Repository: hive Updated Branches: refs/heads/storage-branch-2.6 10dcff625 -> 489f6a20a
http://git-wip-us.apache.org/repos/asf/hive/blob/4c0475ff/standalone-metastore/src/main/thrift/hive_metastore.thrift ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/main/thrift/hive_metastore.thrift b/standalone-metastore/src/main/thrift/hive_metastore.thrift index c56a4f9..363f69b 100644 --- a/standalone-metastore/src/main/thrift/hive_metastore.thrift +++ b/standalone-metastore/src/main/thrift/hive_metastore.thrift @@ -862,6 +862,15 @@ struct CommitTxnRequest { 2: optional string replPolicy, } +struct ReplTblWriteIdStateRequest { + 1: required string validWriteIdlist, + 2: required string user, + 3: required string hostName, + 4: required string dbName, + 5: required string tableName, + 6: optional list<string> partNames, +} + // Request msg to get the valid write ids list for the given list of tables wrt to input validTxnList struct GetValidWriteIdsRequest { 1: required list<string> fullTableNames, // Full table names of format <db_name>.<table_name> @@ -2060,6 +2069,7 @@ service ThriftHiveMetastore extends fb303.FacebookService void abort_txn(1:AbortTxnRequest rqst) throws (1:NoSuchTxnException o1) void abort_txns(1:AbortTxnsRequest rqst) throws (1:NoSuchTxnException o1) void commit_txn(1:CommitTxnRequest rqst) throws (1:NoSuchTxnException o1, 2:TxnAbortedException o2) + void repl_tbl_writeid_state(1: ReplTblWriteIdStateRequest rqst) GetValidWriteIdsResponse get_valid_write_ids(1:GetValidWriteIdsRequest rqst) throws (1:NoSuchTxnException o1, 2:MetaException o2) AllocateTableWriteIdsResponse allocate_table_write_ids(1:AllocateTableWriteIdsRequest rqst) http://git-wip-us.apache.org/repos/asf/hive/blob/4c0475ff/standalone-metastore/src/test/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClientPreCatalog.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/test/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClientPreCatalog.java b/standalone-metastore/src/test/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClientPreCatalog.java index 8ae899f..5eb49c2 100644 --- a/standalone-metastore/src/test/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClientPreCatalog.java +++ b/standalone-metastore/src/test/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClientPreCatalog.java @@ -2224,6 +2224,33 @@ public class HiveMetaStoreClientPreCatalog implements IMetaStoreClient, AutoClos } @Override + public void replTableWriteIdState(String validWriteIdList, String dbName, String tableName, List<String> partNames) + throws TException { + String user; + try { + user = UserGroupInformation.getCurrentUser().getUserName(); + } catch (IOException e) { + LOG.error("Unable to resolve current user name " + e.getMessage()); + throw new RuntimeException(e); + } + + String hostName; + try { + hostName = InetAddress.getLocalHost().getHostName(); + } catch (UnknownHostException e) { + LOG.error("Unable to resolve my host name " + e.getMessage()); + throw new RuntimeException(e); + } + + ReplTblWriteIdStateRequest rqst + = new ReplTblWriteIdStateRequest(validWriteIdList, user, hostName, dbName, tableName); + if (partNames != null) { + rqst.setPartNames(partNames); + } + client.repl_tbl_writeid_state(rqst); + } + + @Override public long allocateTableWriteId(long txnId, String dbName, String tableName) throws TException { return allocateTableWriteIdsBatch(Collections.singletonList(txnId), dbName, tableName).get(0).getWriteId(); } http://git-wip-us.apache.org/repos/asf/hive/blob/4c0475ff/storage-api/src/java/org/apache/hadoop/hive/common/ValidReadTxnList.java ---------------------------------------------------------------------- diff --git a/storage-api/src/java/org/apache/hadoop/hive/common/ValidReadTxnList.java b/storage-api/src/java/org/apache/hadoop/hive/common/ValidReadTxnList.java index dd432d9..b8ff03f 100644 --- a/storage-api/src/java/org/apache/hadoop/hive/common/ValidReadTxnList.java +++ b/storage-api/src/java/org/apache/hadoop/hive/common/ValidReadTxnList.java @@ -41,9 +41,6 @@ public class ValidReadTxnList implements ValidTxnList { /** * Used if there are no open transactions in the snapshot */ - public ValidReadTxnList(long[] exceptions, BitSet abortedBits, long highWatermark) { - this(exceptions, abortedBits, highWatermark, Long.MAX_VALUE); - } public ValidReadTxnList(long[] exceptions, BitSet abortedBits, long highWatermark, long minOpenTxn) { if (exceptions.length > 0) { this.minOpenTxn = minOpenTxn;