Search in sources :

Example 66 with NotificationEvent

use of org.apache.hadoop.hive.metastore.api.NotificationEvent in project hive by apache.

the class TestEventHandlerFactory method shouldProvideDefaultHandlerWhenNothingRegisteredForThatEvent.

@Test
public void shouldProvideDefaultHandlerWhenNothingRegisteredForThatEvent() {
    EventHandler eventHandler = EventHandlerFactory.handlerFor(new NotificationEvent(Long.MAX_VALUE, Integer.MAX_VALUE, "shouldGiveDefaultHandler", "s"));
    assertTrue(eventHandler instanceof DefaultHandler);
}
Also used : NotificationEvent(org.apache.hadoop.hive.metastore.api.NotificationEvent) Test(org.junit.Test)

Example 67 with NotificationEvent

use of org.apache.hadoop.hive.metastore.api.NotificationEvent in project hive by apache.

the class ObjectStore method translateDbToThrift.

private NotificationEvent translateDbToThrift(MNotificationLog dbEvent) {
    NotificationEvent event = new NotificationEvent();
    event.setEventId(dbEvent.getEventId());
    event.setEventTime(dbEvent.getEventTime());
    event.setEventType(dbEvent.getEventType());
    event.setDbName(dbEvent.getDbName());
    event.setTableName(dbEvent.getTableName());
    event.setMessage((dbEvent.getMessage()));
    event.setMessageFormat(dbEvent.getMessageFormat());
    return event;
}
Also used : NotificationEvent(org.apache.hadoop.hive.metastore.api.NotificationEvent)

Aggregations

NotificationEvent (org.apache.hadoop.hive.metastore.api.NotificationEvent)67 Test (org.junit.Test)41 Table (org.apache.hadoop.hive.metastore.api.Table)28 NotificationEventResponse (org.apache.hadoop.hive.metastore.api.NotificationEventResponse)27 ArrayList (java.util.ArrayList)16 FieldSchema (org.apache.hadoop.hive.metastore.api.FieldSchema)16 SerDeInfo (org.apache.hadoop.hive.metastore.api.SerDeInfo)12 StorageDescriptor (org.apache.hadoop.hive.metastore.api.StorageDescriptor)12 HCatNotificationEvent (org.apache.hive.hcatalog.api.HCatNotificationEvent)11 MetaException (org.apache.hadoop.hive.metastore.api.MetaException)10 Partition (org.apache.hadoop.hive.metastore.api.Partition)10 ReplicationTask (org.apache.hive.hcatalog.api.repl.ReplicationTask)10 Database (org.apache.hadoop.hive.metastore.api.Database)9 NoopReplicationTask (org.apache.hive.hcatalog.api.repl.NoopReplicationTask)9 IMetaStoreClient (org.apache.hadoop.hive.metastore.IMetaStoreClient)8 Index (org.apache.hadoop.hive.metastore.api.Index)6 HashMap (java.util.HashMap)5 LinkedHashMap (java.util.LinkedHashMap)4 Nullable (javax.annotation.Nullable)4 Function (org.apache.hadoop.hive.metastore.api.Function)4