@BeforeClass
  public static void internalBeforeClassSetup() throws Exception {
    TestMetaStoreEventListenerInRepl.conf = new HiveConfForTest(TestMetaStoreEventListenerInRepl.class);
    TestMetaStoreEventListenerInRepl.conf.set("dfs.client.use.datanode.hostname", "true");
    TestMetaStoreEventListenerInRepl.conf.set("hadoop.proxyuser." + Utils.getUGI().getShortUserName() + ".hosts", "*");
    MiniDFSCluster miniDFSCluster =
        new MiniDFSCluster.Builder(TestMetaStoreEventListenerInRepl.conf).numDataNodes(2).format(true).build();

    Map<String, String> conf = new HashMap<String, String>() {{
	      put("fs.defaultFS", miniDFSCluster.getFileSystem().getUri().toString());
	      put("hive.support.concurrency", "true");
	      put("hive.txn.manager", "org.apache.hadoop.hive.ql.lockmgr.DbTxnManager");
	      put("hive.metastore.client.capability.check", "false");
	      put("hive.repl.bootstrap.dump.open.txn.timeout", "1s");
	      put("hive.strict.checks.bucketing", "false");
	      put("hive.mapred.mode", "nonstrict");
	      put("mapred.input.dir.recursive", "true");
	      put("hive.metastore.disallow.incompatible.col.type.changes", "false");
	      put("hive.in.repl.test", "true");
	      put(MetastoreConf.ConfVars.EVENT_LISTENERS.getVarname(),
                ReplMetaStoreEventListenerTestImpl.class.getName());
    }};

    primary = new WarehouseInstance(LOG, miniDFSCluster, conf);
    conf.put(MetastoreConf.ConfVars.REPLDIR.getHiveName(), primary.repldDir);
    replica = new WarehouseInstance(LOG, miniDFSCluster, conf);
  }
TestMetaStoreEventListenerInRepl - Test metastore events created by replication.
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestMetaStoreEventListenerInRepl.java