ArkoSharma commented on a change in pull request #1593:
URL: https://github.com/apache/hive/pull/1593#discussion_r514906239
##########
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 line updates the value of the configuration. Line 212 sets the new
value in the cleaner's parameters.
----------------------------------------------------------------
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]