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, getInstance
public MessageDeserializer getDeserializer()
getDeserializer
in class MessageFactory
public String getMessageFormat()
MessageFactory
getMessageFormat
in class MessageFactory
public CreateDatabaseMessage buildCreateDatabaseMessage(org.apache.hadoop.hive.metastore.api.Database db)
MessageFactory
buildCreateDatabaseMessage
in class MessageFactory
db
- The Database being added.public AlterDatabaseMessage buildAlterDatabaseMessage(org.apache.hadoop.hive.metastore.api.Database beforeDb, org.apache.hadoop.hive.metastore.api.Database afterDb)
MessageFactory
buildAlterDatabaseMessage
in class MessageFactory
beforeDb
- The Database before alter.afterDb
- The Database after alter.public DropDatabaseMessage buildDropDatabaseMessage(org.apache.hadoop.hive.metastore.api.Database db)
MessageFactory
buildDropDatabaseMessage
in class MessageFactory
db
- The Database being dropped.public CreateTableMessage buildCreateTableMessage(org.apache.hadoop.hive.metastore.api.Table table, Iterator<String> fileIter)
MessageFactory
buildCreateTableMessage
in class MessageFactory
table
- 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)
MessageFactory
buildAlterTableMessage
in class MessageFactory
before
- 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)
MessageFactory
buildDropTableMessage
in class MessageFactory
table
- 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)
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(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)
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 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)
MessageFactory
buildDropPartitionMessage
in class MessageFactory
table
- 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)
MessageFactory
buildCreateFunctionMessage
in class MessageFactory
fn
- The Function being added.public DropFunctionMessage buildDropFunctionMessage(org.apache.hadoop.hive.metastore.api.Function fn)
MessageFactory
buildDropFunctionMessage
in class MessageFactory
fn
- 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)
MessageFactory
buildInsertMessage
in class MessageFactory
tableObj
- 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)
MessageFactory
buildAddPrimaryKeyMessage
in class MessageFactory
pks
- list of primary keyspublic AddForeignKeyMessage buildAddForeignKeyMessage(List<org.apache.hadoop.hive.metastore.api.SQLForeignKey> fks)
MessageFactory
buildAddForeignKeyMessage
in class MessageFactory
fks
- list of foreign keyspublic AddUniqueConstraintMessage buildAddUniqueConstraintMessage(List<org.apache.hadoop.hive.metastore.api.SQLUniqueConstraint> uks)
MessageFactory
buildAddUniqueConstraintMessage
in class MessageFactory
uks
- list of unique constraintspublic AddNotNullConstraintMessage buildAddNotNullConstraintMessage(List<org.apache.hadoop.hive.metastore.api.SQLNotNullConstraint> nns)
MessageFactory
buildAddNotNullConstraintMessage
in class MessageFactory
nns
- list of not null constraintspublic DropConstraintMessage buildDropConstraintMessage(String dbName, String tableName, String constraintName)
MessageFactory
buildDropConstraintMessage
in class MessageFactory
public CreateCatalogMessage buildCreateCatalogMessage(org.apache.hadoop.hive.metastore.api.Catalog catalog)
buildCreateCatalogMessage
in class MessageFactory
public AlterCatalogMessage buildAlterCatalogMessage(org.apache.hadoop.hive.metastore.api.Catalog beforeCat, org.apache.hadoop.hive.metastore.api.Catalog afterCat)
buildAlterCatalogMessage
in class MessageFactory
public DropCatalogMessage buildDropCatalogMessage(org.apache.hadoop.hive.metastore.api.Catalog catalog)
buildDropCatalogMessage
in class MessageFactory
public OpenTxnMessage buildOpenTxnMessage(Long fromTxnId, Long toTxnId)
MessageFactory
buildOpenTxnMessage
in class MessageFactory
fromTxnId
- start transaction id (inclusive)toTxnId
- end transaction id (inclusive)public CommitTxnMessage buildCommitTxnMessage(Long txnId)
MessageFactory
buildCommitTxnMessage
in class MessageFactory
txnId
- Id of the transaction to be committedpublic AbortTxnMessage buildAbortTxnMessage(Long txnId)
MessageFactory
buildAbortTxnMessage
in class MessageFactory
txnId
- Id of the transaction to be abortedpublic AllocWriteIdMessage buildAllocWriteIdMessage(List<org.apache.hadoop.hive.metastore.api.TxnToWriteId> txnToWriteIdList, String dbName, String tableName)
MessageFactory
buildAllocWriteIdMessage
in class MessageFactory
txnToWriteIdList
- 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
Exception
public static org.codehaus.jackson.node.ObjectNode getJsonTree(String eventMessage) throws Exception
Exception
public static org.apache.hadoop.hive.metastore.api.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 © 2019 The Apache Software Foundation. All Rights Reserved.