lcspinter commented on a change in pull request #2916:
URL: https://github.com/apache/hive/pull/2916#discussion_r788957639



##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/metrics/DeltaFilesMetricReporter.java
##########
@@ -139,157 +92,37 @@ public static DeltaFilesMetricReporter getInstance() {
     return InstanceHolder.instance;
   }
 
-  public static synchronized void init(HiveConf conf) throws Exception {
-    getInstance().configure(conf);
+  public static synchronized void init(Configuration conf, TxnStore 
txnHandler) throws Exception {
+    if (!initialized) {
+      getInstance().configure(conf, txnHandler);
+      initialized = true;
+    }
   }
 
-  private void configure(HiveConf conf) throws Exception {
+  private void configure(Configuration conf, TxnStore txnHandler) throws 
Exception {
     long reportingInterval =
-        HiveConf.getTimeVar(conf, 
HiveConf.ConfVars.HIVE_TXN_ACID_METRICS_REPORTING_INTERVAL, TimeUnit.SECONDS);
-    hiveEntitySeparator = conf.getVar(HiveConf.ConfVars.HIVE_ENTITY_SEPARATOR);
+        MetastoreConf.getTimeVar(conf, 
MetastoreConf.ConfVars.METASTORE_DELTAMETRICS_REPORTING_INTERVAL, 
TimeUnit.SECONDS);
+
+    maxCacheSize = MetastoreConf.getIntVar(conf, 
MetastoreConf.ConfVars.METASTORE_DELTAMETRICS_MAX_CACHE_SIZE);
 
-    initCachesForMetrics(conf);
     initObjectsForMetrics();
 
     ThreadFactory threadFactory =
         new 
ThreadFactoryBuilder().setDaemon(true).setNameFormat("DeltaFilesMetricReporter 
%d").build();
-    executorService = 
Executors.newSingleThreadScheduledExecutor(threadFactory);
-    executorService.scheduleAtFixedRate(new ReportingTask(), 0, 
reportingInterval, TimeUnit.SECONDS);
+    reporterExecutorService = 
Executors.newSingleThreadScheduledExecutor(threadFactory);
+    reporterExecutorService.scheduleAtFixedRate(new ReportingTask(txnHandler), 
0, reportingInterval, TimeUnit.SECONDS);
 
     LOG.info("Started DeltaFilesMetricReporter thread");

Review comment:
       Could you please point me to the original one? I cannot find it. 




-- 
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]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to