aasha commented on a change in pull request #1593:
URL: https://github.com/apache/hive/pull/1593#discussion_r516437630



##########
File path: 
hcatalog/server-extensions/src/main/java/org/apache/hive/hcatalog/listener/DbNotificationListener.java
##########
@@ -184,8 +193,25 @@ public void onConfigChange(ConfigChangeEvent tableEvent) 
throws MetaException {
           TimeUnit.SECONDS);
       MetastoreConf.setTimeVar(getConf(), 
MetastoreConf.ConfVars.EVENT_DB_LISTENER_TTL, time,
           TimeUnit.SECONDS);
-      cleaner.setTimeToLive(MetastoreConf.getTimeVar(getConf(),
-          MetastoreConf.ConfVars.EVENT_DB_LISTENER_TTL, TimeUnit.SECONDS));
+      boolean isReplEnabled = MetastoreConf.getBoolVar(getConf(), 
ConfVars.REPLCMENABLED);
+      if(!isReplEnabled){
+        cleaner.setTimeToLive(MetastoreConf.getTimeVar(getConf(), 
ConfVars.EVENT_DB_LISTENER_TTL,
+                TimeUnit.SECONDS));
+      }
+    } else if (key.equals(ConfVars.REPL_EVENT_DB_LISTENER_TTL.toString()) ||
+            key.equals(ConfVars.REPL_EVENT_DB_LISTENER_TTL.getHiveName())) {
+      // This weirdness of setting it in our conf and then reading back does 
two things.
+      // One, it handles the conversion of the TimeUnit.  Two, it keeps the 
value around for
+      // later in case we need it again.
+      long time = MetastoreConf.convertTimeStr(tableEvent.getNewValue(), 
TimeUnit.SECONDS,
+              TimeUnit.SECONDS);
+      MetastoreConf.setTimeVar(getConf(), 
MetastoreConf.ConfVars.REPL_EVENT_DB_LISTENER_TTL, time,

Review comment:
       // This weirdness of setting it in our conf and then reading back does 
two things.
         // One, it handles the conversion of the TimeUnit.  Two, it keeps the 
value around for
         // later in case we need it again.
   
   See if this is used later or its just a one time thing. Then you can go 
ahead without setting in conf I think. 

##########
File path: 
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java
##########
@@ -991,6 +992,10 @@ public static ConfVars getMetaConf(String name) {
         "hive.exec.copyfile.maxsize", 32L * 1024 * 1024 /*32M*/,
         "Maximum file size (in bytes) that Hive uses to do single HDFS copies 
between directories." +
             "Distributed copies (distcp) will be used instead for bigger files 
so that copies can be done faster."),
+    REPL_EVENT_DB_LISTENER_TTL("metastore.repl.event.db.listener.timetolive",

Review comment:
       REPL_EVENT_DB_LISTENER_TTL is set to 10days, then REPLCMRETIAN also 
should be 10 days.




----------------------------------------------------------------
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:
[email protected]



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

Reply via email to