stream2000 commented on code in PR #10010:
URL: https://github.com/apache/hudi/pull/10010#discussion_r1385925628


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metrics/MetricsFileSystemReporter.java:
##########
@@ -0,0 +1,133 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hudi.metrics;
+
+import org.apache.hudi.common.config.SerializableConfiguration;
+import org.apache.hudi.common.fs.FSUtils;
+import org.apache.hudi.common.util.JsonUtils;
+import org.apache.hudi.common.util.StringUtils;
+import org.apache.hudi.config.HoodieWriteConfig;
+
+import com.codahale.metrics.MetricRegistry;
+import org.apache.hadoop.fs.FSDataOutputStream;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.Map;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
+
+public class MetricsFileSystemReporter extends MetricsReporter {
+
+  private static final Logger LOG = 
LoggerFactory.getLogger(MetricsFileSystemReporter.class);
+  private MetricRegistry metricRegistry;
+  private SerializableConfiguration hadoopConf;
+  private String metricsPath;
+  private HoodieWriteConfig config;
+  private FileSystem fs;
+  private ScheduledExecutorService executor;
+  private static final String META_FOLDER_NAME = "/.hoodie";
+  private static final String METRICS_FOLDER_NAME = "/metrics";
+  private static final String METRICS_FILE_NAME = "_metrics.json";

Review Comment:
   Who is gonna to delete the metrcs file? If we report the metrics multiple 
times, for the same table will them overwrite each other? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to