pkumarsinha commented on a change in pull request #1523:
URL: https://github.com/apache/hive/pull/1523#discussion_r500213892



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplDumpTask.java
##########
@@ -1036,15 +1026,29 @@ private String getValidWriteIdList(String dbName, 
String tblName, String validTx
     return ((validWriteIds != null) ? validWriteIds.toString() : null);
   }
 
-  private List<Long> getOpenTxns(ValidTxnList validTxnList) {
+  List<Long> getTxnsNotPresentInHiveLocksTable(ValidTxnList validTxnList) 
throws LockException {

Review comment:
       Revert back the access modifier to 'private'.

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplDumpTask.java
##########
@@ -1036,15 +1026,29 @@ private String getValidWriteIdList(String dbName, 
String tblName, String validTx
     return ((validWriteIds != null) ? validWriteIds.toString() : null);
   }
 
-  private List<Long> getOpenTxns(ValidTxnList validTxnList) {
+  List<Long> getTxnsNotPresentInHiveLocksTable(ValidTxnList validTxnList) 
throws LockException {
     long[] invalidTxns = validTxnList.getInvalidTransactions();
-    List<Long> openTxns = new ArrayList<>();
-    for (long invalidTxn : invalidTxns) {
-      if (!validTxnList.isTxnAborted(invalidTxn)) {
-        openTxns.add(invalidTxn);
+    List<Long> txnsNotPresentInHiveLocks = new ArrayList<>();
+    for (long openTxnId : invalidTxns) {
+      if (!isTxnPresentInHiveLocks(openTxnId)) {
+        txnsNotPresentInHiveLocks.add(openTxnId);
       }
     }
-    return openTxns;
+    return txnsNotPresentInHiveLocks;
+  }
+
+  /**
+   * Get if there is an entry for the txn id in the hive locks table. It can 
be in waiting state or acquired state.
+   * @param txnId
+   * @return true if the entry for the txn id is present in hive locks.
+   * @throws LockException
+   */
+  boolean isTxnPresentInHiveLocks(long txnId) throws LockException {

Review comment:
        Access modifier to 'private'.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to