public class JSONMessageFactory extends MessageFactory
ADD_PARTITION_EVENT, ALTER_INDEX_EVENT, ALTER_PARTITION_EVENT, ALTER_TABLE_EVENT, CREATE_DATABASE_EVENT, CREATE_FUNCTION_EVENT, CREATE_INDEX_EVENT, CREATE_TABLE_EVENT, DROP_DATABASE_EVENT, DROP_FUNCTION_EVENT, DROP_INDEX_EVENT, DROP_PARTITION_EVENT, DROP_TABLE_EVENT, hiveConf, INSERT_EVENT, MS_SERVER_URL, MS_SERVICE_PRINCIPAL
Constructor and Description |
---|
JSONMessageFactory() |
Modifier and Type | Method and Description |
---|---|
AddPartitionMessage |
buildAddPartitionMessage(Table table,
Iterator<Partition> partitionsIterator,
Iterator<PartitionFiles> partitionFileIter)
Factory method for AddPartitionMessage.
|
AlterIndexMessage |
buildAlterIndexMessage(Index before,
Index after)
Factory method for AlterIndexMessage.
|
AlterPartitionMessage |
buildAlterPartitionMessage(Table table,
Partition before,
Partition after)
Factory method for building AlterPartitionMessage
|
AlterTableMessage |
buildAlterTableMessage(Table before,
Table after)
Factory method for AlterTableMessage.
|
CreateDatabaseMessage |
buildCreateDatabaseMessage(Database db)
Factory method for CreateDatabaseMessage.
|
CreateFunctionMessage |
buildCreateFunctionMessage(Function fn)
Factory method for CreateFunctionMessage.
|
CreateIndexMessage |
buildCreateIndexMessage(Index idx)
Factory method for CreateIndexMessage.
|
CreateTableMessage |
buildCreateTableMessage(Table table,
Iterator<String> fileIter)
Factory method for CreateTableMessage.
|
DropDatabaseMessage |
buildDropDatabaseMessage(Database db)
Factory method for DropDatabaseMessage.
|
DropFunctionMessage |
buildDropFunctionMessage(Function fn)
Factory method for DropFunctionMessage.
|
DropIndexMessage |
buildDropIndexMessage(Index idx)
Factory method for DropIndexMessage.
|
DropPartitionMessage |
buildDropPartitionMessage(Table table,
Iterator<Partition> partitionsIterator)
Factory method for DropPartitionMessage.
|
DropTableMessage |
buildDropTableMessage(Table table)
Factory method for DropTableMessage.
|
InsertMessage |
buildInsertMessage(String db,
String table,
Map<String,String> partKeyVals,
Iterator<String> fileIter)
Factory method for building insert message
|
MessageDeserializer |
getDeserializer() |
static org.codehaus.jackson.node.ObjectNode |
getJsonTree(NotificationEvent event) |
static org.codehaus.jackson.node.ObjectNode |
getJsonTree(String eventMessage) |
String |
getMessageFormat()
Getter for message-format.
|
static Table |
getTableObj(org.codehaus.jackson.node.ObjectNode jsonTree) |
static org.apache.thrift.TBase |
getTObj(String tSerialized,
Class<? extends org.apache.thrift.TBase> objClass) |
static Iterable<? extends org.apache.thrift.TBase> |
getTObjs(Iterable<String> objRefStrs,
Class<? extends org.apache.thrift.TBase> objClass) |
static Iterable<? extends org.apache.thrift.TBase> |
getTObjs(org.codehaus.jackson.node.ObjectNode jsonTree,
String objRefListName,
Class<? extends org.apache.thrift.TBase> objClass) |
getDeserializer, getInstance
public MessageDeserializer getDeserializer()
getDeserializer
in class MessageFactory
public String getMessageFormat()
MessageFactory
getMessageFormat
in class MessageFactory
public CreateDatabaseMessage buildCreateDatabaseMessage(Database db)
MessageFactory
buildCreateDatabaseMessage
in class MessageFactory
db
- The Database being added.public DropDatabaseMessage buildDropDatabaseMessage(Database db)
MessageFactory
buildDropDatabaseMessage
in class MessageFactory
db
- The Database being dropped.public CreateTableMessage buildCreateTableMessage(Table table, Iterator<String> fileIter)
MessageFactory
buildCreateTableMessage
in class MessageFactory
table
- The Table being created.fileIter
- Iterator of filespublic AlterTableMessage buildAlterTableMessage(Table before, Table after)
MessageFactory
buildAlterTableMessage
in class MessageFactory
before
- The table before the alterafter
- The table after the alterpublic DropTableMessage buildDropTableMessage(Table table)
MessageFactory
buildDropTableMessage
in class MessageFactory
table
- The Table being dropped.public AddPartitionMessage buildAddPartitionMessage(Table table, Iterator<Partition> partitionsIterator, Iterator<PartitionFiles> partitionFileIter)
MessageFactory
buildAddPartitionMessage
in class MessageFactory
table
- The Table to which the partitions are added.partitionsIterator
- The iterator to set of Partitions being added.partitionFileIter
- The iterator of partition filespublic AlterPartitionMessage buildAlterPartitionMessage(Table table, Partition before, Partition after)
MessageFactory
buildAlterPartitionMessage
in class MessageFactory
table
- The table in which the partition is being alteredbefore
- The partition before it was alteredafter
- The partition after it was alteredpublic DropPartitionMessage buildDropPartitionMessage(Table table, Iterator<Partition> partitionsIterator)
MessageFactory
buildDropPartitionMessage
in class MessageFactory
table
- The Table from which the partition is dropped.partitionsIterator
- The set of partitions being dropped.public CreateFunctionMessage buildCreateFunctionMessage(Function fn)
MessageFactory
buildCreateFunctionMessage
in class MessageFactory
fn
- The Function being added.public DropFunctionMessage buildDropFunctionMessage(Function fn)
MessageFactory
buildDropFunctionMessage
in class MessageFactory
fn
- The Function being dropped.public CreateIndexMessage buildCreateIndexMessage(Index idx)
MessageFactory
buildCreateIndexMessage
in class MessageFactory
idx
- The Index being added.public DropIndexMessage buildDropIndexMessage(Index idx)
MessageFactory
buildDropIndexMessage
in class MessageFactory
idx
- The Index being dropped.public AlterIndexMessage buildAlterIndexMessage(Index before, Index after)
MessageFactory
buildAlterIndexMessage
in class MessageFactory
before
- The index before the alterafter
- The index after the alterpublic InsertMessage buildInsertMessage(String db, String table, Map<String,String> partKeyVals, Iterator<String> fileIter)
MessageFactory
buildInsertMessage
in class MessageFactory
db
- Name of the database the insert occurred intable
- Name of the table the insert occurred inpartKeyVals
- Partition values for the partition that the insert occurred in, may be null if
the insert was done into a non-partitioned tablefileIter
- Iterator of file createdpublic static org.codehaus.jackson.node.ObjectNode getJsonTree(NotificationEvent event) throws Exception
Exception
public static org.codehaus.jackson.node.ObjectNode getJsonTree(String eventMessage) throws Exception
Exception
public static Table getTableObj(org.codehaus.jackson.node.ObjectNode jsonTree) throws Exception
Exception
public static org.apache.thrift.TBase getTObj(String tSerialized, Class<? extends org.apache.thrift.TBase> objClass) throws Exception
Exception
public static Iterable<? extends org.apache.thrift.TBase> getTObjs(Iterable<String> objRefStrs, Class<? extends org.apache.thrift.TBase> objClass) throws Exception
Exception
Copyright © 2021 The Apache Software Foundation. All rights reserved.