Search in sources :

Example 1 with MessageFactory

use of org.apache.hadoop.hive.metastore.messaging.MessageFactory in project hive by apache.

the class TestReplicationScenarios method createDummyEvent.

private NotificationEvent createDummyEvent(String dbname, String tblname, long evid) {
    MessageFactory msgFactory = MessageFactory.getInstance();
    Table t = new Table();
    t.setDbName(dbname);
    t.setTableName(tblname);
    NotificationEvent event = new NotificationEvent(evid, (int) System.currentTimeMillis(), MessageFactory.CREATE_TABLE_EVENT, msgFactory.buildCreateTableMessage(t, Arrays.asList("/tmp/").iterator()).toString());
    event.setDbName(t.getDbName());
    event.setTableName(t.getTableName());
    event.setMessageFormat(msgFactory.getMessageFormat());
    return event;
}
Also used : Table(org.apache.hadoop.hive.metastore.api.Table) MessageFactory(org.apache.hadoop.hive.metastore.messaging.MessageFactory) NotificationEvent(org.apache.hadoop.hive.metastore.api.NotificationEvent)

Example 2 with MessageFactory

use of org.apache.hadoop.hive.metastore.messaging.MessageFactory in project hive by apache.

the class TestReplicationScenarios method createDummyEvent.

private NotificationEvent createDummyEvent(String dbname, String tblname, long evid) {
    MessageFactory msgFactory = MessageFactory.getInstance();
    Table t = new Table();
    t.setDbName(dbname);
    t.setTableName(tblname);
    NotificationEvent event = new NotificationEvent(evid, (int) System.currentTimeMillis(), MessageFactory.CREATE_TABLE_EVENT, msgFactory.buildCreateTableMessage(t, Arrays.asList("/tmp/").iterator()).toString());
    event.setDbName(t.getDbName());
    event.setTableName(t.getTableName());
    event.setMessageFormat(msgFactory.getMessageFormat());
    return event;
}
Also used : Table(org.apache.hadoop.hive.metastore.api.Table) MessageFactory(org.apache.hadoop.hive.metastore.messaging.MessageFactory) NotificationEvent(org.apache.hadoop.hive.metastore.api.NotificationEvent)

Aggregations

NotificationEvent (org.apache.hadoop.hive.metastore.api.NotificationEvent)2 Table (org.apache.hadoop.hive.metastore.api.Table)2 MessageFactory (org.apache.hadoop.hive.metastore.messaging.MessageFactory)2