public class JSONMessageFactory extends MessageFactory
ABORT_TXN_EVENT, ADD_FOREIGNKEY_EVENT, ADD_NOTNULLCONSTRAINT_EVENT, ADD_PARTITION_EVENT, ADD_PRIMARYKEY_EVENT, ADD_SCHEMA_VERSION_EVENT, ADD_UNIQUECONSTRAINT_EVENT, ALLOC_WRITE_ID_EVENT, ALTER_CATALOG_EVENT, ALTER_DATABASE_EVENT, ALTER_ISCHEMA_EVENT, ALTER_PARTITION_EVENT, ALTER_SCHEMA_VERSION_EVENT, ALTER_TABLE_EVENT, COMMIT_TXN_EVENT, conf, CREATE_CATALOG_EVENT, CREATE_DATABASE_EVENT, CREATE_FUNCTION_EVENT, CREATE_ISCHEMA_EVENT, CREATE_TABLE_EVENT, DROP_CATALOG_EVENT, DROP_CONSTRAINT_EVENT, DROP_DATABASE_EVENT, DROP_FUNCTION_EVENT, DROP_ISCHEMA_EVENT, DROP_PARTITION_EVENT, DROP_SCHEMA_VERSION_EVENT, DROP_TABLE_EVENT, INSERT_EVENT, MS_SERVER_URL, MS_SERVICE_PRINCIPAL, OPEN_TXN_EVENT| Constructor and Description |
|---|
JSONMessageFactory() |
| Modifier and Type | Method and Description |
|---|---|
AbortTxnMessage |
buildAbortTxnMessage(Long txnId)
Factory method for building abort txn message
|
AddForeignKeyMessage |
buildAddForeignKeyMessage(List<org.apache.hadoop.hive.metastore.api.SQLForeignKey> fks)
Factory method for building add foreign key message
|
AddNotNullConstraintMessage |
buildAddNotNullConstraintMessage(List<org.apache.hadoop.hive.metastore.api.SQLNotNullConstraint> nns)
Factory method for building add not null constraint message
|
AddPartitionMessage |
buildAddPartitionMessage(org.apache.hadoop.hive.metastore.api.Table table,
Iterator<org.apache.hadoop.hive.metastore.api.Partition> partitionsIterator,
Iterator<PartitionFiles> partitionFileIter)
Factory method for AddPartitionMessage.
|
AddPrimaryKeyMessage |
buildAddPrimaryKeyMessage(List<org.apache.hadoop.hive.metastore.api.SQLPrimaryKey> pks)
Factory method for building add primary key message
|
AddUniqueConstraintMessage |
buildAddUniqueConstraintMessage(List<org.apache.hadoop.hive.metastore.api.SQLUniqueConstraint> uks)
Factory method for building add unique constraint message
|
AllocWriteIdMessage |
buildAllocWriteIdMessage(List<org.apache.hadoop.hive.metastore.api.TxnToWriteId> txnToWriteIdList,
String dbName,
String tableName)
Factory method for building alloc write id message
|
AlterCatalogMessage |
buildAlterCatalogMessage(org.apache.hadoop.hive.metastore.api.Catalog beforeCat,
org.apache.hadoop.hive.metastore.api.Catalog afterCat) |
AlterDatabaseMessage |
buildAlterDatabaseMessage(org.apache.hadoop.hive.metastore.api.Database beforeDb,
org.apache.hadoop.hive.metastore.api.Database afterDb)
Factory method for AlterDatabaseMessage.
|
AlterPartitionMessage |
buildAlterPartitionMessage(org.apache.hadoop.hive.metastore.api.Table table,
org.apache.hadoop.hive.metastore.api.Partition before,
org.apache.hadoop.hive.metastore.api.Partition after,
boolean isTruncateOp)
Factory method for building AlterPartitionMessage
|
AlterTableMessage |
buildAlterTableMessage(org.apache.hadoop.hive.metastore.api.Table before,
org.apache.hadoop.hive.metastore.api.Table after,
boolean isTruncateOp)
Factory method for AlterTableMessage.
|
CommitTxnMessage |
buildCommitTxnMessage(Long txnId)
Factory method for building commit txn message
|
CreateCatalogMessage |
buildCreateCatalogMessage(org.apache.hadoop.hive.metastore.api.Catalog catalog) |
CreateDatabaseMessage |
buildCreateDatabaseMessage(org.apache.hadoop.hive.metastore.api.Database db)
Factory method for CreateDatabaseMessage.
|
CreateFunctionMessage |
buildCreateFunctionMessage(org.apache.hadoop.hive.metastore.api.Function fn)
Factory method for CreateFunctionMessage.
|
CreateTableMessage |
buildCreateTableMessage(org.apache.hadoop.hive.metastore.api.Table table,
Iterator<String> fileIter)
Factory method for CreateTableMessage.
|
DropCatalogMessage |
buildDropCatalogMessage(org.apache.hadoop.hive.metastore.api.Catalog catalog) |
DropConstraintMessage |
buildDropConstraintMessage(String dbName,
String tableName,
String constraintName)
Factory method for building drop constraint message
|
DropDatabaseMessage |
buildDropDatabaseMessage(org.apache.hadoop.hive.metastore.api.Database db)
Factory method for DropDatabaseMessage.
|
DropFunctionMessage |
buildDropFunctionMessage(org.apache.hadoop.hive.metastore.api.Function fn)
Factory method for DropFunctionMessage.
|
DropPartitionMessage |
buildDropPartitionMessage(org.apache.hadoop.hive.metastore.api.Table table,
Iterator<org.apache.hadoop.hive.metastore.api.Partition> partitionsIterator)
Factory method for DropPartitionMessage.
|
DropTableMessage |
buildDropTableMessage(org.apache.hadoop.hive.metastore.api.Table table)
Factory method for DropTableMessage.
|
InsertMessage |
buildInsertMessage(org.apache.hadoop.hive.metastore.api.Table tableObj,
org.apache.hadoop.hive.metastore.api.Partition partObj,
boolean replace,
Iterator<String> fileIter)
Factory method for building insert message
|
OpenTxnMessage |
buildOpenTxnMessage(Long fromTxnId,
Long toTxnId)
Factory method for building open txn message using start and end transaction range
|
MessageDeserializer |
getDeserializer() |
static org.codehaus.jackson.node.ObjectNode |
getJsonTree(org.apache.hadoop.hive.metastore.api.NotificationEvent event) |
static org.codehaus.jackson.node.ObjectNode |
getJsonTree(String eventMessage) |
String |
getMessageFormat()
Getter for message-format.
|
static org.apache.hadoop.hive.metastore.api.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, getInstancepublic MessageDeserializer getDeserializer()
getDeserializer in class MessageFactorypublic String getMessageFormat()
MessageFactorygetMessageFormat in class MessageFactorypublic CreateDatabaseMessage buildCreateDatabaseMessage(org.apache.hadoop.hive.metastore.api.Database db)
MessageFactorybuildCreateDatabaseMessage in class MessageFactorydb - The Database being added.public AlterDatabaseMessage buildAlterDatabaseMessage(org.apache.hadoop.hive.metastore.api.Database beforeDb, org.apache.hadoop.hive.metastore.api.Database afterDb)
MessageFactorybuildAlterDatabaseMessage in class MessageFactorybeforeDb - The Database before alter.afterDb - The Database after alter.public DropDatabaseMessage buildDropDatabaseMessage(org.apache.hadoop.hive.metastore.api.Database db)
MessageFactorybuildDropDatabaseMessage in class MessageFactorydb - The Database being dropped.public CreateTableMessage buildCreateTableMessage(org.apache.hadoop.hive.metastore.api.Table table, Iterator<String> fileIter)
MessageFactorybuildCreateTableMessage in class MessageFactorytable - The Table being created.fileIter - Iterator of filespublic AlterTableMessage buildAlterTableMessage(org.apache.hadoop.hive.metastore.api.Table before, org.apache.hadoop.hive.metastore.api.Table after, boolean isTruncateOp)
MessageFactorybuildAlterTableMessage in class MessageFactorybefore - The table before the alterafter - The table after the alterisTruncateOp - Flag to denote truncate tablepublic DropTableMessage buildDropTableMessage(org.apache.hadoop.hive.metastore.api.Table table)
MessageFactorybuildDropTableMessage in class MessageFactorytable - The Table being dropped.public AddPartitionMessage buildAddPartitionMessage(org.apache.hadoop.hive.metastore.api.Table table, Iterator<org.apache.hadoop.hive.metastore.api.Partition> partitionsIterator, Iterator<PartitionFiles> partitionFileIter)
MessageFactorybuildAddPartitionMessage in class MessageFactorytable - 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(org.apache.hadoop.hive.metastore.api.Table table, org.apache.hadoop.hive.metastore.api.Partition before, org.apache.hadoop.hive.metastore.api.Partition after, boolean isTruncateOp)
MessageFactorybuildAlterPartitionMessage in class MessageFactorytable - The table in which the partition is being alteredbefore - The partition before it was alteredafter - The partition after it was alteredisTruncateOp - Flag to denote truncate partitionpublic DropPartitionMessage buildDropPartitionMessage(org.apache.hadoop.hive.metastore.api.Table table, Iterator<org.apache.hadoop.hive.metastore.api.Partition> partitionsIterator)
MessageFactorybuildDropPartitionMessage in class MessageFactorytable - The Table from which the partition is dropped.partitionsIterator - The set of partitions being dropped.public CreateFunctionMessage buildCreateFunctionMessage(org.apache.hadoop.hive.metastore.api.Function fn)
MessageFactorybuildCreateFunctionMessage in class MessageFactoryfn - The Function being added.public DropFunctionMessage buildDropFunctionMessage(org.apache.hadoop.hive.metastore.api.Function fn)
MessageFactorybuildDropFunctionMessage in class MessageFactoryfn - The Function being dropped.public InsertMessage buildInsertMessage(org.apache.hadoop.hive.metastore.api.Table tableObj, org.apache.hadoop.hive.metastore.api.Partition partObj, boolean replace, Iterator<String> fileIter)
MessageFactorybuildInsertMessage in class MessageFactorytableObj - Table object where the insert occurred inpartObj - Partition object where the insert occurred in, may be null if
the insert was done into a non-partitioned tablereplace - Flag to represent if INSERT OVERWRITE or INSERT INTOfileIter - Iterator of file createdpublic AddPrimaryKeyMessage buildAddPrimaryKeyMessage(List<org.apache.hadoop.hive.metastore.api.SQLPrimaryKey> pks)
MessageFactorybuildAddPrimaryKeyMessage in class MessageFactorypks - list of primary keyspublic AddForeignKeyMessage buildAddForeignKeyMessage(List<org.apache.hadoop.hive.metastore.api.SQLForeignKey> fks)
MessageFactorybuildAddForeignKeyMessage in class MessageFactoryfks - list of foreign keyspublic AddUniqueConstraintMessage buildAddUniqueConstraintMessage(List<org.apache.hadoop.hive.metastore.api.SQLUniqueConstraint> uks)
MessageFactorybuildAddUniqueConstraintMessage in class MessageFactoryuks - list of unique constraintspublic AddNotNullConstraintMessage buildAddNotNullConstraintMessage(List<org.apache.hadoop.hive.metastore.api.SQLNotNullConstraint> nns)
MessageFactorybuildAddNotNullConstraintMessage in class MessageFactorynns - list of not null constraintspublic DropConstraintMessage buildDropConstraintMessage(String dbName, String tableName, String constraintName)
MessageFactorybuildDropConstraintMessage in class MessageFactorypublic CreateCatalogMessage buildCreateCatalogMessage(org.apache.hadoop.hive.metastore.api.Catalog catalog)
buildCreateCatalogMessage in class MessageFactorypublic AlterCatalogMessage buildAlterCatalogMessage(org.apache.hadoop.hive.metastore.api.Catalog beforeCat, org.apache.hadoop.hive.metastore.api.Catalog afterCat)
buildAlterCatalogMessage in class MessageFactorypublic DropCatalogMessage buildDropCatalogMessage(org.apache.hadoop.hive.metastore.api.Catalog catalog)
buildDropCatalogMessage in class MessageFactorypublic OpenTxnMessage buildOpenTxnMessage(Long fromTxnId, Long toTxnId)
MessageFactorybuildOpenTxnMessage in class MessageFactoryfromTxnId - start transaction id (inclusive)toTxnId - end transaction id (inclusive)public CommitTxnMessage buildCommitTxnMessage(Long txnId)
MessageFactorybuildCommitTxnMessage in class MessageFactorytxnId - Id of the transaction to be committedpublic AbortTxnMessage buildAbortTxnMessage(Long txnId)
MessageFactorybuildAbortTxnMessage in class MessageFactorytxnId - Id of the transaction to be abortedpublic AllocWriteIdMessage buildAllocWriteIdMessage(List<org.apache.hadoop.hive.metastore.api.TxnToWriteId> txnToWriteIdList, String dbName, String tableName)
MessageFactorybuildAllocWriteIdMessage in class MessageFactorytxnToWriteIdList - List of Txn Ids and write id mapdbName - db for which write ids to be allocatedtableName - table for which write ids to be allocatedpublic static org.codehaus.jackson.node.ObjectNode getJsonTree(org.apache.hadoop.hive.metastore.api.NotificationEvent event)
throws Exception
Exceptionpublic static org.codehaus.jackson.node.ObjectNode getJsonTree(String eventMessage) throws Exception
Exceptionpublic static org.apache.hadoop.hive.metastore.api.Table getTableObj(org.codehaus.jackson.node.ObjectNode jsonTree)
throws Exception
Exceptionpublic static org.apache.thrift.TBase getTObj(String tSerialized, Class<? extends org.apache.thrift.TBase> objClass) throws Exception
Exceptionpublic static Iterable<? extends org.apache.thrift.TBase> getTObjs(Iterable<String> objRefStrs, Class<? extends org.apache.thrift.TBase> objClass) throws Exception
ExceptionCopyright © 2019 The Apache Software Foundation. All Rights Reserved.