[ https://issues.apache.org/jira/browse/HIVE-23668?focusedWorklogId=447105&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-447105 ]
ASF GitHub Bot logged work on HIVE-23668: ----------------------------------------- Author: ASF GitHub Bot Created on: 17/Jun/20 07:47 Start Date: 17/Jun/20 07:47 Worklog Time Spent: 10m Work Description: pkumarsinha commented on a change in pull request #1129: URL: https://github.com/apache/hive/pull/1129#discussion_r441334160 ########## File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java ########## @@ -13142,6 +13143,28 @@ public ReplicationMetricList getReplicationMetrics(GetReplicationMetricsRequest } } + @Override + public int deleteReplicationMetrics(int maxRetainSecs) { + if (maxRetainSecs < 0) { + LOG.debug("replication metrics deletion is disabled"); + return 0; + } + boolean committed = false; + Query q = null; + try { + openTransaction(); + long maxCreateTime = (int) (System.currentTimeMillis() / 1000) - maxRetainSecs; Review comment: We are converting long to int earlier and now int to long. why not to use long everywhere. Don't we have chances of loosing the precision when System.currentTimeMillis becomes significantly higher than Integer.MAX_VALUE ########## File path: standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java ########## @@ -981,9 +981,15 @@ public static ConfVars getMetaConf(String name) { + " and the frequency of persisting the metrics to persistent storage. " ), REPL_METRICS_UPDATE_FREQUENCY("metastore.repl.metrics.update.frequency", - "hive.repl.metrics.update.frequency", 1 /*1 minute */, + "hive.repl.metrics.update.frequency", 1, TimeUnit.MINUTES /*1 minute */, "Frequency at which replication Metrics will be stored in persistent storage. " ), + REPL_METRICS_CLEANUP_FREQUENCY("metastore.repl.metrics.cleanup.frequency", Review comment: REPL_METRICS_MAX_AGE set to lower value than REPL_METRICS_CLEANUP_FREQUENCY will result with retaining entries longer than REPL_METRICS_MAX_AGE set. If REPL_METRICS_MAX_AGEis set in days, why not to fix the REPL_METRICS_CLEANUP_FREQUENCY to 1 day and not make it configurable? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 447105) Time Spent: 20m (was: 10m) > Clean up Task for Hive Metrics > ------------------------------ > > Key: HIVE-23668 > URL: https://issues.apache.org/jira/browse/HIVE-23668 > Project: Hive > Issue Type: Task > Reporter: Aasha Medhi > Assignee: Aasha Medhi > Priority: Major > Labels: pull-request-available > Attachments: HIVE-23668.01.patch, HIVE-23668.02.patch > > Time Spent: 20m > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.3.4#803005)