Search in sources :

Example 1 with ReplicationV1CompatRule

use of org.apache.hive.hcatalog.api.repl.ReplicationV1CompatRule in project hive by apache.

the class TestDbNotificationListener method connectToMetastore.

@SuppressWarnings("rawtypes")
@BeforeClass
public static void connectToMetastore() throws Exception {
    HiveConf conf = new HiveConf();
    conf.setVar(HiveConf.ConfVars.METASTORE_TRANSACTIONAL_EVENT_LISTENERS, DbNotificationListener.class.getName());
    conf.setVar(HiveConf.ConfVars.METASTORE_EVENT_LISTENERS, MockMetaStoreEventListener.class.getName());
    conf.setVar(HiveConf.ConfVars.METASTORE_EVENT_DB_LISTENER_TTL, String.valueOf(EVENTS_TTL) + "s");
    conf.setBoolVar(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY, false);
    conf.setBoolVar(HiveConf.ConfVars.FIRE_EVENTS_FOR_DML, true);
    conf.setVar(HiveConf.ConfVars.METASTORE_RAW_STORE_IMPL, DummyRawStoreFailEvent.class.getName());
    MetastoreConf.setTimeVar(conf, MetastoreConf.ConfVars.EVENT_DB_LISTENER_CLEAN_INTERVAL, CLEANUP_SLEEP_TIME, TimeUnit.SECONDS);
    MetastoreConf.setVar(conf, MetastoreConf.ConfVars.EVENT_MESSAGE_FACTORY, JSONMessageEncoder.class.getName());
    conf.setVar(HiveConf.ConfVars.HIVE_AUTHORIZATION_MANAGER, "org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory");
    SessionState.start(new CliSessionState(conf));
    msClient = new HiveMetaStoreClient(conf);
    driver = DriverFactory.newDriver(conf);
    md = JSONMessageEncoder.getInstance().getDeserializer();
    bcompat = new ReplicationV1CompatRule(msClient, conf, testsToSkipForReplV1BackwardCompatTesting);
}
Also used : HiveMetaStoreClient(org.apache.hadoop.hive.metastore.HiveMetaStoreClient) ReplicationV1CompatRule(org.apache.hive.hcatalog.api.repl.ReplicationV1CompatRule) JSONMessageEncoder(org.apache.hadoop.hive.metastore.messaging.json.JSONMessageEncoder) HiveConf(org.apache.hadoop.hive.conf.HiveConf) CliSessionState(org.apache.hadoop.hive.cli.CliSessionState) BeforeClass(org.junit.BeforeClass)

Aggregations

CliSessionState (org.apache.hadoop.hive.cli.CliSessionState)1 HiveConf (org.apache.hadoop.hive.conf.HiveConf)1 HiveMetaStoreClient (org.apache.hadoop.hive.metastore.HiveMetaStoreClient)1 JSONMessageEncoder (org.apache.hadoop.hive.metastore.messaging.json.JSONMessageEncoder)1 ReplicationV1CompatRule (org.apache.hive.hcatalog.api.repl.ReplicationV1CompatRule)1 BeforeClass (org.junit.BeforeClass)1