diff --git a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java index 04166db865..ae44b083be 100644 --- a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java +++ b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java @@ -1191,7 +1191,7 @@ private static void populateLlapDaemonVarsSet(Set llapDaemonVarsSetLocal */ @Deprecated METASTORE_EVENT_MESSAGE_FACTORY("hive.metastore.event.message.factory", - "org.apache.hadoop.hive.metastore.messaging.json.JSONMessageEncoder", + "org.apache.hadoop.hive.metastore.messaging.json.gzip.GzipJSONMessageEncoder", "Factory class for making encoding and decoding messages in the events generated."), /** * @deprecated Use MetastoreConf.EXECUTE_SET_UGI diff --git a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplAcidTablesWithJsonMessage.java b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplAcidTablesWithJsonMessage.java index c16799da28..da3c3aceb7 100644 --- a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplAcidTablesWithJsonMessage.java +++ b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplAcidTablesWithJsonMessage.java @@ -18,12 +18,15 @@ package org.apache.hadoop.hive.ql.parse; +import org.apache.hadoop.hive.metastore.conf.MetastoreConf; +import org.apache.hadoop.hive.metastore.messaging.json.JSONMessageEncoder; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Rule; import org.junit.rules.TestRule; import java.util.Collections; +import java.util.HashMap; public class TestReplAcidTablesWithJsonMessage extends TestReplicationScenariosAcidTables { @@ -32,7 +35,10 @@ @BeforeClass public static void classLevelSetup() throws Exception { - internalBeforeClassSetup(Collections.emptyMap(), TestReplAcidTablesWithJsonMessage.class); + HashMap overrides = new HashMap<>(); + overrides.put(MetastoreConf.ConfVars.EVENT_MESSAGE_FACTORY.getHiveName(), + JSONMessageEncoder.class.getCanonicalName()); + internalBeforeClassSetup(overrides, TestReplAcidTablesWithJsonMessage.class); } @Before diff --git a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplAcrossInstancesWithJsonMessageFormat.java b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplAcrossInstancesWithJsonMessageFormat.java index 0ec0275032..eb5b5e7f5d 100644 --- a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplAcrossInstancesWithJsonMessageFormat.java +++ b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplAcrossInstancesWithJsonMessageFormat.java @@ -18,6 +18,8 @@ package org.apache.hadoop.hive.ql.parse; +import org.apache.hadoop.hive.metastore.conf.MetastoreConf; +import org.apache.hadoop.hive.metastore.messaging.json.JSONMessageEncoder; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Rule; @@ -25,6 +27,7 @@ import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; public class TestReplAcrossInstancesWithJsonMessageFormat extends TestReplicationScenariosAcrossInstances { @@ -34,7 +37,10 @@ @BeforeClass public static void classLevelSetup() throws Exception { - internalBeforeClassSetup(Collections.emptyMap(), TestReplicationScenarios.class); + HashMap overrides = new HashMap<>(); + overrides.put(MetastoreConf.ConfVars.EVENT_MESSAGE_FACTORY.getHiveName(), + JSONMessageEncoder.class.getCanonicalName()); + internalBeforeClassSetup(overrides, TestReplicationScenarios.class); } @Before diff --git a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplIncrementalLoadAcidTablesWithJsonMessage.java b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplIncrementalLoadAcidTablesWithJsonMessage.java index 422508d061..042c2f1074 100644 --- a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplIncrementalLoadAcidTablesWithJsonMessage.java +++ b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplIncrementalLoadAcidTablesWithJsonMessage.java @@ -18,6 +18,8 @@ package org.apache.hadoop.hive.ql.parse; +import org.apache.hadoop.hive.metastore.conf.MetastoreConf; +import org.apache.hadoop.hive.metastore.messaging.json.JSONMessageEncoder; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Rule; @@ -25,6 +27,7 @@ import org.junit.Ignore; import java.util.Collections; +import java.util.HashMap; @Ignore public class TestReplIncrementalLoadAcidTablesWithJsonMessage @@ -35,8 +38,10 @@ @BeforeClass public static void classLevelSetup() throws Exception { - internalBeforeClassSetup(Collections.emptyMap(), - TestReplIncrementalLoadAcidTablesWithJsonMessage.class); + HashMap overrides = new HashMap<>(); + overrides.put(MetastoreConf.ConfVars.EVENT_MESSAGE_FACTORY.getHiveName(), + JSONMessageEncoder.class.getCanonicalName()); + internalBeforeClassSetup(overrides, TestReplIncrementalLoadAcidTablesWithJsonMessage.class); } @Before diff --git a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplTableMigrationWithJsonFormat.java b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplTableMigrationWithJsonFormat.java index 0151ed0325..d66e946928 100644 --- a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplTableMigrationWithJsonFormat.java +++ b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplTableMigrationWithJsonFormat.java @@ -17,13 +17,19 @@ */ package org.apache.hadoop.hive.ql.parse; +import org.apache.hadoop.hive.metastore.conf.MetastoreConf; +import org.apache.hadoop.hive.metastore.messaging.json.JSONMessageEncoder; import org.junit.BeforeClass; import java.util.Collections; +import java.util.HashMap; public class TestReplTableMigrationWithJsonFormat extends TestReplicationWithTableMigration { @BeforeClass public static void classLevelSetup() throws Exception { - internalBeforeClassSetup(Collections.emptyMap()); + HashMap overrides = new HashMap<>(); + overrides.put(MetastoreConf.ConfVars.EVENT_MESSAGE_FACTORY.getHiveName(), + JSONMessageEncoder.class.getCanonicalName()); + internalBeforeClassSetup(overrides); } } diff --git a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplWithJsonMessageFormat.java b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplWithJsonMessageFormat.java index f76dc1d79a..80469a0c09 100644 --- a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplWithJsonMessageFormat.java +++ b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplWithJsonMessageFormat.java @@ -17,6 +17,8 @@ */ package org.apache.hadoop.hive.ql.parse; +import org.apache.hadoop.hive.metastore.conf.MetastoreConf; +import org.apache.hadoop.hive.metastore.messaging.json.JSONMessageEncoder; import org.apache.hive.hcatalog.api.repl.ReplicationV1CompatRule; import org.junit.BeforeClass; import org.junit.Rule; @@ -24,6 +26,7 @@ import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; public class TestReplWithJsonMessageFormat extends TestReplicationScenarios { @Rule @@ -33,7 +36,10 @@ @BeforeClass public static void setUpBeforeClass() throws Exception { - internalBeforeClassSetup(Collections.emptyMap(), false); + HashMap overrides = new HashMap<>(); + overrides.put(MetastoreConf.ConfVars.EVENT_MESSAGE_FACTORY.getHiveName(), + JSONMessageEncoder.class.getCanonicalName()); + internalBeforeClassSetup(overrides, false); } } 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 3a9912f398..ce352e5b40 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 @@ -544,7 +544,7 @@ public static ConfVars getMetaConf(String name) { "Alternatively, configure hive.metastore.transactional.event.listeners to ensure both are invoked in same JDO transaction."), EVENT_MESSAGE_FACTORY("metastore.event.message.factory", "hive.metastore.event.message.factory", - "org.apache.hadoop.hive.metastore.messaging.json.JSONMessageEncoder", + "org.apache.hadoop.hive.metastore.messaging.json.gzip.GzipJSONMessageEncoder", "Factory class for making encoding and decoding messages in the events generated."), EVENT_NOTIFICATION_PARAMETERS_EXCLUDE_PATTERNS("metastore.notification.parameters.exclude.patterns", "hive.metastore.notification.parameters.exclude.patterns", "",