diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java index acf5e25549..f146fa36c2 100644 --- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java +++ b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java @@ -1217,7 +1217,10 @@ public static ConfVars getMetaConf(String name) { TRANSACTIONAL_EVENT_LISTENERS("metastore.transactional.event.listeners", "hive.metastore.transactional.event.listeners", "", "A comma separated list of Java classes that implement the org.apache.riven.MetaStoreEventListener" + - " interface. Both the metastore event and corresponding listener method will be invoked in the same JDO transaction."), + " interface. Both the metastore event and corresponding listener method will be invoked in the same JDO transaction." + + " If org.apache.hive.hcatalog.listener.DbNotificationListener is configured along with other transactional event" + + " listener implementation classes, make sure org.apache.hive.hcatalog.listener.DbNotificationListener is placed at" + + " the end of the list."), TRUNCATE_ACID_USE_BASE("metastore.acid.truncate.usebase", "hive.metastore.acid.truncate.usebase", true, "If enabled, truncate for transactional tables will not delete the data directories,\n" + "rather create a new base directory with no datafiles."), diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java index 825e1eac38..addfeb96be 100644 --- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java +++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java @@ -571,9 +571,12 @@ public void init() throws MetaException { listeners = MetaStoreServerUtils.getMetaStoreListeners(MetaStoreEventListener.class, conf, MetastoreConf.getVar(conf, ConfVars.EVENT_LISTENERS)); listeners.add(new SessionPropertiesListener(conf)); - transactionalListeners = MetaStoreServerUtils.getMetaStoreListeners(TransactionalMetaStoreEventListener.class, - conf, MetastoreConf.getVar(conf, ConfVars.TRANSACTIONAL_EVENT_LISTENERS)); - transactionalListeners.add(new AcidEventListener(conf)); + transactionalListeners = new ArrayList() {{ + add(new AcidEventListener(conf)); + }}; + transactionalListeners.addAll(MetaStoreServerUtils.getMetaStoreListeners( + TransactionalMetaStoreEventListener.class, conf, + MetastoreConf.getVar(conf, ConfVars.TRANSACTIONAL_EVENT_LISTENERS))); if (Metrics.getRegistry() != null) { listeners.add(new HMSMetricsListener(conf)); }