You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by su...@apache.org on 2015/10/22 01:56:47 UTC

[1/6] incubator-trafodion git commit: [TRAFODION-34]Support region splitting/balancing

Repository: incubator-trafodion
Updated Branches:
  refs/heads/master 63b124ab4 -> 5360a1d45


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/65d0f1cf/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/TransactionState.java
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/TransactionState.java b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/TransactionState.java
index 2543f21..e5db798 100755
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/TransactionState.java
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/TransactionState.java
@@ -128,6 +128,7 @@ public class TransactionState {
     protected int reInstated = 0;
     protected long flushTxId = 0;
 
+    protected boolean splitRetry = false;
     protected boolean earlyLogging = false;
     protected boolean commit_TS_CC = false;
     protected HLog tHLog = null;
@@ -219,6 +220,18 @@ public class TransactionState {
         return status;
     }
 
+    public long getLogSeqId() {
+      return logSeqId.get();
+    }
+
+    public void setSplitRetry(boolean value) {
+      splitRetry = value;
+    }
+
+    public boolean getSplitRetry() {
+      return splitRetry;
+    }
+
     public long getFlushTxId() {
        return flushTxId;
     }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/65d0f1cf/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/TrxTransactionState.java
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/TrxTransactionState.java b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/TrxTransactionState.java
index a942a99..8e464c5 100644
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/TrxTransactionState.java
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/TrxTransactionState.java
@@ -234,6 +234,8 @@ public class TrxTransactionState  extends TransactionState{
     }
 
     public synchronized void addDelete(final Delete delete) {
+        if (LOG.isTraceEnabled()) LOG.trace("addDelete -- ENTRY: delete: " + delete.toString());
+
         WriteAction waction;
         WALEdit e1  = new WALEdit();
         long now = EnvironmentEdgeManager.currentTimeMillis();
@@ -965,5 +967,9 @@ public class TrxTransactionState  extends TransactionState{
           return edits;
       }
     }
+    public Set<TrxTransactionState> getTransactionsToCheck() {
+      return transactionsToCheck;
+    }
+
    
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/65d0f1cf/core/sqf/src/seatrans/hbase-trx/src/main/protobuf/TrxRegion.proto
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/protobuf/TrxRegion.proto b/core/sqf/src/seatrans/hbase-trx/src/main/protobuf/TrxRegion.proto
index 5525d8b..1b17a9f 100755
--- a/core/sqf/src/seatrans/hbase-trx/src/main/protobuf/TrxRegion.proto
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/protobuf/TrxRegion.proto
@@ -288,6 +288,27 @@ message TransactionalAggregateResponse {
 
 }
 
+message TransactionPersist {
+  repeated int64 txById = 1;
+  repeated int64 seqNoListSeq = 2;
+  repeated int64 seqNoListTxn = 3;
+  required int64 nextSeqId = 4;
+}
+
+message TransactionStateMsg {
+  required int64 txId = 1;
+  repeated MutationProto put = 2;
+  repeated MutationProto delete = 3;
+  repeated bool putOrDel = 4;
+  repeated int64 txnsToCheck = 5;
+  required int64 startSeqNum = 6;
+  required int64 seqNum = 7;
+  required int64 logSeqId = 8;
+  required bool reinstated = 9;
+  required int32 status = 10;
+  required int32 commitProgress = 11;
+}
+
 service TrxRegionService {
   rpc abortTransaction(AbortTransactionRequest)
     returns(AbortTransactionResponse);


[6/6] incubator-trafodion git commit: Merge remote branch 'origin/pr/137/head' into mrg_68

Posted by su...@apache.org.
Merge remote branch 'origin/pr/137/head' into mrg_68


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/5360a1d4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/5360a1d4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/5360a1d4

Branch: refs/heads/master
Commit: 5360a1d455c7ed3c7a53981fb349f860e78af55b
Parents: 63b124a 815fc9b
Author: Suresh Subbiah <su...@apache.org>
Authored: Wed Oct 21 23:56:24 2015 +0000
Committer: Suresh Subbiah <su...@apache.org>
Committed: Wed Oct 21 23:56:24 2015 +0000

----------------------------------------------------------------------
 .../transactional/TransactionManager.java       |  204 +-
 .../client/transactional/TransactionState.java  |   10 +
 .../transactional/TransactionalReturn.java      |    1 +
 .../transactional/TransactionalTable.java       |  285 +-
 .../transactional/SplitBalanceHelper.java       |  296 ++
 .../transactional/TrxRegionEndpoint.java        |  272 +-
 .../transactional/TrxRegionObserver.java        |  232 +-
 .../generated/TrxRegionProtos.java              | 3001 +++++++++++++++++-
 .../transactional/TransactionState.java         |   13 +
 .../transactional/TrxTransactionState.java      |    6 +
 .../hbase-trx/src/main/protobuf/TrxRegion.proto |   21 +
 11 files changed, 4067 insertions(+), 274 deletions(-)
----------------------------------------------------------------------



[3/6] incubator-trafodion git commit: [TRAFODION-34]Support region splitting/balancing

Posted by su...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/65d0f1cf/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionObserver.java
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionObserver.java b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionObserver.java
index b3a6516..521ee14 100644
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionObserver.java
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionObserver.java
@@ -50,6 +50,7 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
+import java.util.ListIterator;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
@@ -62,6 +63,8 @@ import java.util.concurrent.atomic.AtomicInteger;
 import org.apache.commons.codec.binary.Hex;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CellUtil;
 import org.apache.hadoop.hbase.CoprocessorEnvironment;
 import org.apache.hadoop.hbase.HRegionInfo;
@@ -75,6 +78,10 @@ import org.apache.hadoop.hbase.coprocessor.ObserverContext;
 import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;
 import org.apache.hadoop.hbase.regionserver.HRegion;
 import org.apache.hadoop.hbase.regionserver.RegionServerServices;
+import org.apache.hadoop.hbase.regionserver.ScanType;
+import org.apache.hadoop.hbase.regionserver.Store;
+import org.apache.hadoop.hbase.regionserver.compactions.CompactionRequest;
+import org.apache.hadoop.hbase.regionserver.transactional.TransactionalRegionScannerHolder;
 import org.apache.hadoop.hbase.regionserver.transactional.TrxTransactionState;
 import org.apache.hadoop.hbase.regionserver.wal.HLog;
 import org.apache.hadoop.hbase.regionserver.wal.HLogKey;
@@ -108,7 +115,9 @@ public static final String trxkeycommitPendingTransactions = "commitPendingTrans
 public static final String trxkeypendingTransactionsById = "pendingTransactionsById";
 public static final String trxkeyindoubtTransactionsCountByTmid = "indoubtTransactionsCountByTmid";
 public static final String trxkeyClosingVar = "checkClosingVariable";
+public static final String trxkeyScanners = "trxScanners";
 
+public static final String SPLIT_DELAY_NOFLUSH = "hbase.transaction.split.delay.noflush";
 public static final String SPLIT_DELAY_LIMIT = "hbase.transaction.split.delay.limit";
 public static final String EARLY_DRAIN =       "hbase.transaction.split.drain.early";
 public static final String ACTIVE_DELAY_LEN =  "hbase.transaction.split.active.delay";
@@ -133,9 +142,17 @@ private Map<Integer, Integer> indoubtTransactionsCountByTmid = new TreeMap<Integ
 // Map for Transactional Region to exchange data structures between Region Observer coprocessor and Endpoint Coprocessor
 static ConcurrentHashMap<String, Object> transactionsRefMap = new ConcurrentHashMap<String, Object>();
 
+private ConcurrentHashMap<Long,TransactionalRegionScannerHolder> scanners =
+                    new ConcurrentHashMap<Long, TransactionalRegionScannerHolder>();
+
+static ConcurrentHashMap<String, Object> trxRegionMap;
+
 private ConcurrentHashMap<String, TrxTransactionState> transactionsById = new ConcurrentHashMap<String, TrxTransactionState>();
 private Set<TrxTransactionState> commitPendingTransactions = Collections.synchronizedSet(new HashSet<TrxTransactionState>());
 private AtomicBoolean closing = new AtomicBoolean(false);
+private boolean hasClosed = false;
+private boolean hasFlushed = false;
+
 
 HRegion my_Region;
 HRegionInfo regionInfo;
@@ -145,6 +162,7 @@ String hostName;
 int port;
 int splitDelayLimit;
 boolean earlyDrain;
+boolean splitDelayNoFlush;
 int activeDelayLen;
 int pendingDelayLen;
 long activeCount = 0;
@@ -159,15 +177,18 @@ int flushCount = 0;
 int regionState = 0;
 private Object recoveryCheckLock = new Object();
 private Object editReplay = new Object();
-private AtomicInteger nextSequenceId = new AtomicInteger(0);
-
-private static String zNodePath = "/hbase/Trafodion/recovery/";
+public static String zTrafPath = "/hbase/Trafodion/";
+private static String zNodePath = zTrafPath + "recovery/";
 private static ZooKeeperWatcher zkw1 = null;
 private static Object zkRecoveryCheckLock = new Object();
 
+SplitBalanceHelper sbHelper;
+
 // Region Observer Coprocessor START
 @Override
 public void start(CoprocessorEnvironment e) throws IOException {
+    trxRegionMap = TrxRegionEndpoint.getRegionMap();
+
     RegionCoprocessorEnvironment regionCoprEnv = (RegionCoprocessorEnvironment)e;
     RegionCoprocessorEnvironment re = (RegionCoprocessorEnvironment) e;
     my_Region = re.getRegion();
@@ -178,6 +199,7 @@ public void start(CoprocessorEnvironment e) throws IOException {
     this.activeDelayLen = conf.getInt(ACTIVE_DELAY_LEN, ACTIVETXN_DELAY_DEFAULT);
     this.pendingDelayLen = conf.getInt(PENDING_DELAY_LEN, PENDINGTXN_DELAY_DEFAULT);
     this.earlyDrain = conf.getBoolean(EARLY_DRAIN, false);
+    this.splitDelayNoFlush = conf.getBoolean(SPLIT_DELAY_NOFLUSH, true);
 
     if (LOG.isTraceEnabled()) {
         LOG.trace("Properties for -- " + regionInfo.getRegionNameAsString());
@@ -185,6 +207,7 @@ public void start(CoprocessorEnvironment e) throws IOException {
         LOG.trace("Property: activeDelayLen = " + this.activeDelayLen);
         LOG.trace("Property: pendingDelayLen = " + this.pendingDelayLen);
         LOG.trace("Property: earlyDrain = " + this.earlyDrain);
+        LOG.trace("Property: splitDelayNoFlush = " + this.splitDelayNoFlush);
     }
     
     if (LOG.isTraceEnabled()) LOG.trace("Trafodion Recovery Region Observer CP: trxRegionObserver load start ");
@@ -263,7 +286,20 @@ public void start(CoprocessorEnvironment e) throws IOException {
        transactionsRefMap.put(regionName+trxkeyClosingVar, this.closing);
    }
 
-    if (LOG.isTraceEnabled()) LOG.trace("Trafodion Recovery Region Observer CP: trxRegionObserver load start complete");
+   @SuppressWarnings("unchecked")
+   ConcurrentHashMap<Long,TransactionalRegionScannerHolder> scannersCheck =
+       (ConcurrentHashMap<Long,TransactionalRegionScannerHolder>)transactionsRefMap
+           .get(regionName+trxkeyScanners);
+   if(scannersCheck != null) {
+     this.scanners = scannersCheck;
+   }
+   else {
+     transactionsRefMap.put(regionName+trxkeyScanners, this.scanners);
+   }
+
+   sbHelper = new SplitBalanceHelper(my_Region, zkw1);
+
+   if (LOG.isTraceEnabled()) LOG.trace("Trafodion Recovery Region Observer CP: trxRegionObserver load start complete");
 
 } // end of start
 
@@ -411,6 +447,30 @@ static ConcurrentHashMap<String, Object> getRefMap() {
 @Override
 public void postOpen(ObserverContext<RegionCoprocessorEnvironment> e) {
 
+  if(!this.splitDelayNoFlush) {
+    @SuppressWarnings("rawtypes")
+    TrxRegionEndpoint tre = (TrxRegionEndpoint)trxRegionMap.get(regionInfo.getRegionNameAsString()+TrxRegionEndpoint.trxkeyEPCPinstance);
+    if(tre == null) {
+        LOG.error("Unable to obtain TrxRegionEndpoint object from shared map for " + regionInfo.getRegionNameAsString());
+    }
+    else {
+  	  Path readPath = null;
+  	  StringBuilder sbPath = new StringBuilder();
+  	  if(sbHelper.getSplit(sbPath)) {
+  		  sbHelper.clearSplit();
+  	  }
+  	  else if(sbHelper.getBalance(sbPath)) {
+  	    readPath = new Path(sbPath.toString());
+  	    try {
+  		  tre.readTxnInfo(readPath);
+  	    } catch(IOException ioe) {
+  	      if (LOG.isErrorEnabled()) LOG.error("Unable to read Transactional Info for balance coordination: " + ioe);
+  	    }
+  		  sbHelper.clearBalance();
+  	  }
+    }
+  }
+
    //        Trafodion Recovery : after Open, we should have alreday constructed all the indoubt transactions in
    //        pendingTransactionsById now process it and construct transaction list by TM id. These two data
    //        structures are put in the reference map which is shared with TrxRegionEndpoint coprocessor class per region 
@@ -577,75 +637,110 @@ public void createRecoveryzNode(int node, String encodedName, byte [] data) thro
        }
 } // end of createRecoveryzNode
 
-    protected void pendingWait() throws IOException {
-        int count = 1;
-        while(!commitPendingTransactions.isEmpty()) {
-            try {
-                if(LOG.isDebugEnabled()) LOG.debug("pendingWait() delay, count " + count++ + " on: " + regionInfo.getRegionNameAsString());
-                Thread.sleep(this.pendingDelayLen);
-            } catch(InterruptedException e) {
-                String error = "Problem while calling sleep() on pendingWait delay, " + e;
-                if(LOG.isErrorEnabled()) LOG.error("Problem while calling sleep() on preSplit delay, returning. " + e);
-                throw new IOException(error);
-            }
-        }
-    }
 
-    protected void activeWait() throws IOException {
-        int counter = 0;
-        int minutes = 0;
-        int currentMin = 0;
-
-        boolean delayMsg = false;
-        while(!transactionsById.isEmpty()) {
-            try {
-                delayMsg = true;
-                Thread.sleep(this.activeDelayLen);
-                counter++;
-                currentMin = (counter * this.activeDelayLen) / 60000;
-
-                if(currentMin > minutes) {
-                    minutes = currentMin;
-                    if (LOG.isInfoEnabled()) LOG.info("Delaying split due to transactions present. Delayed : " + 
-                                                      minutes + " minute(s) on " + regionInfo.getRegionNameAsString());
-                }
-                if(minutes >= this.splitDelayLimit) {
-                    if(LOG.isWarnEnabled()) LOG.warn("Surpassed split delay limit of " + this.splitDelayLimit
-                                                    + " minutes. Continuing with split");
-                    delayMsg = false;
-                    break;
-                }
-            } catch (InterruptedException e) {
-                String error = "Problem while calling sleep() on preSplit delay - activeWait: " + e;
-                if(LOG.isErrorEnabled()) LOG.error(error);
-                throw new IOException(error);
-            }
-        }
-        if(delayMsg) {
-          if(LOG.isWarnEnabled()) LOG.warn("Continuing with split operation, no active transactions on: " + regionInfo.getRegionNameAsString());
-        }
-    }
 
     @Override
     public void preSplit(ObserverContext<RegionCoprocessorEnvironment> c, byte[] splitRow) throws IOException {
         if(LOG.isTraceEnabled()) LOG.trace("preSplit -- ENTRY region: " + regionInfo.getRegionNameAsString());
 
-        if(!this.earlyDrain) {
-          activeWait();
+        if(splitDelayNoFlush) {
+            if(!this.earlyDrain)
+              sbHelper.activeWait(transactionsById, activeDelayLen, splitDelayLimit);
+            closing.set(true);
+            sbHelper.pendingWait(commitPendingTransactions, pendingDelayLen);
+        }
+        else {
+            sbHelper.pendingAndScannersWait(commitPendingTransactions, scanners, pendingDelayLen);
+            closing.set(true);
+
+            sbHelper.setSplit();
         }
-        closing.set(true);
-        pendingWait();
 
         if(LOG.isTraceEnabled()) LOG.trace("preSplit -- EXIT region: " + regionInfo.getRegionNameAsString());
     }
 
     @Override
+    public void	postSplit(ObserverContext<RegionCoprocessorEnvironment> e, HRegion l, HRegion r) {
+
+        if(splitDelayNoFlush)
+          return;
+
+        @SuppressWarnings("rawtypes")
+        TrxRegionEndpoint treL = (TrxRegionEndpoint)trxRegionMap.get(l.getRegionInfo().getRegionNameAsString()+TrxRegionEndpoint.trxkeyEPCPinstance);
+          @SuppressWarnings("rawtypes")
+          TrxRegionEndpoint treR = (TrxRegionEndpoint)trxRegionMap.get(r.getRegionInfo().getRegionNameAsString()+TrxRegionEndpoint.trxkeyEPCPinstance);
+          if(treL == null || treR == null) {
+             LOG.error("Unable to obtain TrxRegionEndpoint object from shared map for " + regionInfo.getRegionNameAsString());
+          }
+          else {
+          try {
+             treL.setClosing(true);
+             treR.setClosing(true);
+             Thread readThread = new Thread(new TxnReadThread(treL, sbHelper.getPath(), true));
+             readThread.start();
+             //treL.readTxnInfo(sbHelper.getPath(), true);
+             treR.readTxnInfo(sbHelper.getPath(), true);
+             readThread.join();
+             treL.setClosing(false);
+             treR.setClosing(false);
+             sbHelper.clearSplit();
+          } catch (IOException ioe) {
+             if(LOG.isErrorEnabled()) LOG.error("Unable to read Transaction Info for transactional split coordination: " + ioe);
+          } catch (InterruptedException ie) {
+             if(LOG.isErrorEnabled()) LOG.error("Thread issue hit while trying to read Transaction Info for transactional split coordination: " + ie);
+          }
+       }
+    }
+
+    @Override
     public void    preClose(ObserverContext<RegionCoprocessorEnvironment> c, boolean abortRequested) {
-        if(LOG.isInfoEnabled()) {
-            HRegion region = c.getEnvironment().getRegion();
-            LOG.info("preClose -- setting close var to true on: " + region.getRegionNameAsString());
+        if (hasFlushed ||
+            hasClosed ||
+            splitDelayNoFlush ||
+            c.getEnvironment().getRegionServerServices().isStopping() ||
+            c.getEnvironment().getRegionServerServices().isStopped())
+            return;
+
+        if (!hasClosed) {
+	        if(LOG.isInfoEnabled()) {
+	            HRegion region = c.getEnvironment().getRegion();
+	            LOG.debug("preClose -- setting close var to true on: " + region.getRegionNameAsString());
+	        }
+	        try {
+	          sbHelper.pendingAndScannersWait(commitPendingTransactions, scanners, pendingDelayLen);
+	        } catch(IOException ioe) {
+	          LOG.error("Encountered exception when calling pendingAndScannersWait(): " + ioe);
+	        }
+	        closing.set(true);
+	        hasClosed = true;
+        }
+
+        if (c.getEnvironment().getRegionServerServices().isStopping() ||
+            c.getEnvironment().getRegionServerServices().isStopped() ||
+            hasFlushed)
+            return;
+
+        @SuppressWarnings("rawtypes")
+        TrxRegionEndpoint tre = (TrxRegionEndpoint)trxRegionMap.get(regionInfo.getRegionNameAsString()+TrxRegionEndpoint.trxkeyEPCPinstance);
+        if(tre == null) {
+            LOG.error("Unable to obtain TrxRegionEndpoint objet from shared map for " + regionInfo.getRegionNameAsString());
+        }
+        else {
+          try {
+            tre.flushToFS(sbHelper.getPath());
+            if(!sbHelper.getSplit()) {
+              try {
+               sbHelper.setBalance();
+              } catch (IOException ioe) {
+               if(LOG.isErrorEnabled()) LOG.error("Unable to set balance: " + ioe);
+              }
+            }
+            hasFlushed = true;
+          } catch (IOException ioe) {
+            if (LOG.isErrorEnabled()) LOG.error("Unable to flush to filesystem");
+            hasFlushed = false;
+          }
         }
-        closing.set(true);
     }
 
     @Override
@@ -656,6 +751,7 @@ public void createRecoveryzNode(int node, String encodedName, byte [] data) thro
         transactionsRefMap.remove(regionName+trxkeytransactionsById);
         transactionsRefMap.remove(regionName+trxkeycommitPendingTransactions);
         transactionsRefMap.remove(regionName+trxkeyClosingVar);
+        transactionsRefMap.remove(regionName+trxkeyScanners);
     }
 
     protected InternalScanner getWrappedScanner(final long lowStartId, final InternalScanner s) {
@@ -787,4 +883,22 @@ public void createRecoveryzNode(int node, String encodedName, byte [] data) thro
         return getWrappedScanner(lowStartId , scanner); 
     }
 
+    private static class TxnReadThread implements Runnable {
+      @SuppressWarnings("rawtypes")
+      private TrxRegionEndpoint tre;
+      private Path path;
+      private boolean isSplit;
+      TxnReadThread(@SuppressWarnings("rawtypes") TrxRegionEndpoint tre, Path path, boolean isSplit) {
+        this.tre = tre;
+        this.path = path;
+        this.isSplit = isSplit;
+      }
+      public void run(){
+        try {
+          tre.readTxnInfo(path, isSplit);
+        } catch (IOException ioe) {
+          if(LOG.isErrorEnabled()) LOG.error("Unable to read Transaction Info for transactional split coordination: " + ioe);
+        }
+      }
+    }
 } // end of TrxRegionObserver Class


[2/6] incubator-trafodion git commit: [TRAFODION-34]Support region splitting/balancing

Posted by su...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/65d0f1cf/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/generated/TrxRegionProtos.java
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/generated/TrxRegionProtos.java b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/generated/TrxRegionProtos.java
index cf857a5..ea3ba54 100755
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/generated/TrxRegionProtos.java
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/generated/TrxRegionProtos.java
@@ -27568,6 +27568,2878 @@ public final class TrxRegionProtos {
     // @@protoc_insertion_point(class_scope:TransactionalAggregateResponse)
   }
 
+  public interface TransactionPersistOrBuilder
+      extends com.google.protobuf.MessageOrBuilder {
+
+    // repeated int64 txById = 1;
+    /**
+     * <code>repeated int64 txById = 1;</code>
+     */
+    java.util.List<java.lang.Long> getTxByIdList();
+    /**
+     * <code>repeated int64 txById = 1;</code>
+     */
+    int getTxByIdCount();
+    /**
+     * <code>repeated int64 txById = 1;</code>
+     */
+    long getTxById(int index);
+
+    // repeated int64 seqNoListSeq = 2;
+    /**
+     * <code>repeated int64 seqNoListSeq = 2;</code>
+     */
+    java.util.List<java.lang.Long> getSeqNoListSeqList();
+    /**
+     * <code>repeated int64 seqNoListSeq = 2;</code>
+     */
+    int getSeqNoListSeqCount();
+    /**
+     * <code>repeated int64 seqNoListSeq = 2;</code>
+     */
+    long getSeqNoListSeq(int index);
+
+    // repeated int64 seqNoListTxn = 3;
+    /**
+     * <code>repeated int64 seqNoListTxn = 3;</code>
+     */
+    java.util.List<java.lang.Long> getSeqNoListTxnList();
+    /**
+     * <code>repeated int64 seqNoListTxn = 3;</code>
+     */
+    int getSeqNoListTxnCount();
+    /**
+     * <code>repeated int64 seqNoListTxn = 3;</code>
+     */
+    long getSeqNoListTxn(int index);
+
+    // required int64 nextSeqId = 4;
+    /**
+     * <code>required int64 nextSeqId = 4;</code>
+     */
+    boolean hasNextSeqId();
+    /**
+     * <code>required int64 nextSeqId = 4;</code>
+     */
+    long getNextSeqId();
+  }
+  /**
+   * Protobuf type {@code TransactionPersist}
+   */
+  public static final class TransactionPersist extends
+      com.google.protobuf.GeneratedMessage
+      implements TransactionPersistOrBuilder {
+    // Use TransactionPersist.newBuilder() to construct.
+    private TransactionPersist(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+      super(builder);
+      this.unknownFields = builder.getUnknownFields();
+    }
+    private TransactionPersist(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+    private static final TransactionPersist defaultInstance;
+    public static TransactionPersist getDefaultInstance() {
+      return defaultInstance;
+    }
+
+    public TransactionPersist getDefaultInstanceForType() {
+      return defaultInstance;
+    }
+
+    private final com.google.protobuf.UnknownFieldSet unknownFields;
+    @java.lang.Override
+    public final com.google.protobuf.UnknownFieldSet
+        getUnknownFields() {
+      return this.unknownFields;
+    }
+    private TransactionPersist(
+        com.google.protobuf.CodedInputStream input,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws com.google.protobuf.InvalidProtocolBufferException {
+      initFields();
+      int mutable_bitField0_ = 0;
+      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+          com.google.protobuf.UnknownFieldSet.newBuilder();
+      try {
+        boolean done = false;
+        while (!done) {
+          int tag = input.readTag();
+          switch (tag) {
+            case 0:
+              done = true;
+              break;
+            default: {
+              if (!parseUnknownField(input, unknownFields,
+                                     extensionRegistry, tag)) {
+                done = true;
+              }
+              break;
+            }
+            case 8: {
+              if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
+                txById_ = new java.util.ArrayList<java.lang.Long>();
+                mutable_bitField0_ |= 0x00000001;
+              }
+              txById_.add(input.readInt64());
+              break;
+            }
+            case 10: {
+              int length = input.readRawVarint32();
+              int limit = input.pushLimit(length);
+              if (!((mutable_bitField0_ & 0x00000001) == 0x00000001) && input.getBytesUntilLimit() > 0) {
+                txById_ = new java.util.ArrayList<java.lang.Long>();
+                mutable_bitField0_ |= 0x00000001;
+              }
+              while (input.getBytesUntilLimit() > 0) {
+                txById_.add(input.readInt64());
+              }
+              input.popLimit(limit);
+              break;
+            }
+            case 16: {
+              if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
+                seqNoListSeq_ = new java.util.ArrayList<java.lang.Long>();
+                mutable_bitField0_ |= 0x00000002;
+              }
+              seqNoListSeq_.add(input.readInt64());
+              break;
+            }
+            case 18: {
+              int length = input.readRawVarint32();
+              int limit = input.pushLimit(length);
+              if (!((mutable_bitField0_ & 0x00000002) == 0x00000002) && input.getBytesUntilLimit() > 0) {
+                seqNoListSeq_ = new java.util.ArrayList<java.lang.Long>();
+                mutable_bitField0_ |= 0x00000002;
+              }
+              while (input.getBytesUntilLimit() > 0) {
+                seqNoListSeq_.add(input.readInt64());
+              }
+              input.popLimit(limit);
+              break;
+            }
+            case 24: {
+              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
+                seqNoListTxn_ = new java.util.ArrayList<java.lang.Long>();
+                mutable_bitField0_ |= 0x00000004;
+              }
+              seqNoListTxn_.add(input.readInt64());
+              break;
+            }
+            case 26: {
+              int length = input.readRawVarint32();
+              int limit = input.pushLimit(length);
+              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004) && input.getBytesUntilLimit() > 0) {
+                seqNoListTxn_ = new java.util.ArrayList<java.lang.Long>();
+                mutable_bitField0_ |= 0x00000004;
+              }
+              while (input.getBytesUntilLimit() > 0) {
+                seqNoListTxn_.add(input.readInt64());
+              }
+              input.popLimit(limit);
+              break;
+            }
+            case 32: {
+              bitField0_ |= 0x00000001;
+              nextSeqId_ = input.readInt64();
+              break;
+            }
+          }
+        }
+      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+        throw e.setUnfinishedMessage(this);
+      } catch (java.io.IOException e) {
+        throw new com.google.protobuf.InvalidProtocolBufferException(
+            e.getMessage()).setUnfinishedMessage(this);
+      } finally {
+        if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
+          txById_ = java.util.Collections.unmodifiableList(txById_);
+        }
+        if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
+          seqNoListSeq_ = java.util.Collections.unmodifiableList(seqNoListSeq_);
+        }
+        if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
+          seqNoListTxn_ = java.util.Collections.unmodifiableList(seqNoListTxn_);
+        }
+        this.unknownFields = unknownFields.build();
+        makeExtensionsImmutable();
+      }
+    }
+    public static final com.google.protobuf.Descriptors.Descriptor
+        getDescriptor() {
+      return org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.internal_static_TransactionPersist_descriptor;
+    }
+
+    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+        internalGetFieldAccessorTable() {
+      return org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.internal_static_TransactionPersist_fieldAccessorTable
+          .ensureFieldAccessorsInitialized(
+              org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist.class, org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist.Builder.class);
+    }
+
+    public static com.google.protobuf.Parser<TransactionPersist> PARSER =
+        new com.google.protobuf.AbstractParser<TransactionPersist>() {
+      public TransactionPersist parsePartialFrom(
+          com.google.protobuf.CodedInputStream input,
+          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+          throws com.google.protobuf.InvalidProtocolBufferException {
+        return new TransactionPersist(input, extensionRegistry);
+      }
+    };
+
+    @java.lang.Override
+    public com.google.protobuf.Parser<TransactionPersist> getParserForType() {
+      return PARSER;
+    }
+
+    private int bitField0_;
+    // repeated int64 txById = 1;
+    public static final int TXBYID_FIELD_NUMBER = 1;
+    private java.util.List<java.lang.Long> txById_;
+    /**
+     * <code>repeated int64 txById = 1;</code>
+     */
+    public java.util.List<java.lang.Long>
+        getTxByIdList() {
+      return txById_;
+    }
+    /**
+     * <code>repeated int64 txById = 1;</code>
+     */
+    public int getTxByIdCount() {
+      return txById_.size();
+    }
+    /**
+     * <code>repeated int64 txById = 1;</code>
+     */
+    public long getTxById(int index) {
+      return txById_.get(index);
+    }
+
+    // repeated int64 seqNoListSeq = 2;
+    public static final int SEQNOLISTSEQ_FIELD_NUMBER = 2;
+    private java.util.List<java.lang.Long> seqNoListSeq_;
+    /**
+     * <code>repeated int64 seqNoListSeq = 2;</code>
+     */
+    public java.util.List<java.lang.Long>
+        getSeqNoListSeqList() {
+      return seqNoListSeq_;
+    }
+    /**
+     * <code>repeated int64 seqNoListSeq = 2;</code>
+     */
+    public int getSeqNoListSeqCount() {
+      return seqNoListSeq_.size();
+    }
+    /**
+     * <code>repeated int64 seqNoListSeq = 2;</code>
+     */
+    public long getSeqNoListSeq(int index) {
+      return seqNoListSeq_.get(index);
+    }
+
+    // repeated int64 seqNoListTxn = 3;
+    public static final int SEQNOLISTTXN_FIELD_NUMBER = 3;
+    private java.util.List<java.lang.Long> seqNoListTxn_;
+    /**
+     * <code>repeated int64 seqNoListTxn = 3;</code>
+     */
+    public java.util.List<java.lang.Long>
+        getSeqNoListTxnList() {
+      return seqNoListTxn_;
+    }
+    /**
+     * <code>repeated int64 seqNoListTxn = 3;</code>
+     */
+    public int getSeqNoListTxnCount() {
+      return seqNoListTxn_.size();
+    }
+    /**
+     * <code>repeated int64 seqNoListTxn = 3;</code>
+     */
+    public long getSeqNoListTxn(int index) {
+      return seqNoListTxn_.get(index);
+    }
+
+    // required int64 nextSeqId = 4;
+    public static final int NEXTSEQID_FIELD_NUMBER = 4;
+    private long nextSeqId_;
+    /**
+     * <code>required int64 nextSeqId = 4;</code>
+     */
+    public boolean hasNextSeqId() {
+      return ((bitField0_ & 0x00000001) == 0x00000001);
+    }
+    /**
+     * <code>required int64 nextSeqId = 4;</code>
+     */
+    public long getNextSeqId() {
+      return nextSeqId_;
+    }
+
+    private void initFields() {
+      txById_ = java.util.Collections.emptyList();
+      seqNoListSeq_ = java.util.Collections.emptyList();
+      seqNoListTxn_ = java.util.Collections.emptyList();
+      nextSeqId_ = 0L;
+    }
+    private byte memoizedIsInitialized = -1;
+    public final boolean isInitialized() {
+      byte isInitialized = memoizedIsInitialized;
+      if (isInitialized != -1) return isInitialized == 1;
+
+      if (!hasNextSeqId()) {
+        memoizedIsInitialized = 0;
+        return false;
+      }
+      memoizedIsInitialized = 1;
+      return true;
+    }
+
+    public void writeTo(com.google.protobuf.CodedOutputStream output)
+                        throws java.io.IOException {
+      getSerializedSize();
+      for (int i = 0; i < txById_.size(); i++) {
+        output.writeInt64(1, txById_.get(i));
+      }
+      for (int i = 0; i < seqNoListSeq_.size(); i++) {
+        output.writeInt64(2, seqNoListSeq_.get(i));
+      }
+      for (int i = 0; i < seqNoListTxn_.size(); i++) {
+        output.writeInt64(3, seqNoListTxn_.get(i));
+      }
+      if (((bitField0_ & 0x00000001) == 0x00000001)) {
+        output.writeInt64(4, nextSeqId_);
+      }
+      getUnknownFields().writeTo(output);
+    }
+
+    private int memoizedSerializedSize = -1;
+    public int getSerializedSize() {
+      int size = memoizedSerializedSize;
+      if (size != -1) return size;
+
+      size = 0;
+      {
+        int dataSize = 0;
+        for (int i = 0; i < txById_.size(); i++) {
+          dataSize += com.google.protobuf.CodedOutputStream
+            .computeInt64SizeNoTag(txById_.get(i));
+        }
+        size += dataSize;
+        size += 1 * getTxByIdList().size();
+      }
+      {
+        int dataSize = 0;
+        for (int i = 0; i < seqNoListSeq_.size(); i++) {
+          dataSize += com.google.protobuf.CodedOutputStream
+            .computeInt64SizeNoTag(seqNoListSeq_.get(i));
+        }
+        size += dataSize;
+        size += 1 * getSeqNoListSeqList().size();
+      }
+      {
+        int dataSize = 0;
+        for (int i = 0; i < seqNoListTxn_.size(); i++) {
+          dataSize += com.google.protobuf.CodedOutputStream
+            .computeInt64SizeNoTag(seqNoListTxn_.get(i));
+        }
+        size += dataSize;
+        size += 1 * getSeqNoListTxnList().size();
+      }
+      if (((bitField0_ & 0x00000001) == 0x00000001)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeInt64Size(4, nextSeqId_);
+      }
+      size += getUnknownFields().getSerializedSize();
+      memoizedSerializedSize = size;
+      return size;
+    }
+
+    private static final long serialVersionUID = 0L;
+    @java.lang.Override
+    protected java.lang.Object writeReplace()
+        throws java.io.ObjectStreamException {
+      return super.writeReplace();
+    }
+
+    public static org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist parseFrom(
+        com.google.protobuf.ByteString data)
+        throws com.google.protobuf.InvalidProtocolBufferException {
+      return PARSER.parseFrom(data);
+    }
+    public static org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist parseFrom(
+        com.google.protobuf.ByteString data,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws com.google.protobuf.InvalidProtocolBufferException {
+      return PARSER.parseFrom(data, extensionRegistry);
+    }
+    public static org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist parseFrom(byte[] data)
+        throws com.google.protobuf.InvalidProtocolBufferException {
+      return PARSER.parseFrom(data);
+    }
+    public static org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist parseFrom(
+        byte[] data,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws com.google.protobuf.InvalidProtocolBufferException {
+      return PARSER.parseFrom(data, extensionRegistry);
+    }
+    public static org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist parseFrom(java.io.InputStream input)
+        throws java.io.IOException {
+      return PARSER.parseFrom(input);
+    }
+    public static org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist parseFrom(
+        java.io.InputStream input,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws java.io.IOException {
+      return PARSER.parseFrom(input, extensionRegistry);
+    }
+    public static org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist parseDelimitedFrom(java.io.InputStream input)
+        throws java.io.IOException {
+      return PARSER.parseDelimitedFrom(input);
+    }
+    public static org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist parseDelimitedFrom(
+        java.io.InputStream input,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws java.io.IOException {
+      return PARSER.parseDelimitedFrom(input, extensionRegistry);
+    }
+    public static org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist parseFrom(
+        com.google.protobuf.CodedInputStream input)
+        throws java.io.IOException {
+      return PARSER.parseFrom(input);
+    }
+    public static org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist parseFrom(
+        com.google.protobuf.CodedInputStream input,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws java.io.IOException {
+      return PARSER.parseFrom(input, extensionRegistry);
+    }
+
+    public static Builder newBuilder() { return Builder.create(); }
+    public Builder newBuilderForType() { return newBuilder(); }
+    public static Builder newBuilder(org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist prototype) {
+      return newBuilder().mergeFrom(prototype);
+    }
+    public Builder toBuilder() { return newBuilder(this); }
+
+    @java.lang.Override
+    protected Builder newBuilderForType(
+        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+      Builder builder = new Builder(parent);
+      return builder;
+    }
+    /**
+     * Protobuf type {@code TransactionPersist}
+     */
+    public static final class Builder extends
+        com.google.protobuf.GeneratedMessage.Builder<Builder>
+       implements org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersistOrBuilder {
+      public static final com.google.protobuf.Descriptors.Descriptor
+          getDescriptor() {
+        return org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.internal_static_TransactionPersist_descriptor;
+      }
+
+      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+          internalGetFieldAccessorTable() {
+        return org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.internal_static_TransactionPersist_fieldAccessorTable
+            .ensureFieldAccessorsInitialized(
+                org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist.class, org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist.Builder.class);
+      }
+
+      // Construct using org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist.newBuilder()
+      private Builder() {
+        maybeForceBuilderInitialization();
+      }
+
+      private Builder(
+          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+        super(parent);
+        maybeForceBuilderInitialization();
+      }
+      private void maybeForceBuilderInitialization() {
+        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+        }
+      }
+      private static Builder create() {
+        return new Builder();
+      }
+
+      public Builder clear() {
+        super.clear();
+        txById_ = java.util.Collections.emptyList();
+        bitField0_ = (bitField0_ & ~0x00000001);
+        seqNoListSeq_ = java.util.Collections.emptyList();
+        bitField0_ = (bitField0_ & ~0x00000002);
+        seqNoListTxn_ = java.util.Collections.emptyList();
+        bitField0_ = (bitField0_ & ~0x00000004);
+        nextSeqId_ = 0L;
+        bitField0_ = (bitField0_ & ~0x00000008);
+        return this;
+      }
+
+      public Builder clone() {
+        return create().mergeFrom(buildPartial());
+      }
+
+      public com.google.protobuf.Descriptors.Descriptor
+          getDescriptorForType() {
+        return org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.internal_static_TransactionPersist_descriptor;
+      }
+
+      public org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist getDefaultInstanceForType() {
+        return org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist.getDefaultInstance();
+      }
+
+      public org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist build() {
+        org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist result = buildPartial();
+        if (!result.isInitialized()) {
+          throw newUninitializedMessageException(result);
+        }
+        return result;
+      }
+
+      public org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist buildPartial() {
+        org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist result = new org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist(this);
+        int from_bitField0_ = bitField0_;
+        int to_bitField0_ = 0;
+        if (((bitField0_ & 0x00000001) == 0x00000001)) {
+          txById_ = java.util.Collections.unmodifiableList(txById_);
+          bitField0_ = (bitField0_ & ~0x00000001);
+        }
+        result.txById_ = txById_;
+        if (((bitField0_ & 0x00000002) == 0x00000002)) {
+          seqNoListSeq_ = java.util.Collections.unmodifiableList(seqNoListSeq_);
+          bitField0_ = (bitField0_ & ~0x00000002);
+        }
+        result.seqNoListSeq_ = seqNoListSeq_;
+        if (((bitField0_ & 0x00000004) == 0x00000004)) {
+          seqNoListTxn_ = java.util.Collections.unmodifiableList(seqNoListTxn_);
+          bitField0_ = (bitField0_ & ~0x00000004);
+        }
+        result.seqNoListTxn_ = seqNoListTxn_;
+        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
+          to_bitField0_ |= 0x00000001;
+        }
+        result.nextSeqId_ = nextSeqId_;
+        result.bitField0_ = to_bitField0_;
+        onBuilt();
+        return result;
+      }
+
+      public Builder mergeFrom(com.google.protobuf.Message other) {
+        if (other instanceof org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist) {
+          return mergeFrom((org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist)other);
+        } else {
+          super.mergeFrom(other);
+          return this;
+        }
+      }
+
+      public Builder mergeFrom(org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist other) {
+        if (other == org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist.getDefaultInstance()) return this;
+        if (!other.txById_.isEmpty()) {
+          if (txById_.isEmpty()) {
+            txById_ = other.txById_;
+            bitField0_ = (bitField0_ & ~0x00000001);
+          } else {
+            ensureTxByIdIsMutable();
+            txById_.addAll(other.txById_);
+          }
+          onChanged();
+        }
+        if (!other.seqNoListSeq_.isEmpty()) {
+          if (seqNoListSeq_.isEmpty()) {
+            seqNoListSeq_ = other.seqNoListSeq_;
+            bitField0_ = (bitField0_ & ~0x00000002);
+          } else {
+            ensureSeqNoListSeqIsMutable();
+            seqNoListSeq_.addAll(other.seqNoListSeq_);
+          }
+          onChanged();
+        }
+        if (!other.seqNoListTxn_.isEmpty()) {
+          if (seqNoListTxn_.isEmpty()) {
+            seqNoListTxn_ = other.seqNoListTxn_;
+            bitField0_ = (bitField0_ & ~0x00000004);
+          } else {
+            ensureSeqNoListTxnIsMutable();
+            seqNoListTxn_.addAll(other.seqNoListTxn_);
+          }
+          onChanged();
+        }
+        if (other.hasNextSeqId()) {
+          setNextSeqId(other.getNextSeqId());
+        }
+        this.mergeUnknownFields(other.getUnknownFields());
+        return this;
+      }
+
+      public final boolean isInitialized() {
+        if (!hasNextSeqId()) {
+          
+          return false;
+        }
+        return true;
+      }
+
+      public Builder mergeFrom(
+          com.google.protobuf.CodedInputStream input,
+          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+          throws java.io.IOException {
+        org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist parsedMessage = null;
+        try {
+          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+          parsedMessage = (org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist) e.getUnfinishedMessage();
+          throw e;
+        } finally {
+          if (parsedMessage != null) {
+            mergeFrom(parsedMessage);
+          }
+        }
+        return this;
+      }
+      private int bitField0_;
+
+      // repeated int64 txById = 1;
+      private java.util.List<java.lang.Long> txById_ = java.util.Collections.emptyList();
+      private void ensureTxByIdIsMutable() {
+        if (!((bitField0_ & 0x00000001) == 0x00000001)) {
+          txById_ = new java.util.ArrayList<java.lang.Long>(txById_);
+          bitField0_ |= 0x00000001;
+         }
+      }
+      /**
+       * <code>repeated int64 txById = 1;</code>
+       */
+      public java.util.List<java.lang.Long>
+          getTxByIdList() {
+        return java.util.Collections.unmodifiableList(txById_);
+      }
+      /**
+       * <code>repeated int64 txById = 1;</code>
+       */
+      public int getTxByIdCount() {
+        return txById_.size();
+      }
+      /**
+       * <code>repeated int64 txById = 1;</code>
+       */
+      public long getTxById(int index) {
+        return txById_.get(index);
+      }
+      /**
+       * <code>repeated int64 txById = 1;</code>
+       */
+      public Builder setTxById(
+          int index, long value) {
+        ensureTxByIdIsMutable();
+        txById_.set(index, value);
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>repeated int64 txById = 1;</code>
+       */
+      public Builder addTxById(long value) {
+        ensureTxByIdIsMutable();
+        txById_.add(value);
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>repeated int64 txById = 1;</code>
+       */
+      public Builder addAllTxById(
+          java.lang.Iterable<? extends java.lang.Long> values) {
+        ensureTxByIdIsMutable();
+        super.addAll(values, txById_);
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>repeated int64 txById = 1;</code>
+       */
+      public Builder clearTxById() {
+        txById_ = java.util.Collections.emptyList();
+        bitField0_ = (bitField0_ & ~0x00000001);
+        onChanged();
+        return this;
+      }
+
+      // repeated int64 seqNoListSeq = 2;
+      private java.util.List<java.lang.Long> seqNoListSeq_ = java.util.Collections.emptyList();
+      private void ensureSeqNoListSeqIsMutable() {
+        if (!((bitField0_ & 0x00000002) == 0x00000002)) {
+          seqNoListSeq_ = new java.util.ArrayList<java.lang.Long>(seqNoListSeq_);
+          bitField0_ |= 0x00000002;
+         }
+      }
+      /**
+       * <code>repeated int64 seqNoListSeq = 2;</code>
+       */
+      public java.util.List<java.lang.Long>
+          getSeqNoListSeqList() {
+        return java.util.Collections.unmodifiableList(seqNoListSeq_);
+      }
+      /**
+       * <code>repeated int64 seqNoListSeq = 2;</code>
+       */
+      public int getSeqNoListSeqCount() {
+        return seqNoListSeq_.size();
+      }
+      /**
+       * <code>repeated int64 seqNoListSeq = 2;</code>
+       */
+      public long getSeqNoListSeq(int index) {
+        return seqNoListSeq_.get(index);
+      }
+      /**
+       * <code>repeated int64 seqNoListSeq = 2;</code>
+       */
+      public Builder setSeqNoListSeq(
+          int index, long value) {
+        ensureSeqNoListSeqIsMutable();
+        seqNoListSeq_.set(index, value);
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>repeated int64 seqNoListSeq = 2;</code>
+       */
+      public Builder addSeqNoListSeq(long value) {
+        ensureSeqNoListSeqIsMutable();
+        seqNoListSeq_.add(value);
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>repeated int64 seqNoListSeq = 2;</code>
+       */
+      public Builder addAllSeqNoListSeq(
+          java.lang.Iterable<? extends java.lang.Long> values) {
+        ensureSeqNoListSeqIsMutable();
+        super.addAll(values, seqNoListSeq_);
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>repeated int64 seqNoListSeq = 2;</code>
+       */
+      public Builder clearSeqNoListSeq() {
+        seqNoListSeq_ = java.util.Collections.emptyList();
+        bitField0_ = (bitField0_ & ~0x00000002);
+        onChanged();
+        return this;
+      }
+
+      // repeated int64 seqNoListTxn = 3;
+      private java.util.List<java.lang.Long> seqNoListTxn_ = java.util.Collections.emptyList();
+      private void ensureSeqNoListTxnIsMutable() {
+        if (!((bitField0_ & 0x00000004) == 0x00000004)) {
+          seqNoListTxn_ = new java.util.ArrayList<java.lang.Long>(seqNoListTxn_);
+          bitField0_ |= 0x00000004;
+         }
+      }
+      /**
+       * <code>repeated int64 seqNoListTxn = 3;</code>
+       */
+      public java.util.List<java.lang.Long>
+          getSeqNoListTxnList() {
+        return java.util.Collections.unmodifiableList(seqNoListTxn_);
+      }
+      /**
+       * <code>repeated int64 seqNoListTxn = 3;</code>
+       */
+      public int getSeqNoListTxnCount() {
+        return seqNoListTxn_.size();
+      }
+      /**
+       * <code>repeated int64 seqNoListTxn = 3;</code>
+       */
+      public long getSeqNoListTxn(int index) {
+        return seqNoListTxn_.get(index);
+      }
+      /**
+       * <code>repeated int64 seqNoListTxn = 3;</code>
+       */
+      public Builder setSeqNoListTxn(
+          int index, long value) {
+        ensureSeqNoListTxnIsMutable();
+        seqNoListTxn_.set(index, value);
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>repeated int64 seqNoListTxn = 3;</code>
+       */
+      public Builder addSeqNoListTxn(long value) {
+        ensureSeqNoListTxnIsMutable();
+        seqNoListTxn_.add(value);
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>repeated int64 seqNoListTxn = 3;</code>
+       */
+      public Builder addAllSeqNoListTxn(
+          java.lang.Iterable<? extends java.lang.Long> values) {
+        ensureSeqNoListTxnIsMutable();
+        super.addAll(values, seqNoListTxn_);
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>repeated int64 seqNoListTxn = 3;</code>
+       */
+      public Builder clearSeqNoListTxn() {
+        seqNoListTxn_ = java.util.Collections.emptyList();
+        bitField0_ = (bitField0_ & ~0x00000004);
+        onChanged();
+        return this;
+      }
+
+      // required int64 nextSeqId = 4;
+      private long nextSeqId_ ;
+      /**
+       * <code>required int64 nextSeqId = 4;</code>
+       */
+      public boolean hasNextSeqId() {
+        return ((bitField0_ & 0x00000008) == 0x00000008);
+      }
+      /**
+       * <code>required int64 nextSeqId = 4;</code>
+       */
+      public long getNextSeqId() {
+        return nextSeqId_;
+      }
+      /**
+       * <code>required int64 nextSeqId = 4;</code>
+       */
+      public Builder setNextSeqId(long value) {
+        bitField0_ |= 0x00000008;
+        nextSeqId_ = value;
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>required int64 nextSeqId = 4;</code>
+       */
+      public Builder clearNextSeqId() {
+        bitField0_ = (bitField0_ & ~0x00000008);
+        nextSeqId_ = 0L;
+        onChanged();
+        return this;
+      }
+
+      // @@protoc_insertion_point(builder_scope:TransactionPersist)
+    }
+
+    static {
+      defaultInstance = new TransactionPersist(true);
+      defaultInstance.initFields();
+    }
+
+    // @@protoc_insertion_point(class_scope:TransactionPersist)
+  }
+
+  public interface TransactionStateMsgOrBuilder
+      extends com.google.protobuf.MessageOrBuilder {
+
+    // required int64 txId = 1;
+    /**
+     * <code>required int64 txId = 1;</code>
+     */
+    boolean hasTxId();
+    /**
+     * <code>required int64 txId = 1;</code>
+     */
+    long getTxId();
+
+    // repeated .MutationProto put = 2;
+    /**
+     * <code>repeated .MutationProto put = 2;</code>
+     */
+    java.util.List<org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto> 
+        getPutList();
+    /**
+     * <code>repeated .MutationProto put = 2;</code>
+     */
+    org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto getPut(int index);
+    /**
+     * <code>repeated .MutationProto put = 2;</code>
+     */
+    int getPutCount();
+    /**
+     * <code>repeated .MutationProto put = 2;</code>
+     */
+    java.util.List<? extends org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProtoOrBuilder> 
+        getPutOrBuilderList();
+    /**
+     * <code>repeated .MutationProto put = 2;</code>
+     */
+    org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProtoOrBuilder getPutOrBuilder(
+        int index);
+
+    // repeated .MutationProto delete = 3;
+    /**
+     * <code>repeated .MutationProto delete = 3;</code>
+     */
+    java.util.List<org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto> 
+        getDeleteList();
+    /**
+     * <code>repeated .MutationProto delete = 3;</code>
+     */
+    org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto getDelete(int index);
+    /**
+     * <code>repeated .MutationProto delete = 3;</code>
+     */
+    int getDeleteCount();
+    /**
+     * <code>repeated .MutationProto delete = 3;</code>
+     */
+    java.util.List<? extends org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProtoOrBuilder> 
+        getDeleteOrBuilderList();
+    /**
+     * <code>repeated .MutationProto delete = 3;</code>
+     */
+    org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProtoOrBuilder getDeleteOrBuilder(
+        int index);
+
+    // repeated bool putOrDel = 4;
+    /**
+     * <code>repeated bool putOrDel = 4;</code>
+     */
+    java.util.List<java.lang.Boolean> getPutOrDelList();
+    /**
+     * <code>repeated bool putOrDel = 4;</code>
+     */
+    int getPutOrDelCount();
+    /**
+     * <code>repeated bool putOrDel = 4;</code>
+     */
+    boolean getPutOrDel(int index);
+
+    // repeated int64 txnsToCheck = 5;
+    /**
+     * <code>repeated int64 txnsToCheck = 5;</code>
+     */
+    java.util.List<java.lang.Long> getTxnsToCheckList();
+    /**
+     * <code>repeated int64 txnsToCheck = 5;</code>
+     */
+    int getTxnsToCheckCount();
+    /**
+     * <code>repeated int64 txnsToCheck = 5;</code>
+     */
+    long getTxnsToCheck(int index);
+
+    // required int64 startSeqNum = 6;
+    /**
+     * <code>required int64 startSeqNum = 6;</code>
+     */
+    boolean hasStartSeqNum();
+    /**
+     * <code>required int64 startSeqNum = 6;</code>
+     */
+    long getStartSeqNum();
+
+    // required int64 seqNum = 7;
+    /**
+     * <code>required int64 seqNum = 7;</code>
+     */
+    boolean hasSeqNum();
+    /**
+     * <code>required int64 seqNum = 7;</code>
+     */
+    long getSeqNum();
+
+    // required int64 logSeqId = 8;
+    /**
+     * <code>required int64 logSeqId = 8;</code>
+     */
+    boolean hasLogSeqId();
+    /**
+     * <code>required int64 logSeqId = 8;</code>
+     */
+    long getLogSeqId();
+
+    // required bool reinstated = 9;
+    /**
+     * <code>required bool reinstated = 9;</code>
+     */
+    boolean hasReinstated();
+    /**
+     * <code>required bool reinstated = 9;</code>
+     */
+    boolean getReinstated();
+
+    // required int32 status = 10;
+    /**
+     * <code>required int32 status = 10;</code>
+     */
+    boolean hasStatus();
+    /**
+     * <code>required int32 status = 10;</code>
+     */
+    int getStatus();
+
+    // required int32 commitProgress = 11;
+    /**
+     * <code>required int32 commitProgress = 11;</code>
+     */
+    boolean hasCommitProgress();
+    /**
+     * <code>required int32 commitProgress = 11;</code>
+     */
+    int getCommitProgress();
+  }
+  /**
+   * Protobuf type {@code TransactionStateMsg}
+   */
+  public static final class TransactionStateMsg extends
+      com.google.protobuf.GeneratedMessage
+      implements TransactionStateMsgOrBuilder {
+    // Use TransactionStateMsg.newBuilder() to construct.
+    private TransactionStateMsg(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+      super(builder);
+      this.unknownFields = builder.getUnknownFields();
+    }
+    private TransactionStateMsg(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+    private static final TransactionStateMsg defaultInstance;
+    public static TransactionStateMsg getDefaultInstance() {
+      return defaultInstance;
+    }
+
+    public TransactionStateMsg getDefaultInstanceForType() {
+      return defaultInstance;
+    }
+
+    private final com.google.protobuf.UnknownFieldSet unknownFields;
+    @java.lang.Override
+    public final com.google.protobuf.UnknownFieldSet
+        getUnknownFields() {
+      return this.unknownFields;
+    }
+    private TransactionStateMsg(
+        com.google.protobuf.CodedInputStream input,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws com.google.protobuf.InvalidProtocolBufferException {
+      initFields();
+      int mutable_bitField0_ = 0;
+      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+          com.google.protobuf.UnknownFieldSet.newBuilder();
+      try {
+        boolean done = false;
+        while (!done) {
+          int tag = input.readTag();
+          switch (tag) {
+            case 0:
+              done = true;
+              break;
+            default: {
+              if (!parseUnknownField(input, unknownFields,
+                                     extensionRegistry, tag)) {
+                done = true;
+              }
+              break;
+            }
+            case 8: {
+              bitField0_ |= 0x00000001;
+              txId_ = input.readInt64();
+              break;
+            }
+            case 18: {
+              if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
+                put_ = new java.util.ArrayList<org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto>();
+                mutable_bitField0_ |= 0x00000002;
+              }
+              put_.add(input.readMessage(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.PARSER, extensionRegistry));
+              break;
+            }
+            case 26: {
+              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
+                delete_ = new java.util.ArrayList<org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto>();
+                mutable_bitField0_ |= 0x00000004;
+              }
+              delete_.add(input.readMessage(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.PARSER, extensionRegistry));
+              break;
+            }
+            case 32: {
+              if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
+                putOrDel_ = new java.util.ArrayList<java.lang.Boolean>();
+                mutable_bitField0_ |= 0x00000008;
+              }
+              putOrDel_.add(input.readBool());
+              break;
+            }
+            case 34: {
+              int length = input.readRawVarint32();
+              int limit = input.pushLimit(length);
+              if (!((mutable_bitField0_ & 0x00000008) == 0x00000008) && input.getBytesUntilLimit() > 0) {
+                putOrDel_ = new java.util.ArrayList<java.lang.Boolean>();
+                mutable_bitField0_ |= 0x00000008;
+              }
+              while (input.getBytesUntilLimit() > 0) {
+                putOrDel_.add(input.readBool());
+              }
+              input.popLimit(limit);
+              break;
+            }
+            case 40: {
+              if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
+                txnsToCheck_ = new java.util.ArrayList<java.lang.Long>();
+                mutable_bitField0_ |= 0x00000010;
+              }
+              txnsToCheck_.add(input.readInt64());
+              break;
+            }
+            case 42: {
+              int length = input.readRawVarint32();
+              int limit = input.pushLimit(length);
+              if (!((mutable_bitField0_ & 0x00000010) == 0x00000010) && input.getBytesUntilLimit() > 0) {
+                txnsToCheck_ = new java.util.ArrayList<java.lang.Long>();
+                mutable_bitField0_ |= 0x00000010;
+              }
+              while (input.getBytesUntilLimit() > 0) {
+                txnsToCheck_.add(input.readInt64());
+              }
+              input.popLimit(limit);
+              break;
+            }
+            case 48: {
+              bitField0_ |= 0x00000002;
+              startSeqNum_ = input.readInt64();
+              break;
+            }
+            case 56: {
+              bitField0_ |= 0x00000004;
+              seqNum_ = input.readInt64();
+              break;
+            }
+            case 64: {
+              bitField0_ |= 0x00000008;
+              logSeqId_ = input.readInt64();
+              break;
+            }
+            case 72: {
+              bitField0_ |= 0x00000010;
+              reinstated_ = input.readBool();
+              break;
+            }
+            case 80: {
+              bitField0_ |= 0x00000020;
+              status_ = input.readInt32();
+              break;
+            }
+            case 88: {
+              bitField0_ |= 0x00000040;
+              commitProgress_ = input.readInt32();
+              break;
+            }
+          }
+        }
+      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+        throw e.setUnfinishedMessage(this);
+      } catch (java.io.IOException e) {
+        throw new com.google.protobuf.InvalidProtocolBufferException(
+            e.getMessage()).setUnfinishedMessage(this);
+      } finally {
+        if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
+          put_ = java.util.Collections.unmodifiableList(put_);
+        }
+        if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
+          delete_ = java.util.Collections.unmodifiableList(delete_);
+        }
+        if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
+          putOrDel_ = java.util.Collections.unmodifiableList(putOrDel_);
+        }
+        if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
+          txnsToCheck_ = java.util.Collections.unmodifiableList(txnsToCheck_);
+        }
+        this.unknownFields = unknownFields.build();
+        makeExtensionsImmutable();
+      }
+    }
+    public static final com.google.protobuf.Descriptors.Descriptor
+        getDescriptor() {
+      return org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.internal_static_TransactionStateMsg_descriptor;
+    }
+
+    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+        internalGetFieldAccessorTable() {
+      return org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.internal_static_TransactionStateMsg_fieldAccessorTable
+          .ensureFieldAccessorsInitialized(
+              org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg.class, org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg.Builder.class);
+    }
+
+    public static com.google.protobuf.Parser<TransactionStateMsg> PARSER =
+        new com.google.protobuf.AbstractParser<TransactionStateMsg>() {
+      public TransactionStateMsg parsePartialFrom(
+          com.google.protobuf.CodedInputStream input,
+          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+          throws com.google.protobuf.InvalidProtocolBufferException {
+        return new TransactionStateMsg(input, extensionRegistry);
+      }
+    };
+
+    @java.lang.Override
+    public com.google.protobuf.Parser<TransactionStateMsg> getParserForType() {
+      return PARSER;
+    }
+
+    private int bitField0_;
+    // required int64 txId = 1;
+    public static final int TXID_FIELD_NUMBER = 1;
+    private long txId_;
+    /**
+     * <code>required int64 txId = 1;</code>
+     */
+    public boolean hasTxId() {
+      return ((bitField0_ & 0x00000001) == 0x00000001);
+    }
+    /**
+     * <code>required int64 txId = 1;</code>
+     */
+    public long getTxId() {
+      return txId_;
+    }
+
+    // repeated .MutationProto put = 2;
+    public static final int PUT_FIELD_NUMBER = 2;
+    private java.util.List<org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto> put_;
+    /**
+     * <code>repeated .MutationProto put = 2;</code>
+     */
+    public java.util.List<org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto> getPutList() {
+      return put_;
+    }
+    /**
+     * <code>repeated .MutationProto put = 2;</code>
+     */
+    public java.util.List<? extends org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProtoOrBuilder> 
+        getPutOrBuilderList() {
+      return put_;
+    }
+    /**
+     * <code>repeated .MutationProto put = 2;</code>
+     */
+    public int getPutCount() {
+      return put_.size();
+    }
+    /**
+     * <code>repeated .MutationProto put = 2;</code>
+     */
+    public org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto getPut(int index) {
+      return put_.get(index);
+    }
+    /**
+     * <code>repeated .MutationProto put = 2;</code>
+     */
+    public org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProtoOrBuilder getPutOrBuilder(
+        int index) {
+      return put_.get(index);
+    }
+
+    // repeated .MutationProto delete = 3;
+    public static final int DELETE_FIELD_NUMBER = 3;
+    private java.util.List<org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto> delete_;
+    /**
+     * <code>repeated .MutationProto delete = 3;</code>
+     */
+    public java.util.List<org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto> getDeleteList() {
+      return delete_;
+    }
+    /**
+     * <code>repeated .MutationProto delete = 3;</code>
+     */
+    public java.util.List<? extends org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProtoOrBuilder> 
+        getDeleteOrBuilderList() {
+      return delete_;
+    }
+    /**
+     * <code>repeated .MutationProto delete = 3;</code>
+     */
+    public int getDeleteCount() {
+      return delete_.size();
+    }
+    /**
+     * <code>repeated .MutationProto delete = 3;</code>
+     */
+    public org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto getDelete(int index) {
+      return delete_.get(index);
+    }
+    /**
+     * <code>repeated .MutationProto delete = 3;</code>
+     */
+    public org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProtoOrBuilder getDeleteOrBuilder(
+        int index) {
+      return delete_.get(index);
+    }
+
+    // repeated bool putOrDel = 4;
+    public static final int PUTORDEL_FIELD_NUMBER = 4;
+    private java.util.List<java.lang.Boolean> putOrDel_;
+    /**
+     * <code>repeated bool putOrDel = 4;</code>
+     */
+    public java.util.List<java.lang.Boolean>
+        getPutOrDelList() {
+      return putOrDel_;
+    }
+    /**
+     * <code>repeated bool putOrDel = 4;</code>
+     */
+    public int getPutOrDelCount() {
+      return putOrDel_.size();
+    }
+    /**
+     * <code>repeated bool putOrDel = 4;</code>
+     */
+    public boolean getPutOrDel(int index) {
+      return putOrDel_.get(index);
+    }
+
+    // repeated int64 txnsToCheck = 5;
+    public static final int TXNSTOCHECK_FIELD_NUMBER = 5;
+    private java.util.List<java.lang.Long> txnsToCheck_;
+    /**
+     * <code>repeated int64 txnsToCheck = 5;</code>
+     */
+    public java.util.List<java.lang.Long>
+        getTxnsToCheckList() {
+      return txnsToCheck_;
+    }
+    /**
+     * <code>repeated int64 txnsToCheck = 5;</code>
+     */
+    public int getTxnsToCheckCount() {
+      return txnsToCheck_.size();
+    }
+    /**
+     * <code>repeated int64 txnsToCheck = 5;</code>
+     */
+    public long getTxnsToCheck(int index) {
+      return txnsToCheck_.get(index);
+    }
+
+    // required int64 startSeqNum = 6;
+    public static final int STARTSEQNUM_FIELD_NUMBER = 6;
+    private long startSeqNum_;
+    /**
+     * <code>required int64 startSeqNum = 6;</code>
+     */
+    public boolean hasStartSeqNum() {
+      return ((bitField0_ & 0x00000002) == 0x00000002);
+    }
+    /**
+     * <code>required int64 startSeqNum = 6;</code>
+     */
+    public long getStartSeqNum() {
+      return startSeqNum_;
+    }
+
+    // required int64 seqNum = 7;
+    public static final int SEQNUM_FIELD_NUMBER = 7;
+    private long seqNum_;
+    /**
+     * <code>required int64 seqNum = 7;</code>
+     */
+    public boolean hasSeqNum() {
+      return ((bitField0_ & 0x00000004) == 0x00000004);
+    }
+    /**
+     * <code>required int64 seqNum = 7;</code>
+     */
+    public long getSeqNum() {
+      return seqNum_;
+    }
+
+    // required int64 logSeqId = 8;
+    public static final int LOGSEQID_FIELD_NUMBER = 8;
+    private long logSeqId_;
+    /**
+     * <code>required int64 logSeqId = 8;</code>
+     */
+    public boolean hasLogSeqId() {
+      return ((bitField0_ & 0x00000008) == 0x00000008);
+    }
+    /**
+     * <code>required int64 logSeqId = 8;</code>
+     */
+    public long getLogSeqId() {
+      return logSeqId_;
+    }
+
+    // required bool reinstated = 9;
+    public static final int REINSTATED_FIELD_NUMBER = 9;
+    private boolean reinstated_;
+    /**
+     * <code>required bool reinstated = 9;</code>
+     */
+    public boolean hasReinstated() {
+      return ((bitField0_ & 0x00000010) == 0x00000010);
+    }
+    /**
+     * <code>required bool reinstated = 9;</code>
+     */
+    public boolean getReinstated() {
+      return reinstated_;
+    }
+
+    // required int32 status = 10;
+    public static final int STATUS_FIELD_NUMBER = 10;
+    private int status_;
+    /**
+     * <code>required int32 status = 10;</code>
+     */
+    public boolean hasStatus() {
+      return ((bitField0_ & 0x00000020) == 0x00000020);
+    }
+    /**
+     * <code>required int32 status = 10;</code>
+     */
+    public int getStatus() {
+      return status_;
+    }
+
+    // required int32 commitProgress = 11;
+    public static final int COMMITPROGRESS_FIELD_NUMBER = 11;
+    private int commitProgress_;
+    /**
+     * <code>required int32 commitProgress = 11;</code>
+     */
+    public boolean hasCommitProgress() {
+      return ((bitField0_ & 0x00000040) == 0x00000040);
+    }
+    /**
+     * <code>required int32 commitProgress = 11;</code>
+     */
+    public int getCommitProgress() {
+      return commitProgress_;
+    }
+
+    private void initFields() {
+      txId_ = 0L;
+      put_ = java.util.Collections.emptyList();
+      delete_ = java.util.Collections.emptyList();
+      putOrDel_ = java.util.Collections.emptyList();
+      txnsToCheck_ = java.util.Collections.emptyList();
+      startSeqNum_ = 0L;
+      seqNum_ = 0L;
+      logSeqId_ = 0L;
+      reinstated_ = false;
+      status_ = 0;
+      commitProgress_ = 0;
+    }
+    private byte memoizedIsInitialized = -1;
+    public final boolean isInitialized() {
+      byte isInitialized = memoizedIsInitialized;
+      if (isInitialized != -1) return isInitialized == 1;
+
+      if (!hasTxId()) {
+        memoizedIsInitialized = 0;
+        return false;
+      }
+      if (!hasStartSeqNum()) {
+        memoizedIsInitialized = 0;
+        return false;
+      }
+      if (!hasSeqNum()) {
+        memoizedIsInitialized = 0;
+        return false;
+      }
+      if (!hasLogSeqId()) {
+        memoizedIsInitialized = 0;
+        return false;
+      }
+      if (!hasReinstated()) {
+        memoizedIsInitialized = 0;
+        return false;
+      }
+      if (!hasStatus()) {
+        memoizedIsInitialized = 0;
+        return false;
+      }
+      if (!hasCommitProgress()) {
+        memoizedIsInitialized = 0;
+        return false;
+      }
+      for (int i = 0; i < getPutCount(); i++) {
+        if (!getPut(i).isInitialized()) {
+          memoizedIsInitialized = 0;
+          return false;
+        }
+      }
+      for (int i = 0; i < getDeleteCount(); i++) {
+        if (!getDelete(i).isInitialized()) {
+          memoizedIsInitialized = 0;
+          return false;
+        }
+      }
+      memoizedIsInitialized = 1;
+      return true;
+    }
+
+    public void writeTo(com.google.protobuf.CodedOutputStream output)
+                        throws java.io.IOException {
+      getSerializedSize();
+      if (((bitField0_ & 0x00000001) == 0x00000001)) {
+        output.writeInt64(1, txId_);
+      }
+      for (int i = 0; i < put_.size(); i++) {
+        output.writeMessage(2, put_.get(i));
+      }
+      for (int i = 0; i < delete_.size(); i++) {
+        output.writeMessage(3, delete_.get(i));
+      }
+      for (int i = 0; i < putOrDel_.size(); i++) {
+        output.writeBool(4, putOrDel_.get(i));
+      }
+      for (int i = 0; i < txnsToCheck_.size(); i++) {
+        output.writeInt64(5, txnsToCheck_.get(i));
+      }
+      if (((bitField0_ & 0x00000002) == 0x00000002)) {
+        output.writeInt64(6, startSeqNum_);
+      }
+      if (((bitField0_ & 0x00000004) == 0x00000004)) {
+        output.writeInt64(7, seqNum_);
+      }
+      if (((bitField0_ & 0x00000008) == 0x00000008)) {
+        output.writeInt64(8, logSeqId_);
+      }
+      if (((bitField0_ & 0x00000010) == 0x00000010)) {
+        output.writeBool(9, reinstated_);
+      }
+      if (((bitField0_ & 0x00000020) == 0x00000020)) {
+        output.writeInt32(10, status_);
+      }
+      if (((bitField0_ & 0x00000040) == 0x00000040)) {
+        output.writeInt32(11, commitProgress_);
+      }
+      getUnknownFields().writeTo(output);
+    }
+
+    private int memoizedSerializedSize = -1;
+    public int getSerializedSize() {
+      int size = memoizedSerializedSize;
+      if (size != -1) return size;
+
+      size = 0;
+      if (((bitField0_ & 0x00000001) == 0x00000001)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeInt64Size(1, txId_);
+      }
+      for (int i = 0; i < put_.size(); i++) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeMessageSize(2, put_.get(i));
+      }
+      for (int i = 0; i < delete_.size(); i++) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeMessageSize(3, delete_.get(i));
+      }
+      {
+        int dataSize = 0;
+        dataSize = 1 * getPutOrDelList().size();
+        size += dataSize;
+        size += 1 * getPutOrDelList().size();
+      }
+      {
+        int dataSize = 0;
+        for (int i = 0; i < txnsToCheck_.size(); i++) {
+          dataSize += com.google.protobuf.CodedOutputStream
+            .computeInt64SizeNoTag(txnsToCheck_.get(i));
+        }
+        size += dataSize;
+        size += 1 * getTxnsToCheckList().size();
+      }
+      if (((bitField0_ & 0x00000002) == 0x00000002)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeInt64Size(6, startSeqNum_);
+      }
+      if (((bitField0_ & 0x00000004) == 0x00000004)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeInt64Size(7, seqNum_);
+      }
+      if (((bitField0_ & 0x00000008) == 0x00000008)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeInt64Size(8, logSeqId_);
+      }
+      if (((bitField0_ & 0x00000010) == 0x00000010)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeBoolSize(9, reinstated_);
+      }
+      if (((bitField0_ & 0x00000020) == 0x00000020)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeInt32Size(10, status_);
+      }
+      if (((bitField0_ & 0x00000040) == 0x00000040)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeInt32Size(11, commitProgress_);
+      }
+      size += getUnknownFields().getSerializedSize();
+      memoizedSerializedSize = size;
+      return size;
+    }
+
+    private static final long serialVersionUID = 0L;
+    @java.lang.Override
+    protected java.lang.Object writeReplace()
+        throws java.io.ObjectStreamException {
+      return super.writeReplace();
+    }
+
+    public static org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg parseFrom(
+        com.google.protobuf.ByteString data)
+        throws com.google.protobuf.InvalidProtocolBufferException {
+      return PARSER.parseFrom(data);
+    }
+    public static org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg parseFrom(
+        com.google.protobuf.ByteString data,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws com.google.protobuf.InvalidProtocolBufferException {
+      return PARSER.parseFrom(data, extensionRegistry);
+    }
+    public static org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg parseFrom(byte[] data)
+        throws com.google.protobuf.InvalidProtocolBufferException {
+      return PARSER.parseFrom(data);
+    }
+    public static org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg parseFrom(
+        byte[] data,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws com.google.protobuf.InvalidProtocolBufferException {
+      return PARSER.parseFrom(data, extensionRegistry);
+    }
+    public static org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg parseFrom(java.io.InputStream input)
+        throws java.io.IOException {
+      return PARSER.parseFrom(input);
+    }
+    public static org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg parseFrom(
+        java.io.InputStream input,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws java.io.IOException {
+      return PARSER.parseFrom(input, extensionRegistry);
+    }
+    public static org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg parseDelimitedFrom(java.io.InputStream input)
+        throws java.io.IOException {
+      return PARSER.parseDelimitedFrom(input);
+    }
+    public static org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg parseDelimitedFrom(
+        java.io.InputStream input,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws java.io.IOException {
+      return PARSER.parseDelimitedFrom(input, extensionRegistry);
+    }
+    public static org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg parseFrom(
+        com.google.protobuf.CodedInputStream input)
+        throws java.io.IOException {
+      return PARSER.parseFrom(input);
+    }
+    public static org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg parseFrom(
+        com.google.protobuf.CodedInputStream input,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws java.io.IOException {
+      return PARSER.parseFrom(input, extensionRegistry);
+    }
+
+    public static Builder newBuilder() { return Builder.create(); }
+    public Builder newBuilderForType() { return newBuilder(); }
+    public static Builder newBuilder(org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg prototype) {
+      return newBuilder().mergeFrom(prototype);
+    }
+    public Builder toBuilder() { return newBuilder(this); }
+
+    @java.lang.Override
+    protected Builder newBuilderForType(
+        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+      Builder builder = new Builder(parent);
+      return builder;
+    }
+    /**
+     * Protobuf type {@code TransactionStateMsg}
+     */
+    public static final class Builder extends
+        com.google.protobuf.GeneratedMessage.Builder<Builder>
+       implements org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsgOrBuilder {
+      public static final com.google.protobuf.Descriptors.Descriptor
+          getDescriptor() {
+        return org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.internal_static_TransactionStateMsg_descriptor;
+      }
+
+      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+          internalGetFieldAccessorTable() {
+        return org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.internal_static_TransactionStateMsg_fieldAccessorTable
+            .ensureFieldAccessorsInitialized(
+                org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg.class, org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg.Builder.class);
+      }
+
+      // Construct using org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg.newBuilder()
+      private Builder() {
+        maybeForceBuilderInitialization();
+      }
+
+      private Builder(
+          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+        super(parent);
+        maybeForceBuilderInitialization();
+      }
+      private void maybeForceBuilderInitialization() {
+        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+          getPutFieldBuilder();
+          getDeleteFieldBuilder();
+        }
+      }
+      private static Builder create() {
+        return new Builder();
+      }
+
+      public Builder clear() {
+        super.clear();
+        txId_ = 0L;
+        bitField0_ = (bitField0_ & ~0x00000001);
+        if (putBuilder_ == null) {
+          put_ = java.util.Collections.emptyList();
+          bitField0_ = (bitField0_ & ~0x00000002);
+        } else {
+          putBuilder_.clear();
+        }
+        if (deleteBuilder_ == null) {
+          delete_ = java.util.Collections.emptyList();
+          bitField0_ = (bitField0_ & ~0x00000004);
+        } else {
+          deleteBuilder_.clear();
+        }
+        putOrDel_ = java.util.Collections.emptyList();
+        bitField0_ = (bitField0_ & ~0x00000008);
+        txnsToCheck_ = java.util.Collections.emptyList();
+        bitField0_ = (bitField0_ & ~0x00000010);
+        startSeqNum_ = 0L;
+        bitField0_ = (bitField0_ & ~0x00000020);
+        seqNum_ = 0L;
+        bitField0_ = (bitField0_ & ~0x00000040);
+        logSeqId_ = 0L;
+        bitField0_ = (bitField0_ & ~0x00000080);
+        reinstated_ = false;
+        bitField0_ = (bitField0_ & ~0x00000100);
+        status_ = 0;
+        bitField0_ = (bitField0_ & ~0x00000200);
+        commitProgress_ = 0;
+        bitField0_ = (bitField0_ & ~0x00000400);
+        return this;
+      }
+
+      public Builder clone() {
+        return create().mergeFrom(buildPartial());
+      }
+
+      public com.google.protobuf.Descriptors.Descriptor
+          getDescriptorForType() {
+        return org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.internal_static_TransactionStateMsg_descriptor;
+      }
+
+      public org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg getDefaultInstanceForType() {
+        return org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg.getDefaultInstance();
+      }
+
+      public org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg build() {
+        org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg result = buildPartial();
+        if (!result.isInitialized()) {
+          throw newUninitializedMessageException(result);
+        }
+        return result;
+      }
+
+      public org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg buildPartial() {
+        org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg result = new org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg(this);
+        int from_bitField0_ = bitField0_;
+        int to_bitField0_ = 0;
+        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+          to_bitField0_ |= 0x00000001;
+        }
+        result.txId_ = txId_;
+        if (putBuilder_ == null) {
+          if (((bitField0_ & 0x00000002) == 0x00000002)) {
+            put_ = java.util.Collections.unmodifiableList(put_);
+            bitField0_ = (bitField0_ & ~0x00000002);
+          }
+          result.put_ = put_;
+        } else {
+          result.put_ = putBuilder_.build();
+        }
+        if (deleteBuilder_ == null) {
+          if (((bitField0_ & 0x00000004) == 0x00000004)) {
+            delete_ = java.util.Collections.unmodifiableList(delete_);
+            bitField0_ = (bitField0_ & ~0x00000004);
+          }
+          result.delete_ = delete_;
+        } else {
+          result.delete_ = deleteBuilder_.build();
+        }
+        if (((bitField0_ & 0x00000008) == 0x00000008)) {
+          putOrDel_ = java.util.Collections.unmodifiableList(putOrDel_);
+          bitField0_ = (bitField0_ & ~0x00000008);
+        }
+        result.putOrDel_ = putOrDel_;
+        if (((bitField0_ & 0x00000010) == 0x00000010)) {
+          txnsToCheck_ = java.util.Collections.unmodifiableList(txnsToCheck_);
+          bitField0_ = (bitField0_ & ~0x00000010);
+        }
+        result.txnsToCheck_ = txnsToCheck_;
+        if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
+          to_bitField0_ |= 0x00000002;
+        }
+        result.startSeqNum_ = startSeqNum_;
+        if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
+          to_bitField0_ |= 0x00000004;
+        }
+        result.seqNum_ = seqNum_;
+        if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
+          to_bitField0_ |= 0x00000008;
+        }
+        result.logSeqId_ = logSeqId_;
+        if (((from_bitField0_ & 0x00000100) == 0x00000100)) {
+          to_bitField0_ |= 0x00000010;
+        }
+        result.reinstated_ = reinstated_;
+        if (((from_bitField0_ & 0x00000200) == 0x00000200)) {
+          to_bitField0_ |= 0x00000020;
+        }
+        result.status_ = status_;
+        if (((from_bitField0_ & 0x00000400) == 0x00000400)) {
+          to_bitField0_ |= 0x00000040;
+        }
+        result.commitProgress_ = commitProgress_;
+        result.bitField0_ = to_bitField0_;
+        onBuilt();
+        return result;
+      }
+
+      public Builder mergeFrom(com.google.protobuf.Message other) {
+        if (other instanceof org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg) {
+          return mergeFrom((org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg)other);
+        } else {
+          super.mergeFrom(other);
+          return this;
+        }
+      }
+
+      public Builder mergeFrom(org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg other) {
+        if (other == org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg.getDefaultInstance()) return this;
+        if (other.hasTxId()) {
+          setTxId(other.getTxId());
+        }
+        if (putBuilder_ == null) {
+          if (!other.put_.isEmpty()) {
+            if (put_.isEmpty()) {
+              put_ = other.put_;
+              bitField0_ = (bitField0_ & ~0x00000002);
+            } else {
+              ensurePutIsMutable();
+              put_.addAll(other.put_);
+            }
+            onChanged();
+          }
+        } else {
+          if (!other.put_.isEmpty()) {
+            if (putBuilder_.isEmpty()) {
+              putBuilder_.dispose();
+              putBuilder_ = null;
+              put_ = other.put_;
+              bitField0_ = (bitField0_ & ~0x00000002);
+              putBuilder_ = 
+                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
+                   getPutFieldBuilder() : null;
+            } else {
+              putBuilder_.addAllMessages(other.put_);
+            }
+          }
+        }
+        if (deleteBuilder_ == null) {
+          if (!other.delete_.isEmpty()) {
+            if (delete_.isEmpty()) {
+              delete_ = other.delete_;
+              bitField0_ = (bitField0_ & ~0x00000004);
+            } else {
+              ensureDeleteIsMutable();
+              delete_.addAll(other.delete_);
+            }
+            onChanged();
+          }
+        } else {
+          if (!other.delete_.isEmpty()) {
+            if (deleteBuilder_.isEmpty()) {
+              deleteBuilder_.dispose();
+              deleteBuilder_ = null;
+              delete_ = other.delete_;
+              bitField0_ = (bitField0_ & ~0x00000004);
+              deleteBuilder_ = 
+                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
+                   getDeleteFieldBuilder() : null;
+            } else {
+              deleteBuilder_.addAllMessages(other.delete_);
+            }
+          }
+        }
+        if (!other.putOrDel_.isEmpty()) {
+          if (putOrDel_.isEmpty()) {
+            putOrDel_ = other.putOrDel_;
+            bitField0_ = (bitField0_ & ~0x00000008);
+          } else {
+            ensurePutOrDelIsMutable();
+            putOrDel_.addAll(other.putOrDel_);
+          }
+          onChanged();
+        }
+        if (!other.txnsToCheck_.isEmpty()) {
+          if (txnsToCheck_.isEmpty()) {
+            txnsToCheck_ = other.txnsToCheck_;
+            bitField0_ = (bitField0_ & ~0x00000010);
+          } else {
+            ensureTxnsToCheckIsMutable();
+            txnsToCheck_.addAll(other.txnsToCheck_);
+          }
+          onChanged();
+        }
+        if (other.hasStartSeqNum()) {
+          setStartSeqNum(other.getStartSeqNum());
+        }
+        if (other.hasSeqNum()) {
+          setSeqNum(other.getSeqNum());
+        }
+        if (other.hasLogSeqId()) {
+          setLogSeqId(other.getLogSeqId());
+        }
+        if (other.hasReinstated()) {
+          setReinstated(other.getReinstated());
+        }
+        if (other.hasStatus()) {
+          setStatus(other.getStatus());
+        }
+        if (other.hasCommitProgress()) {
+          setCommitProgress(other.getCommitProgress());
+        }
+        this.mergeUnknownFields(other.getUnknownFields());
+        return this;
+      }
+
+      public final boolean isInitialized() {
+        if (!hasTxId()) {
+          
+          return false;
+        }
+        if (!hasStartSeqNum()) {
+          
+          return false;
+        }
+        if (!hasSeqNum()) {
+          
+          return false;
+        }
+        if (!hasLogSeqId()) {
+          
+          return false;
+        }
+        if (!hasReinstated()) {
+          
+          return false;
+        }
+        if (!hasStatus()) {
+          
+          return false;
+        }
+        if (!hasCommitProgress()) {
+          
+          return false;
+        }
+        for (int i = 0; i < getPutCount(); i++) {
+          if (!getPut(i).isInitialized()) {
+            
+            return false;
+          }
+        }
+        for (int i = 0; i < getDeleteCount(); i++) {
+          if (!getDelete(i).isInitialized()) {
+            
+            return false;
+          }
+        }
+        return true;
+      }
+
+      public Builder mergeFrom(
+          com.google.protobuf.CodedInputStream input,
+          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+          throws java.io.IOException {
+        org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg parsedMessage = null;
+        try {
+          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+          parsedMessage = (org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg) e.getUnfinishedMessage();
+          throw e;
+        } finally {
+          if (parsedMessage != null) {
+            mergeFrom(parsedMessage);
+          }
+        }
+        return this;
+      }
+      private int bitField0_;
+
+      // required int64 txId = 1;
+      private long txId_ ;
+      /**
+       * <code>required int64 txId = 1;</code>
+       */
+      public boolean hasTxId() {
+        return ((bitField0_ & 0x00000001) == 0x00000001);
+      }
+      /**
+       * <code>required int64 txId = 1;</code>
+       */
+      public long getTxId() {
+        return txId_;
+      }
+      /**
+       * <code>required int64 txId = 1;</code>
+       */
+      public Builder setTxId(long value) {
+        bitField0_ |= 0x00000001;
+        txId_ = value;
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>required int64 txId = 1;</code>
+       */
+      public Builder clearTxId() {
+        bitField0_ = (bitField0_ & ~0x00000001);
+        txId_ = 0L;
+        onChanged();
+        return this;
+      }
+
+      // repeated .MutationProto put = 2;
+      private java.util.List<org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto> put_ =
+        java.util.Collections.emptyList();
+      private void ensurePutIsMutable() {
+        if (!((bitField0_ & 0x00000002) == 0x00000002)) {
+          put_ = new java.util.ArrayList<org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto>(put_);
+          bitField0_ |= 0x00000002;
+         }
+      }
+
+      private com.google.protobuf.RepeatedFieldBuilder<
+          org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto, org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Builder, org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProtoOrBuilder> putBuilder_;
+
+      /**
+       * <code>repeated .MutationProto put = 2;</code>
+       */
+      public java.util.List<org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto> getPutList() {
+        if (putBuilder_ == null) {
+          return java.util.Collections.unmodifiableList(put_);
+        } else {
+          return putBuilder_.getMessageList();
+        }
+      }
+      /**
+       * <code>repeated .MutationProto put = 2;</code>
+       */
+      public int getPutCount() {
+        if (putBuilder_ == null) {
+          return put_.size();
+        } else {
+          return putBuilder_.getCount();
+        }
+      }
+      /**
+       * <code>repeated .MutationProto put = 2;</code>
+       */
+      public org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto getPut(int index) {
+        if (putBuilder_ == null) {
+          return put_.get(index);
+        } else {
+          return putBuilder_.getMessage(index);
+        }
+      }
+      /**
+       * <code>repeated .MutationProto put = 2;</code>
+       */
+      public Builder setPut(
+          int index, org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto value) {
+        if (putBuilder_ == null) {
+          if (value == null) {
+            throw new NullPointerException();
+          }
+          ensurePutIsMutable();
+          put_.set(index, value);
+          onChanged();
+        } else {
+          putBuilder_.setMessage(index, value);
+        }
+        return this;
+      }
+      /**
+       * <code>repeated .MutationProto put = 2;</code>
+       */
+      public Builder setPut(
+          int index, org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Builder builderForValue) {
+        if (putBuilder_ == null) {
+          ensurePutIsMutable();
+          put_.set(index, builderForValue.build());
+          onChanged();
+        } else {
+          putBuilder_.setMessage(index, builderForValue.build());
+        }
+        return this;
+      }
+      /**
+       * <code>repeated .MutationProto put = 2;</code>
+       */
+      public Builder addPut(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto value) {
+        if (putBuilder_ == null) {
+          if (value == null) {
+            throw new NullPointerException();
+          }
+          ensurePutIsMutable();
+          put_.add(value);
+          onChanged();
+        } else {
+          putBuilder_.addMessage(value);
+        }
+        return this;
+      }
+      /**
+       * <code>repeated .MutationProto put = 2;</code>
+       */
+      public Builder addPut(
+          int index, org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto value) {
+        if (putBuilder_ == null) {
+          if (value == null) {
+            throw new NullPointerException();
+          }
+          ensurePutIsMutable();
+          put_.add(index, value);
+          onChanged();
+        } else {
+          putBuilder_.addMessage(index, value);
+        }
+        return this;
+      }
+      /**
+       * <code>repeated .MutationProto put = 2;</code>
+       */
+      public Builder addPut(
+          org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Builder builderForValue) {
+        if (putBuilder_ == null) {
+          ensurePutIsMutable();
+          put_.add(builderForValue.build());
+          onChanged();
+        } else {
+          putBuilder_.addMessage(builderForValue.build());
+        }
+        return this;
+      }
+      /**
+       * <code>repeated .MutationProto put = 2;</code>
+       */
+      public Builder addPut(
+          int index, org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Builder builderForValue) {
+        if (putBuilder_ == null) {
+          ensurePutIsMutable();
+          put_.add(index, builderForValue.build());
+          onChanged();
+        } else {
+          putBuilder_.addMessage(index, builderForValue.build());
+        }
+        return this;
+      }
+      /**
+       * <code>repeated .MutationProto put = 2;</code>
+       */
+      public Builder addAllPut(
+          java.lang.Iterable<? extends org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto> values) {
+        if (putBuilder_ == null) {
+          ensurePutIsMutable();
+          super.addAll(values, put_);
+          onChanged();
+        } else {
+          putBuilder_.addAllMessages(values);
+        }
+        return this;
+      }
+      /**
+       * <code>repeated .MutationProto put = 2;</code>
+       */
+      public Builder clearPut() {
+        if (putBuilder_ == null) {
+          put_ = java.util.Collections.emptyList();
+          bitField0_ = (bitField0_ & ~0x00000002);
+          onChanged();
+        } else {
+          putBuilder_.clear();
+        }
+        return this;
+      }
+      /**
+       * <code>repeated .MutationProto put = 2;</code>
+       */
+      public Builder removePut(int index) {
+        if (putBuilder_ == null) {
+          ensurePutIsMutable();
+          put_.remove(index);
+          onChanged();
+        } else {
+          putBuilder_.remove(index);
+        }
+        return this;
+      }
+      /**
+       * <code>repeated .MutationProto put = 2;</code>
+       */
+      public org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Builder getPutBuilder(
+          int index) {
+        return getPutFieldBuilder().getBuilder(index);
+      }
+      /**
+       * <code>repeated .MutationProto put = 2;</code>
+       */
+      public org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProtoOrBuilder getPutOrBuilder(
+          int index) {
+        if (putBuilder_ == null) {
+          return put_.get(index);  } else {
+          return putBuilder_.getMessageOrBuilder(index);
+        }
+      }
+      /**
+       * <code>repeated .MutationProto put = 2;</code>
+       */
+      public java.util.List<? extends org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProtoOrBuilder> 
+           getPutOrBuilderList() {
+        if (putBuilder_ != null) {
+          return putBuilder_.getMessageOrBuilderList();
+        } else {
+          return java.util.Collections.unmodifiableList(put_);
+        }
+      }
+      /**
+       * <code>repeated .MutationProto put = 2;</code>
+       */
+      public org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Builder addPutBuilder() {
+        return getPutFieldBuilder().addBuilder(
+            org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.getDefaultInstance());
+      }
+      /**
+       * <code>repeated .MutationProto put = 2;</code>
+       */
+      public org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Builder addPutBuilder(
+          int index) {
+        return getPutFieldBuilder().addBuilder(
+            index, org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.getDefaultInstance());
+      }
+      /**
+       * <code>repeated .MutationProto put = 2;</code>
+       */
+      public java.util.List<org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Builder> 
+           getPutBuilderList() {
+        return getPutFieldBuilder().getBuilderList();
+      }
+      private com.google.protobuf.RepeatedFieldBuilder<
+          org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto, org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Builder, org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProtoOrBuilder> 
+          getPutFieldBuilder() {
+        if (putBuilder_ == null) {
+          putBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
+              org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto, org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Builder, org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProtoOrBuilder>(
+                  put_,
+                  ((bitField0_ & 0x00000002) == 0x00000002),
+                  getParentForChildren(),
+                  isClean());
+          put_ = null;
+        }
+        return putBuilder_;
+      }
+
+      // repeated .MutationProto delete = 3;
+      private java.util.List<org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto> delete_ =
+        java.util.Collections.emptyList();
+      private void ensureDeleteIsMutable() {
+        if (!((bitField0_ & 0x00000004) == 0x00000004)) {
+          delete_ = new java.util.ArrayList<org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto>(delete_);
+          bitField0_ |= 0x00000004;
+         }
+      }
+
+      private com.google.protobuf.RepeatedFieldBuilder<
+          org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto, org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Builder, org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProtoOrBuilder> deleteBuilder_;
+
+      /**
+       * <code>repeated .MutationProto delete = 3;</code>
+       */
+      public java.util.List<org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto> getDeleteList() {
+        if (deleteBuilder_ == null) {
+          return java.util.Collections.unmodifiableList(delete_);
+        } else {
+          return deleteBuilder_.getMessageList();
+        }
+      }
+      /**
+       * <code>repeated .MutationProto delete = 3;</code>
+       */
+      public int getDeleteCount() {
+        if (deleteBuilder_ == null) {
+          return delete_.size();
+        } else {
+          return deleteBuilder_.getCount();
+        }
+      }
+      /**
+       * <code>repeated .MutationProto delete = 3;</code>
+       */
+      public org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto getDelete(int index) {
+        if (deleteBuilder_ == null) {
+          return delete_.get(index);
+        } else {
+          return deleteBuilder_.getMessage(index);
+        }
+      }
+      /**
+       * <code>repeated .MutationProto delete = 3;</code>
+       */
+      public Builder setDelete(
+          int index, org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto value) {
+        if (deleteBuilder_ == null) {
+          if (value == null) {
+            throw new NullPointerException();
+          }
+          ensureDeleteIsMutable();
+          delete_.set(index, value);
+          onChanged();
+        } else {
+          deleteBuilder_.setMessage(index, value);
+        }
+        return this;
+      }
+      /**
+       * <code>repeated .MutationProto delete = 3;</code>
+       */
+      public Builder setDelete(
+          int index, org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Builder builderForValue) {
+        if (deleteBuilder_ == null) {
+          ensureDeleteIsMutable();
+          delete_.set(index, builderForValue.build());
+          onChanged();
+        } else {
+          deleteBuilder_.setMessage(index, builderForValue.build());
+        }
+        return this;
+      }
+      /**
+       * <code>repeated .MutationProto delete = 3;</code>
+       */
+      public Builder addDelete(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto value) {
+        if (deleteBuilder_ == null) {
+          if (value == null) {
+            throw new NullPointerException();
+          }
+          ensureDeleteIsMutable();
+          delete_.add(value);
+          onChanged();
+        } else {
+          deleteBuilder_.addMessage(value);
+        }
+        return this;
+      }
+      /**
+       * <code>repeated .MutationProto delete = 3;</code>
+       */
+      public Builder addDelete(
+          int index, org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto value) {
+        if (deleteBuilder_ == null) {
+          if (value == null) {
+            throw new NullPointerException();
+          }
+          ensureDeleteIsMutable();
+          delete_.add(index, value);
+          onChanged();
+        } else {
+          deleteBuilder_.addMessage(index, value);
+        }
+        return this;
+      }
+      /**
+       * <code>repeated .MutationProto delete = 3;</code>
+       */
+      public Builder addDelete(
+          org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Builder builderForValue) {
+        if (deleteBuilder_ == null) {
+          ensureDeleteIsMutable();
+          delete_.add(builderForValue.build());
+          onChanged();
+        } else {
+          deleteBuilder_.addMessage(builderForValue.build());
+        }
+        return this;
+      }
+      /**
+       * <code>repeated .MutationProto delete = 3;</code>
+       */
+      public Builder addDelete(
+          int index, org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Builder builderForValue) {
+        if (deleteBuilder_ == null) {
+          ensureDeleteIsMutable();
+          delete_.add(index, builderForValue.build());
+          onChanged();
+        } else {
+          deleteBuilder_.addMessage(index, builderForValue.build());
+        }
+        return this;
+      }
+      /**
+       * <code>repeated .Mutatio

<TRUNCATED>


[5/6] incubator-trafodion git commit: Merge branch 'master' of github.com:apache/incubator-trafodion into jira_34

Posted by su...@apache.org.
Merge branch 'master' of github.com:apache/incubator-trafodion into jira_34

Conflicts:
	core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/815fc9bb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/815fc9bb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/815fc9bb

Branch: refs/heads/master
Commit: 815fc9bb4a861a3917b2dd912c67da6ffdc3eb8f
Parents: 65d0f1c aa86b53
Author: Oliver Bucaojit <ol...@esgyn.com>
Authored: Tue Oct 20 04:55:57 2015 +0000
Committer: Oliver Bucaojit <ol...@esgyn.com>
Committed: Tue Oct 20 04:55:57 2015 +0000

----------------------------------------------------------------------
 .../transactional/TrxRegionEndpoint.java        | 36 +++++++-------------
 core/sql/generator/GenPreCode.cpp               |  2 +-
 core/sql/generator/GenRelUpdate.cpp             |  3 ++
 core/sql/optimizer/RelExpr.cpp                  | 13 ++++---
 core/sql/optimizer/RelUpdate.h                  |  8 +++--
 core/sql/regress/compGeneral/EXPECTED013.SB     |  2 +-
 core/sql/regress/compGeneral/FILTER042          | 11 +++---
 core/sql/regress/compGeneral/TEST042            |  2 ++
 core/sql/regress/executor/EXPECTED122           |  4 +--
 install/installer/traf_config_check             | 18 ++++++----
 10 files changed, 53 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/815fc9bb/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java
----------------------------------------------------------------------
diff --cc core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java
index 2e64c12,2d740c8..16153c3
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java
@@@ -384,7 -368,7 +385,8 @@@ CoprocessorService, Coprocessor 
    private static float memoryPercentage = 0;
    private static boolean memoryThrottle = false;
    private static boolean suppressOutOfOrderProtocolException = DEFAULT_SUPPRESS_OOP;
 +  private Configuration config;
+   private static boolean checkRowBelongs = true;
  
    // Transaction state defines
    private static final int COMMIT_OK = 1;
@@@ -2923,16 -2894,16 +2925,16 @@@
            HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD,
            HConstants.HBASE_REGIONSERVER_LEASE_PERIOD_KEY,
            HConstants.DEFAULT_HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD);
 -        this.scannerThreadWakeFrequency = conf.getInt(HConstants.THREAD_WAKE_FREQUENCY, 10 * 1000);
 +        this.scannerThreadWakeFrequency = config.getInt(HConstants.THREAD_WAKE_FREQUENCY, 10 * 1000);
  
 -        this.cleanTimer = conf.getInt(SLEEP_CONF, DEFAULT_SLEEP);
 -        this.memoryUsageThreshold = conf.getInt(MEMORY_THRESHOLD, DEFAULT_MEMORY_THRESHOLD);
 -        this.memoryUsagePerformGC = conf.getBoolean(MEMORY_PERFORM_GC, DEFAULT_MEMORY_PERFORM_GC);
 -        this.memoryUsageWarnOnly = conf.getBoolean(MEMORY_WARN_ONLY, DEFAULT_MEMORY_WARN_ONLY);
 -        this.memoryUsageTimer = conf.getInt(MEMORY_CONF, DEFAULT_MEMORY_SLEEP);
 -        this.checkRowBelongs = conf.getBoolean(CHECK_ROW, true);
 +        this.cleanTimer = config.getInt(SLEEP_CONF, DEFAULT_SLEEP);
 +        this.memoryUsageThreshold = config.getInt(MEMORY_THRESHOLD, DEFAULT_MEMORY_THRESHOLD);
 +        this.memoryUsagePerformGC = config.getBoolean(MEMORY_PERFORM_GC, DEFAULT_MEMORY_PERFORM_GC);
 +        this.memoryUsageWarnOnly = config.getBoolean(MEMORY_WARN_ONLY, DEFAULT_MEMORY_WARN_ONLY);
 +        this.memoryUsageTimer = config.getInt(MEMORY_CONF, DEFAULT_MEMORY_SLEEP);
-         this.memoryUsageTimer = config.getInt(MEMORY_CONF, DEFAULT_MEMORY_SLEEP);
++        this.checkRowBelongs = config.getBoolean(CHECK_ROW, true);
  
 -        this.suppressOutOfOrderProtocolException = conf.getBoolean(SUPPRESS_OOP, DEFAULT_SUPPRESS_OOP);
 +        this.suppressOutOfOrderProtocolException = config.getBoolean(SUPPRESS_OOP, DEFAULT_SUPPRESS_OOP);
  	if (this.transactionLeases == null)  
  	    this.transactionLeases = new Leases(LEASE_CHECK_FREQUENCY);
  


[4/6] incubator-trafodion git commit: [TRAFODION-34]Support region splitting/balancing

Posted by su...@apache.org.
[TRAFODION-34]Support region splitting/balancing

With transactions active. Functionality being checked in disabled.


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/65d0f1cf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/65d0f1cf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/65d0f1cf

Branch: refs/heads/master
Commit: 65d0f1cfe43cb51077227277e5b6321fd69aa442
Parents: 46f7be4
Author: Oliver Bucaojit <ol...@esgyn.com>
Authored: Tue Oct 20 04:24:54 2015 +0000
Committer: Oliver Bucaojit <ol...@esgyn.com>
Committed: Tue Oct 20 04:24:54 2015 +0000

----------------------------------------------------------------------
 .../transactional/TransactionManager.java       |  204 +-
 .../client/transactional/TransactionState.java  |   10 +
 .../transactional/TransactionalReturn.java      |    1 +
 .../transactional/TransactionalTable.java       |  285 +-
 .../transactional/SplitBalanceHelper.java       |  296 ++
 .../transactional/TrxRegionEndpoint.java        |  272 +-
 .../transactional/TrxRegionObserver.java        |  232 +-
 .../generated/TrxRegionProtos.java              | 3001 +++++++++++++++++-
 .../transactional/TransactionState.java         |   13 +
 .../transactional/TrxTransactionState.java      |    6 +
 .../hbase-trx/src/main/protobuf/TrxRegion.proto |   21 +
 11 files changed, 4067 insertions(+), 274 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/65d0f1cf/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionManager.java
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionManager.java b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionManager.java
index 53b0bde..f8f5eaf 100644
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionManager.java
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionManager.java
@@ -44,12 +44,14 @@
 
 package org.apache.hadoop.hbase.client.transactional;
 
+import java.io.File;
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.util.Collection;
 import java.util.List;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.concurrent.Callable;
@@ -62,6 +64,8 @@ import java.util.HashMap;
 
 import org.apache.commons.codec.binary.Hex;
 
+import org.apache.hadoop.fs.Path;
+
 import org.apache.hadoop.hbase.ServerName;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -282,7 +286,10 @@ public class TransactionManager {
         }
         startKey = location.getRegionInfo().getStartKey();
         endKey_orig = location.getRegionInfo().getEndKey();
-        endKey = TransactionManager.binaryIncrementPos(endKey_orig, -1);
+        if(endKey_orig == null || endKey_orig == HConstants.EMPTY_END_ROW)
+          endKey = null;
+        else
+          endKey = TransactionManager.binaryIncrementPos(endKey_orig, -1);
     }
 
     /**
@@ -334,12 +341,12 @@ public class TransactionManager {
                   LOG.error(msg + ":" + e);
                   throw new Exception(msg);
                }
-               if(result.size() != 1) {
+               if(result.size() == 0) {
                   LOG.error("doCommitX, received incorrect result size: " + result.size() + " txid: " + transactionId);
                   refresh = true;
                   retry = true;
                }
-               else {
+               else if(result.size() == 1){
                   // size is 1
                   for (CommitResponse cresponse : result.values()){
                     if(cresponse.getHasException()) {
@@ -361,6 +368,31 @@ public class TransactionManager {
                }
                retry = false;
              }
+             else {
+                  for (CommitResponse cresponse : result.values()){
+                    if(cresponse.getHasException()) {
+                      String exceptionString = new String (cresponse.getException().toString());
+                      if (exceptionString.contains("UnknownTransactionException")) {
+                        if (ignoreUnknownTransactionException == true) {
+                          if (LOG.isTraceEnabled()) LOG.trace("doCommitX, ignoring UnknownTransactionException in cresponse");
+                        }
+                        else {
+                          LOG.error("doCommitX, coprocessor UnknownTransactionException: " + cresponse.getException());
+                          throw new UnknownTransactionException();
+                        }
+                      }
+                      else if(exceptionString.contains("Asked to commit a non-pending transaction")) {
+                        if (LOG.isTraceEnabled()) LOG.trace("doCommitX, ignoring 'commit non-pending transaction' in cresponse");
+                      }
+                      else {
+                        if (LOG.isTraceEnabled()) LOG.trace("doCommitX coprocessor exception: " + cresponse.getException());
+                        throw new Exception(cresponse.getException());
+                      }
+                  }
+               }
+               retry = false;
+             }
+
           }
           catch (UnknownTransactionException ute) {
               LOG.error("Got unknown exception in doCommitX for transaction: " + transactionId + " " + ute);
@@ -368,16 +400,23 @@ public class TransactionManager {
               throw new UnknownTransactionException();
           }
           catch (Exception e) {
-             LOG.error("doCommitX retrying due to Exception: " + e);
-             refresh = true;
-             retry = true;
+             if(e.toString().contains("Asked to commit a non-pending transaction")) {
+               if (LOG.isDebugEnabled()) LOG.debug("doCommitX will not retry: " + e);
+               refresh = false;
+               retry = false;
+             }
+             else {
+               LOG.error("doCommitX retrying due to Exception: " + e);
+               refresh = true;
+               retry = true;
+             }
           }
           if (refresh) {
 
              HRegionLocation lv_hrl = table.getRegionLocation(startKey);
              HRegionInfo     lv_hri = lv_hrl.getRegionInfo();
-             String          lv_node = lv_hrl.getHostname();
-             int             lv_length = lv_node.indexOf('.');
+             //String          lv_node = lv_hrl.getHostname();
+             //int             lv_length = lv_node.indexOf('.');
 
              if (LOG.isTraceEnabled()) LOG.trace("doCommitX -- location being refreshed : " + location.getRegionInfo().getRegionNameAsString() + " endKey: "
                      + Hex.encodeHexString(location.getRegionInfo().getEndKey()) + " for transaction: " + transactionId);
@@ -494,8 +533,6 @@ public class TransactionManager {
 
              HRegionLocation lv_hrl = table.getRegionLocation(startKey);
              HRegionInfo     lv_hri = lv_hrl.getRegionInfo();
-             String          lv_node = lv_hrl.getHostname();
-             int             lv_length = lv_node.indexOf('.');
 
              if (LOG.isTraceEnabled()) LOG.trace("doCommitX -- location being refreshed : " + location.getRegionInfo().getRegionNameAsString() + "endKey: "
                      + Hex.encodeHexString(location.getRegionInfo().getEndKey()) + " for transaction: " + transactionId);
@@ -585,47 +622,89 @@ public class TransactionManager {
              Map<byte[], CommitRequestResponse> result = null;
 
              try {
-//                if (LOG.isTraceEnabled()) LOG.trace("doPrepareX -- before coprocessorService txid: " + transactionId + " table: " + table.toString());
-//                if (LOG.isTraceEnabled()) LOG.trace("doPrepareX -- txid: " + transactionId + " table: " + table.toString() + " endKey_Orig: " + new String(endKey_orig, "UTF-8"));
-//                if (LOG.isTraceEnabled()) LOG.trace("doPrepareX -- " + table.toString() + " startKey: " + new String(startKey, "UTF-8") + " endKey: " + new String(endKey, "UTF-8"));
-
-//                HRegionLocation lv_hrl = table.getRegionLocation(startKey);
-//                HRegionInfo     lv_hri = lv_hrl.getRegionInfo();
-//                String          lv_node = lv_hrl.getHostname();
-//                int             lv_length = lv_node.indexOf('.');
-
-//                if ((location.getRegionInfo().getEncodedName().compareTo(lv_hri.getEncodedName()) != 0) ||  // Encoded name is different
-//                        (location.getHostname().regionMatches(0, lv_node, 0, lv_length) == false)) {            // Node is different
-//                   if (LOG.isInfoEnabled())LOG.info("doPrepareX -- " + table.toString() + " location being refreshed");
-//                   if (LOG.isTraceEnabled()) LOG.trace("doPrepareX -- lv_hri: " + lv_hri);
-//                   if (LOG.isTraceEnabled()) LOG.trace("doPrepareX -- location.getRegionInfo(): " + location.getRegionInfo());
-//                   if (LOG.isTraceEnabled()) LOG.trace("doPrepareX -- lv_node: " + lv_node + " lv_length: " + lv_length);
-//                   if (LOG.isTraceEnabled()) LOG.trace("doPrepareX -- location.getHostname(): " + location.getHostname());
-//                   table.getRegionLocation(startKey, true);
-//                }
                 result = table.coprocessorService(TrxRegionService.class, startKey, endKey, callable);
              } catch (Throwable e) {
                 LOG.error("doPrepareX coprocessor error for " + Bytes.toString(regionName) + " txid: " + transactionId + ":" + e);
                 throw new CommitUnsuccessfulException("Unable to call prepare, coprocessor error");
              }
 
-             if(result.size() != 1)  {
+             if(result.size() == 0)  {
                 LOG.error("doPrepareX, received incorrect result size: " + result.size());
                 refresh = true;
                 retry = true;
              }
-             else {
+             else if(result.size() == 1){
                 // size is 1
                 for (CommitRequestResponse cresponse : result.values()){
                    // Should only be one result
                    int value = cresponse.getResult();
                    commitStatus = value;
                    if(cresponse.getHasException()) {
-                      if (LOG.isTraceEnabled()) LOG.trace("doPrepareX coprocessor exception: " + cresponse.getException());
-                      throw new Exception(cresponse.getException());
+                      if(transactionState.hasRetried() &&
+                          cresponse.getException().contains("encountered unknown transactionID")) {
+                        retry = false;
+                        commitStatus = TransactionalReturn.COMMIT_OK_READ_ONLY;
+                      }
+                      else {
+                        if (LOG.isTraceEnabled()) LOG.trace("doPrepareX coprocessor exception: " + cresponse.getException());
+                        throw new Exception(cresponse.getException());
+                      }
+                   }
+                   if(value == TransactionalReturn.COMMIT_RESEND) {
+                     // Handle situation where repeated region is in list due to different endKeys
+                     int count = 0;
+                     for(TransactionRegionLocation trl : this.transactionState.getParticipatingRegions()) {
+                       if(trl.getRegionInfo().getTable().toString()
+                               .compareTo(location.getRegionInfo().getTable().toString()) == 0
+                               &&
+                          Arrays.equals(trl.getRegionInfo().getStartKey(),
+                               location.getRegionInfo().getStartKey())) {
+                         count++;
+                       }
+                     }
+                     if(count > 1) {
+                       commitStatus = TransactionalReturn.COMMIT_OK;
+                       retry = false;
+                     }
+                     else {
+                       // Pause for split to complete and retry
+                       Thread.sleep(100);
+                       retry = true;
+                     }
+                   }
+                   else {
+                     retry = false;
                    }
                 }
-                retry = false;
+             }
+             else {
+               for(CommitRequestResponse cresponse : result.values()) {
+                 if(cresponse.getResult() == TransactionalReturn.COMMIT_UNSUCCESSFUL_FROM_COPROCESSOR ||
+                  cresponse.getResult() == TransactionalReturn.COMMIT_CONFLICT ||
+                  cresponse.getResult() == TransactionalReturn.COMMIT_UNSUCCESSFUL ||
+                  commitStatus == 0) {
+                     commitStatus = cresponse.getResult();
+
+                     if(cresponse.getHasException()) {
+                       if(cresponse.getException().contains("encountered unknown transactionID")) {
+                         retry = false;
+                         commitStatus = TransactionalReturn.COMMIT_OK_READ_ONLY;
+                       }
+                       else {
+                         if (LOG.isTraceEnabled()) LOG.trace("doPrepareX coprocessor exception: " +
+                            cresponse.getException());
+                         throw new Exception(cresponse.getException());
+                       }
+                     }
+                 }
+               }
+
+                 if(commitStatus == TransactionalReturn.COMMIT_OK ||
+                    commitStatus == TransactionalReturn.COMMIT_OK_READ_ONLY ||
+                    commitStatus == TransactionalReturn.COMMIT_RESEND) {
+                   commitStatus = TransactionalReturn.COMMIT_OK;
+                 }
+               retry = false;
              }
           }
           catch(UnknownTransactionException ute) {
@@ -641,8 +720,6 @@ public class TransactionManager {
 
              HRegionLocation lv_hrl = table.getRegionLocation(startKey);
              HRegionInfo     lv_hri = lv_hrl.getRegionInfo();
-             String          lv_node = lv_hrl.getHostname();
-             int             lv_length = lv_node.indexOf('.');
 
              if (LOG.isTraceEnabled()) LOG.trace("doPrepareX -- location being refreshed : " + location.getRegionInfo().getRegionNameAsString() + "endKey: "
                      + Hex.encodeHexString(location.getRegionInfo().getEndKey()) + " for transaction: " + transactionId);
@@ -742,8 +819,6 @@ public class TransactionManager {
 
              HRegionLocation lv_hrl = table.getRegionLocation(startKey);
              HRegionInfo     lv_hri = lv_hrl.getRegionInfo();
-             String          lv_node = lv_hrl.getHostname();
-             int             lv_length = lv_node.indexOf('.');
 
              if (LOG.isTraceEnabled()) LOG.trace("doPrepareX -- location being refreshed : " + location.getRegionInfo().getRegionNameAsString() + "endKey: "
                      + Hex.encodeHexString(location.getRegionInfo().getEndKey()) + " for transaction: " + transactionId);
@@ -789,6 +864,7 @@ public class TransactionManager {
        switch (commitStatus) {
           case TransactionalReturn.COMMIT_OK:
             break;
+          case TransactionalReturn.COMMIT_RESEND:
           case TransactionalReturn.COMMIT_OK_READ_ONLY:
             transactionState.addRegionToIgnore(location); // No need to doCommit for read-onlys
             readOnly = true;
@@ -870,39 +946,45 @@ public class TransactionManager {
                   throw new Exception(msg);
               }
 
-              if(result.size() != 1) {
-                     LOG.error("doAbortX, received incorrect result size: " + result.size());
+              if(result.size() == 0) {
+                     LOG.error("doAbortX, received 0 region results.");
                      refresh = true;
                      retry = true;
-                  }
-                  else {
-                     for (AbortTransactionResponse cresponse : result.values()) {
-                if(cresponse.getHasException()) {
-                  String exceptionString = cresponse.getException().toString();
-                  LOG.error("Abort HasException true: " + exceptionString);
-                  if(exceptionString.contains("UnknownTransactionException")) {
-                         throw new UnknownTransactionException();
-                  }
-                  throw new Exception(cresponse.getException());
-                }
               }
-              retry = false;
-          }
+              else {
+                 for (AbortTransactionResponse cresponse : result.values()) {
+                   if(cresponse.getHasException()) {
+                     String exceptionString = cresponse.getException().toString();
+                     LOG.error("Abort HasException true: " + exceptionString);
+                     if(exceptionString.contains("UnknownTransactionException")) {
+                       throw new UnknownTransactionException();
+                     }
+                     throw new Exception(cresponse.getException());
+                   }
+                 }
+                 retry = false;
               }
+           }
           catch (UnknownTransactionException ute) {
                  LOG.debug("UnknownTransactionException in doAbortX for transaction: " + transactionId + "(ignoring): " + ute);
           }
           catch (Exception e) {
-                LOG.error("doAbortX retrying due to Exception: " + e );
-                refresh = true;
-                retry = true;
+                if(e.toString().contains("Asked to commit a non-pending transaction")) {
+                  LOG.error("doCommitX will not retry: " + e);
+                  refresh = false;
+                  retry = false;
+                }
+                else {
+                    LOG.error("doAbortX retrying due to Exception: " + e );
+                    refresh = true;
+                    retry = true;
+                }
+
               }
               if (refresh) {
 
                  HRegionLocation lv_hrl = table.getRegionLocation(startKey);
                  HRegionInfo     lv_hri = lv_hrl.getRegionInfo();
-                 String          lv_node = lv_hrl.getHostname();
-                 int             lv_length = lv_node.indexOf('.');
 
                  if (LOG.isTraceEnabled()) LOG.trace("doAbortX -- location being refreshed : " + location.getRegionInfo().getRegionNameAsString() + "endKey: "
                      + Hex.encodeHexString(location.getRegionInfo().getEndKey()) + " for transaction: " + transactionId);
@@ -998,8 +1080,6 @@ public class TransactionManager {
 
                  HRegionLocation lv_hrl = table.getRegionLocation(startKey);
                  HRegionInfo     lv_hri = lv_hrl.getRegionInfo();
-                 String          lv_node = lv_hrl.getHostname();
-                 int             lv_length = lv_node.indexOf('.');
 
                  if (LOG.isTraceEnabled()) LOG.trace("doAbortX -- location being refreshed : " + location.getRegionInfo().getRegionNameAsString() + "endKey: "
                      + Hex.encodeHexString(location.getRegionInfo().getEndKey()) + " for transaction: " + transactionId);
@@ -1098,8 +1178,6 @@ public class TransactionManager {
 
            HRegionLocation lv_hrl = table.getRegionLocation(startKey);
            HRegionInfo     lv_hri = lv_hrl.getRegionInfo();
-           String          lv_node = lv_hrl.getHostname();
-           int             lv_length = lv_node.indexOf('.');
 
            if (LOG.isTraceEnabled()) LOG.trace("doCommitX -- location being refreshed : " + location.getRegionInfo().getRegionNameAsString() + "endKey: "
                    + Hex.encodeHexString(location.getRegionInfo().getEndKey()) + " for transaction: " + transactionId);
@@ -1179,8 +1257,6 @@ public class TransactionManager {
        if (refresh) {
          HRegionLocation lv_hrl = table.getRegionLocation(startKey);
          HRegionInfo     lv_hri = lv_hrl.getRegionInfo();
-         String          lv_node = lv_hrl.getHostname();
-         int             lv_length = lv_node.indexOf('.');
 
          if (LOG.isTraceEnabled()) LOG.trace("doPrepareX -- location being refreshed : " + location.getRegionInfo().getRegionNameAsString() + "endKey: "
                   + Hex.encodeHexString(location.getRegionInfo().getEndKey()) + " for transaction: " + transactionId);
@@ -1309,8 +1385,6 @@ public class TransactionManager {
          if (refresh) {
             HRegionLocation lv_hrl = table.getRegionLocation(startKey);
             HRegionInfo     lv_hri = lv_hrl.getRegionInfo();
-            String          lv_node = lv_hrl.getHostname();
-            int             lv_length = lv_node.indexOf('.');
 
             if (LOG.isTraceEnabled()) LOG.trace("doAbortX -- location being refreshed : " + location.getRegionInfo().getRegionNameAsString() + "endKey: "
                      + Hex.encodeHexString(location.getRegionInfo().getEndKey()) + " for transaction: " + transactionId);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/65d0f1cf/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionState.java
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionState.java b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionState.java
index 45cf8c9..53c4951 100644
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionState.java
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionState.java
@@ -88,6 +88,7 @@ public class TransactionState {
     private boolean ddlTrans;
     private static boolean useConcurrentHM = false;
     private static boolean getCHMVariable = true;
+    private boolean hasRetried = false;
 
     public Set<String> tableNames = Collections.synchronizedSet(new HashSet<String>());
     public Set<TransactionRegionLocation> participatingRegions;
@@ -448,4 +449,13 @@ public class TransactionState {
     public void setDDLTx(final boolean status) {
         this.ddlTrans = status;
     }
+
+    public void setRetried(boolean val) {
+        this.hasRetried = val;
+    }
+
+    public boolean hasRetried() {
+      return this.hasRetried;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/65d0f1cf/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionalReturn.java
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionalReturn.java b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionalReturn.java
index e3d3650..3bb2ea4 100755
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionalReturn.java
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionalReturn.java
@@ -34,4 +34,5 @@ public interface TransactionalReturn {
   final int COMMIT_UNSUCCESSFUL = 4;
   /** Status code representing a transaction that cannot be committed due to conflict. */
   final int COMMIT_CONFLICT = 5;
+  final int COMMIT_RESEND = 6;
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/65d0f1cf/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionalTable.java
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionalTable.java b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionalTable.java
index 5c67129..419664b 100755
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionalTable.java
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionalTable.java
@@ -44,12 +44,16 @@
 
 package org.apache.hadoop.hbase.client.transactional;
 
+import java.io.File;
+import java.util.Collection;
 import java.io.IOException;
+import java.io.InterruptedIOException;
 import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ExecutorService;
@@ -61,6 +65,7 @@ import org.apache.commons.codec.binary.Hex;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HRegionLocation;
@@ -75,6 +80,7 @@ import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.client.ResultScanner;
 import org.apache.hadoop.hbase.client.Scan;
 import org.apache.hadoop.hbase.client.coprocessor.Batch;
+import org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos;
 import org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.CheckAndDeleteRequest;
 import org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.CheckAndDeleteResponse;
 import org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.CheckAndPutRequest;
@@ -99,6 +105,7 @@ import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto;
 import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.MutationType;
 import org.apache.hadoop.hbase.regionserver.transactional.SingleVersionDeleteNotSupported;
 import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.hadoop.fs.Path;
 
 import com.google.protobuf.ByteString;
 import com.google.protobuf.HBaseZeroCopyByteString;
@@ -113,6 +120,9 @@ public class TransactionalTable extends HTable implements TransactionalTableClie
     static private HConnection connection = null;
     static Configuration       config = HBaseConfiguration.create();
     static ExecutorService     threadPool;
+    static int                 retries = 15;
+    static int                 delay = 1000;
+    private String retryErrMsg = "Coprocessor result is null, retries exhausted";
 
     static {
 	config.set("hbase.hregion.impl", "org.apache.hadoop.hbase.regionserver.transactional.TransactionalRegion");
@@ -194,27 +204,48 @@ public class TransactionalTable extends HTable implements TransactionalTableClie
        }   
       };  
 
-      Map<byte[], GetTransactionalResponse> result = null;   
+      GetTransactionalResponse result = null;   
       try {
-        result = super.coprocessorService(TrxRegionService.class, get.getRow(), get.getRow(), callable);
+        int retryCount = 0;
+        boolean retry = false;
+        do {
+          Iterator<Map.Entry<byte[], TrxRegionProtos.GetTransactionalResponse>> it = super.coprocessorService(TrxRegionService.class, 
+                                                                                                              get.getRow(), 
+                                                                                                              get.getRow(), 
+                                                                                                              callable)
+                                                                                                              .entrySet().iterator();
+          if(it.hasNext()) {
+            result = it.next().getValue();
+            retry = false;
+          } 
+
+          if(result == null || result.getException().contains("closing region")) {
+            Thread.sleep(TransactionalTable.delay);
+            retry = true;
+            transactionState.setRetried(true);
+            retryCount++;
+          }
+        } while (retryCount < TransactionalTable.retries && retry == true);
       } catch (Throwable e) {
         e.printStackTrace();    
         throw new IOException("ERROR while calling coprocessor");
       }            
-      Collection<GetTransactionalResponse> results = result.values();
+      //Collection<GetTransactionalResponse> results = result.values();
       // Should only be one result, if more than one. Can't handle.
       // Need to test whether '!=' or '>' is correct
-      if (LOG.isTraceEnabled()) LOG.trace("Results count: " + results.size());
+      //if (LOG.isTraceEnabled()) LOG.trace("Results count: " + results.size());
       //if(results.size() != 1)
       //  throw new IOException("Incorrect number of results from coprocessor call");      
-      GetTransactionalResponse[] resultArray = new GetTransactionalResponse[results.size()];    		  
-      results.toArray(resultArray);            
-      if(resultArray.length == 0) 
-    	  throw new IOException("Problem with calling coprocessor, no regions returned result");
+      //GetTransactionalResponse[] resultArray = new GetTransactionalResponse[results.size()];    		  
+      //results.toArray(resultArray);            
+      //if(resultArray.length == 0) 
+    	//  throw new IOException("Problem with calling coprocessor, no regions returned result");
       
-      if(resultArray[0].hasException())
-        throw new IOException(resultArray[0].getException());
-      return ProtobufUtil.toResult(resultArray[0].getResult());      
+      if(result == null)
+        throw new IOException(retryErrMsg);
+      else if(result.hasException())
+        throw new IOException(result.getException());
+      return ProtobufUtil.toResult(result.getResult());      
     }
     
     /**
@@ -254,10 +285,28 @@ public class TransactionalTable extends HTable implements TransactionalTableClie
         };
 
         byte[] row = delete.getRow();
-        Map<byte[], DeleteTransactionalResponse> result = null; 
+        DeleteTransactionalResponse result = null; 
         try {
-          result = super.coprocessorService(TrxRegionService.class, row, row, callable);
-          
+          int retryCount = 0;
+          boolean retry = false;
+          do {
+            Iterator<Map.Entry<byte[], DeleteTransactionalResponse>> it = super.coprocessorService(TrxRegionService.class, 
+                                              row, 
+                                              row, 
+                                              callable)
+                                              .entrySet().iterator();
+            if(it.hasNext()) {
+              result = it.next().getValue();
+              retry = false;
+            }
+
+            if(result == null || result.getException().contains("closing region")) {
+              Thread.sleep(TransactionalTable.delay);
+              retry = true;
+              transactionState.setRetried(true);
+              retryCount++;
+            }
+          } while (retryCount < TransactionalTable.retries && retry == true);
         } catch (ServiceException e) {
           e.printStackTrace();
           throw new IOException();
@@ -265,16 +314,11 @@ public class TransactionalTable extends HTable implements TransactionalTableClie
           t.printStackTrace();
           throw new IOException();
         } 
-        Collection<DeleteTransactionalResponse> results = result.values();
-        //GetTransactionalResponse[] resultArray = (GetTransactionalResponse[]) results.toArray();
-        DeleteTransactionalResponse[] resultArray = new DeleteTransactionalResponse[results.size()];
-        results.toArray(resultArray);
-        
-        if(resultArray.length == 0) 
-      	  throw new IOException("Problem with calling coprocessor, no regions returned result");
 
-        if(resultArray[0].hasException())
-          throw new IOException(resultArray[0].getException());
+        if(result == null)
+          throw new IOException(retryErrMsg);
+        else if(result.hasException())
+          throw new IOException(result.getException());
     }
 
     /**
@@ -318,21 +362,37 @@ public class TransactionalTable extends HTable implements TransactionalTableClie
         return rpcCallback.get();
       }
     };
-    Map<byte[], PutTransactionalResponse> result = null; 
+    PutTransactionalResponse result = null; 
     try {
-      result = super.coprocessorService(TrxRegionService.class, put.getRow(), put.getRow(), callable);
+      int retryCount = 0;
+      boolean retry = false;
+      do {
+        Iterator<Map.Entry<byte[], PutTransactionalResponse>> it= super.coprocessorService(TrxRegionService.class, 
+                                                                                          put.getRow(), 
+                                                                                          put.getRow(), 
+                                                                                          callable)
+                                                                                          .entrySet().iterator();
+        if(it.hasNext()) {
+          result = it.next().getValue();
+          retry = false;
+        }
+
+        if(result == null || result.getException().contains("closing region")) {
+          Thread.sleep(TransactionalTable.delay);
+          retry = true;
+          transactionState.setRetried(true);
+          retryCount++;
+        }
+
+      } while(retryCount < TransactionalTable.retries && retry == true);
     } catch (Throwable e) {
       e.printStackTrace();
       throw new IOException("ERROR while calling coprocessor");
     }    
-    Collection<PutTransactionalResponse> results = result.values();
-    PutTransactionalResponse[] resultArray = new PutTransactionalResponse[results.size()]; 
-    results.toArray(resultArray);
-    if(resultArray.length == 0) 
-  	  throw new IOException("Problem with calling coprocessor, no regions returned result");
-    
-    if(resultArray[0].hasException())
-      throw new IOException(resultArray[0].getException());
+    if(result == null)
+      throw new IOException(retryErrMsg);
+    else if(result.hasException())
+      throw new IOException(result.getException());
     
     // put is void, may not need to check result
     if (LOG.isTraceEnabled()) LOG.trace("TransactionalTable.put EXIT");
@@ -394,22 +454,38 @@ public class TransactionalTable extends HTable implements TransactionalTableClie
         }
       };
 
-      Map<byte[], CheckAndDeleteResponse> result = null;
+      CheckAndDeleteResponse result = null;
       try {
-        result = super.coprocessorService(TrxRegionService.class, delete.getRow(), delete.getRow(), callable);
+        int retryCount = 0;
+        boolean retry = false;
+        do {
+          Iterator<Map.Entry<byte[], CheckAndDeleteResponse>> it = super.coprocessorService(TrxRegionService.class, 
+                                                                                            delete.getRow(), 
+                                                                                            delete.getRow(), 
+                                                                                            callable)
+                                                                                            .entrySet()
+                                                                                            .iterator();
+          if(it.hasNext()) {
+            result = it.next().getValue();
+            retry = false;
+          }
+
+          if(result == null || result.getException().contains("closing region")) {
+            Thread.sleep(TransactionalTable.delay);
+            retry = true;
+            transactionState.setRetried(true);
+            retryCount++;
+          }
+        } while (retryCount < TransactionalTable.retries && retry == true);
       } catch (Throwable e) {
         e.printStackTrace();
         throw new IOException("ERROR while calling coprocessor");
       }
-      
-      Collection<CheckAndDeleteResponse> results = result.values();
-      
-      if(results.size() == 0) 
-    	  throw new IOException("Problem with calling coprocessor, no regions returned result");
-     CheckAndDeleteResponse response = results.iterator().next();
-      if(response.hasException())
-          throw new IOException(response.getException());
-      return response.getResult();
+      if(result == null)
+        throw new IOException(retryErrMsg);
+      else if(result.hasException())
+        throw new IOException(result.getException());
+      return result.getResult();
    }
     
 	public boolean checkAndPut(final TransactionState transactionState,
@@ -460,23 +536,42 @@ public class TransactionalTable extends HTable implements TransactionalTableClie
       }
     };
 
-      Map<byte[], CheckAndPutResponse> result = null;
+      CheckAndPutResponse result = null;
       try {
-	  result = super.coprocessorService(TrxRegionService.class, put.getRow(), put.getRow(), callable);
+        int retryCount = 0;
+        boolean retry = false;
+        do {
+          Iterator<Map.Entry<byte[], CheckAndPutResponse>> it = super.coprocessorService(TrxRegionService.class, 
+                                                                                      put.getRow(), 
+                                                                                      put.getRow(), 
+                                                                                      callable)
+                                                                                      .entrySet()
+                                                                                      .iterator();
+          if(it.hasNext()) {
+            result = it.next().getValue();
+            retry = false;
+          }
+
+          if(result == null || result.getException().contains("closing region")) {
+            Thread.sleep(TransactionalTable.delay);
+            retry = true;
+            transactionState.setRetried(true);
+            retryCount++;
+          }
+        } while (retryCount < TransactionalTable.retries && retry == true);
       } catch (Throwable e) {        
           StringWriter sw = new StringWriter();
           PrintWriter pw = new PrintWriter(sw);
           e.printStackTrace(pw);
-          //sw.toString();
         throw new IOException("ERROR while calling coprocessor " + sw.toString());       
       }
-      Collection<CheckAndPutResponse> results = result.values();
-      if(results.size() == 0) 
-    	  throw new IOException("Problem with calling coprocessor, no regions returned result");
-      CheckAndPutResponse response = results.iterator().next();
-      if(response.hasException())
-          throw new IOException(response.getException());
-      return response.getResult();          
+
+      if(result == null)
+        throw new IOException(retryErrMsg);
+      else if(result.hasException())
+        throw new IOException(result.getException());
+
+      return result.getResult();          
     }
 
        /**
@@ -541,28 +636,38 @@ public class TransactionalTable extends HTable implements TransactionalTableClie
    	      }
    	    };
    	    
-   	   Map<byte[], DeleteMultipleTransactionalResponse> result = null;
+   	   DeleteMultipleTransactionalResponse result = null;
  	      try {
- 	        result = super.coprocessorService(TrxRegionService.class, 
-                                                  entry.getValue().get(0).getRow(),
-                                                  entry.getValue().get(0).getRow(),
-                                                  callable);
+ 	        int retryCount = 0;
+ 	        boolean retry = false;
+ 	        do {
+ 	          Iterator<Map.Entry<byte[], DeleteMultipleTransactionalResponse>> it= super.coprocessorService(TrxRegionService.class, 
+ 	                                            entry.getValue().get(0).getRow(), 
+ 	                                            entry.getValue().get(0).getRow(), 
+ 	                                            callable)
+ 	                                            .entrySet().iterator();
+ 	          if(it.hasNext()) {
+ 	            result = it.next().getValue();
+ 	            retry = false;
+ 	          }
+
+ 	          if(result == null || result.getException().contains("closing region")) {
+ 	            Thread.sleep(TransactionalTable.delay);
+ 	            retry = true;
+ 	            transactionState.setRetried(true);
+ 	            retryCount++;
+ 	          }
+ 	        } while (retryCount < TransactionalTable.retries && retry == true);
+ 	        
  	      } catch (Throwable e) {
  	        e.printStackTrace();
 	        throw new IOException("ERROR while calling coprocessor");
  	      }
-	      if(result.size() > 1) {
-             LOG.error("result size for multiple delete:" + result.size());
-             throw new IOException("Incorrect number of region results");
-	      }
-	      Collection<DeleteMultipleTransactionalResponse> results = result.values();
-	      DeleteMultipleTransactionalResponse[] resultArray = new DeleteMultipleTransactionalResponse[results.size()];
-	      results.toArray(resultArray);
-	      if(resultArray.length == 0) 
-	    	  throw new IOException("Problem with calling coprocessor, no regions returned result");
-	      
-          if (resultArray[0].hasException())
-             throw new IOException(resultArray[0].getException());
+
+             if(result == null)
+               throw new IOException(retryErrMsg);
+             else if (result.hasException())
+               throw new IOException(result.getException());
 	   }
    	}
 
@@ -627,24 +732,36 @@ public class TransactionalTable extends HTable implements TransactionalTableClie
 	        return rpcCallback.get();
 	      }
 	    };
-	    Map<byte[], PutMultipleTransactionalResponse> result = null;
+	    PutMultipleTransactionalResponse result = null;
       try {
-        result = super.coprocessorService(TrxRegionService.class,
-                                          entry.getValue().get(0).getRow(),
-                                          entry.getValue().get(0).getRow(),
-                                          callable);
+        int retryCount = 0;
+        boolean retry = false;
+        do {
+          Iterator<Map.Entry<byte[], PutMultipleTransactionalResponse>> it= super.coprocessorService(TrxRegionService.class, 
+                                            entry.getValue().get(0).getRow(),
+                                            entry.getValue().get(0).getRow(),                                             
+                                            callable)
+                                            .entrySet().iterator();
+          if(it.hasNext()) {
+            result = it.next().getValue();
+            retry = false;
+          }
+
+          if(result == null || result.getException().contains("closing region")) {
+            Thread.sleep(TransactionalTable.delay);
+            retry = true;
+            transactionState.setRetried(true);
+            retryCount++;
+          }
+        } while (retryCount < TransactionalTable.retries && retry == true);
       } catch (Throwable e) {
         e.printStackTrace();
         throw new IOException("ERROR while calling coprocessor");
       }
-      Collection<PutMultipleTransactionalResponse> results = result.values();
-      PutMultipleTransactionalResponse[] resultArray = new PutMultipleTransactionalResponse[results.size()];
-      results.toArray(resultArray);
-      if(resultArray.length == 0) 
-    	  throw new IOException("Problem with calling coprocessor, no regions returned result");
-      
-      if (resultArray[0].hasException()) 
-        throw new IOException(resultArray[0].getException());
+      if(result == null)
+        throw new IOException(retryErrMsg);
+      else if (result.hasException()) 
+        throw new IOException(result.getException());
      }
 		}
 	

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/65d0f1cf/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/SplitBalanceHelper.java
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/SplitBalanceHelper.java b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/SplitBalanceHelper.java
new file mode 100644
index 0000000..1107bdc
--- /dev/null
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/SplitBalanceHelper.java
@@ -0,0 +1,296 @@
+package org.apache.hadoop.hbase.coprocessor.transactional;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hbase.HRegionInfo;
+import org.apache.hadoop.hbase.regionserver.HRegion;
+import org.apache.hadoop.hbase.regionserver.transactional.TransactionalRegionScannerHolder;
+import org.apache.hadoop.hbase.regionserver.transactional.TrxTransactionState;
+import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.hadoop.hbase.zookeeper.ZKUtil;
+import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
+import org.apache.zookeeper.KeeperException;
+
+public class SplitBalanceHelper {
+	private static final Log LOG = LogFactory.getLog(SplitBalanceHelper.class);
+	
+	private Path flushPath;
+	
+	private static String zkTable = "/hbase/table";
+	private static String zSplitBalPath =        TrxRegionObserver.zTrafPath + "splitbalance/";
+	private static String zSplitBalPathNoSlash = TrxRegionObserver.zTrafPath + "splitbalance";
+	private static String SPLIT = "SPLIT";
+	private static String BALANCE = "BALANCE";
+	private static final String FLUSH_PATH = "traf.txn.out";
+	private static AtomicBoolean needsCleanup = new AtomicBoolean(true);
+	private String balancePath;
+	private String splitPath;
+	private String regionPath;
+	
+	private ZooKeeperWatcher zkw;
+	private HRegionInfo hri;
+	private HRegion region;
+	private String tablename;
+	
+	
+	public SplitBalanceHelper(HRegion my_Region, ZooKeeperWatcher zkw) {
+
+	  String fileName = FLUSH_PATH + getTimeStamp();
+		this.region = my_Region;
+		this.hri = my_Region.getRegionInfo();
+		this.zkw = zkw;
+		this.tablename = my_Region.getTableDesc().getNameAsString();
+		try {
+			if (ZKUtil.checkExists(zkw, zSplitBalPathNoSlash) == -1) 
+				ZKUtil.createWithParents(zkw, zSplitBalPathNoSlash);
+		} catch (KeeperException ke) {
+			LOG.error("ERROR: Zookeeper exception: "+ ke);
+		}
+		this.flushPath = new Path(region.getRegionFileSystem().getRegionDir(), fileName);
+		regionPath = zSplitBalPath  + this.tablename + "/" + hri.getEncodedName();
+		balancePath =  regionPath + "/" + BALANCE + "/";
+		splitPath = regionPath + "/" + SPLIT + "/";
+		
+    if (SplitBalanceHelper.needsCleanup.compareAndSet(true, false)) {
+      zkCleanup();
+    }
+	}
+	
+	public Path getPath() {
+		return flushPath;
+	}
+	
+	public boolean getSplit() {
+		return getSplit(null);
+	}
+    
+	public boolean getSplit(StringBuilder path) {
+		try {
+			byte [] splPath = ZKUtil.getData(zkw, splitPath.substring(0,splitPath.length()-1));
+			if (splPath == null) {
+				return false;
+                        }
+			else{
+				if (path != null)
+					path.append(splPath.toString());
+				if(LOG.isDebugEnabled()) LOG.debug("Split information retrieved, path is: " + splPath.toString());
+				return true;
+                        }
+		} catch (Exception e) {
+			if(LOG.isErrorEnabled()) LOG.error("Keeper exception: " + e);
+      return false;
+		} 
+        }
+    
+	public void setSplit(HRegion leftRegion, HRegion rightRegion) throws IOException {
+		String zLeftKey =  zSplitBalPath + leftRegion.getRegionInfo().getEncodedName();
+		String zRightKey = zSplitBalPath + rightRegion.getRegionInfo().getEncodedName();
+		
+		try {
+			if(ZKUtil.checkExists(zkw, balancePath.substring(0,balancePath.length()-1)) != -1) {
+				clearBalance();
+			}
+			if (ZKUtil.checkExists(zkw, zLeftKey) == -1) 
+				ZKUtil.createWithParents(zkw, zLeftKey);
+			if (ZKUtil.checkExists(zkw, zRightKey) == -1) 
+				ZKUtil.createWithParents(zkw, zRightKey);
+			
+			ZKUtil.createAndFailSilent(zkw, zLeftKey + "/" + SPLIT, Bytes.toBytes(flushPath.toString()));
+			ZKUtil.createAndFailSilent(zkw, zRightKey + "/" + SPLIT, Bytes.toBytes(flushPath.toString()));
+			if(LOG.isDebugEnabled()) LOG.debug("Split coordination node written for " + leftRegion.getRegionNameAsString() +
+					                           " and " + rightRegion.getRegionNameAsString());
+			
+		} catch (KeeperException ke) {
+			LOG.error("ERROR: Zookeeper exception: "+ ke);
+		}
+	}
+	
+	public void setSplit() {
+	   
+    try {
+      if (ZKUtil.checkExists(zkw, balancePath.substring(0, balancePath.length()-1)) != -1) {
+        clearBalance();
+      }
+      if (ZKUtil.checkExists(zkw, splitPath.substring(0, splitPath.length()-1)) == -1) {
+        ZKUtil.createWithParents(zkw, splitPath.substring(0, splitPath.length()-1));
+      }
+
+      ZKUtil.createSetData(zkw, splitPath.substring(0, splitPath.length()-1), Bytes.toBytes(flushPath.toString()));
+      if(LOG.isDebugEnabled()) LOG.debug("Setting split coordination node for " + hri.getRegionNameAsString());
+      
+    } catch (KeeperException ke) {
+      LOG.error("ERROR: Zookeeper exception: "+ ke);
+    }
+	}
+	
+	public void clearSplit() {
+		if(LOG.isTraceEnabled()) LOG.trace("clearSplit called for region: " + this.hri.getRegionNameAsString());
+		try {
+			ZKUtil.deleteNodeRecursively(zkw, regionPath);
+		} catch (KeeperException ke) {
+			LOG.error("Zookeeper exception: " + ke);
+		}
+	}
+	
+	public boolean getBalance(StringBuilder path) {
+		try {
+		
+			byte [] balPath = ZKUtil.getData(zkw, balancePath.substring(0, balancePath.length()-1));
+			if (balPath == null)
+				return false;
+			else{
+				path.append(new String(balPath));
+				if(LOG.isDebugEnabled()) LOG.debug("Balance information retrieved, path is: " + new String(balPath));
+				return true;
+			}
+    } catch (Exception e) {
+			if(LOG.isErrorEnabled()) LOG.error("Keeper exception: " + e);
+    }
+		return true;
+	}
+	
+	public void setBalance() throws IOException {
+		
+		try {
+			if (ZKUtil.checkExists(zkw, splitPath.substring(0, splitPath.length()-1)) != -1) {
+				throw new IOException("SPLIT node already exists when trying to add BALANCE node");
+			}
+
+			if (ZKUtil.checkExists(zkw, balancePath.substring(0, balancePath.length()-1)) == -1) {
+				ZKUtil.createWithParents(zkw, balancePath.substring(0, balancePath.length()-1));
+			}
+			ZKUtil.createSetData(zkw, balancePath.substring(0, balancePath.length()-1), Bytes.toBytes(flushPath.toString()));
+			if(LOG.isDebugEnabled()) LOG.debug("Setting balance coordination node for " + hri.getRegionNameAsString());
+			
+		} catch (KeeperException ke) {
+			LOG.error("ERROR: Zookeeper exception: "+ ke);
+		}
+	}
+	
+	public void clearBalance() {
+		if(LOG.isTraceEnabled()) LOG.trace("clearBalance called for region: " + this.hri.getRegionNameAsString());
+		try {
+			ZKUtil.deleteNodeRecursively(zkw, regionPath);
+		} catch (KeeperException ke) {
+			LOG.error("Zookeeper exception: " + ke);
+		}
+	}
+	
+	private long getTimeStamp() {
+		return System.currentTimeMillis();
+	}
+	
+	protected boolean pendingListClear(Set<TrxTransactionState> commitPendingTransactions) throws IOException {
+	  return commitPendingTransactions.isEmpty();
+	}
+	
+	 protected boolean scannersListClear(ConcurrentHashMap<Long,TransactionalRegionScannerHolder> scanners) throws IOException {
+	    return scanners.isEmpty();
+	  }
+	
+  protected void pendingWait(Set<TrxTransactionState> commitPendingTransactions, int pendingDelayLen) throws IOException {
+      int count = 1;
+      while(!pendingListClear(commitPendingTransactions)) {
+          try {
+              if(LOG.isDebugEnabled()) LOG.debug("pendingWait() delay, count " + count++ + " on: " + hri.getRegionNameAsString());
+              Thread.sleep(pendingDelayLen);
+          } catch(InterruptedException e) {
+              String error = "Problem while calling sleep() on pendingWait delay, " + e;
+              if(LOG.isErrorEnabled()) LOG.error("Problem while calling sleep() on preSplit delay, returning. " + e);
+              throw new IOException(error);
+          }
+      }
+  }
+    
+  protected void scannersWait(ConcurrentHashMap<Long,TransactionalRegionScannerHolder> scanners, int pendingDelayLen) 
+      throws IOException {
+    int count = 1;
+    while(!scannersListClear(scanners)) {
+        try {
+            if(LOG.isDebugEnabled()) LOG.debug("scannersWait() delay, count " + count++ + " on: " + hri.getRegionNameAsString());
+            Thread.sleep(pendingDelayLen);
+        } catch(InterruptedException e) {
+            String error = "Problem while calling sleep() on scannersWait delay, " + e;
+            if(LOG.isErrorEnabled()) LOG.error("Problem while calling sleep() on preSplit delay, returning. " + e);
+            throw new IOException(error);
+        }
+    }
+  }
+  
+  protected void pendingAndScannersWait(Set<TrxTransactionState> commitPendingTransactions, 
+                                        ConcurrentHashMap<Long,TransactionalRegionScannerHolder> scanners,
+                                        int pendingDelayLen) throws IOException {
+    int count = 1;
+    while(!scannersListClear(scanners) && !pendingListClear(commitPendingTransactions)) {
+      try {
+          if(LOG.isDebugEnabled()) LOG.debug("pendingAndScannersWait() delay, count " + count++ + " on: " + hri.getRegionNameAsString());
+          Thread.sleep(pendingDelayLen);
+      } catch(InterruptedException e) {
+          String error = "Problem while calling sleep() on pendingAndScannersWait delay, " + e;
+          if(LOG.isErrorEnabled()) LOG.error("Problem while calling sleep() on pendingAndScannersWait delay, returning. " + e);
+          throw new IOException(error);
+      }
+    }
+  }
+
+  protected void activeWait(ConcurrentHashMap<String, TrxTransactionState> transactionsById, int activeDelayLen, int splitDelayLimit) throws IOException {
+      int counter = 0;
+      int minutes = 0;
+      int currentMin = 0;
+
+      boolean delayMsg = false;
+      while(!transactionsById.isEmpty()) {
+          try {
+              delayMsg = true;
+              Thread.sleep(activeDelayLen);
+              counter++;
+              currentMin = (counter * activeDelayLen) / 60000;
+
+              if(currentMin > minutes) {
+                  minutes = currentMin;
+                  if (LOG.isInfoEnabled()) LOG.info("Delaying split due to transactions present. Delayed : " + 
+                                                    minutes + " minute(s) on " + hri.getRegionNameAsString());
+              }
+              if(minutes >= splitDelayLimit) {
+                  if(LOG.isWarnEnabled()) LOG.warn("Surpassed split delay limit of " + splitDelayLimit
+                                                  + " minutes. Continuing with split");
+                  delayMsg = false;
+                  break;
+              }
+          } catch (InterruptedException e) {
+              String error = "Problem while calling sleep() on preSplit delay - activeWait: " + e;
+              if(LOG.isErrorEnabled()) LOG.error(error);
+              throw new IOException(error);
+          }
+      }
+      if(delayMsg) {
+        if(LOG.isWarnEnabled()) LOG.warn("Continuing with split operation, no active transactions on: " + hri.getRegionNameAsString());
+      }
+  }
+  
+  protected void zkCleanup() {
+      if(LOG.isTraceEnabled()) LOG.trace("zkCleanup -- ENTRY");
+      try {
+          List<String> trafTables = ZKUtil.listChildrenNoWatch(zkw, zSplitBalPathNoSlash);
+          List<String> hbaseTables = ZKUtil.listChildrenNoWatch(zkw, SplitBalanceHelper.zkTable);
+          
+          for(String tableName : trafTables) {
+              if(!hbaseTables.contains(tableName)) {
+                  if(LOG.isTraceEnabled()) LOG.trace("zkCleanup, removing " + zSplitBalPath + tableName);
+                  ZKUtil.deleteNodeRecursively(zkw, zSplitBalPath + tableName);
+              }
+          }
+      } catch(KeeperException ke) {
+          if(LOG.isErrorEnabled()) LOG.error("zkCleanup error, please check your ZooKeeper: " + ke);
+      }
+      if(LOG.isTraceEnabled()) LOG.trace("zkCleanup -- EXIT");
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/65d0f1cf/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java
index e426159..2e64c12 100755
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java
@@ -91,6 +91,18 @@ import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.commons.codec.binary.Hex;
 
+import org.apache.hadoop.hbase.io.hfile.CacheConfig;
+import org.apache.hadoop.hbase.io.hfile.HFile;
+import org.apache.hadoop.hbase.io.hfile.HFileContext;
+import org.apache.hadoop.hbase.io.hfile.HFileContextBuilder;
+import org.apache.hadoop.hbase.io.hfile.HFileScanner;
+import org.apache.hadoop.hbase.io.hfile.HFileWriterV2;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.util.ProtoUtil;
+import org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionPersist;
+import org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TransactionStateMsg;
+import com.google.protobuf.CodedInputStream;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.classification.InterfaceAudience;
@@ -136,10 +148,12 @@ import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;
 import org.apache.hadoop.hbase.coprocessor.RegionObserver;
 import org.apache.hadoop.hbase.filter.FilterList;
 import org.apache.hadoop.hbase.filter.FirstKeyOnlyFilter;
+import org.apache.hadoop.hbase.filter.Filter.ReturnCode;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HBaseInterfaceAudience;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HRegionInfo;
+import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.Tag;
 import org.apache.hadoop.hbase.client.Mutation;
@@ -268,7 +282,7 @@ CoprocessorService, Coprocessor {
 
   // Concurrent map for transactional region scanner holders
   // Protected by synchronized methods
-  final ConcurrentHashMap<Long,
+  private ConcurrentHashMap<Long,
                           TransactionalRegionScannerHolder> scanners =
       new ConcurrentHashMap<Long, TransactionalRegionScannerHolder>();
 
@@ -341,6 +355,9 @@ CoprocessorService, Coprocessor {
   String lv_hostName;
   int lv_port;
   private static String zNodePath = "/hbase/Trafodion/recovery/";
+  private static final String COMMITTED_TXNS_KEY = "1_COMMITED_TXNS_KEY";
+  private static final String TXNS_BY_ID_KEY = "2_TXNS_BY_ID_KEY";
+  private HFileContext context = new HFileContextBuilder().withIncludesTags(false).build();
 
   private static final int MINIMUM_LEASE_TIME = 7200 * 1000;
   private static final int LEASE_CHECK_FREQUENCY = 1000;
@@ -367,12 +384,14 @@ CoprocessorService, Coprocessor {
   private static float memoryPercentage = 0;
   private static boolean memoryThrottle = false;
   private static boolean suppressOutOfOrderProtocolException = DEFAULT_SUPPRESS_OOP;
+  private Configuration config;
 
   // Transaction state defines
   private static final int COMMIT_OK = 1;
   private static final int COMMIT_OK_READ_ONLY = 2;
   private static final int COMMIT_UNSUCCESSFUL_FROM_COPROCESSOR = 3;
   private static final int COMMIT_CONFLICT = 5;
+  private static final int COMMIT_RESEND = 6;
 
   private static final int CLOSE_WAIT_ON_COMMIT_PENDING = 1000;
   private static final int MAX_COMMIT_PENDING_WAITS = 10;
@@ -392,7 +411,7 @@ CoprocessorService, Coprocessor {
 
   public static final String trxkeyEPCPinstance = "EPCPinstance";
   // TBD Maybe we should just use HashMap to improve the performance, ConcurrentHashMap could be too strict
-  static ConcurrentHashMap<String, Object> transactionsEPCPMap = new ConcurrentHashMap<String, Object>();
+  static ConcurrentHashMap<String, Object> transactionsEPCPMap;
 
   // TrxRegionService methods
     
@@ -839,9 +858,11 @@ CoprocessorService, Coprocessor {
       } catch (UnknownTransactionException u) {
         if (LOG.isTraceEnabled()) LOG.trace("TrxRegionEndpoint coprocessor: commitRequest - txId " + transactionId + ", Caught UnknownTransactionException after internal commitRequest call - " + u.toString());
         ute = u;
+        status = COMMIT_UNSUCCESSFUL_FROM_COPROCESSOR;
       } catch (IOException e) {
         if (LOG.isTraceEnabled()) LOG.trace("TrxRegionEndpoint coprocessor: commitRequest - txId " + transactionId + ", Caught IOException after internal commitRequest call - "+ e.toString());
         ioe = e;
+        status = COMMIT_UNSUCCESSFUL_FROM_COPROCESSOR;
       }
     }
 
@@ -2851,6 +2872,13 @@ CoprocessorService, Coprocessor {
     return this;
   }
 
+  static public ConcurrentHashMap<String, Object> getRegionMap() {
+    if (transactionsEPCPMap == null) {
+      transactionsEPCPMap = new ConcurrentHashMap<String, Object>();
+    }
+    return transactionsEPCPMap;
+  }
+
   /**
    * Stores a reference to the coprocessor environment provided by the
    * {@link org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost} 
@@ -2864,6 +2892,9 @@ CoprocessorService, Coprocessor {
    */
   @Override
   public void start(CoprocessorEnvironment env) throws IOException {
+    if (transactionsEPCPMap == null)
+      transactionsEPCPMap = new ConcurrentHashMap<String, Object>();
+
     if (env instanceof RegionCoprocessorEnvironment) {
       this.env = (RegionCoprocessorEnvironment)env;
     } else {
@@ -2878,30 +2909,30 @@ CoprocessorService, Coprocessor {
     this.t_Region = (TransactionalRegion) tmp_env.getRegion();
     this.fs = this.m_Region.getFilesystem();
 
-    org.apache.hadoop.conf.Configuration conf = tmp_env.getConfiguration(); 
+    this.config = tmp_env.getConfiguration();
     
     synchronized (stoppableLock) {
       try {
-        this.transactionLeaseTimeout = conf.getInt(LEASE_CONF, MINIMUM_LEASE_TIME);
+        this.transactionLeaseTimeout = config.getInt(LEASE_CONF, MINIMUM_LEASE_TIME);
         if (this.transactionLeaseTimeout < MINIMUM_LEASE_TIME) {
           if (LOG.isWarnEnabled()) LOG.warn("Transaction lease time: " + this.transactionLeaseTimeout + ", was less than the minimum lease time.  Now setting the timeout to the minimum default value: " + MINIMUM_LEASE_TIME);
           this.transactionLeaseTimeout = MINIMUM_LEASE_TIME;
         }
 
-        this.scannerLeaseTimeoutPeriod = HBaseConfiguration.getInt(conf,
+        this.scannerLeaseTimeoutPeriod = HBaseConfiguration.getInt(config,
           HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD,
           HConstants.HBASE_REGIONSERVER_LEASE_PERIOD_KEY,
           HConstants.DEFAULT_HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD);
-        this.scannerThreadWakeFrequency = conf.getInt(HConstants.THREAD_WAKE_FREQUENCY, 10 * 1000);
+        this.scannerThreadWakeFrequency = config.getInt(HConstants.THREAD_WAKE_FREQUENCY, 10 * 1000);
 
-        this.cleanTimer = conf.getInt(SLEEP_CONF, DEFAULT_SLEEP);
-        this.memoryUsageThreshold = conf.getInt(MEMORY_THRESHOLD, DEFAULT_MEMORY_THRESHOLD);
-        this.memoryUsagePerformGC = conf.getBoolean(MEMORY_PERFORM_GC, DEFAULT_MEMORY_PERFORM_GC);
-        this.memoryUsageWarnOnly = conf.getBoolean(MEMORY_WARN_ONLY, DEFAULT_MEMORY_WARN_ONLY);
-        this.memoryUsageTimer = conf.getInt(MEMORY_CONF, DEFAULT_MEMORY_SLEEP);
-        this.memoryUsageTimer = conf.getInt(MEMORY_CONF, DEFAULT_MEMORY_SLEEP);
+        this.cleanTimer = config.getInt(SLEEP_CONF, DEFAULT_SLEEP);
+        this.memoryUsageThreshold = config.getInt(MEMORY_THRESHOLD, DEFAULT_MEMORY_THRESHOLD);
+        this.memoryUsagePerformGC = config.getBoolean(MEMORY_PERFORM_GC, DEFAULT_MEMORY_PERFORM_GC);
+        this.memoryUsageWarnOnly = config.getBoolean(MEMORY_WARN_ONLY, DEFAULT_MEMORY_WARN_ONLY);
+        this.memoryUsageTimer = config.getInt(MEMORY_CONF, DEFAULT_MEMORY_SLEEP);
+        this.memoryUsageTimer = config.getInt(MEMORY_CONF, DEFAULT_MEMORY_SLEEP);
 
-        this.suppressOutOfOrderProtocolException = conf.getBoolean(SUPPRESS_OOP, DEFAULT_SUPPRESS_OOP);
+        this.suppressOutOfOrderProtocolException = config.getBoolean(SUPPRESS_OOP, DEFAULT_SUPPRESS_OOP);
 	if (this.transactionLeases == null)  
 	    this.transactionLeases = new Leases(LEASE_CHECK_FREQUENCY);
 
@@ -3076,6 +3107,16 @@ CoprocessorService, Coprocessor {
         transactionsByIdTestz.put(this.m_Region.getRegionNameAsString()+TrxRegionObserver.trxkeyClosingVar,
                                   this.closing);
     }
+    ConcurrentHashMap<Long,TransactionalRegionScannerHolder> scannersCheck =
+        (ConcurrentHashMap<Long,TransactionalRegionScannerHolder>)transactionsByIdTestz
+        .get(this.m_Region.getRegionNameAsString()+TrxRegionObserver.trxkeyScanners);
+    if(scannersCheck != null) {
+      this.scanners = scannersCheck;
+    }
+    else {
+      transactionsByIdTestz.put(this.m_Region.getRegionNameAsString()+TrxRegionObserver.trxkeyScanners,
+                              this.scanners);
+    }
 
     // Set up the memoryBean from the ManagementFactory
     if (memoryUsageThreshold < DEFAULT_MEMORY_THRESHOLD) 
@@ -4059,7 +4100,6 @@ CoprocessorService, Coprocessor {
      throws IOException {
 
     if (LOG.isTraceEnabled()) LOG.trace("TrxRegionEndpoint coprocessor: beginTransaction -- ENTRY txId: " + transactionId);
-    checkClosing(transactionId);
 
     // TBD until integration with recovery 
     if (reconstructIndoubts == 0) {
@@ -4174,6 +4214,7 @@ CoprocessorService, Coprocessor {
     if (LOG.isTraceEnabled()) LOG.trace("Enter TrxRegionEndpoint coprocessor: beginTransIfNotExist, txid: "
               + transactionId + " transactionsById size: "
               + transactionsById.size());
+    checkClosing(transactionId);
 
     String key = getTransactionalUniqueId(transactionId);
     synchronized (transactionsById) {
@@ -4303,8 +4344,10 @@ CoprocessorService, Coprocessor {
     }
       // may change to indicate a NOTFOUND case  then depends on the TM ts state, if reinstated tx, ignore the exception
       if (state == null) {
-        if (LOG.isTraceEnabled()) LOG.trace("TrxRegionEndpoint coprocessor: commitRequest encountered unknown transactionID txId: " + transactionId + " returning COMMIT_UNSUCCESSFUL_FROM_COPROCESSOR");
-        return COMMIT_UNSUCCESSFUL_FROM_COPROCESSOR;
+        String errMsg = "TrxRegionEndpoint coprocessor: commitRequest encountered unknown transactionID txId: " + transactionId;
+        if (LOG.isTraceEnabled()) LOG.trace(errMsg);
+        //return COMMIT_UNSUCCESSFUL_FROM_COPROCESSOR;
+        throw new UnknownTransactionException(errMsg);
       }
 
     if (LOG.isInfoEnabled()) 
@@ -4503,6 +4546,8 @@ CoprocessorService, Coprocessor {
 
     // Otherwise we were read-only and commitable, so we can forget it.
     state.setStatus(Status.COMMITED);
+    if(state.getSplitRetry())
+      return COMMIT_RESEND;
     retireTransaction(state, true);
     if (LOG.isDebugEnabled()) LOG.debug("TrxRegionEndpoint coprocessor: commitRequest READ ONLY -- EXIT txId: " + transactionId);
     return COMMIT_OK_READ_ONLY;
@@ -4673,7 +4718,7 @@ CoprocessorService, Coprocessor {
          if (LOG.isTraceEnabled()) LOG.trace("TrxRegionEndpoint coprocessor: commitIfPossible -- ENTRY txId: " + transactionId + " COMMIT_OK");
          return true;
        } catch (Throwable e) {
-         LOG.error("TrxRegionEndpoint coprocessor: commitIfPossible - txId " + transactionId + ", Caught exception after internal commit call "
+        if (LOG.isTraceEnabled()) LOG.trace("TrxRegionEndpoint coprocessor: commitIfPossible - txId " + transactionId + ", Caught exception after internal commit call "
                     + e.getMessage() + " " + stackTraceToString(e));
         throw new IOException(e.toString());
        }
@@ -5178,6 +5223,199 @@ CoprocessorService, Coprocessor {
       }
     }
   }
+  public void flushToFS(Path flushPath) throws IOException {
+    TransactionPersist.Builder txnPersistBuilder = TransactionPersist.newBuilder();
+    fs.delete(flushPath, true);
+
+    HFileWriterV2 w =
+        (HFileWriterV2)
+        HFile.getWriterFactory(config, new CacheConfig(config))
+        .withPath(fs, flushPath).withFileContext(context).create();
+
+    Map<Long, TrxTransactionState> transactionMap = new HashMap<Long, TrxTransactionState>();
+
+    for(TrxTransactionState ts : transactionsById.values()) {
+      transactionMap.put(ts.getTransactionId(), ts);
+      txnPersistBuilder.addTxById(ts.getTransactionId());
+    }
+    for(Map.Entry<Long, TrxTransactionState> entry :
+        commitedTransactionsBySequenceNumber.entrySet()) {
+      transactionMap.put(entry.getValue().getTransactionId(), entry.getValue());
+      txnPersistBuilder.addSeqNoListSeq(entry.getKey());
+      txnPersistBuilder.addSeqNoListTxn(entry.getValue().getTransactionId());
+    }
+    for(TrxTransactionState ts : transactionMap.values()) {
+      for(TrxTransactionState ts2 : ts.getTransactionsToCheck()) {
+        transactionMap.put(ts.getTransactionId(), ts);
+      }
+    }
+    txnPersistBuilder.setNextSeqId(nextSequenceId.get());
+
+    ByteArrayOutputStream output = new ByteArrayOutputStream();
+
+    for(TrxTransactionState ts : transactionMap.values()) {
+      TransactionStateMsg.Builder tsBuilder =  TransactionStateMsg.newBuilder();
+      tsBuilder.setTxId(ts.getTransactionId());
+      tsBuilder.setStartSeqNum(ts.getStartSequenceNumber());
+      tsBuilder.setSeqNum(ts.getHLogStartSequenceId());
+      tsBuilder.setLogSeqId(ts.getLogSeqId());
+      tsBuilder.setReinstated(ts.isReinstated());
+
+      if(ts.getCommitProgress() == null)
+          tsBuilder.setCommitProgress(-1);
+      else
+          tsBuilder.setCommitProgress(ts.getCommitProgress().ordinal());
+
+      tsBuilder.setStatus(ts.getStatus().ordinal());
+      for (WriteAction wa : ts.getWriteOrdering()) {
+        if(wa.getPut() != null) {
+          tsBuilder.addPutOrDel(true);
+          tsBuilder.addPut(ProtobufUtil.toMutation(MutationType.PUT, wa.getPut()));
+        }
+        else {
+          tsBuilder.addPutOrDel(false);
+
+          tsBuilder.addDelete(ProtobufUtil.toMutation(MutationType.DELETE, wa.getDelete()));
+        }
+      }
+      tsBuilder.build().writeDelimitedTo(output);
+    }
+    byte [] firstByte = output.toByteArray();
+
+    w.append(new KeyValue(Bytes.toBytes(COMMITTED_TXNS_KEY), Bytes.toBytes("cf"), Bytes.toBytes("qual"),
+      firstByte));
+
+    byte [] persistByte = txnPersistBuilder.build().toByteArray();
+    TransactionPersist persistMsg = TransactionPersist.parseFrom(persistByte);
+    w.append(new KeyValue(Bytes.toBytes(TXNS_BY_ID_KEY), Bytes.toBytes("cf"), Bytes.toBytes("qual"),
+      persistByte));
+    w.close();
+  }
+
+  public void readTxnInfo(Path flushPath) throws IOException {
+    readTxnInfo(flushPath, false);
+  }
 
+  public void readTxnInfo(Path flushPath, boolean setRetry) throws IOException {
+          if(LOG.isTraceEnabled()) LOG.trace("readTxnInfo -- ENTRY, Path: " + flushPath.toString());
+
+          try {
+              HFile.Reader reader = HFile.createReader(fs, flushPath, new CacheConfig(config), config);
+              HFileScanner scanner = reader.getScanner(true, false);
+              scanner.seekTo();
+              //KeyValue firstVal = scanner.getKeyValue();
+              Cell firstVal = scanner.getKeyValue();
+              scanner.next();
+              //KeyValue persistKV = scanner.getKeyValue();
+              Cell persistKV = scanner.getKeyValue();
+
+              if(firstVal == null || persistKV == null) {
+                throw new IOException("Invalid values read from HFile in readTxnInfo");
+              }
+
+              Map<Long, TrxTransactionState> txnMap = new HashMap<Long, TrxTransactionState>();
+              Map<Long, List<Long>> txnsToCheckMap = new HashMap<Long, List<Long>>();
+              ByteArrayInputStream input = new ByteArrayInputStream(CellUtil.cloneValue(firstVal));
+
+              TransactionStateMsg tsm  = TransactionStateMsg.parseDelimitedFrom(input);
+              while (tsm != null) {
+                TrxTransactionState ts = new TrxTransactionState(tsm.getTxId(),
+                                                                 tsm.getSeqNum(),
+                                                                 new AtomicLong(tsm.getLogSeqId()),
+                                                                 m_Region.getRegionInfo(),
+                                                                 m_Region.getTableDesc(),
+                                                                 m_Region.getLog(),
+                                                                 configuredEarlyLogging);
+                ts.setStartSequenceNumber(tsm.getStartSeqNum());
+
+                List<Boolean> putOrDel = tsm.getPutOrDelList();
+                List<MutationProto> puts = tsm.getPutList();
+                List<MutationProto> deletes = tsm.getDeleteList();
+
+                int putIndex = 0;
+                int deleteIndex = 0;
+                for (Boolean put : putOrDel) {
+                  if(put) {
+                    Put writePut = ProtobufUtil.toPut(puts.get(putIndex++));
+                    if(m_Region.rowIsInRange(regionInfo, writePut.getRow())) {
+                        ts.addWrite(writePut);
+                    }
+                  }
+                  else {
+                    Delete writeDelete = ProtobufUtil.toDelete(deletes.get(deleteIndex++));
+                    if(m_Region.rowIsInRange(regionInfo, writeDelete.getRow())) {
+                        ts.addDelete(writeDelete);
+                    }
+                  }
+                }
+                txnsToCheckMap.put(tsm.getTxId(), tsm.getTxnsToCheckList());
+                if(setRetry)
+                  ts.setSplitRetry(true);
+                txnMap.put(ts.getTransactionId(), ts);
+                tsm  = TransactionStateMsg.parseDelimitedFrom(input);
+              }
+
+              for(TrxTransactionState ts : txnMap.values()) {
+                for (Long txid : txnsToCheckMap.get(ts.getTransactionId())) {
+                  TrxTransactionState mapTS = txnMap.get(txid);
+                  if(mapTS != null)
+                    ts.addTransactionToCheck(mapTS);
+                }
+              }
+              TransactionPersist txnPersistMsg = TransactionPersist.parseFrom(CellUtil.cloneValue(persistKV));
+
+              if(txnPersistMsg == null) {
+                throw new IOException("Invalid protobuf, message is null.");
+              }
+              for (Long txid : txnPersistMsg.getTxByIdList()) {
+                String key = getTransactionalUniqueId(txid);
+                TrxTransactionState ts = txnMap.get(txid);
+                if (ts != null) {
+                  TrxTransactionState existingTs = transactionsById.get(txid);
+                  if(existingTs != null) {
+                    for(WriteAction wa : existingTs.getWriteOrdering()) {
+                      if(wa.getPut() != null) {
+                        ts.addWrite(wa.getPut());
+                      }
+                      else {
+                        ts.addDelete(wa.getDelete());
+                      }
+                    }
+                  }
+                  transactionsById.put(key, ts);
+                  transactionLeases.createLease(key, transactionLeaseTimeout, new TransactionLeaseListener(txid));
+                }
+                else {
+                  TrxTransactionState tsEntry = new TrxTransactionState(txid,
+              0,
+              new AtomicLong(0),
+              m_Region.getRegionInfo(),
+              m_Region.getTableDesc(),
+              m_Region.getLog(),
+              configuredEarlyLogging);
+                  transactionsById.putIfAbsent(key, tsEntry);
+                }
+              }
+
+              for (int i = 0; i < txnPersistMsg.getSeqNoListSeqCount(); i++) {
+                TrxTransactionState ts = txnMap.get(txnPersistMsg.getSeqNoListTxn(i));
+                if (ts!=null)
+                  commitedTransactionsBySequenceNumber.put(txnPersistMsg.getSeqNoListSeq(i), ts);
+              }
+
+              this.nextSequenceId = new AtomicLong(txnPersistMsg.getNextSeqId());
+            } catch(IOException e) {
+                StringWriter sw = new StringWriter();
+                PrintWriter pw = new PrintWriter(sw);
+                e.printStackTrace(pw);
+                LOG.error(sw.toString());
+            }
+          if(LOG.isTraceEnabled()) LOG.trace("readTxnInfo -- EXIT");
+
+  }
+
+  public void setClosing(boolean value) {
+    closing.set(value);
+  }
 }
 //1}