You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@omid.apache.org by fp...@apache.org on 2016/05/11 18:06:08 UTC

[01/50] [abbrv] incubator-omid git commit: [ci skip]prepare release omid-0.8.1.41 [Forced Update!]

Repository: incubator-omid
Updated Branches:
  refs/heads/master e5b4ca315 -> 2dc484e4b (forced update)


[ci skip]prepare release omid-0.8.1.41


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

Branch: refs/heads/master
Commit: da54c4b447ca58c94fe6c4aa66f2ffb3749da253
Parents: e14c2c9
Author: Omid CI <om...@yahoo-inc.com>
Authored: Thu Apr 21 19:46:26 2016 +0000
Committer: Omid CI <om...@yahoo-inc.com>
Committed: Thu Apr 21 19:46:26 2016 +0000

----------------------------------------------------------------------
 benchmarks/pom.xml          | 2 +-
 codahale-metrics/pom.xml    | 2 +-
 commit-table/pom.xml        | 2 +-
 common/pom.xml              | 2 +-
 examples/pom.xml            | 2 +-
 hbase-client/pom.xml        | 2 +-
 hbase-commit-table/pom.xml  | 2 +-
 hbase-common/pom.xml        | 2 +-
 hbase-coprocessor/pom.xml   | 2 +-
 hbase-shims/hbase-0/pom.xml | 2 +-
 hbase-shims/hbase-1/pom.xml | 2 +-
 hbase-shims/pom.xml         | 2 +-
 hbase-tools/pom.xml         | 2 +-
 metrics/pom.xml             | 2 +-
 pom.xml                     | 4 ++--
 statemachine/pom.xml        | 2 +-
 timestamp-storage/pom.xml   | 2 +-
 transaction-client/pom.xml  | 2 +-
 tso-server/pom.xml          | 2 +-
 19 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/da54c4b4/benchmarks/pom.xml
----------------------------------------------------------------------
diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml
index 192d113..f5e1ec6 100644
--- a/benchmarks/pom.xml
+++ b/benchmarks/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.41-SNAPSHOT</version>
+        <version>0.8.1.41</version>
     </parent>
 
     <artifactId>benchmarks</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/da54c4b4/codahale-metrics/pom.xml
----------------------------------------------------------------------
diff --git a/codahale-metrics/pom.xml b/codahale-metrics/pom.xml
index 9329220..de537db 100644
--- a/codahale-metrics/pom.xml
+++ b/codahale-metrics/pom.xml
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.41-SNAPSHOT</version>
+        <version>0.8.1.41</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/da54c4b4/commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/commit-table/pom.xml b/commit-table/pom.xml
index 0408f81..6d9e632 100644
--- a/commit-table/pom.xml
+++ b/commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.41-SNAPSHOT</version>
+        <version>0.8.1.41</version>
     </parent>
 
     <artifactId>commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/da54c4b4/common/pom.xml
----------------------------------------------------------------------
diff --git a/common/pom.xml b/common/pom.xml
index fe173cd..667b9f5 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.41-SNAPSHOT</version>
+        <version>0.8.1.41</version>
     </parent>
 
     <artifactId>common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/da54c4b4/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index d09872c..3eb13cb 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.41-SNAPSHOT</version>
+        <version>0.8.1.41</version>
     </parent>
 
     <artifactId>examples</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/da54c4b4/hbase-client/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml
index 77379f9..4333708 100644
--- a/hbase-client/pom.xml
+++ b/hbase-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.41-SNAPSHOT</version>
+        <version>0.8.1.41</version>
     </parent>
 
     <artifactId>hbase-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/da54c4b4/hbase-commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-commit-table/pom.xml b/hbase-commit-table/pom.xml
index b66fa79..4837fb5 100644
--- a/hbase-commit-table/pom.xml
+++ b/hbase-commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.41-SNAPSHOT</version>
+        <version>0.8.1.41</version>
     </parent>
 
     <artifactId>hbase-commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/da54c4b4/hbase-common/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml
index 765e589..20884d7 100644
--- a/hbase-common/pom.xml
+++ b/hbase-common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.41-SNAPSHOT</version>
+        <version>0.8.1.41</version>
     </parent>
 
     <artifactId>hbase-common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/da54c4b4/hbase-coprocessor/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-coprocessor/pom.xml b/hbase-coprocessor/pom.xml
index b383f7c..7db44e4 100644
--- a/hbase-coprocessor/pom.xml
+++ b/hbase-coprocessor/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.41-SNAPSHOT</version>
+        <version>0.8.1.41</version>
     </parent>
 
     <artifactId>hbase-coprocessor</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/da54c4b4/hbase-shims/hbase-0/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-0/pom.xml b/hbase-shims/hbase-0/pom.xml
index 5844851..8f07022 100644
--- a/hbase-shims/hbase-0/pom.xml
+++ b/hbase-shims/hbase-0/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.41-SNAPSHOT</version>
+        <version>0.8.1.41</version>
     </parent>
 
     <artifactId>hbase0-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/da54c4b4/hbase-shims/hbase-1/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-1/pom.xml b/hbase-shims/hbase-1/pom.xml
index bd9fa30..c7cee69 100644
--- a/hbase-shims/hbase-1/pom.xml
+++ b/hbase-shims/hbase-1/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.41-SNAPSHOT</version>
+        <version>0.8.1.41</version>
     </parent>
 
     <artifactId>hbase1-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/da54c4b4/hbase-shims/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/pom.xml b/hbase-shims/pom.xml
index 0eb83cf..fcd32f8 100644
--- a/hbase-shims/pom.xml
+++ b/hbase-shims/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.41-SNAPSHOT</version>
+        <version>0.8.1.41</version>
     </parent>
 
     <artifactId>omid-shims-aggregator</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/da54c4b4/hbase-tools/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-tools/pom.xml b/hbase-tools/pom.xml
index 1d4da3e..a57e6b6 100644
--- a/hbase-tools/pom.xml
+++ b/hbase-tools/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.41-SNAPSHOT</version>
+        <version>0.8.1.41</version>
     </parent>
 
     <artifactId>hbase-tools</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/da54c4b4/metrics/pom.xml
----------------------------------------------------------------------
diff --git a/metrics/pom.xml b/metrics/pom.xml
index dd0500c..0dd825e 100644
--- a/metrics/pom.xml
+++ b/metrics/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.41-SNAPSHOT</version>
+        <version>0.8.1.41</version>
     </parent>
 
     <artifactId>metrics</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/da54c4b4/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index ee8bdc7..d147f4b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
     <artifactId>omid</artifactId>
     <packaging>pom</packaging>
     <!-- WARNING: do not update version manually, use mvn versions:set -->
-    <version>0.8.1.41-SNAPSHOT</version>
+    <version>0.8.1.41</version>
 
     <organization>
         <name>Apache Software Foundation</name>
@@ -105,7 +105,7 @@
         <connection>scm:git:git://github.com/yahoo/omid.git</connection>
         <developerConnection>scm:git:https://${GH_TOKEN}@github.com/yahoo/omid.git</developerConnection>
         <url>https://github.com/yahoo/omid</url>
-        <tag>master</tag>
+        <tag>omid-0.8.1.41</tag>
     </scm>
 
     <distributionManagement>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/da54c4b4/statemachine/pom.xml
----------------------------------------------------------------------
diff --git a/statemachine/pom.xml b/statemachine/pom.xml
index 47c0ade..01c55ee 100644
--- a/statemachine/pom.xml
+++ b/statemachine/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.41-SNAPSHOT</version>
+        <version>0.8.1.41</version>
     </parent>
 
     <name>State Machine</name>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/da54c4b4/timestamp-storage/pom.xml
----------------------------------------------------------------------
diff --git a/timestamp-storage/pom.xml b/timestamp-storage/pom.xml
index 14a3d22..0f7d8cd 100644
--- a/timestamp-storage/pom.xml
+++ b/timestamp-storage/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.41-SNAPSHOT</version>
+        <version>0.8.1.41</version>
     </parent>
 
     <artifactId>timestamp-storage</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/da54c4b4/transaction-client/pom.xml
----------------------------------------------------------------------
diff --git a/transaction-client/pom.xml b/transaction-client/pom.xml
index 4a582c4..97d343a 100644
--- a/transaction-client/pom.xml
+++ b/transaction-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.41-SNAPSHOT</version>
+        <version>0.8.1.41</version>
     </parent>
 
     <artifactId>transaction-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/da54c4b4/tso-server/pom.xml
----------------------------------------------------------------------
diff --git a/tso-server/pom.xml b/tso-server/pom.xml
index f1fe556..04e92ce 100644
--- a/tso-server/pom.xml
+++ b/tso-server/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.41-SNAPSHOT</version>
+        <version>0.8.1.41</version>
     </parent>
 
     <artifactId>tso-server</artifactId>


[36/50] [abbrv] incubator-omid git commit: Send retried responses directly form Retry processor

Posted by fp...@apache.org.
Send retried responses directly form Retry processor

Bypass the reply processor as it just introduces unnecessary complexity in the
code (e.g. NO_ORDER code, etc.)

Change-Id: I9b7f36aba98caef655a8ba74d398691c9b57f043


Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/0afa8f16
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/0afa8f16
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/0afa8f16

Branch: refs/heads/master
Commit: 0afa8f16e1f4cadaf621bac67417e1cb6b8b81f0
Parents: 472c828
Author: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Authored: Thu May 5 13:18:36 2016 -0700
Committer: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Committed: Thu May 5 13:18:36 2016 -0700

----------------------------------------------------------------------
 .../org/apache/omid/tso/ReplyProcessor.java     | 36 +++++++++++--
 .../org/apache/omid/tso/ReplyProcessorImpl.java | 56 +++++++-------------
 .../org/apache/omid/tso/RetryProcessorImpl.java | 22 ++++----
 .../org/apache/omid/tso/TestRetryProcessor.java | 23 ++++----
 4 files changed, 68 insertions(+), 69 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/0afa8f16/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessor.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessor.java b/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessor.java
index 04f40cc..820630b 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessor.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessor.java
@@ -32,10 +32,38 @@ interface ReplyProcessor {
      */
     void manageResponsesBatch(long batchSequence, Batch batch);
 
-    // TODO This method can be removed if we return the responses from the retry processor
-    void addAbort(Batch batch, long startTimestamp, Channel c, MonitoringContext context);
-    // TODO This method can be removed if we return the responses from the retry processor
-    void addCommit(Batch batch, long startTimestamp, long commitTimestamp, Channel c, MonitoringContext context);
+    /**
+     * Allows to send a commit response back to the client.
+     *
+     * @param startTimestamp
+     *            the start timestamp representing the tx identifier that is going to receive the commit response
+     * @param commitTimestamp
+     *            the commit timestamp
+     * @param channel
+     *            the channel used to send the response back to the client
+     */
+    void sendCommitResponse(long startTimestamp, long commitTimestamp, Channel channel);
+
+    /**
+     * Allows to send an abort response back to the client.
+     *
+     * @param startTimestamp
+     *            the start timestamp representing the tx identifier that is going to receive the abort response
+     * @param channel
+     *            the channel used to send the response back to the client
+     */
+    void sendAbortResponse(long startTimestamp, Channel channel);
+
+    /**
+     * Allow to send a timestamp response back to the client.
+     *
+     * @param startTimestamp
+     *            the start timestamp to return that will represent the tx identifier for the created transaction
+     * @param channel
+     *            the channel used to send the response back to the client
+     */
+
+    void sendTimestampResponse(long startTimestamp, Channel channel);
 
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/0afa8f16/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java b/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java
index a37f90f..a4e2ce1 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java
@@ -46,8 +46,6 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyBatchEv
 
     private static final Logger LOG = LoggerFactory.getLogger(ReplyProcessorImpl.class);
 
-    private static final int NO_ORDER = (-1);
-
     private final ObjectPool<Batch> batchPool;
 
     private final RingBuffer<ReplyBatchEvent> replyRing;
@@ -82,7 +80,7 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyBatchEv
 
         this.futureEvents = new PriorityQueue<>(10, new Comparator<ReplyBatchEvent>() {
             public int compare(ReplyBatchEvent replyBatchEvent1, ReplyBatchEvent replyBatchEvent2) {
-                return Long.compare(replyBatchEvent1.getBatchID(), replyBatchEvent2.getBatchID());
+                return Long.compare(replyBatchEvent1.getBatchSequence(), replyBatchEvent2.getBatchSequence());
             }
         });
 
@@ -96,28 +94,29 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyBatchEv
 
         String name;
         Batch batch = event.getBatch();
-        for (int i=0; batch != null && i < batch.getNumEvents(); ++i) {
+        for (int i = 0; batch != null && i < batch.getNumEvents(); ++i) {
             PersistEvent localEvent = batch.get(i);
 
             switch (localEvent.getType()) {
             case COMMIT:
                 name = "commitReplyProcessor";
                 localEvent.getMonCtx().timerStart(name);
-                handleCommitResponse(localEvent.getStartTimestamp(), localEvent.getCommitTimestamp(), localEvent.getChannel());
+                sendCommitResponse(localEvent.getStartTimestamp(), localEvent.getCommitTimestamp(), localEvent.getChannel());
                 localEvent.getMonCtx().timerStop(name);
                  break;
             case ABORT:
                 name = "abortReplyProcessor";
                 localEvent.getMonCtx().timerStart(name);
-                handleAbortResponse(localEvent.getStartTimestamp(), localEvent.getChannel());
+                sendAbortResponse(localEvent.getStartTimestamp(), localEvent.getChannel());
                 localEvent.getMonCtx().timerStop(name);
                 break;
             case TIMESTAMP:
                 name = "timestampReplyProcessor";
                 localEvent.getMonCtx().timerStart(name);
-                handleTimestampResponse(localEvent.getStartTimestamp(), localEvent.getChannel());
+                sendTimestampResponse(localEvent.getStartTimestamp(), localEvent.getChannel());
                 localEvent.getMonCtx().timerStop(name);
                 break;
+            // TODO Check if we still need this
             case LOW_WATERMARK:
                 break;
             default:
@@ -135,7 +134,7 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyBatchEv
 
     private void processWaitingEvents() throws Exception {
 
-        while (!futureEvents.isEmpty() && futureEvents.peek().getBatchID() == nextIDToHandle.get()) {
+        while (!futureEvents.isEmpty() && futureEvents.peek().getBatchSequence() == nextIDToHandle.get()) {
             ReplyBatchEvent e = futureEvents.poll();
             handleReplyBatchEvent(e);
             nextIDToHandle.incrementAndGet();
@@ -150,17 +149,13 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyBatchEv
         // while commit smaller than still does not appear in the commit table.
 
         // If previous events were not processed yet (events contain smaller id)
-        if (event.getBatchID() > nextIDToHandle.get()) {
+        if (event.getBatchSequence() > nextIDToHandle.get()) {
             futureEvents.add(event);
             return;
         }
 
         handleReplyBatchEvent(event);
 
-        if (event.getBatchID() == NO_ORDER) {
-            return;
-        }
-
         nextIDToHandle.incrementAndGet();
 
         // Process events that arrived before and kept in futureEvents.
@@ -178,25 +173,8 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyBatchEv
 
     }
 
-    // TODO This method can be removed if we return the responses from the retry processor
     @Override
-    public void addAbort(Batch batch, long startTimestamp, Channel c, MonitoringContext context) {
-
-        batch.addAbort(startTimestamp, true, c, context);
-        manageResponsesBatch(NO_ORDER, batch);
-
-    }
-
-    // TODO This method can be removed if we return the responses from the retry processor
-    @Override
-    public void addCommit(Batch batch, long startTimestamp, long commitTimestamp, Channel c, MonitoringContext context) {
-
-        batch.addCommit(startTimestamp, commitTimestamp, c, context);
-        manageResponsesBatch(NO_ORDER, batch);
-
-    }
-
-    private void handleCommitResponse(long startTimestamp, long commitTimestamp, Channel c) {
+    public void sendCommitResponse(long startTimestamp, long commitTimestamp, Channel c) {
 
         TSOProto.Response.Builder builder = TSOProto.Response.newBuilder();
         TSOProto.CommitResponse.Builder commitBuilder = TSOProto.CommitResponse.newBuilder();
@@ -210,7 +188,8 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyBatchEv
 
     }
 
-    private void handleAbortResponse(long startTimestamp, Channel c) {
+    @Override
+    public void sendAbortResponse(long startTimestamp, Channel c) {
 
         TSOProto.Response.Builder builder = TSOProto.Response.newBuilder();
         TSOProto.CommitResponse.Builder commitBuilder = TSOProto.CommitResponse.newBuilder();
@@ -223,7 +202,8 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyBatchEv
 
     }
 
-    private void handleTimestampResponse(long startTimestamp, Channel c) {
+    @Override
+    public void sendTimestampResponse(long startTimestamp, Channel c) {
 
         TSOProto.Response.Builder builder = TSOProto.Response.newBuilder();
         TSOProto.TimestampResponse.Builder respBuilder = TSOProto.TimestampResponse.newBuilder();
@@ -238,19 +218,19 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyBatchEv
     final static class ReplyBatchEvent {
 
         private Batch batch;
-        private long batchID;
+        private long batchSequence;
 
-        static void makeReplyBatch(ReplyBatchEvent e, Batch batch, long batchID) {
+        static void makeReplyBatch(ReplyBatchEvent e, Batch batch, long batchSequence) {
             e.batch = batch;
-            e.batchID = batchID;
+            e.batchSequence = batchSequence;
         }
 
         Batch getBatch() {
             return batch;
         }
 
-        long getBatchID() {
-            return batchID;
+        long getBatchSequence() {
+            return batchSequence;
         }
 
         final static EventFactory<ReplyBatchEvent> EVENT_FACTORY = new EventFactory<ReplyBatchEvent>() {

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/0afa8f16/tso-server/src/main/java/org/apache/omid/tso/RetryProcessorImpl.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/RetryProcessorImpl.java b/tso-server/src/main/java/org/apache/omid/tso/RetryProcessorImpl.java
index 7b67674..5ac12ad 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/RetryProcessorImpl.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/RetryProcessorImpl.java
@@ -24,7 +24,6 @@ import com.lmax.disruptor.EventFactory;
 import com.lmax.disruptor.EventHandler;
 import com.lmax.disruptor.RingBuffer;
 import com.lmax.disruptor.SequenceBarrier;
-import com.lmax.disruptor.WaitStrategy;
 import com.lmax.disruptor.YieldingWaitStrategy;
 import org.apache.commons.pool2.ObjectPool;
 import org.apache.omid.committable.CommitTable;
@@ -48,7 +47,8 @@ import java.util.concurrent.ThreadFactory;
 import static com.codahale.metrics.MetricRegistry.name;
 
 /**
- * Manages the retry requests that clients can send when they did not received the response in the specified timeout.
+ * Manages the disambiguation of the retry requests that clients send when they did not received a response in the
+ * specified timeout. It replies directly to the client with the outcome identified.
  */
 class RetryProcessorImpl implements EventHandler<RetryProcessorImpl.RetryEvent>, RetryProcessor {
 
@@ -59,7 +59,6 @@ class RetryProcessorImpl implements EventHandler<RetryProcessorImpl.RetryEvent>,
     final RingBuffer<RetryEvent> retryRing;
 
     final CommitTable.Client commitTableClient;
-    final CommitTable.Writer writer; // TODO This is not used. Remove
     final ObjectPool<Batch> batchPool;
 
     // Metrics
@@ -74,7 +73,6 @@ class RetryProcessorImpl implements EventHandler<RetryProcessorImpl.RetryEvent>,
             throws InterruptedException, ExecutionException, IOException {
 
         this.commitTableClient = commitTable.getClient();
-        this.writer = commitTable.getWriter();
         this.replyProc = replyProc;
         this.batchPool = batchPool;
 
@@ -109,24 +107,22 @@ class RetryProcessorImpl implements EventHandler<RetryProcessorImpl.RetryEvent>,
 
     }
 
-    // TODO Reply to the client directly here instead of adding new workload to the reply processor. This avoids a lot
-    // of complexity
     private void handleCommitRetry(RetryEvent event) throws Exception {
+
         long startTimestamp = event.getStartTimestamp();
         try {
             Optional<CommitTimestamp> commitTimestamp = commitTableClient.getCommitTimestamp(startTimestamp).get();
-            Batch batch = batchPool.borrowObject();
             if(commitTimestamp.isPresent()) {
                 if (commitTimestamp.get().isValid()) {
-                    LOG.trace("Valid commit TS found in Commit Table");
-                    replyProc.addCommit(batch, startTimestamp, commitTimestamp.get().getValue(), event.getChannel(), event.getMonCtx());
+                    LOG.trace("Valid commit TS found in Commit Table. Replying Commit to the client...");
+                    replyProc.sendCommitResponse(startTimestamp, commitTimestamp.get().getValue(), event.getChannel());
                 } else {
-                    LOG.trace("Invalid commit TS found in Commit Table");
-                    replyProc.addAbort(batch, startTimestamp, event.getChannel(), event.getMonCtx());
+                    LOG.trace("Invalid commit TS found in Commit Table. Replying Abort to the client...");
+                    replyProc.sendAbortResponse(startTimestamp, event.getChannel());
                 }
             } else {
-                LOG.trace("No commit TS found in Commit Table");
-                replyProc.addAbort(batch, startTimestamp, event.getChannel(), event.getMonCtx());
+                LOG.trace("No commit TS found in Commit Table. Replying Abort to the client..");
+                replyProc.sendAbortResponse(startTimestamp, event.getChannel());
             }
         } catch (InterruptedException e) {
             LOG.error("Interrupted reading from commit table");

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/0afa8f16/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java b/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java
index 0a4fd44..eecab7a 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java
@@ -43,8 +43,6 @@ public class TestRetryProcessor {
 
     private static final Logger LOG = LoggerFactory.getLogger(TestRetryProcessor.class);
 
-    private MetricsRegistry metrics = new NullMetricsProvider();
-
     private static long NON_EXISTING_ST_TX = 1000;
     private static long ST_TX_1 = 0;
     private static long CT_TX_1 = 1;
@@ -55,6 +53,8 @@ public class TestRetryProcessor {
     private ReplyProcessor replyProc;
     @Mock
     private Panicker panicker;
+    @Mock
+    private MetricsRegistry metrics;
 
     private CommitTable commitTable;
 
@@ -63,7 +63,6 @@ public class TestRetryProcessor {
         MockitoAnnotations.initMocks(this);
         // Init components
         commitTable = new InMemoryCommitTable();
-        metrics = new NullMetricsProvider();
     }
 
     @Test(timeOut = 10_000)
@@ -77,8 +76,7 @@ public class TestRetryProcessor {
         retryProc.disambiguateRetryRequestHeuristically(NON_EXISTING_ST_TX, channel, new MonitoringContext(metrics));
         ArgumentCaptor<Long> firstTSCapture = ArgumentCaptor.forClass(Long.class);
 
-        verify(replyProc, timeout(100).times(1))
-                .addAbort(any(Batch.class), firstTSCapture.capture(), any(Channel.class), any(MonitoringContext.class));
+        verify(replyProc, timeout(100).times(1)).sendAbortResponse(firstTSCapture.capture(), any(Channel.class));
         long startTS = firstTSCapture.getValue();
         assertEquals(startTS, NON_EXISTING_ST_TX, "Captured timestamp should be the same as NON_EXISTING_ST_TX");
     }
@@ -96,16 +94,15 @@ public class TestRetryProcessor {
         ArgumentCaptor<Long> firstTSCapture = ArgumentCaptor.forClass(Long.class);
         ArgumentCaptor<Long> secondTSCapture = ArgumentCaptor.forClass(Long.class);
 
-        verify(replyProc, timeout(100).times(1)).addCommit(any(Batch.class),
-                                                           firstTSCapture.capture(),
-                                                           secondTSCapture.capture(),
-                                                           any(Channel.class),
-                                                           any(MonitoringContext.class));
+        verify(replyProc, timeout(100).times(1)).sendCommitResponse(firstTSCapture.capture(),
+                                                                    secondTSCapture.capture(),
+                                                                    any(Channel.class));
 
         long startTS = firstTSCapture.getValue();
         long commitTS = secondTSCapture.getValue();
         assertEquals(startTS, ST_TX_1, "Captured timestamp should be the same as ST_TX_1");
         assertEquals(commitTS, CT_TX_1, "Captured timestamp should be the same as CT_TX_1");
+
     }
 
     @Test(timeOut = 10_000)
@@ -125,12 +122,10 @@ public class TestRetryProcessor {
         // The element to test
         RetryProcessor retryProc = new RetryProcessorImpl(metrics, commitTable, replyProc, panicker, batchPool);
 
-        // Test we'll reply with an abort for a retry request when the
-        // transaction id IS in the commit table BUT invalidated
+        // Test we return an Abort to a retry request when the transaction id IS in the commit table BUT invalidated
         retryProc.disambiguateRetryRequestHeuristically(ST_TX_1, channel, new MonitoringContext(metrics));
         ArgumentCaptor<Long> startTSCapture = ArgumentCaptor.forClass(Long.class);
-        verify(replyProc, timeout(100).times(1))
-                .addAbort(any(Batch.class), startTSCapture.capture(), any(Channel.class), any(MonitoringContext.class));
+        verify(replyProc, timeout(100).times(1)).sendAbortResponse(startTSCapture.capture(), any(Channel.class));
         long startTS = startTSCapture.getValue();
         Assert.assertEquals(startTS, ST_TX_1, "Captured timestamp should be the same as NON_EXISTING_ST_TX");
 


[37/50] [abbrv] incubator-omid git commit: Fix error that flushed data constantly. Also identified and marked error in persist timeout.

Posted by fp...@apache.org.
Fix error that flushed data constantly. Also identified and marked error in persist timeout.

The endOfBatch variable from Disruptor was incorrectly used to decide when to flush the TSO batch, what
provoked a continuous flow of flush requests not following the logic of the TSO itself (flush only
when timeout expires or when the Batch is full

Change-Id: Ia90b1ddc4ca8f5498262adcbe78783f4fc5bbb3f


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

Branch: refs/heads/master
Commit: b759eb85ec083aba5821e933bab3c7bc30ff469e
Parents: 0afa8f1
Author: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Authored: Thu May 5 15:58:49 2016 -0700
Committer: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Committed: Thu May 5 15:58:49 2016 -0700

----------------------------------------------------------------------
 .../org/apache/omid/tso/RequestProcessorImpl.java     | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/b759eb85/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java b/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java
index 9340977..12f8326 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java
@@ -100,7 +100,7 @@ class RequestProcessorImpl implements EventHandler<RequestProcessorImpl.RequestE
     public void onEvent(RequestEvent event, long sequence, boolean endOfBatch) throws Exception {
 
         String name = null;
-        try {
+        try { // TODO this should be a switch. Re-check why it's NOT now
             if (event.getType() == RequestEvent.Type.TIMESTAMP) {
                 name = "timestampReqProcessor";
                 event.getMonCtx().timerStart(name);
@@ -111,20 +111,22 @@ class RequestProcessorImpl implements EventHandler<RequestProcessorImpl.RequestE
                 handleCommit(event);
             }
         } finally {
-            if (name != null) {
+            if (null != name) {
                 event.getMonCtx().timerStop(name);
             }
         }
 
-        if (endOfBatch) {
-            persistProc.triggerCurrentBatchFlush();
-        }
-
     }
 
     @Override
     public void onTimeout(long sequence) throws Exception {
 
+        // TODO We can not use this as a timeout trigger for flushing. This timeout is related to the time between
+        // TODO (cont) arrivals of requests to the disruptor. We need another mechanism to trigger timeouts
+        // TODO (cont) WARNING!!! Take care with the implementation because if there's other thread than request-0
+        // TODO (cont) thread the one that calls persistProc.triggerCurrentBatchFlush(); we'll incur in concurrency issues
+        // TODO (cont) This is because, in the current implementation, only the request-0 thread calls the public methods
+        // TODO (cont) in persistProc and it is guaranteed that access them serially.
         persistProc.triggerCurrentBatchFlush();
 
     }


[21/50] [abbrv] incubator-omid git commit: Merge pull request #100 from yahoo/fix-ha-initialization

Posted by fp...@apache.org.
Merge pull request #100 from yahoo/fix-ha-initialization

Fix HA initialization

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

Branch: refs/heads/master
Commit: f63b34c75af7ebfc5072c7386d6112b76da97884
Parents: bcdd3d1 2c33ff8
Author: ikatkov <ik...@gmail.com>
Authored: Thu Apr 28 15:54:10 2016 -0700
Committer: ikatkov <ik...@gmail.com>
Committed: Thu Apr 28 15:54:10 2016 -0700

----------------------------------------------------------------------
 .../apache/omid/timestamp/storage/ZKModule.java | 28 +++++++-
 .../omid/tso/HALeaseManagementModule.java       | 67 ++++++++++++++++++--
 tso-server/src/main/resources/default-omid.yml  | 15 ++---
 .../client/TestTSOClientConnectionToTSO.java    |  6 +-
 4 files changed, 98 insertions(+), 18 deletions(-)
----------------------------------------------------------------------



[20/50] [abbrv] incubator-omid git commit: Fix HA initialization

Posted by fp...@apache.org.
Fix HA initialization

The HALeaseManagementModule was not initialized properly.
Also, the ZKModule is instantiated twice in certain configurations
, so it required the equals() and hashCode() methods implemented.

Change-Id: I21049e81abbeaebcec1bcb75ed2e391e0166c1aa


Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/2c33ff8b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/2c33ff8b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/2c33ff8b

Branch: refs/heads/master
Commit: 2c33ff8be8f580dc9e81e5a329ad4b757d42b738
Parents: bcdd3d1
Author: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Authored: Thu Apr 28 15:49:52 2016 -0700
Committer: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Committed: Thu Apr 28 15:49:57 2016 -0700

----------------------------------------------------------------------
 .../apache/omid/timestamp/storage/ZKModule.java | 28 +++++++-
 .../omid/tso/HALeaseManagementModule.java       | 67 ++++++++++++++++++--
 tso-server/src/main/resources/default-omid.yml  | 15 ++---
 .../client/TestTSOClientConnectionToTSO.java    |  6 +-
 4 files changed, 98 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/2c33ff8b/timestamp-storage/src/main/java/org/apache/omid/timestamp/storage/ZKModule.java
----------------------------------------------------------------------
diff --git a/timestamp-storage/src/main/java/org/apache/omid/timestamp/storage/ZKModule.java b/timestamp-storage/src/main/java/org/apache/omid/timestamp/storage/ZKModule.java
index 468511e..0ce0cb7 100644
--- a/timestamp-storage/src/main/java/org/apache/omid/timestamp/storage/ZKModule.java
+++ b/timestamp-storage/src/main/java/org/apache/omid/timestamp/storage/ZKModule.java
@@ -19,8 +19,8 @@ package org.apache.omid.timestamp.storage;
 
 import com.google.inject.AbstractModule;
 import com.google.inject.Provides;
-import org.apache.omid.zk.ZKUtils;
 import org.apache.curator.framework.CuratorFramework;
+import org.apache.omid.zk.ZKUtils;
 
 import javax.inject.Singleton;
 import java.io.IOException;
@@ -46,4 +46,30 @@ public class ZKModule extends AbstractModule {
         return ZKUtils.initZKClient(zkCluster, namespace, 10);
     }
 
+    // ----------------------------------------------------------------------------------------------------------------
+    // NOTE: We need to implement equals() and hashCode() because the ZKModule is installed from several parent modules
+    // ----------------------------------------------------------------------------------------------------------------
+
+    @Override
+    public boolean equals(Object o) {
+
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        ZKModule zkModule = (ZKModule) o;
+
+        if (!zkCluster.equals(zkModule.zkCluster)) return false;
+        return namespace.equals(zkModule.namespace);
+
+    }
+
+    @Override
+    public int hashCode() {
+
+        int result = zkCluster.hashCode();
+        result = 31 * result + namespace.hashCode();
+        return result;
+
+    }
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/2c33ff8b/tso-server/src/main/java/org/apache/omid/tso/HALeaseManagementModule.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/HALeaseManagementModule.java b/tso-server/src/main/java/org/apache/omid/tso/HALeaseManagementModule.java
index 7821549..6bbec42 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/HALeaseManagementModule.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/HALeaseManagementModule.java
@@ -17,11 +17,12 @@
  */
 package org.apache.omid.tso;
 
+import com.google.common.annotations.VisibleForTesting;
 import com.google.inject.AbstractModule;
 import com.google.inject.Provides;
+import org.apache.curator.framework.CuratorFramework;
 import org.apache.omid.timestamp.storage.ZKModule;
 import org.apache.omid.tso.LeaseManagement.LeaseManagementException;
-import org.apache.curator.framework.CuratorFramework;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -33,12 +34,22 @@ import static org.apache.omid.tso.TSOServer.TSO_HOST_AND_PORT_KEY;
 public class HALeaseManagementModule extends AbstractModule {
 
     private static final Logger LOG = LoggerFactory.getLogger(HALeaseManagementModule.class);
-    private final long leasePeriodInMs;
-    private final String tsoLeasePath;
-    private final String currentTsoPath;
-    private final String zkCluster;
-    private final String zkNamespace;
 
+    private long leasePeriodInMs = 10_000; // 10 secs
+    private String tsoLeasePath = "/tso-lease";
+    private String currentTsoPath = "/current-tso";
+    private String zkCluster = "localhost:2181";
+    private String zkNamespace = "omid";
+
+    // ----------------------------------------------------------------------------------------------------------------
+    // WARNING: Do not remove empty constructor, needed by snake_yaml!
+    // ----------------------------------------------------------------------------------------------------------------
+
+    public HALeaseManagementModule() {
+
+    }
+
+    @VisibleForTesting
     public HALeaseManagementModule(long leasePeriodInMs, String tsoLeasePath, String currentTsoPath,
                                    String zkCluster, String zkNamespace) {
 
@@ -78,4 +89,48 @@ public class HALeaseManagementModule extends AbstractModule {
 
     }
 
+    // ----------------------------------------------------------------------------------------------------------------
+    // WARNING: Do not remove getters/setters, needed by snake_yaml!
+    // ----------------------------------------------------------------------------------------------------------------
+
+    public String getCurrentTsoPath() {
+        return currentTsoPath;
+    }
+
+    public void setCurrentTsoPath(String currentTsoPath) {
+        this.currentTsoPath = currentTsoPath;
+    }
+
+    public long getLeasePeriodInMs() {
+        return leasePeriodInMs;
+    }
+
+    public void setLeasePeriodInMs(long leasePeriodInMs) {
+        this.leasePeriodInMs = leasePeriodInMs;
+    }
+
+    public String getTsoLeasePath() {
+        return tsoLeasePath;
+    }
+
+    public void setTsoLeasePath(String tsoLeasePath) {
+        this.tsoLeasePath = tsoLeasePath;
+    }
+
+    public String getZkCluster() {
+        return zkCluster;
+    }
+
+    public void setZkCluster(String zkCluster) {
+        this.zkCluster = zkCluster;
+    }
+
+    public String getZkNamespace() {
+        return zkNamespace;
+    }
+
+    public void setZkNamespace(String zkNamespace) {
+        this.zkNamespace = zkNamespace;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/2c33ff8b/tso-server/src/main/resources/default-omid.yml
----------------------------------------------------------------------
diff --git a/tso-server/src/main/resources/default-omid.yml b/tso-server/src/main/resources/default-omid.yml
index 85b2b53..4cffe98 100644
--- a/tso-server/src/main/resources/default-omid.yml
+++ b/tso-server/src/main/resources/default-omid.yml
@@ -23,7 +23,7 @@ timestampStoreModule: !!org.apache.omid.tso.InMemoryTimestampStorageModule [ ]
 commitTableStoreModule: !!org.apache.omid.tso.InMemoryCommitTableStorageModule [ ]
 leaseModule: !!org.apache.omid.tso.VoidLeaseManagementModule [ ]
 
-# Default stats/metrics configuration (
+# Default stats/metrics configuration
 metrics: !!org.apache.omid.metrics.NullMetricsProvider [ ]
 
 # ---------------------------------------------------------------------------------------------------------------------
@@ -132,13 +132,12 @@ metrics: !!org.apache.omid.metrics.NullMetricsProvider [ ]
 #
 # commitTableStoreModule: !!org.apache.omid.tso.DefaultHBaseCommitTableStorageModule [ ]
 # timestampStoreModule: !!org.apache.omid.tso.DefaultHBaseTimestampStorageModule [ ]
-# leaseModule: !!org.apache.omid.tso.HALeaseManagementModule [
-#     leasePeriodInMs: 10000,
-#     tsoLeasePath: "/tso-lease",
-#     zkCurrentTsoPath: "/current-tso",
-#     zkCluster: "localhost:2181",
-#     namespace: "omid"
-# ]
+# leaseModule: !!org.apache.omid.tso.HALeaseManagementModule
+#     leasePeriodInMs: 10000
+#     tsoLeasePath: "/tso-lease"
+#     currentTsoPath: "/current-tso"
+#     zkCluster: "localhost:2181"
+#     zkNamespace: "omid"
 # metrics: !!org.apache.omid.metrics.NullMetricsProvider [ ]
 
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/2c33ff8b/tso-server/src/test/java/org/apache/omid/tso/client/TestTSOClientConnectionToTSO.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/client/TestTSOClientConnectionToTSO.java b/tso-server/src/test/java/org/apache/omid/tso/client/TestTSOClientConnectionToTSO.java
index 32fbd97..5e6aca9 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/client/TestTSOClientConnectionToTSO.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/client/TestTSOClientConnectionToTSO.java
@@ -19,6 +19,9 @@ package org.apache.omid.tso.client;
 
 import com.google.inject.Guice;
 import com.google.inject.Injector;
+import org.apache.curator.framework.CuratorFramework;
+import org.apache.curator.test.TestingServer;
+import org.apache.curator.utils.CloseableUtils;
 import org.apache.omid.TestUtils;
 import org.apache.omid.tso.HALeaseManagementModule;
 import org.apache.omid.tso.TSOMockModule;
@@ -26,9 +29,6 @@ import org.apache.omid.tso.TSOServer;
 import org.apache.omid.tso.TSOServerConfig;
 import org.apache.omid.tso.VoidLeaseManagementModule;
 import org.apache.statemachine.StateMachine.FsmImpl;
-import org.apache.curator.framework.CuratorFramework;
-import org.apache.curator.test.TestingServer;
-import org.apache.curator.utils.CloseableUtils;
 import org.apache.zookeeper.KeeperException.NoNodeException;
 import org.apache.zookeeper.data.Stat;
 import org.slf4j.Logger;


[04/50] [abbrv] incubator-omid git commit: [ci skip]prepare for next development iteration

Posted by fp...@apache.org.
[ci skip]prepare for next development iteration


Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/3072f32b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/3072f32b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/3072f32b

Branch: refs/heads/master
Commit: 3072f32b267e86c8802c1414ec6e58561a41dad9
Parents: 6d087c8
Author: Omid CI <om...@yahoo-inc.com>
Authored: Thu Apr 21 20:05:54 2016 +0000
Committer: Omid CI <om...@yahoo-inc.com>
Committed: Thu Apr 21 20:05:54 2016 +0000

----------------------------------------------------------------------
 benchmarks/pom.xml          | 2 +-
 codahale-metrics/pom.xml    | 2 +-
 commit-table/pom.xml        | 2 +-
 common/pom.xml              | 2 +-
 examples/pom.xml            | 2 +-
 hbase-client/pom.xml        | 2 +-
 hbase-commit-table/pom.xml  | 2 +-
 hbase-common/pom.xml        | 2 +-
 hbase-coprocessor/pom.xml   | 2 +-
 hbase-shims/hbase-0/pom.xml | 2 +-
 hbase-shims/hbase-1/pom.xml | 2 +-
 hbase-shims/pom.xml         | 2 +-
 hbase-tools/pom.xml         | 2 +-
 metrics/pom.xml             | 2 +-
 pom.xml                     | 4 ++--
 statemachine/pom.xml        | 2 +-
 timestamp-storage/pom.xml   | 2 +-
 transaction-client/pom.xml  | 2 +-
 tso-server/pom.xml          | 2 +-
 19 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/3072f32b/benchmarks/pom.xml
----------------------------------------------------------------------
diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml
index d125230..fd329bc 100644
--- a/benchmarks/pom.xml
+++ b/benchmarks/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.42</version>
+        <version>0.8.1.43-SNAPSHOT</version>
     </parent>
 
     <artifactId>benchmarks</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/3072f32b/codahale-metrics/pom.xml
----------------------------------------------------------------------
diff --git a/codahale-metrics/pom.xml b/codahale-metrics/pom.xml
index 7dd1150..3e051d5 100644
--- a/codahale-metrics/pom.xml
+++ b/codahale-metrics/pom.xml
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.42</version>
+        <version>0.8.1.43-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/3072f32b/commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/commit-table/pom.xml b/commit-table/pom.xml
index 77ab17f..8fd85be 100644
--- a/commit-table/pom.xml
+++ b/commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.42</version>
+        <version>0.8.1.43-SNAPSHOT</version>
     </parent>
 
     <artifactId>commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/3072f32b/common/pom.xml
----------------------------------------------------------------------
diff --git a/common/pom.xml b/common/pom.xml
index c989bcc..a7d948f 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.42</version>
+        <version>0.8.1.43-SNAPSHOT</version>
     </parent>
 
     <artifactId>common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/3072f32b/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index d8262f1..55c429f 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.42</version>
+        <version>0.8.1.43-SNAPSHOT</version>
     </parent>
 
     <artifactId>examples</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/3072f32b/hbase-client/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml
index adac8b0..c1a022c 100644
--- a/hbase-client/pom.xml
+++ b/hbase-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.42</version>
+        <version>0.8.1.43-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/3072f32b/hbase-commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-commit-table/pom.xml b/hbase-commit-table/pom.xml
index b91c192..c20656d 100644
--- a/hbase-commit-table/pom.xml
+++ b/hbase-commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.42</version>
+        <version>0.8.1.43-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/3072f32b/hbase-common/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml
index f1dbb68..6dc89a5 100644
--- a/hbase-common/pom.xml
+++ b/hbase-common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.42</version>
+        <version>0.8.1.43-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/3072f32b/hbase-coprocessor/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-coprocessor/pom.xml b/hbase-coprocessor/pom.xml
index 5692df5..d289c3e 100644
--- a/hbase-coprocessor/pom.xml
+++ b/hbase-coprocessor/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.42</version>
+        <version>0.8.1.43-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-coprocessor</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/3072f32b/hbase-shims/hbase-0/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-0/pom.xml b/hbase-shims/hbase-0/pom.xml
index 1bfd67f..b933a4c 100644
--- a/hbase-shims/hbase-0/pom.xml
+++ b/hbase-shims/hbase-0/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.42</version>
+        <version>0.8.1.43-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase0-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/3072f32b/hbase-shims/hbase-1/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-1/pom.xml b/hbase-shims/hbase-1/pom.xml
index 86d1e41..52933e1 100644
--- a/hbase-shims/hbase-1/pom.xml
+++ b/hbase-shims/hbase-1/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.42</version>
+        <version>0.8.1.43-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase1-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/3072f32b/hbase-shims/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/pom.xml b/hbase-shims/pom.xml
index abd3fff..6751e1a 100644
--- a/hbase-shims/pom.xml
+++ b/hbase-shims/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.42</version>
+        <version>0.8.1.43-SNAPSHOT</version>
     </parent>
 
     <artifactId>omid-shims-aggregator</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/3072f32b/hbase-tools/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-tools/pom.xml b/hbase-tools/pom.xml
index f63fc31..1f8f708 100644
--- a/hbase-tools/pom.xml
+++ b/hbase-tools/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.42</version>
+        <version>0.8.1.43-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-tools</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/3072f32b/metrics/pom.xml
----------------------------------------------------------------------
diff --git a/metrics/pom.xml b/metrics/pom.xml
index 176827f..00a0e0b 100644
--- a/metrics/pom.xml
+++ b/metrics/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.42</version>
+        <version>0.8.1.43-SNAPSHOT</version>
     </parent>
 
     <artifactId>metrics</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/3072f32b/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 7834cb0..ac77137 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
     <artifactId>omid</artifactId>
     <packaging>pom</packaging>
     <!-- WARNING: do not update version manually, use mvn versions:set -->
-    <version>0.8.1.42</version>
+    <version>0.8.1.43-SNAPSHOT</version>
 
     <organization>
         <name>Apache Software Foundation</name>
@@ -105,7 +105,7 @@
         <connection>scm:git:git://github.com/yahoo/omid.git</connection>
         <developerConnection>scm:git:https://${GH_TOKEN}@github.com/yahoo/omid.git</developerConnection>
         <url>https://github.com/yahoo/omid</url>
-        <tag>omid-0.8.1.42</tag>
+        <tag>master</tag>
     </scm>
 
     <distributionManagement>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/3072f32b/statemachine/pom.xml
----------------------------------------------------------------------
diff --git a/statemachine/pom.xml b/statemachine/pom.xml
index 59893fe..9d2246a 100644
--- a/statemachine/pom.xml
+++ b/statemachine/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.42</version>
+        <version>0.8.1.43-SNAPSHOT</version>
     </parent>
 
     <name>State Machine</name>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/3072f32b/timestamp-storage/pom.xml
----------------------------------------------------------------------
diff --git a/timestamp-storage/pom.xml b/timestamp-storage/pom.xml
index 6902887..6bc3ba2 100644
--- a/timestamp-storage/pom.xml
+++ b/timestamp-storage/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.42</version>
+        <version>0.8.1.43-SNAPSHOT</version>
     </parent>
 
     <artifactId>timestamp-storage</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/3072f32b/transaction-client/pom.xml
----------------------------------------------------------------------
diff --git a/transaction-client/pom.xml b/transaction-client/pom.xml
index cd56f72..53348cc 100644
--- a/transaction-client/pom.xml
+++ b/transaction-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.42</version>
+        <version>0.8.1.43-SNAPSHOT</version>
     </parent>
 
     <artifactId>transaction-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/3072f32b/tso-server/pom.xml
----------------------------------------------------------------------
diff --git a/tso-server/pom.xml b/tso-server/pom.xml
index c2c2e08..d2c8f51 100644
--- a/tso-server/pom.xml
+++ b/tso-server/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.42</version>
+        <version>0.8.1.43-SNAPSHOT</version>
     </parent>
 
     <artifactId>tso-server</artifactId>


[50/50] [abbrv] incubator-omid git commit: [ci skip]prepare for next development iteration

Posted by fp...@apache.org.
[ci skip]prepare for next development iteration


Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/2dc484e4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/2dc484e4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/2dc484e4

Branch: refs/heads/master
Commit: 2dc484e4b2b9a307d5050e7c56b98aa92ae7140a
Parents: ef6de6a
Author: Omid CI <om...@yahoo-inc.com>
Authored: Wed May 11 18:01:53 2016 +0000
Committer: Omid CI <om...@yahoo-inc.com>
Committed: Wed May 11 18:01:53 2016 +0000

----------------------------------------------------------------------
 benchmarks/pom.xml          | 2 +-
 codahale-metrics/pom.xml    | 2 +-
 commit-table/pom.xml        | 2 +-
 common/pom.xml              | 2 +-
 examples/pom.xml            | 2 +-
 hbase-client/pom.xml        | 2 +-
 hbase-commit-table/pom.xml  | 2 +-
 hbase-common/pom.xml        | 2 +-
 hbase-coprocessor/pom.xml   | 2 +-
 hbase-shims/hbase-0/pom.xml | 2 +-
 hbase-shims/hbase-1/pom.xml | 2 +-
 hbase-shims/pom.xml         | 2 +-
 hbase-tools/pom.xml         | 2 +-
 metrics/pom.xml             | 2 +-
 pom.xml                     | 4 ++--
 statemachine/pom.xml        | 2 +-
 timestamp-storage/pom.xml   | 2 +-
 transaction-client/pom.xml  | 2 +-
 tso-server/pom.xml          | 2 +-
 19 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/2dc484e4/benchmarks/pom.xml
----------------------------------------------------------------------
diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml
index 3f3d69a..5a480d3 100644
--- a/benchmarks/pom.xml
+++ b/benchmarks/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.50</version>
+        <version>0.8.1.51-SNAPSHOT</version>
     </parent>
 
     <artifactId>benchmarks</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/2dc484e4/codahale-metrics/pom.xml
----------------------------------------------------------------------
diff --git a/codahale-metrics/pom.xml b/codahale-metrics/pom.xml
index 854f87f..2e1d71f 100644
--- a/codahale-metrics/pom.xml
+++ b/codahale-metrics/pom.xml
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.50</version>
+        <version>0.8.1.51-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/2dc484e4/commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/commit-table/pom.xml b/commit-table/pom.xml
index e331575..ee7e4a3 100644
--- a/commit-table/pom.xml
+++ b/commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.50</version>
+        <version>0.8.1.51-SNAPSHOT</version>
     </parent>
 
     <artifactId>commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/2dc484e4/common/pom.xml
----------------------------------------------------------------------
diff --git a/common/pom.xml b/common/pom.xml
index 97c5bd6..8d2aaf0 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.50</version>
+        <version>0.8.1.51-SNAPSHOT</version>
     </parent>
 
     <artifactId>common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/2dc484e4/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 5d9e9f4..bb558cf 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.50</version>
+        <version>0.8.1.51-SNAPSHOT</version>
     </parent>
 
     <artifactId>examples</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/2dc484e4/hbase-client/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml
index e28e8a9..a82f4e4 100644
--- a/hbase-client/pom.xml
+++ b/hbase-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.50</version>
+        <version>0.8.1.51-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/2dc484e4/hbase-commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-commit-table/pom.xml b/hbase-commit-table/pom.xml
index 0470660..597f586 100644
--- a/hbase-commit-table/pom.xml
+++ b/hbase-commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.50</version>
+        <version>0.8.1.51-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/2dc484e4/hbase-common/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml
index 072b6f8..d8a3efc 100644
--- a/hbase-common/pom.xml
+++ b/hbase-common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.50</version>
+        <version>0.8.1.51-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/2dc484e4/hbase-coprocessor/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-coprocessor/pom.xml b/hbase-coprocessor/pom.xml
index fa61620..9b49709 100644
--- a/hbase-coprocessor/pom.xml
+++ b/hbase-coprocessor/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.50</version>
+        <version>0.8.1.51-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-coprocessor</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/2dc484e4/hbase-shims/hbase-0/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-0/pom.xml b/hbase-shims/hbase-0/pom.xml
index dff912f..1ceabed 100644
--- a/hbase-shims/hbase-0/pom.xml
+++ b/hbase-shims/hbase-0/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.50</version>
+        <version>0.8.1.51-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase0-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/2dc484e4/hbase-shims/hbase-1/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-1/pom.xml b/hbase-shims/hbase-1/pom.xml
index 4376803..884079a 100644
--- a/hbase-shims/hbase-1/pom.xml
+++ b/hbase-shims/hbase-1/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.50</version>
+        <version>0.8.1.51-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase1-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/2dc484e4/hbase-shims/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/pom.xml b/hbase-shims/pom.xml
index 5f0eb03..4c6b2aa 100644
--- a/hbase-shims/pom.xml
+++ b/hbase-shims/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.50</version>
+        <version>0.8.1.51-SNAPSHOT</version>
     </parent>
 
     <artifactId>omid-shims-aggregator</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/2dc484e4/hbase-tools/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-tools/pom.xml b/hbase-tools/pom.xml
index 69290c6..ccbf53d 100644
--- a/hbase-tools/pom.xml
+++ b/hbase-tools/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.50</version>
+        <version>0.8.1.51-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-tools</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/2dc484e4/metrics/pom.xml
----------------------------------------------------------------------
diff --git a/metrics/pom.xml b/metrics/pom.xml
index abb75c6..1ad2626 100644
--- a/metrics/pom.xml
+++ b/metrics/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.50</version>
+        <version>0.8.1.51-SNAPSHOT</version>
     </parent>
 
     <artifactId>metrics</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/2dc484e4/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index dfd4156..833964d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
     <artifactId>omid</artifactId>
     <packaging>pom</packaging>
     <!-- WARNING: do not update version manually, use mvn versions:set -->
-    <version>0.8.1.50</version>
+    <version>0.8.1.51-SNAPSHOT</version>
 
     <organization>
         <name>Apache Software Foundation</name>
@@ -105,7 +105,7 @@
         <connection>scm:git:git://github.com/yahoo/omid.git</connection>
         <developerConnection>scm:git:https://${GH_TOKEN}@github.com/yahoo/omid.git</developerConnection>
         <url>https://github.com/yahoo/omid</url>
-        <tag>omid-0.8.1.50</tag>
+        <tag>master</tag>
     </scm>
 
     <distributionManagement>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/2dc484e4/statemachine/pom.xml
----------------------------------------------------------------------
diff --git a/statemachine/pom.xml b/statemachine/pom.xml
index 2a94cc0..aa2e41c 100644
--- a/statemachine/pom.xml
+++ b/statemachine/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.50</version>
+        <version>0.8.1.51-SNAPSHOT</version>
     </parent>
 
     <name>State Machine</name>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/2dc484e4/timestamp-storage/pom.xml
----------------------------------------------------------------------
diff --git a/timestamp-storage/pom.xml b/timestamp-storage/pom.xml
index c7d02b3..4ba6b58 100644
--- a/timestamp-storage/pom.xml
+++ b/timestamp-storage/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.50</version>
+        <version>0.8.1.51-SNAPSHOT</version>
     </parent>
 
     <artifactId>timestamp-storage</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/2dc484e4/transaction-client/pom.xml
----------------------------------------------------------------------
diff --git a/transaction-client/pom.xml b/transaction-client/pom.xml
index 9275efc..107241d 100644
--- a/transaction-client/pom.xml
+++ b/transaction-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.50</version>
+        <version>0.8.1.51-SNAPSHOT</version>
     </parent>
 
     <artifactId>transaction-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/2dc484e4/tso-server/pom.xml
----------------------------------------------------------------------
diff --git a/tso-server/pom.xml b/tso-server/pom.xml
index a9fb59d..e023689 100644
--- a/tso-server/pom.xml
+++ b/tso-server/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.50</version>
+        <version>0.8.1.51-SNAPSHOT</version>
     </parent>
 
     <artifactId>tso-server</artifactId>


[39/50] [abbrv] incubator-omid git commit: Merge pull request #101 from yahoo/gh-ParallelExecutionExample

Posted by fp...@apache.org.
Merge pull request #101 from yahoo/gh-ParallelExecutionExample

Parallel execution example

Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/4e02a913
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/4e02a913
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/4e02a913

Branch: refs/heads/master
Commit: 4e02a913026bcd004ff6c12a498e97c18b8172f1
Parents: 41d2e23 e95a12f
Author: Francisco P�rez-Sorrosal <fp...@gmail.com>
Authored: Fri May 6 10:11:42 2016 -0700
Committer: Francisco P�rez-Sorrosal <fp...@gmail.com>
Committed: Fri May 6 10:11:42 2016 -0700

----------------------------------------------------------------------
 examples/pom.xml                                |   6 +
 examples/run.sh                                 |  11 +-
 .../apache/omid/examples/ParallelExecution.java |  94 ++++++++
 .../apache/omid/examples/RowIdGenerator.java    |  23 ++
 .../omid/examples/SnapshotIsolationExample.java | 215 +++++++++++--------
 pom.xml                                         |   2 +-
 6 files changed, 260 insertions(+), 91 deletions(-)
----------------------------------------------------------------------



[22/50] [abbrv] incubator-omid git commit: [ci skip]prepare release omid-0.8.1.46

Posted by fp...@apache.org.
[ci skip]prepare release omid-0.8.1.46


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

Branch: refs/heads/master
Commit: c4bd5dbd717fe5c757b8dc61f0b23196167c02d0
Parents: f63b34c
Author: Omid CI <om...@yahoo-inc.com>
Authored: Thu Apr 28 23:16:16 2016 +0000
Committer: Omid CI <om...@yahoo-inc.com>
Committed: Thu Apr 28 23:16:16 2016 +0000

----------------------------------------------------------------------
 benchmarks/pom.xml          | 2 +-
 codahale-metrics/pom.xml    | 2 +-
 commit-table/pom.xml        | 2 +-
 common/pom.xml              | 2 +-
 examples/pom.xml            | 2 +-
 hbase-client/pom.xml        | 2 +-
 hbase-commit-table/pom.xml  | 2 +-
 hbase-common/pom.xml        | 2 +-
 hbase-coprocessor/pom.xml   | 2 +-
 hbase-shims/hbase-0/pom.xml | 2 +-
 hbase-shims/hbase-1/pom.xml | 2 +-
 hbase-shims/pom.xml         | 2 +-
 hbase-tools/pom.xml         | 2 +-
 metrics/pom.xml             | 2 +-
 pom.xml                     | 4 ++--
 statemachine/pom.xml        | 2 +-
 timestamp-storage/pom.xml   | 2 +-
 transaction-client/pom.xml  | 2 +-
 tso-server/pom.xml          | 2 +-
 19 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c4bd5dbd/benchmarks/pom.xml
----------------------------------------------------------------------
diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml
index c33de3c..ce550a5 100644
--- a/benchmarks/pom.xml
+++ b/benchmarks/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.46-SNAPSHOT</version>
+        <version>0.8.1.46</version>
     </parent>
 
     <artifactId>benchmarks</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c4bd5dbd/codahale-metrics/pom.xml
----------------------------------------------------------------------
diff --git a/codahale-metrics/pom.xml b/codahale-metrics/pom.xml
index 97b139e..0dbf723 100644
--- a/codahale-metrics/pom.xml
+++ b/codahale-metrics/pom.xml
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.46-SNAPSHOT</version>
+        <version>0.8.1.46</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c4bd5dbd/commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/commit-table/pom.xml b/commit-table/pom.xml
index 9c49143..7904657 100644
--- a/commit-table/pom.xml
+++ b/commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.46-SNAPSHOT</version>
+        <version>0.8.1.46</version>
     </parent>
 
     <artifactId>commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c4bd5dbd/common/pom.xml
----------------------------------------------------------------------
diff --git a/common/pom.xml b/common/pom.xml
index c28e3da..9b77ec3 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.46-SNAPSHOT</version>
+        <version>0.8.1.46</version>
     </parent>
 
     <artifactId>common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c4bd5dbd/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 1ed519e..a7c3d58 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.46-SNAPSHOT</version>
+        <version>0.8.1.46</version>
     </parent>
 
     <artifactId>examples</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c4bd5dbd/hbase-client/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml
index 577d065..e69180d 100644
--- a/hbase-client/pom.xml
+++ b/hbase-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.46-SNAPSHOT</version>
+        <version>0.8.1.46</version>
     </parent>
 
     <artifactId>hbase-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c4bd5dbd/hbase-commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-commit-table/pom.xml b/hbase-commit-table/pom.xml
index 8bd684e..7c12bea 100644
--- a/hbase-commit-table/pom.xml
+++ b/hbase-commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.46-SNAPSHOT</version>
+        <version>0.8.1.46</version>
     </parent>
 
     <artifactId>hbase-commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c4bd5dbd/hbase-common/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml
index 4ed0424..fd836c8 100644
--- a/hbase-common/pom.xml
+++ b/hbase-common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.46-SNAPSHOT</version>
+        <version>0.8.1.46</version>
     </parent>
 
     <artifactId>hbase-common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c4bd5dbd/hbase-coprocessor/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-coprocessor/pom.xml b/hbase-coprocessor/pom.xml
index 9fbdc56..06373d0 100644
--- a/hbase-coprocessor/pom.xml
+++ b/hbase-coprocessor/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.46-SNAPSHOT</version>
+        <version>0.8.1.46</version>
     </parent>
 
     <artifactId>hbase-coprocessor</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c4bd5dbd/hbase-shims/hbase-0/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-0/pom.xml b/hbase-shims/hbase-0/pom.xml
index 76ba833..05ea0f6 100644
--- a/hbase-shims/hbase-0/pom.xml
+++ b/hbase-shims/hbase-0/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.46-SNAPSHOT</version>
+        <version>0.8.1.46</version>
     </parent>
 
     <artifactId>hbase0-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c4bd5dbd/hbase-shims/hbase-1/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-1/pom.xml b/hbase-shims/hbase-1/pom.xml
index 2a6b45e..92d5c68 100644
--- a/hbase-shims/hbase-1/pom.xml
+++ b/hbase-shims/hbase-1/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.46-SNAPSHOT</version>
+        <version>0.8.1.46</version>
     </parent>
 
     <artifactId>hbase1-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c4bd5dbd/hbase-shims/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/pom.xml b/hbase-shims/pom.xml
index f8e8594..9af547b 100644
--- a/hbase-shims/pom.xml
+++ b/hbase-shims/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.46-SNAPSHOT</version>
+        <version>0.8.1.46</version>
     </parent>
 
     <artifactId>omid-shims-aggregator</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c4bd5dbd/hbase-tools/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-tools/pom.xml b/hbase-tools/pom.xml
index 51a5dbe..1ccb388 100644
--- a/hbase-tools/pom.xml
+++ b/hbase-tools/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.46-SNAPSHOT</version>
+        <version>0.8.1.46</version>
     </parent>
 
     <artifactId>hbase-tools</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c4bd5dbd/metrics/pom.xml
----------------------------------------------------------------------
diff --git a/metrics/pom.xml b/metrics/pom.xml
index 5426f46..67cf31b 100644
--- a/metrics/pom.xml
+++ b/metrics/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.46-SNAPSHOT</version>
+        <version>0.8.1.46</version>
     </parent>
 
     <artifactId>metrics</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c4bd5dbd/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 8d24ce1..329540e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
     <artifactId>omid</artifactId>
     <packaging>pom</packaging>
     <!-- WARNING: do not update version manually, use mvn versions:set -->
-    <version>0.8.1.46-SNAPSHOT</version>
+    <version>0.8.1.46</version>
 
     <organization>
         <name>Apache Software Foundation</name>
@@ -105,7 +105,7 @@
         <connection>scm:git:git://github.com/yahoo/omid.git</connection>
         <developerConnection>scm:git:https://${GH_TOKEN}@github.com/yahoo/omid.git</developerConnection>
         <url>https://github.com/yahoo/omid</url>
-        <tag>master</tag>
+        <tag>omid-0.8.1.46</tag>
     </scm>
 
     <distributionManagement>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c4bd5dbd/statemachine/pom.xml
----------------------------------------------------------------------
diff --git a/statemachine/pom.xml b/statemachine/pom.xml
index 806d888..bc85330 100644
--- a/statemachine/pom.xml
+++ b/statemachine/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.46-SNAPSHOT</version>
+        <version>0.8.1.46</version>
     </parent>
 
     <name>State Machine</name>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c4bd5dbd/timestamp-storage/pom.xml
----------------------------------------------------------------------
diff --git a/timestamp-storage/pom.xml b/timestamp-storage/pom.xml
index 1f5409b..478b818 100644
--- a/timestamp-storage/pom.xml
+++ b/timestamp-storage/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.46-SNAPSHOT</version>
+        <version>0.8.1.46</version>
     </parent>
 
     <artifactId>timestamp-storage</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c4bd5dbd/transaction-client/pom.xml
----------------------------------------------------------------------
diff --git a/transaction-client/pom.xml b/transaction-client/pom.xml
index 7f1db0b..a818db5 100644
--- a/transaction-client/pom.xml
+++ b/transaction-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.46-SNAPSHOT</version>
+        <version>0.8.1.46</version>
     </parent>
 
     <artifactId>transaction-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c4bd5dbd/tso-server/pom.xml
----------------------------------------------------------------------
diff --git a/tso-server/pom.xml b/tso-server/pom.xml
index b3f317e..af27199 100644
--- a/tso-server/pom.xml
+++ b/tso-server/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.46-SNAPSHOT</version>
+        <version>0.8.1.46</version>
     </parent>
 
     <artifactId>tso-server</artifactId>


[34/50] [abbrv] incubator-omid git commit: Move from Batch to Persistence proc. the responsiblity of adding sendReplies to Reply proc.

Posted by fp...@apache.org.
Move from Batch to Persistence proc. the responsiblity of adding sendReplies to Reply proc.

Change-Id: I754f7189a166420652fcfec4fa4c1497212f8d7c


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

Branch: refs/heads/master
Commit: aa2651a0a866e60e49504d6b9b6d4b47062a1c5a
Parents: 1d60f21
Author: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Authored: Wed May 4 10:04:28 2016 -0700
Committer: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Committed: Wed May 4 10:04:28 2016 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/omid/tso/Batch.java    | 38 ++++++-------------
 .../omid/tso/PersistenceProcessorHandler.java   | 40 ++++++++++++++++----
 .../java/org/apache/omid/tso/TestBatch.java     |  8 ++--
 3 files changed, 48 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/aa2651a0/tso-server/src/main/java/org/apache/omid/tso/Batch.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/Batch.java b/tso-server/src/main/java/org/apache/omid/tso/Batch.java
index 2b17f23..b3b9eef 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/Batch.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/Batch.java
@@ -91,6 +91,18 @@ public class Batch {
 
     }
 
+    PersistEvent get(int idx) {
+        return events[idx];
+    }
+
+    void set(int idx, PersistEvent event) {
+        events[idx] = event;
+    }
+
+    void decreaseNumEvents() {
+        numEvents--;
+    }
+
     void addCommit(long startTimestamp, long commitTimestamp, Channel c, MonitoringContext context) {
         Preconditions.checkState(!isFull(), "batch is full");
         int index = numEvents++;
@@ -123,32 +135,6 @@ public class Batch {
 
     }
 
-    void sendReply(ReplyProcessor reply, RetryProcessor retryProc, long batchID) {
-
-        int i = 0;
-        while (i < numEvents) {
-            PersistEvent e = events[i];
-            if (e.getType() == Type.ABORT && e.isRetry()) {
-                retryProc.disambiguateRetryRequestHeuristically(e.getStartTimestamp(), e.getChannel(), e.getMonCtx());
-                PersistEvent tmp = events[i];
-                //TODO: why assign it?
-                events[i] = events[numEvents - 1];
-                events[numEvents - 1] = tmp;
-                if (numEvents == 1) {
-                    clear();
-                    reply.manageResponsesBatch(batchID, null);
-                    return;
-                }
-                numEvents--;
-                continue;
-            }
-            i++;
-        }
-
-        reply.manageResponsesBatch(batchID, this);
-
-    }
-
     @Override
     public String toString() {
         return Objects.toStringHelper(this)

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/aa2651a0/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java
index 84890b9..099cf88 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java
@@ -17,7 +17,6 @@
  */
 package org.apache.omid.tso;
 
-import com.lmax.disruptor.LifecycleAware;
 import com.lmax.disruptor.WorkHandler;
 import org.apache.omid.committable.CommitTable;
 import org.apache.omid.metrics.Histogram;
@@ -94,25 +93,24 @@ public class PersistenceProcessorHandler implements WorkHandler<PersistenceProce
                 throw new RuntimeException("Unknown event type: " + localEvent.getType().name());
             }
         }
-        flush(batch, event.getBatchSequence());
-
+        if (batch.getNumEvents() > 0) {
+            flush(batch.getNumEvents());
+            sendReplies(batch, event.getBatchSequence());
+        }
     }
 
-    private void flush(Batch batch, long batchSequence) {
+    private void flush(int numBatchedEvents) {
 
-        if (batch.getNumEvents() > 0) {
             commitSuicideIfNotMaster();
             try {
                 long startFlushTimeInNs = System.nanoTime();
                 writer.flush();
                 flushTimer.update(System.nanoTime() - startFlushTimeInNs);
-                batchSizeHistogram.update(batch.getNumEvents());
+                batchSizeHistogram.update(numBatchedEvents);
             } catch (IOException e) {
                 panicker.panic("Error persisting commit batch", e);
             }
             commitSuicideIfNotMaster(); // TODO Here, we can return the client responses before committing suicide
-            batch.sendReply(replyProcessor, retryProc, batchSequence);
-        }
 
     }
 
@@ -122,4 +120,30 @@ public class PersistenceProcessorHandler implements WorkHandler<PersistenceProce
         }
     }
 
+    private void sendReplies(Batch batch, long batchSequence) {
+
+        int i = 0;
+        while (i < batch.getNumEvents()) {
+            PersistEvent e = batch.get(i);
+            if (e.getType() == PersistEvent.Type.ABORT && e.isRetry()) {
+                retryProc.disambiguateRetryRequestHeuristically(e.getStartTimestamp(), e.getChannel(), e.getMonCtx());
+                PersistEvent tmp = batch.get(i);
+                //TODO: why assign it?
+                batch.set(i, batch.get(batch.getNumEvents() - 1));
+                batch.set(batch.getNumEvents()  - 1, tmp);
+                if (batch.getNumEvents()  == 1) {
+                    batch.clear();
+                    replyProcessor.manageResponsesBatch(batchSequence, null);
+                    return;
+                }
+                batch.decreaseNumEvents();
+                continue;
+            }
+            i++;
+        }
+
+        replyProcessor.manageResponsesBatch(batchSequence, batch);
+
+    }
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/aa2651a0/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java b/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
index c003f34..2b8b318 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
@@ -110,8 +110,8 @@ public class TestBatch {
 //        assertFalse(batch.isFull(), "Batch shouldn't be full");
 //        assertEquals(batch.getNumEvents(), 0, "Num events should be 0");
 //=======
-        batch.sendReply(replyProcessor, retryProcessor, (-1));
-        verify(replyProcessor, timeout(100).times(1)).manageResponsesBatch((-1), batch);
+//        batch.sendReply(replyProcessor, retryProcessor, (-1));
+        //verify(replyProcessor, timeout(100).times(1)).manageResponsesBatch((-1), batch);
         assertTrue(batch.isFull(), "Batch shouldn't be empty");
     }
 
@@ -135,8 +135,8 @@ public class TestBatch {
 
         // Test that sending replies empties the batch also when the replica  is NOT master and calls the
         // ambiguousCommitResponse() method on the reply processor
-        batch.sendReply(replyProcessor, retryProcessor, (-1));
-        verify(replyProcessor, timeout(100).times(1)).manageResponsesBatch((-1), batch);
+        //batch.sendReply(replyProcessor, retryProcessor, (-1));
+        //verify(replyProcessor, timeout(100).times(1)).manageResponsesBatch((-1), batch);
         assertTrue(batch.isFull(), "Batch should be full");
     }
 


[08/50] [abbrv] incubator-omid git commit: [ci skip]prepare for next development iteration

Posted by fp...@apache.org.
[ci skip]prepare for next development iteration


Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/10fea274
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/10fea274
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/10fea274

Branch: refs/heads/master
Commit: 10fea2747751359f3cd474e8a13eb9786457e5b8
Parents: 06e1dcd
Author: Omid CI <om...@yahoo-inc.com>
Authored: Mon Apr 25 19:11:42 2016 +0000
Committer: Omid CI <om...@yahoo-inc.com>
Committed: Mon Apr 25 19:11:42 2016 +0000

----------------------------------------------------------------------
 benchmarks/pom.xml          | 2 +-
 codahale-metrics/pom.xml    | 2 +-
 commit-table/pom.xml        | 2 +-
 common/pom.xml              | 2 +-
 examples/pom.xml            | 2 +-
 hbase-client/pom.xml        | 2 +-
 hbase-commit-table/pom.xml  | 2 +-
 hbase-common/pom.xml        | 2 +-
 hbase-coprocessor/pom.xml   | 2 +-
 hbase-shims/hbase-0/pom.xml | 2 +-
 hbase-shims/hbase-1/pom.xml | 2 +-
 hbase-shims/pom.xml         | 2 +-
 hbase-tools/pom.xml         | 2 +-
 metrics/pom.xml             | 2 +-
 pom.xml                     | 4 ++--
 statemachine/pom.xml        | 2 +-
 timestamp-storage/pom.xml   | 2 +-
 transaction-client/pom.xml  | 2 +-
 tso-server/pom.xml          | 2 +-
 19 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/10fea274/benchmarks/pom.xml
----------------------------------------------------------------------
diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml
index b24af5b..dd4859e 100644
--- a/benchmarks/pom.xml
+++ b/benchmarks/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.43</version>
+        <version>0.8.1.44-SNAPSHOT</version>
     </parent>
 
     <artifactId>benchmarks</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/10fea274/codahale-metrics/pom.xml
----------------------------------------------------------------------
diff --git a/codahale-metrics/pom.xml b/codahale-metrics/pom.xml
index 0c28fc6..348ab6c 100644
--- a/codahale-metrics/pom.xml
+++ b/codahale-metrics/pom.xml
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.43</version>
+        <version>0.8.1.44-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/10fea274/commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/commit-table/pom.xml b/commit-table/pom.xml
index 09003d6..9e6c74b 100644
--- a/commit-table/pom.xml
+++ b/commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.43</version>
+        <version>0.8.1.44-SNAPSHOT</version>
     </parent>
 
     <artifactId>commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/10fea274/common/pom.xml
----------------------------------------------------------------------
diff --git a/common/pom.xml b/common/pom.xml
index 99e8c9d..32a1cd5 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.43</version>
+        <version>0.8.1.44-SNAPSHOT</version>
     </parent>
 
     <artifactId>common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/10fea274/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index f50b467..6586d59 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.43</version>
+        <version>0.8.1.44-SNAPSHOT</version>
     </parent>
 
     <artifactId>examples</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/10fea274/hbase-client/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml
index 4a0f84c..69a9abd 100644
--- a/hbase-client/pom.xml
+++ b/hbase-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.43</version>
+        <version>0.8.1.44-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/10fea274/hbase-commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-commit-table/pom.xml b/hbase-commit-table/pom.xml
index c58e559..94ba5f9 100644
--- a/hbase-commit-table/pom.xml
+++ b/hbase-commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.43</version>
+        <version>0.8.1.44-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/10fea274/hbase-common/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml
index 5df849c..faed30c 100644
--- a/hbase-common/pom.xml
+++ b/hbase-common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.43</version>
+        <version>0.8.1.44-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/10fea274/hbase-coprocessor/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-coprocessor/pom.xml b/hbase-coprocessor/pom.xml
index e18659f..3182229 100644
--- a/hbase-coprocessor/pom.xml
+++ b/hbase-coprocessor/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.43</version>
+        <version>0.8.1.44-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-coprocessor</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/10fea274/hbase-shims/hbase-0/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-0/pom.xml b/hbase-shims/hbase-0/pom.xml
index e5438f9..c389516 100644
--- a/hbase-shims/hbase-0/pom.xml
+++ b/hbase-shims/hbase-0/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.43</version>
+        <version>0.8.1.44-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase0-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/10fea274/hbase-shims/hbase-1/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-1/pom.xml b/hbase-shims/hbase-1/pom.xml
index 48d1aee..ad92212 100644
--- a/hbase-shims/hbase-1/pom.xml
+++ b/hbase-shims/hbase-1/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.43</version>
+        <version>0.8.1.44-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase1-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/10fea274/hbase-shims/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/pom.xml b/hbase-shims/pom.xml
index cbf5d4c..8f847a3 100644
--- a/hbase-shims/pom.xml
+++ b/hbase-shims/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.43</version>
+        <version>0.8.1.44-SNAPSHOT</version>
     </parent>
 
     <artifactId>omid-shims-aggregator</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/10fea274/hbase-tools/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-tools/pom.xml b/hbase-tools/pom.xml
index 066606c..4a52974 100644
--- a/hbase-tools/pom.xml
+++ b/hbase-tools/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.43</version>
+        <version>0.8.1.44-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-tools</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/10fea274/metrics/pom.xml
----------------------------------------------------------------------
diff --git a/metrics/pom.xml b/metrics/pom.xml
index e0205b9..4453fed 100644
--- a/metrics/pom.xml
+++ b/metrics/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.43</version>
+        <version>0.8.1.44-SNAPSHOT</version>
     </parent>
 
     <artifactId>metrics</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/10fea274/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index a7eda12..dafba98 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
     <artifactId>omid</artifactId>
     <packaging>pom</packaging>
     <!-- WARNING: do not update version manually, use mvn versions:set -->
-    <version>0.8.1.43</version>
+    <version>0.8.1.44-SNAPSHOT</version>
 
     <organization>
         <name>Apache Software Foundation</name>
@@ -105,7 +105,7 @@
         <connection>scm:git:git://github.com/yahoo/omid.git</connection>
         <developerConnection>scm:git:https://${GH_TOKEN}@github.com/yahoo/omid.git</developerConnection>
         <url>https://github.com/yahoo/omid</url>
-        <tag>omid-0.8.1.43</tag>
+        <tag>master</tag>
     </scm>
 
     <distributionManagement>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/10fea274/statemachine/pom.xml
----------------------------------------------------------------------
diff --git a/statemachine/pom.xml b/statemachine/pom.xml
index 3ce4de2..45fdf7c 100644
--- a/statemachine/pom.xml
+++ b/statemachine/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.43</version>
+        <version>0.8.1.44-SNAPSHOT</version>
     </parent>
 
     <name>State Machine</name>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/10fea274/timestamp-storage/pom.xml
----------------------------------------------------------------------
diff --git a/timestamp-storage/pom.xml b/timestamp-storage/pom.xml
index 71b452b..56b29fc 100644
--- a/timestamp-storage/pom.xml
+++ b/timestamp-storage/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.43</version>
+        <version>0.8.1.44-SNAPSHOT</version>
     </parent>
 
     <artifactId>timestamp-storage</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/10fea274/transaction-client/pom.xml
----------------------------------------------------------------------
diff --git a/transaction-client/pom.xml b/transaction-client/pom.xml
index e1a2e70..606ec74 100644
--- a/transaction-client/pom.xml
+++ b/transaction-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.43</version>
+        <version>0.8.1.44-SNAPSHOT</version>
     </parent>
 
     <artifactId>transaction-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/10fea274/tso-server/pom.xml
----------------------------------------------------------------------
diff --git a/tso-server/pom.xml b/tso-server/pom.xml
index e239c11..c6497ab 100644
--- a/tso-server/pom.xml
+++ b/tso-server/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.43</version>
+        <version>0.8.1.44-SNAPSHOT</version>
     </parent>
 
     <artifactId>tso-server</artifactId>


[26/50] [abbrv] incubator-omid git commit: [ci skip]prepare release omid-0.8.1.47

Posted by fp...@apache.org.
[ci skip]prepare release omid-0.8.1.47


Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/6422981d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/6422981d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/6422981d

Branch: refs/heads/master
Commit: 6422981dcfcc08345e2bd0a2933861e986c628f1
Parents: dcd9db8
Author: Omid CI <om...@yahoo-inc.com>
Authored: Fri Apr 29 00:24:02 2016 +0000
Committer: Omid CI <om...@yahoo-inc.com>
Committed: Fri Apr 29 00:24:02 2016 +0000

----------------------------------------------------------------------
 benchmarks/pom.xml          | 2 +-
 codahale-metrics/pom.xml    | 2 +-
 commit-table/pom.xml        | 2 +-
 common/pom.xml              | 2 +-
 examples/pom.xml            | 2 +-
 hbase-client/pom.xml        | 2 +-
 hbase-commit-table/pom.xml  | 2 +-
 hbase-common/pom.xml        | 2 +-
 hbase-coprocessor/pom.xml   | 2 +-
 hbase-shims/hbase-0/pom.xml | 2 +-
 hbase-shims/hbase-1/pom.xml | 2 +-
 hbase-shims/pom.xml         | 2 +-
 hbase-tools/pom.xml         | 2 +-
 metrics/pom.xml             | 2 +-
 pom.xml                     | 4 ++--
 statemachine/pom.xml        | 2 +-
 timestamp-storage/pom.xml   | 2 +-
 transaction-client/pom.xml  | 2 +-
 tso-server/pom.xml          | 2 +-
 19 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6422981d/benchmarks/pom.xml
----------------------------------------------------------------------
diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml
index fa34b12..fccea84 100644
--- a/benchmarks/pom.xml
+++ b/benchmarks/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.47-SNAPSHOT</version>
+        <version>0.8.1.47</version>
     </parent>
 
     <artifactId>benchmarks</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6422981d/codahale-metrics/pom.xml
----------------------------------------------------------------------
diff --git a/codahale-metrics/pom.xml b/codahale-metrics/pom.xml
index b5e9b8f..4ad45e6 100644
--- a/codahale-metrics/pom.xml
+++ b/codahale-metrics/pom.xml
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.47-SNAPSHOT</version>
+        <version>0.8.1.47</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6422981d/commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/commit-table/pom.xml b/commit-table/pom.xml
index a1f7394..fa670d3 100644
--- a/commit-table/pom.xml
+++ b/commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.47-SNAPSHOT</version>
+        <version>0.8.1.47</version>
     </parent>
 
     <artifactId>commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6422981d/common/pom.xml
----------------------------------------------------------------------
diff --git a/common/pom.xml b/common/pom.xml
index 0ae1910..095513b 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.47-SNAPSHOT</version>
+        <version>0.8.1.47</version>
     </parent>
 
     <artifactId>common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6422981d/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index eb27b2e..8738e00 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.47-SNAPSHOT</version>
+        <version>0.8.1.47</version>
     </parent>
 
     <artifactId>examples</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6422981d/hbase-client/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml
index 96c9ba1..34acce4 100644
--- a/hbase-client/pom.xml
+++ b/hbase-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.47-SNAPSHOT</version>
+        <version>0.8.1.47</version>
     </parent>
 
     <artifactId>hbase-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6422981d/hbase-commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-commit-table/pom.xml b/hbase-commit-table/pom.xml
index 4f80486..b3184dc 100644
--- a/hbase-commit-table/pom.xml
+++ b/hbase-commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.47-SNAPSHOT</version>
+        <version>0.8.1.47</version>
     </parent>
 
     <artifactId>hbase-commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6422981d/hbase-common/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml
index b32f89d..2a75d5e 100644
--- a/hbase-common/pom.xml
+++ b/hbase-common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.47-SNAPSHOT</version>
+        <version>0.8.1.47</version>
     </parent>
 
     <artifactId>hbase-common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6422981d/hbase-coprocessor/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-coprocessor/pom.xml b/hbase-coprocessor/pom.xml
index 66f8e37..746a6bf 100644
--- a/hbase-coprocessor/pom.xml
+++ b/hbase-coprocessor/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.47-SNAPSHOT</version>
+        <version>0.8.1.47</version>
     </parent>
 
     <artifactId>hbase-coprocessor</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6422981d/hbase-shims/hbase-0/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-0/pom.xml b/hbase-shims/hbase-0/pom.xml
index 333aa10..dccd50e 100644
--- a/hbase-shims/hbase-0/pom.xml
+++ b/hbase-shims/hbase-0/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.47-SNAPSHOT</version>
+        <version>0.8.1.47</version>
     </parent>
 
     <artifactId>hbase0-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6422981d/hbase-shims/hbase-1/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-1/pom.xml b/hbase-shims/hbase-1/pom.xml
index e920c1d..5be4045 100644
--- a/hbase-shims/hbase-1/pom.xml
+++ b/hbase-shims/hbase-1/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.47-SNAPSHOT</version>
+        <version>0.8.1.47</version>
     </parent>
 
     <artifactId>hbase1-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6422981d/hbase-shims/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/pom.xml b/hbase-shims/pom.xml
index 9d9bfa7..a4d2572 100644
--- a/hbase-shims/pom.xml
+++ b/hbase-shims/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.47-SNAPSHOT</version>
+        <version>0.8.1.47</version>
     </parent>
 
     <artifactId>omid-shims-aggregator</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6422981d/hbase-tools/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-tools/pom.xml b/hbase-tools/pom.xml
index 0359a4a..0ae2841 100644
--- a/hbase-tools/pom.xml
+++ b/hbase-tools/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.47-SNAPSHOT</version>
+        <version>0.8.1.47</version>
     </parent>
 
     <artifactId>hbase-tools</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6422981d/metrics/pom.xml
----------------------------------------------------------------------
diff --git a/metrics/pom.xml b/metrics/pom.xml
index 6d62a8e..5896689 100644
--- a/metrics/pom.xml
+++ b/metrics/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.47-SNAPSHOT</version>
+        <version>0.8.1.47</version>
     </parent>
 
     <artifactId>metrics</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6422981d/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index fbf0a1b..e61d15c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
     <artifactId>omid</artifactId>
     <packaging>pom</packaging>
     <!-- WARNING: do not update version manually, use mvn versions:set -->
-    <version>0.8.1.47-SNAPSHOT</version>
+    <version>0.8.1.47</version>
 
     <organization>
         <name>Apache Software Foundation</name>
@@ -105,7 +105,7 @@
         <connection>scm:git:git://github.com/yahoo/omid.git</connection>
         <developerConnection>scm:git:https://${GH_TOKEN}@github.com/yahoo/omid.git</developerConnection>
         <url>https://github.com/yahoo/omid</url>
-        <tag>master</tag>
+        <tag>omid-0.8.1.47</tag>
     </scm>
 
     <distributionManagement>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6422981d/statemachine/pom.xml
----------------------------------------------------------------------
diff --git a/statemachine/pom.xml b/statemachine/pom.xml
index 2057355..b140eac 100644
--- a/statemachine/pom.xml
+++ b/statemachine/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.47-SNAPSHOT</version>
+        <version>0.8.1.47</version>
     </parent>
 
     <name>State Machine</name>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6422981d/timestamp-storage/pom.xml
----------------------------------------------------------------------
diff --git a/timestamp-storage/pom.xml b/timestamp-storage/pom.xml
index b0a2948..4633585 100644
--- a/timestamp-storage/pom.xml
+++ b/timestamp-storage/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.47-SNAPSHOT</version>
+        <version>0.8.1.47</version>
     </parent>
 
     <artifactId>timestamp-storage</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6422981d/transaction-client/pom.xml
----------------------------------------------------------------------
diff --git a/transaction-client/pom.xml b/transaction-client/pom.xml
index 65655ae..4e52a92 100644
--- a/transaction-client/pom.xml
+++ b/transaction-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.47-SNAPSHOT</version>
+        <version>0.8.1.47</version>
     </parent>
 
     <artifactId>transaction-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6422981d/tso-server/pom.xml
----------------------------------------------------------------------
diff --git a/tso-server/pom.xml b/tso-server/pom.xml
index 1d25f85..b328c26 100644
--- a/tso-server/pom.xml
+++ b/tso-server/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.47-SNAPSHOT</version>
+        <version>0.8.1.47</version>
     </parent>
 
     <artifactId>tso-server</artifactId>


[02/50] [abbrv] incubator-omid git commit: [ci skip]prepare for next development iteration

Posted by fp...@apache.org.
[ci skip]prepare for next development iteration


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

Branch: refs/heads/master
Commit: fd3eeff46b339983b077f278082d497024978346
Parents: da54c4b
Author: Omid CI <om...@yahoo-inc.com>
Authored: Thu Apr 21 19:46:29 2016 +0000
Committer: Omid CI <om...@yahoo-inc.com>
Committed: Thu Apr 21 19:46:29 2016 +0000

----------------------------------------------------------------------
 benchmarks/pom.xml          | 2 +-
 codahale-metrics/pom.xml    | 2 +-
 commit-table/pom.xml        | 2 +-
 common/pom.xml              | 2 +-
 examples/pom.xml            | 2 +-
 hbase-client/pom.xml        | 2 +-
 hbase-commit-table/pom.xml  | 2 +-
 hbase-common/pom.xml        | 2 +-
 hbase-coprocessor/pom.xml   | 2 +-
 hbase-shims/hbase-0/pom.xml | 2 +-
 hbase-shims/hbase-1/pom.xml | 2 +-
 hbase-shims/pom.xml         | 2 +-
 hbase-tools/pom.xml         | 2 +-
 metrics/pom.xml             | 2 +-
 pom.xml                     | 4 ++--
 statemachine/pom.xml        | 2 +-
 timestamp-storage/pom.xml   | 2 +-
 transaction-client/pom.xml  | 2 +-
 tso-server/pom.xml          | 2 +-
 19 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/fd3eeff4/benchmarks/pom.xml
----------------------------------------------------------------------
diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml
index f5e1ec6..9469cde 100644
--- a/benchmarks/pom.xml
+++ b/benchmarks/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.41</version>
+        <version>0.8.1.42-SNAPSHOT</version>
     </parent>
 
     <artifactId>benchmarks</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/fd3eeff4/codahale-metrics/pom.xml
----------------------------------------------------------------------
diff --git a/codahale-metrics/pom.xml b/codahale-metrics/pom.xml
index de537db..8d1eafa 100644
--- a/codahale-metrics/pom.xml
+++ b/codahale-metrics/pom.xml
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.41</version>
+        <version>0.8.1.42-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/fd3eeff4/commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/commit-table/pom.xml b/commit-table/pom.xml
index 6d9e632..a81d994 100644
--- a/commit-table/pom.xml
+++ b/commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.41</version>
+        <version>0.8.1.42-SNAPSHOT</version>
     </parent>
 
     <artifactId>commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/fd3eeff4/common/pom.xml
----------------------------------------------------------------------
diff --git a/common/pom.xml b/common/pom.xml
index 667b9f5..8a8dbb2 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.41</version>
+        <version>0.8.1.42-SNAPSHOT</version>
     </parent>
 
     <artifactId>common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/fd3eeff4/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 3eb13cb..bcbac02 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.41</version>
+        <version>0.8.1.42-SNAPSHOT</version>
     </parent>
 
     <artifactId>examples</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/fd3eeff4/hbase-client/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml
index 4333708..655e028 100644
--- a/hbase-client/pom.xml
+++ b/hbase-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.41</version>
+        <version>0.8.1.42-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/fd3eeff4/hbase-commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-commit-table/pom.xml b/hbase-commit-table/pom.xml
index 4837fb5..d565bd9 100644
--- a/hbase-commit-table/pom.xml
+++ b/hbase-commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.41</version>
+        <version>0.8.1.42-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/fd3eeff4/hbase-common/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml
index 20884d7..debfee5 100644
--- a/hbase-common/pom.xml
+++ b/hbase-common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.41</version>
+        <version>0.8.1.42-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/fd3eeff4/hbase-coprocessor/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-coprocessor/pom.xml b/hbase-coprocessor/pom.xml
index 7db44e4..1cbd5a8 100644
--- a/hbase-coprocessor/pom.xml
+++ b/hbase-coprocessor/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.41</version>
+        <version>0.8.1.42-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-coprocessor</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/fd3eeff4/hbase-shims/hbase-0/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-0/pom.xml b/hbase-shims/hbase-0/pom.xml
index 8f07022..4f6e925 100644
--- a/hbase-shims/hbase-0/pom.xml
+++ b/hbase-shims/hbase-0/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.41</version>
+        <version>0.8.1.42-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase0-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/fd3eeff4/hbase-shims/hbase-1/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-1/pom.xml b/hbase-shims/hbase-1/pom.xml
index c7cee69..b9958a4 100644
--- a/hbase-shims/hbase-1/pom.xml
+++ b/hbase-shims/hbase-1/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.41</version>
+        <version>0.8.1.42-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase1-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/fd3eeff4/hbase-shims/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/pom.xml b/hbase-shims/pom.xml
index fcd32f8..d72aba0 100644
--- a/hbase-shims/pom.xml
+++ b/hbase-shims/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.41</version>
+        <version>0.8.1.42-SNAPSHOT</version>
     </parent>
 
     <artifactId>omid-shims-aggregator</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/fd3eeff4/hbase-tools/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-tools/pom.xml b/hbase-tools/pom.xml
index a57e6b6..33929e4 100644
--- a/hbase-tools/pom.xml
+++ b/hbase-tools/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.41</version>
+        <version>0.8.1.42-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-tools</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/fd3eeff4/metrics/pom.xml
----------------------------------------------------------------------
diff --git a/metrics/pom.xml b/metrics/pom.xml
index 0dd825e..d9b38eb 100644
--- a/metrics/pom.xml
+++ b/metrics/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.41</version>
+        <version>0.8.1.42-SNAPSHOT</version>
     </parent>
 
     <artifactId>metrics</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/fd3eeff4/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index d147f4b..980b4a9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
     <artifactId>omid</artifactId>
     <packaging>pom</packaging>
     <!-- WARNING: do not update version manually, use mvn versions:set -->
-    <version>0.8.1.41</version>
+    <version>0.8.1.42-SNAPSHOT</version>
 
     <organization>
         <name>Apache Software Foundation</name>
@@ -105,7 +105,7 @@
         <connection>scm:git:git://github.com/yahoo/omid.git</connection>
         <developerConnection>scm:git:https://${GH_TOKEN}@github.com/yahoo/omid.git</developerConnection>
         <url>https://github.com/yahoo/omid</url>
-        <tag>omid-0.8.1.41</tag>
+        <tag>master</tag>
     </scm>
 
     <distributionManagement>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/fd3eeff4/statemachine/pom.xml
----------------------------------------------------------------------
diff --git a/statemachine/pom.xml b/statemachine/pom.xml
index 01c55ee..4791230 100644
--- a/statemachine/pom.xml
+++ b/statemachine/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.41</version>
+        <version>0.8.1.42-SNAPSHOT</version>
     </parent>
 
     <name>State Machine</name>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/fd3eeff4/timestamp-storage/pom.xml
----------------------------------------------------------------------
diff --git a/timestamp-storage/pom.xml b/timestamp-storage/pom.xml
index 0f7d8cd..ca101b9 100644
--- a/timestamp-storage/pom.xml
+++ b/timestamp-storage/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.41</version>
+        <version>0.8.1.42-SNAPSHOT</version>
     </parent>
 
     <artifactId>timestamp-storage</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/fd3eeff4/transaction-client/pom.xml
----------------------------------------------------------------------
diff --git a/transaction-client/pom.xml b/transaction-client/pom.xml
index 97d343a..97ac14b 100644
--- a/transaction-client/pom.xml
+++ b/transaction-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.41</version>
+        <version>0.8.1.42-SNAPSHOT</version>
     </parent>
 
     <artifactId>transaction-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/fd3eeff4/tso-server/pom.xml
----------------------------------------------------------------------
diff --git a/tso-server/pom.xml b/tso-server/pom.xml
index 04e92ce..7a19793 100644
--- a/tso-server/pom.xml
+++ b/tso-server/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.41</version>
+        <version>0.8.1.42-SNAPSHOT</version>
     </parent>
 
     <artifactId>tso-server</artifactId>


[47/50] [abbrv] incubator-omid git commit: Persist LWM directly without batching it

Posted by fp...@apache.org.
Persist LWM directly without batching it

This simplifies the batch creation as we don't need a special bucket
for the low watermark anymore. It also simplifies the treatment of the
low watermark in the processors.

Change-Id: Ie86d92dcba5418647b3803c72cadf60cd2e5e6a9


Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/5b27a074
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/5b27a074
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/5b27a074

Branch: refs/heads/master
Commit: 5b27a0740dbd2752872ebd516cdddb0ca73d5e4b
Parents: 1e74863
Author: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Authored: Tue May 10 17:58:17 2016 -0700
Committer: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Committed: Tue May 10 20:06:16 2016 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/omid/tso/Batch.java    | 17 +----
 .../org/apache/omid/tso/BatchPoolModule.java    |  4 +-
 .../java/org/apache/omid/tso/PersistEvent.java  | 10 +--
 .../apache/omid/tso/PersistenceProcessor.java   |  6 +-
 .../omid/tso/PersistenceProcessorHandler.java   |  3 -
 .../omid/tso/PersistenceProcessorImpl.java      | 56 ++++++++++----
 .../org/apache/omid/tso/ReplyProcessorImpl.java |  3 -
 .../apache/omid/tso/RequestProcessorImpl.java   |  6 +-
 .../java/org/apache/omid/tso/TestBatch.java     | 18 +----
 .../java/org/apache/omid/tso/TestPanicker.java  |  8 +-
 .../omid/tso/TestPersistenceProcessor.java      | 79 ++++++++++++++------
 .../apache/omid/tso/TestRequestProcessor.java   | 13 +++-
 ...stTSOClientRequestAndResponseBehaviours.java | 24 ++----
 13 files changed, 137 insertions(+), 110 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5b27a074/tso-server/src/main/java/org/apache/omid/tso/Batch.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/Batch.java b/tso-server/src/main/java/org/apache/omid/tso/Batch.java
index a36d2a7..c5ed696 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/Batch.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/Batch.java
@@ -64,13 +64,6 @@ public class Batch {
 
     }
 
-    boolean isLastEntryEmpty() {
-
-        Preconditions.checkState(numEvents <= size, "numEvents > size");
-        return numEvents == (size - 1);
-
-    }
-
     int getNumEvents() {
         return numEvents;
     }
@@ -82,7 +75,7 @@ public class Batch {
     }
 
     PersistEvent get(int idx) {
-        Preconditions.checkState(numEvents > 0  && 0 <= idx && idx < numEvents);
+        Preconditions.checkState(numEvents > 0 && 0 <= idx && idx < numEvents);
         return events[idx];
     }
 
@@ -119,14 +112,6 @@ public class Batch {
 
     }
 
-    void addLowWatermark(long lowWatermark, MonitoringContext context) {
-        Preconditions.checkState(!isFull(), "batch is full");
-        int index = numEvents++;
-        PersistEvent e = events[index];
-        e.makePersistLowWatermark(lowWatermark, context);
-
-    }
-
     @Override
     public String toString() {
         return Objects.toStringHelper(this)

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5b27a074/tso-server/src/main/java/org/apache/omid/tso/BatchPoolModule.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/BatchPoolModule.java b/tso-server/src/main/java/org/apache/omid/tso/BatchPoolModule.java
index 96e8717..c28f3aa 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/BatchPoolModule.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/BatchPoolModule.java
@@ -48,9 +48,9 @@ public class BatchPoolModule extends AbstractModule {
     ObjectPool<Batch> getBatchPool() throws Exception {
 
         int poolSize = config.getNumConcurrentCTWriters();
-        int batchSize = config.getBatchSizePerCTWriter() + 1; // Add 1 element to batch size for storing LWM
+        int batchSize = config.getBatchSizePerCTWriter();
 
-        LOG.info("Pool Size (# of Batches) {}; Batch Size {} (including LWM bucket)", poolSize, batchSize);
+        LOG.info("Pool Size (# of Batches) {}; Batch Size {}", poolSize, batchSize);
         LOG.info("Total Batch Size (Pool size * Batch Size): {}", poolSize * batchSize);
         GenericObjectPoolConfig config = new GenericObjectPoolConfig();
         config.setMaxTotal(poolSize);

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5b27a074/tso-server/src/main/java/org/apache/omid/tso/PersistEvent.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/PersistEvent.java b/tso-server/src/main/java/org/apache/omid/tso/PersistEvent.java
index 32820f6..8d4fd85 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/PersistEvent.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/PersistEvent.java
@@ -25,7 +25,7 @@ public final class PersistEvent {
     private MonitoringContext monCtx;
 
     enum Type {
-        TIMESTAMP, COMMIT, ABORT, LOW_WATERMARK
+        TIMESTAMP, COMMIT, ABORT
     }
 
     private Type type = null;
@@ -65,14 +65,6 @@ public final class PersistEvent {
 
     }
 
-    void makePersistLowWatermark(long lowWatermark, MonitoringContext monCtx) {
-
-        this.type = Type.LOW_WATERMARK;
-        this.lowWatermark = lowWatermark;
-        this.monCtx = monCtx;
-
-    }
-
     MonitoringContext getMonCtx() {
 
         return monCtx;

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5b27a074/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessor.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessor.java b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessor.java
index 9467c13..f4e4a51 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessor.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessor.java
@@ -19,6 +19,8 @@ package org.apache.omid.tso;
 
 import org.jboss.netty.channel.Channel;
 
+import java.util.concurrent.Future;
+
 interface PersistenceProcessor {
 
     void addCommitToBatch(long startTimestamp, long commitTimestamp, Channel c, MonitoringContext monCtx)
@@ -28,8 +30,8 @@ interface PersistenceProcessor {
 
     void addTimestampToBatch(long startTimestamp, Channel c, MonitoringContext monCtx) throws Exception;
 
-    void addLowWatermarkToBatch(long lowWatermark, MonitoringContext monCtx);
-
     void triggerCurrentBatchFlush() throws Exception;
 
+    Future<Void> persistLowWatermark(long lowWatermark);
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5b27a074/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java
index 7e84539..cf7557a 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java
@@ -86,9 +86,6 @@ public class PersistenceProcessorHandler implements WorkHandler<PersistenceProce
             case TIMESTAMP:
                 localEvent.getMonCtx().timerStart("timestampPersistProcessor");
                 break;
-            case LOW_WATERMARK:
-                writer.updateLowWatermark(localEvent.getLowWatermark());
-                break;
             default:
                 throw new RuntimeException("Unknown event type: " + localEvent.getType().name());
             }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5b27a074/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java
index b78ad1a..761d30b 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java
@@ -25,14 +25,21 @@ import com.lmax.disruptor.EventFactory;
 import com.lmax.disruptor.RingBuffer;
 import com.lmax.disruptor.WorkerPool;
 import org.apache.commons.pool2.ObjectPool;
+import org.apache.omid.committable.CommitTable;
+import org.apache.omid.metrics.MetricsRegistry;
+import org.apache.omid.metrics.Timer;
 import org.jboss.netty.channel.Channel;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import javax.inject.Inject;
+import java.io.IOException;
+import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
 
+import static org.apache.omid.metrics.MetricsUtils.name;
 import static org.apache.omid.tso.PersistenceProcessorImpl.PersistBatchEvent.EVENT_FACTORY;
 import static org.apache.omid.tso.PersistenceProcessorImpl.PersistBatchEvent.makePersistBatch;
 
@@ -50,21 +57,32 @@ class PersistenceProcessorImpl implements PersistenceProcessor {
 
     // TODO Next two need to be either int or AtomicLong
     volatile private long batchSequence;
-    volatile private long lowWatermark = INITIAL_LWM_VALUE;
 
-    private MonitoringContext lowWatermarkContext;
+    private CommitTable.Writer lowWatermarkWriter;
+    private ExecutorService lowWatermarkWriterExecutor;
+
+    private MetricsRegistry metrics;
+    private final Timer lwmWriteTimer;
 
     @Inject
     PersistenceProcessorImpl(TSOServerConfig config,
+                             CommitTable commitTable,
                              ObjectPool<Batch> batchPool,
                              Panicker panicker,
-                             PersistenceProcessorHandler[] handlers)
+                             PersistenceProcessorHandler[] handlers,
+                             MetricsRegistry metrics)
             throws Exception {
 
+        this.metrics = metrics;
+        this.lowWatermarkWriter = commitTable.getWriter();
         this.batchSequence = 0L;
         this.batchPool = batchPool;
         this.currentBatch = batchPool.borrowObject();
 
+        // Low Watermark writer
+        ThreadFactoryBuilder lwmThreadFactory = new ThreadFactoryBuilder().setNameFormat("lwm-writer-%d");
+        lowWatermarkWriterExecutor = Executors.newSingleThreadExecutor(lwmThreadFactory.build());
+
         // Disruptor configuration
         this.persistRing = RingBuffer.createSingleProducer(EVENT_FACTORY, 1 << 20, new BusySpinWaitStrategy());
 
@@ -79,6 +97,9 @@ class PersistenceProcessorImpl implements PersistenceProcessor {
         this.persistRing.addGatingSequences(persistProcessor.getWorkerSequences());
         persistProcessor.start(requestExec);
 
+        // Metrics config
+        this.lwmWriteTimer = metrics.timer(name("tso", "lwmWriter", "latency"));
+
     }
 
     @Override
@@ -87,7 +108,6 @@ class PersistenceProcessorImpl implements PersistenceProcessor {
         if (currentBatch.isEmpty()) {
             return;
         }
-        currentBatch.addLowWatermark(this.lowWatermark, this.lowWatermarkContext);
         long seq = persistRing.next();
         PersistBatchEvent e = persistRing.get(seq);
         makePersistBatch(e, batchSequence++, currentBatch);
@@ -101,7 +121,7 @@ class PersistenceProcessorImpl implements PersistenceProcessor {
             throws Exception {
 
         currentBatch.addCommit(startTimestamp, commitTimestamp, c, monCtx);
-        if (currentBatch.isLastEntryEmpty()) {
+        if (currentBatch.isFull()) {
             triggerCurrentBatchFlush();
         }
 
@@ -112,28 +132,38 @@ class PersistenceProcessorImpl implements PersistenceProcessor {
             throws Exception {
 
         currentBatch.addAbort(startTimestamp, isRetry, c, context);
-        if (currentBatch.isLastEntryEmpty()) {
+        if (currentBatch.isFull()) {
             triggerCurrentBatchFlush();
         }
 
     }
 
     @Override
-    public void addTimestampToBatch(long startTimestamp, Channel c, MonitoringContext context)
-            throws Exception {
+    public void addTimestampToBatch(long startTimestamp, Channel c, MonitoringContext context) throws Exception {
 
         currentBatch.addTimestamp(startTimestamp, c, context);
-        if (currentBatch.isLastEntryEmpty()) {
+        if (currentBatch.isFull()) {
             triggerCurrentBatchFlush();
         }
 
     }
 
     @Override
-    public void addLowWatermarkToBatch(long lowWatermark, MonitoringContext context) {
-
-        this.lowWatermark = lowWatermark;
-        this.lowWatermarkContext = context;
+    public Future<Void> persistLowWatermark(final long lowWatermark) {
+
+        return lowWatermarkWriterExecutor.submit(new Callable<Void>() {
+            @Override
+            public Void call() throws IOException {
+                try {
+                    lwmWriteTimer.start();
+                    lowWatermarkWriter.updateLowWatermark(lowWatermark);
+                    lowWatermarkWriter.flush();
+                } finally {
+                    lwmWriteTimer.stop();
+                }
+                return null;
+            }
+        });
 
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5b27a074/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java b/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java
index a4e2ce1..c1709ef 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java
@@ -116,9 +116,6 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyBatchEv
                 sendTimestampResponse(localEvent.getStartTimestamp(), localEvent.getChannel());
                 localEvent.getMonCtx().timerStop(name);
                 break;
-            // TODO Check if we still need this
-            case LOW_WATERMARK:
-                break;
             default:
                 LOG.error("Unknown event {}", localEvent.getType());
                 break;

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5b27a074/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java b/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java
index 12f8326..4e17850 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java
@@ -38,6 +38,7 @@ import java.util.Iterator;
 import java.util.NoSuchElementException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 
 class RequestProcessorImpl implements EventHandler<RequestProcessorImpl.RequestEvent>, RequestProcessor, TimeoutHandler {
@@ -91,8 +92,7 @@ class RequestProcessorImpl implements EventHandler<RequestProcessorImpl.RequestE
     public void update(TSOState state) throws Exception {
         LOG.info("Initializing RequestProcessor...");
         this.lowWatermark = state.getLowWatermark();
-        persistProc.addLowWatermarkToBatch(lowWatermark, new MonitoringContext(metrics));
-        persistProc.triggerCurrentBatchFlush();
+        persistProc.persistLowWatermark(lowWatermark).get(); // Sync persist
         LOG.info("RequestProcessor initialized with LWMs {} and Epoch {}", lowWatermark, state.getEpoch());
     }
 
@@ -210,7 +210,7 @@ class RequestProcessorImpl implements EventHandler<RequestProcessorImpl.RequestE
                     if (newLowWatermark != lowWatermark) {
                         LOG.trace("Setting new low Watermark to {}", newLowWatermark);
                         lowWatermark = newLowWatermark;
-                        persistProc.addLowWatermarkToBatch(newLowWatermark, event.getMonCtx());
+                        persistProc.persistLowWatermark(newLowWatermark); // Async persist
                     }
                 }
                 persistProc.addCommitToBatch(startTimestamp, commitTimestamp, c, event.getMonCtx());

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5b27a074/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java b/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
index 45fa639..c472606 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
@@ -38,9 +38,6 @@ public class TestBatch {
     private static final long ANY_ST = 1231;
     private static final long ANY_CT = 2241;
 
-    private static final int DUMMY_LWM = 212;
-    private static final int NEW_LWM = 123;
-
     @Mock
     private Channel channel;
     @Mock
@@ -72,7 +69,7 @@ public class TestBatch {
         }
 
         // Test when filling the batch with different types of events, that becomes full
-        for (int i = 0; i < (BATCH_SIZE - 1); i++) {
+        for (int i = 0; i < BATCH_SIZE; i++) {
             if (i % 3 == 0) {
                 batch.addTimestamp(ANY_ST, channel, monCtx);
             } else if (i % 3 == 1) {
@@ -81,8 +78,6 @@ public class TestBatch {
                 batch.addAbort(ANY_ST, false, channel, monCtx);
             }
         }
-        assertTrue(batch.isLastEntryEmpty(), "Should be only one entry left in the batch");
-        batch.addLowWatermark(DUMMY_LWM, monCtx); // Add DUMMY_LWM as last element
         assertFalse(batch.isEmpty(), "Batch should contain elements");
         assertTrue(batch.isFull(), "Batch should be full");
         assertEquals(batch.getNumEvents(), BATCH_SIZE, "Num events should be " + BATCH_SIZE);
@@ -93,7 +88,7 @@ public class TestBatch {
             fail("Should throw an IllegalStateException");
         } catch (IllegalStateException e) {
             assertEquals(e.getMessage(), "batch is full", "message returned doesn't match");
-            LOG.debug("IllegalStateException catched properly");
+            LOG.debug("IllegalStateException catch properly");
         }
         assertTrue(batch.isFull(), "Batch shouldn't be empty");
 
@@ -101,24 +96,19 @@ public class TestBatch {
         assertTrue(batch.get(0).getType().equals(PersistEvent.Type.TIMESTAMP));
         assertTrue(batch.get(1).getType().equals(PersistEvent.Type.COMMIT));
         assertTrue(batch.get(2).getType().equals(PersistEvent.Type.ABORT));
-        assertTrue(batch.get(BATCH_SIZE - 1).getType().equals(PersistEvent.Type.LOW_WATERMARK));
 
         // Set a new value for last element in Batch and check we obtain the right result
         batch.decreaseNumEvents();
         assertEquals(batch.getNumEvents(), BATCH_SIZE - 1, "Num events should be " + (BATCH_SIZE - 1));
-        assertTrue(batch.isLastEntryEmpty(), "Should be only one entry left in the batch");
         try {
             batch.get(BATCH_SIZE - 1);
             fail();
         } catch (IllegalStateException ex) {
             // Expected, as we can not access elements in the batch greater than the current number of events
         }
-        batch.addLowWatermark(NEW_LWM, monCtx); // Add new LWM as last element
-        assertTrue(batch.get(BATCH_SIZE - 1).getType().equals(PersistEvent.Type.LOW_WATERMARK));
-        assertEquals(batch.get(BATCH_SIZE - 1).getLowWatermark(), NEW_LWM);
 
-        // Re-check that batch is full again
-        assertTrue(batch.isFull(), "Batch shouldn't be empty");
+        // Re-check that batch is NOT full
+        assertFalse(batch.isFull(), "Batch shouldn't be full");
 
         // Clear the batch and goes back to its initial state
         batch.clear();

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5b27a074/tso-server/src/test/java/org/apache/omid/tso/TestPanicker.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestPanicker.java b/tso-server/src/test/java/org/apache/omid/tso/TestPanicker.java
index 716f64f..a5f4eed 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestPanicker.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestPanicker.java
@@ -132,9 +132,11 @@ public class TestPanicker {
         }
 
         PersistenceProcessor proc = new PersistenceProcessorImpl(config,
+                                                                 commitTable,
                                                                  batchPool,
                                                                  panicker,
-                                                                 handlers);
+                                                                 handlers,
+                                                                 metrics);
 
         proc.addCommitToBatch(1, 2, null, new MonitoringContext(metrics));
 
@@ -182,9 +184,11 @@ public class TestPanicker {
         }
 
         PersistenceProcessor proc = new PersistenceProcessorImpl(config,
+                                                                 commitTable,
                                                                  batchPool,
                                                                  panicker,
-                                                                 handlers);
+                                                                 handlers,
+                                                                 metrics);
         proc.addCommitToBatch(1, 2, null, new MonitoringContext(metrics));
 
         new RequestProcessorImpl(metrics, mock(TimestampOracle.class), proc, panicker, mock(TSOServerConfig.class));

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5b27a074/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java b/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java
index 91b9504..6e5c040 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java
@@ -22,6 +22,7 @@ import org.apache.omid.committable.CommitTable;
 import org.apache.omid.metrics.MetricsRegistry;
 import org.apache.omid.metrics.NullMetricsProvider;
 import org.jboss.netty.channel.Channel;
+import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
@@ -43,13 +44,14 @@ import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.timeout;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
+import static org.testng.Assert.assertEquals;
 
 // TODO Refactor: Make visible currentBatch in PersistenceProcessorImpl to add proper verifications
 public class TestPersistenceProcessor {
 
     private static final Logger LOG = LoggerFactory.getLogger(TestPersistenceProcessor.class);
 
-    private static final long ANY_LWM = 0L;
+    private static final long ANY_LWM = 1234L;
     private static final int ANY_ST = 0;
     private static final int ANY_CT = 1;
 
@@ -93,7 +95,41 @@ public class TestPersistenceProcessor {
         Mockito.reset(mockWriter);
     }
 
-    @Test
+    @Test(timeOut = 10_000)
+    public void testLowWatermarkIsPersisted() throws Exception {
+
+        TSOServerConfig tsoConfig = new TSOServerConfig();
+
+        PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[tsoConfig.getNumConcurrentCTWriters()];
+        for (int i = 0; i < tsoConfig.getNumConcurrentCTWriters(); i++) {
+            handlers[i] = new PersistenceProcessorHandler(metrics,
+                                                          "localhost:1234",
+                                                          mock(LeaseManager.class),
+                                                          commitTable,
+                                                          mock(ReplyProcessor.class),
+                                                          retryProcessor,
+                                                          panicker);
+        }
+
+        // Component under test
+        PersistenceProcessorImpl persistenceProcessor =
+                new PersistenceProcessorImpl(tsoConfig,
+                                             commitTable,
+                                             mock(ObjectPool.class),
+                                             panicker,
+                                             handlers,
+                                             metrics);
+
+        persistenceProcessor.persistLowWatermark(ANY_LWM).get();
+
+        ArgumentCaptor<Long> lwmCapture = ArgumentCaptor.forClass(Long.class);
+        CommitTable.Writer lwmWriter = commitTable.getWriter();
+        verify(lwmWriter, timeout(100).times(1)).updateLowWatermark(lwmCapture.capture());
+        assertEquals(lwmCapture.getValue().longValue(), ANY_LWM);
+
+    }
+
+    @Test(timeOut = 10_000)
     public void testCommitPersistenceWithSingleCommitTableWriter() throws Exception {
 
         final int NUM_CT_WRITERS = 1;
@@ -122,8 +158,8 @@ public class TestPersistenceProcessor {
         }
 
         // Component under test
-        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig, batchPool, panicker, handlers);
-        proc.addLowWatermarkToBatch(ANY_LWM, new MonitoringContext(metrics)); // Add a fake DUMMY_LWM
+        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig, commitTable, batchPool,
+                                                                     panicker, handlers, metrics);
 
         verify(batchPool, times(1)).borrowObject(); // Called during initialization
 
@@ -166,9 +202,8 @@ public class TestPersistenceProcessor {
         }
 
         // Component under test
-        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig, batchPool, panicker, handlers);
-
-        proc.addLowWatermarkToBatch(ANY_LWM, mock(MonitoringContext.class)); // Add a fake DUMMY_LWM
+        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig, commitTable, batchPool,
+                                                                     panicker, handlers, metrics);
 
         verify(batchPool, times(1)).borrowObject(); // Called during initialization
 
@@ -238,9 +273,8 @@ public class TestPersistenceProcessor {
         }
 
         // Component under test
-        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig, batchPool, panicker, handlers);
-
-        proc.addLowWatermarkToBatch(ANY_LWM, new MonitoringContext(metrics)); // Add a fake DUMMY_LWM
+        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig, commitTable, batchPool,
+                                                                     panicker, handlers, metrics);
 
         // The non-ha lease manager always return true for
         // stillInLeasePeriod(), so verify the currentBatch sends replies as master
@@ -294,9 +328,8 @@ public class TestPersistenceProcessor {
         PersistenceProcessorHandler[] handlers = configureHandlers (tsoConfig, simulatedHALeaseManager, batchPool);
 
         // Component under test
-        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig, batchPool, panicker, handlers);
-
-        proc.addLowWatermarkToBatch(ANY_LWM, new MonitoringContext(metrics)); // Add a fake DUMMY_LWM
+        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig, commitTable, batchPool,
+                                                                     panicker, handlers, metrics);
 
         // Test: Configure the lease manager to return true always
         doReturn(true).when(simulatedHALeaseManager).stillInLeasePeriod();
@@ -316,11 +349,11 @@ public class TestPersistenceProcessor {
         PersistenceProcessorHandler[] handlers = configureHandlers (tsoConfig, simulatedHALeaseManager, batchPool);
 
         // Component under test
-        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig, batchPool, panicker, handlers);
+        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig, commitTable, batchPool,
+                                                                     panicker, handlers, metrics);
 
         // Test: Configure the lease manager to return true first and false later for stillInLeasePeriod
         doReturn(true).doReturn(false).when(simulatedHALeaseManager).stillInLeasePeriod();
-        //batchPool.notifyEmptyBatch(0); // Unlock this thread to check the panicker
         proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class));
         proc.triggerCurrentBatchFlush();
         verify(simulatedHALeaseManager, timeout(1000).times(2)).stillInLeasePeriod();
@@ -337,7 +370,8 @@ public class TestPersistenceProcessor {
         PersistenceProcessorHandler[] handlers = configureHandlers (tsoConfig, simulatedHALeaseManager, batchPool);
 
         // Component under test
-        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig, batchPool, panicker, handlers);
+        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig, commitTable, batchPool,
+                                                                     panicker, handlers, metrics);
 
         // Test: Configure the lease manager to return false for stillInLeasePeriod
         doReturn(false).when(simulatedHALeaseManager).stillInLeasePeriod();
@@ -358,7 +392,8 @@ public class TestPersistenceProcessor {
         PersistenceProcessorHandler[] handlers = configureHandlers (tsoConfig, simulatedHALeaseManager, batchPool);
 
         // Component under test
-        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig, batchPool, panicker, handlers);
+        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig, commitTable, batchPool,
+                                                                     panicker, handlers, metrics);
 
         // Test: Configure the lease manager to return true first and false later for stillInLeasePeriod and raise
         // an exception when flush
@@ -413,7 +448,8 @@ public class TestPersistenceProcessor {
                                                           panicker);
         }
 
-        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(config, batchPool, panicker, handlers);
+        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(config, commitTable, batchPool,
+                                                                     panicker, handlers, metrics);
 
         MonitoringContext monCtx = new MonitoringContext(metrics);
 
@@ -423,8 +459,6 @@ public class TestPersistenceProcessor {
         // Configure commit table writer to explode when flushing changes to DB
         doThrow(new IOException("Unable to write@TestPersistenceProcessor2")).when(mockWriter).flush();
 
-        proc.addLowWatermarkToBatch(ANY_LWM, new MonitoringContext(metrics)); // Add a fake DUMMY_LWM
-
         // Check the panic is extended!
         proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), monCtx);
         proc.triggerCurrentBatchFlush();
@@ -452,14 +486,13 @@ public class TestPersistenceProcessor {
                                                           panicker);
         }
 
-        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(config, batchPool, panicker, handlers);
+        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(config, commitTable, batchPool,
+                                                                     panicker, handlers, metrics);
 
         // Configure writer to explode with a runtime exception
         doThrow(new RuntimeException("Kaboom!")).when(mockWriter).addCommittedTransaction(anyLong(), anyLong());
         MonitoringContext monCtx = new MonitoringContext(metrics);
 
-        proc.addLowWatermarkToBatch(ANY_LWM, new MonitoringContext(metrics)); // Add a fake DUMMY_LWM
-
         // Check the panic is extended!
         proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), monCtx);
         proc.triggerCurrentBatchFlush();

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5b27a074/tso-server/src/test/java/org/apache/omid/tso/TestRequestProcessor.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestRequestProcessor.java b/tso-server/src/test/java/org/apache/omid/tso/TestRequestProcessor.java
index 11f1a99..5b17d1e 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestRequestProcessor.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestRequestProcessor.java
@@ -18,6 +18,7 @@
 package org.apache.omid.tso;
 
 import com.google.common.collect.Lists;
+import com.google.common.util.concurrent.SettableFuture;
 import org.apache.omid.metrics.MetricsRegistry;
 import org.apache.omid.metrics.NullMetricsProvider;
 import org.jboss.netty.channel.Channel;
@@ -34,6 +35,7 @@ import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyBoolean;
 import static org.mockito.Matchers.anyLong;
 import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.timeout;
 import static org.mockito.Mockito.verify;
@@ -67,6 +69,9 @@ public class TestRequestProcessor {
         stateManager = new TSOStateManagerImpl(timestampOracle);
 
         persist = mock(PersistenceProcessor.class);
+        SettableFuture<Void> f = SettableFuture.create();
+        f.set(null);
+        doReturn(f).when(persist).persistLowWatermark(any(Long.class));
 
         TSOServerConfig config = new TSOServerConfig();
         config.setMaxItems(CONFLICT_MAP_SIZE);
@@ -165,7 +170,7 @@ public class TestRequestProcessor {
         final long FIRST_COMMIT_TS_EVICTED = 1L;
         final long NEXT_COMMIT_TS_THAT_SHOULD_BE_EVICTED = 2L;
 
-                // Fill the cache to provoke a cache eviction
+        // Fill the cache to provoke a cache eviction
         for (long i = 0; i < CONFLICT_MAP_SIZE + CONFLICT_MAP_ASSOCIATIVITY; i++) {
             long writeSetElementHash = i + 1; // This is to match the assigned CT: K/V in cache = WS Element Hash/CT
             List<Long> writeSet = Lists.newArrayList(writeSetElementHash);
@@ -175,11 +180,11 @@ public class TestRequestProcessor {
         Thread.currentThread().sleep(3000); // Allow the Request processor to finish the request processing
 
         // Check that first time its called is on init
-        verify(persist, timeout(100).times(1)).addLowWatermarkToBatch(eq(0L), any(MonitoringContext.class));
+        verify(persist, timeout(100).times(1)).persistLowWatermark(eq(0L));
         // Then, check it is called when cache is full and the first element is evicted (should be a 1)
-        verify(persist, timeout(100).times(1)).addLowWatermarkToBatch(eq(FIRST_COMMIT_TS_EVICTED), any(MonitoringContext.class));
+        verify(persist, timeout(100).times(1)).persistLowWatermark(eq(FIRST_COMMIT_TS_EVICTED));
         // Finally it should never be called with the next element
-        verify(persist, timeout(100).never()).addLowWatermarkToBatch(eq(NEXT_COMMIT_TS_THAT_SHOULD_BE_EVICTED), any(MonitoringContext.class));
+        verify(persist, timeout(100).never()).persistLowWatermark(eq(NEXT_COMMIT_TS_THAT_SHOULD_BE_EVICTED));
 
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5b27a074/tso-server/src/test/java/org/apache/omid/tso/client/TestTSOClientRequestAndResponseBehaviours.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/client/TestTSOClientRequestAndResponseBehaviours.java b/tso-server/src/test/java/org/apache/omid/tso/client/TestTSOClientRequestAndResponseBehaviours.java
index 203f46f..e41e656 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/client/TestTSOClientRequestAndResponseBehaviours.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/client/TestTSOClientRequestAndResponseBehaviours.java
@@ -69,8 +69,8 @@ public class TestTSOClientRequestAndResponseBehaviours {
     private PausableTimestampOracle pausableTSOracle;
     private CommitTable commitTable;
 
-    @BeforeClass
-    public void setup() throws Exception {
+    @BeforeMethod
+    public void beforeMethod() throws Exception {
 
         TSOServerConfig tsoConfig = new TSOServerConfig();
         tsoConfig.setMaxItems(1000);
@@ -94,19 +94,6 @@ public class TestTSOClientRequestAndResponseBehaviours {
         pausableTSOracle = (PausableTimestampOracle) injector.getInstance(TimestampOracle.class);
         commitTable = injector.getInstance(CommitTable.class);
 
-    }
-
-    @AfterClass
-    public void tearDown() throws Exception {
-
-        tsoServer.stopAndWait();
-        tsoServer = null;
-        TestUtils.waitForSocketNotListening(TSO_SERVER_HOST, TSO_SERVER_PORT, 1000);
-
-    }
-
-    @BeforeMethod
-    public void beforeMethod() {
         OmidClientConfiguration tsoClientConf = new OmidClientConfiguration();
         tsoClientConf.setConnectionString(TSO_SERVER_HOST + ":" + TSO_SERVER_PORT);
 
@@ -115,7 +102,12 @@ public class TestTSOClientRequestAndResponseBehaviours {
     }
 
     @AfterMethod
-    public void afterMethod() {
+    public void afterMethod() throws Exception {
+
+
+        tsoServer.stopAndWait();
+        tsoServer = null;
+        TestUtils.waitForSocketNotListening(TSO_SERVER_HOST, TSO_SERVER_PORT, 1000);
 
         pausableTSOracle.resume();
 



[43/50] [abbrv] incubator-omid git commit: Fix benchmark configs to let them run on secure Hbase

Posted by fp...@apache.org.
Fix benchmark configs to let them run on secure Hbase

Change-Id: Ifdd68c6ed75e7be9d758425468c3ee099b102127


Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/4c194978
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/4c194978
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/4c194978

Branch: refs/heads/master
Commit: 4c194978d1ffe80a4a45c4f14affa49db5c767fd
Parents: 41d2e23
Author: Igor Katkov <ka...@yahoo-inc.com>
Authored: Mon May 9 14:13:12 2016 -0700
Committer: Igor Katkov <ka...@yahoo-inc.com>
Committed: Mon May 9 14:13:12 2016 -0700

----------------------------------------------------------------------
 benchmarks/bin/benchmarks.sh                                  | 2 +-
 benchmarks/bin/omid-env.sh                                    | 7 +++++++
 .../apache/omid/benchmarks/tso/TSOServerBenchmarkConfig.java  | 6 +++---
 .../main/resources/default-tso-server-benchmark-config.yml    | 2 ++
 4 files changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/4c194978/benchmarks/bin/benchmarks.sh
----------------------------------------------------------------------
diff --git a/benchmarks/bin/benchmarks.sh b/benchmarks/bin/benchmarks.sh
index 55b2031..c89e25f 100755
--- a/benchmarks/bin/benchmarks.sh
+++ b/benchmarks/bin/benchmarks.sh
@@ -20,7 +20,7 @@ for j in ../lib/*.jar; do
 done
 
 tso() {
-    exec java $JVM_FLAGS -Dlog4j.configuration=log4j.xml -cp $CLASSPATH org.apache.omid.benchmarks.tso.TSOServerBenchmark $@
+    exec java $JVM_FLAGS -Dlog4j.configuration=file:../conf/log4j.xml -cp $CLASSPATH org.apache.omid.benchmarks.tso.TSOServerBenchmark $@
 }
 
 usage() {

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/4c194978/benchmarks/bin/omid-env.sh
----------------------------------------------------------------------
diff --git a/benchmarks/bin/omid-env.sh b/benchmarks/bin/omid-env.sh
index c15f6be..c76897c 100644
--- a/benchmarks/bin/omid-env.sh
+++ b/benchmarks/bin/omid-env.sh
@@ -1,2 +1,9 @@
 # Set the flags to pass to the jvm when running omid
 # export JVM_FLAGS=-Xmx2048m
+# ---------------------------------------------------------------------------------------------------------------------
+# Check if HADOOP_CONF_DIR and HBASE_CONF_DIR are set
+# ---------------------------------------------------------------------------------------------------------------------
+
+if [ -z ${HADOOP_CONF_DIR+x} ]; then echo "WARNING: HADOOP_CONF_DIR is unset"; else echo "HADOOP_CONF_DIR is set to '$HADOOP_CONF_DIR'"; fi
+if [ -z ${HBASE_CONF_DIR+x} ]; then echo "WARNING: HBASE_CONF_DIR is unset"; else echo "HBASE_CONF_DIR is set to '$HBASE_CONF_DIR'"; fi
+

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/4c194978/benchmarks/src/main/java/org/apache/omid/benchmarks/tso/TSOServerBenchmarkConfig.java
----------------------------------------------------------------------
diff --git a/benchmarks/src/main/java/org/apache/omid/benchmarks/tso/TSOServerBenchmarkConfig.java b/benchmarks/src/main/java/org/apache/omid/benchmarks/tso/TSOServerBenchmarkConfig.java
index 49797d4..ccb1d81 100644
--- a/benchmarks/src/main/java/org/apache/omid/benchmarks/tso/TSOServerBenchmarkConfig.java
+++ b/benchmarks/src/main/java/org/apache/omid/benchmarks/tso/TSOServerBenchmarkConfig.java
@@ -26,8 +26,8 @@ import org.apache.omid.tso.client.OmidClientConfiguration;
 
 public class TSOServerBenchmarkConfig extends SecureHBaseConfig {
 
-    private static final String DEFAULT_CONFIG_FILE_NAME = "tso-server-benchmark-config.yml";
-    private static final String CONFIG_FILE_NAME = "default-tso-server-benchmark-config.yml";
+    private static final String CONFIG_FILE_NAME = "tso-server-benchmark-config.yml";
+    private static final String DEFAULT_CONFIG_FILE_NAME = "default-tso-server-benchmark-config.yml";
 
     private long benchmarkRunLengthInMins;
 
@@ -54,7 +54,7 @@ public class TSOServerBenchmarkConfig extends SecureHBaseConfig {
     }
 
     TSOServerBenchmarkConfig(String configFileName) {
-        new YAMLUtils().loadSettings(DEFAULT_CONFIG_FILE_NAME, configFileName, this);
+        new YAMLUtils().loadSettings(configFileName, DEFAULT_CONFIG_FILE_NAME, this);
     }
 
     // ----------------------------------------------------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/4c194978/benchmarks/src/main/resources/default-tso-server-benchmark-config.yml
----------------------------------------------------------------------
diff --git a/benchmarks/src/main/resources/default-tso-server-benchmark-config.yml b/benchmarks/src/main/resources/default-tso-server-benchmark-config.yml
index fd2dd58..c5eacd1 100644
--- a/benchmarks/src/main/resources/default-tso-server-benchmark-config.yml
+++ b/benchmarks/src/main/resources/default-tso-server-benchmark-config.yml
@@ -53,6 +53,8 @@ omidClientConfiguration: !!org.apache.omid.tso.client.OmidClientConfiguration
 # ---------------------------------------------------------------------------------------------------------------------
 commitTableStoreModule: !!org.apache.omid.committable.hbase.DefaultHBaseCommitTableStorageModule
     tableName: "OMID_COMMIT_TABLE"
+# principal: omid_hbase_user
+# keytab: /path/to/hbase/user/keytab
 
 # ---------------------------------------------------------------------------------------------------------------------
 # Metrics configuration


[40/50] [abbrv] incubator-omid git commit: [ci skip]prepare release omid-0.8.1.48

Posted by fp...@apache.org.
[ci skip]prepare release omid-0.8.1.48


Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/0b88b0bc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/0b88b0bc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/0b88b0bc

Branch: refs/heads/master
Commit: 0b88b0bc4091e1f4a62d3f783d95e77c6f76d6ab
Parents: 4e02a91
Author: Omid CI <om...@yahoo-inc.com>
Authored: Fri May 6 17:26:59 2016 +0000
Committer: Omid CI <om...@yahoo-inc.com>
Committed: Fri May 6 17:26:59 2016 +0000

----------------------------------------------------------------------
 benchmarks/pom.xml          | 2 +-
 codahale-metrics/pom.xml    | 2 +-
 commit-table/pom.xml        | 2 +-
 common/pom.xml              | 2 +-
 examples/pom.xml            | 2 +-
 hbase-client/pom.xml        | 2 +-
 hbase-commit-table/pom.xml  | 2 +-
 hbase-common/pom.xml        | 2 +-
 hbase-coprocessor/pom.xml   | 2 +-
 hbase-shims/hbase-0/pom.xml | 2 +-
 hbase-shims/hbase-1/pom.xml | 2 +-
 hbase-shims/pom.xml         | 2 +-
 hbase-tools/pom.xml         | 2 +-
 metrics/pom.xml             | 2 +-
 pom.xml                     | 4 ++--
 statemachine/pom.xml        | 2 +-
 timestamp-storage/pom.xml   | 2 +-
 transaction-client/pom.xml  | 2 +-
 tso-server/pom.xml          | 2 +-
 19 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/0b88b0bc/benchmarks/pom.xml
----------------------------------------------------------------------
diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml
index cd373df..364623e 100644
--- a/benchmarks/pom.xml
+++ b/benchmarks/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.48-SNAPSHOT</version>
+        <version>0.8.1.48</version>
     </parent>
 
     <artifactId>benchmarks</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/0b88b0bc/codahale-metrics/pom.xml
----------------------------------------------------------------------
diff --git a/codahale-metrics/pom.xml b/codahale-metrics/pom.xml
index d8272c6..c598e80 100644
--- a/codahale-metrics/pom.xml
+++ b/codahale-metrics/pom.xml
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.48-SNAPSHOT</version>
+        <version>0.8.1.48</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/0b88b0bc/commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/commit-table/pom.xml b/commit-table/pom.xml
index ad9a3cc..e86936b 100644
--- a/commit-table/pom.xml
+++ b/commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.48-SNAPSHOT</version>
+        <version>0.8.1.48</version>
     </parent>
 
     <artifactId>commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/0b88b0bc/common/pom.xml
----------------------------------------------------------------------
diff --git a/common/pom.xml b/common/pom.xml
index c9cafdf..bf1b1b1 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.48-SNAPSHOT</version>
+        <version>0.8.1.48</version>
     </parent>
 
     <artifactId>common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/0b88b0bc/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index f0dc7ef..e76e647 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.48-SNAPSHOT</version>
+        <version>0.8.1.48</version>
     </parent>
 
     <artifactId>examples</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/0b88b0bc/hbase-client/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml
index 39d9e42..1fb296c 100644
--- a/hbase-client/pom.xml
+++ b/hbase-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.48-SNAPSHOT</version>
+        <version>0.8.1.48</version>
     </parent>
 
     <artifactId>hbase-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/0b88b0bc/hbase-commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-commit-table/pom.xml b/hbase-commit-table/pom.xml
index f0c6b6c..8809051 100644
--- a/hbase-commit-table/pom.xml
+++ b/hbase-commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.48-SNAPSHOT</version>
+        <version>0.8.1.48</version>
     </parent>
 
     <artifactId>hbase-commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/0b88b0bc/hbase-common/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml
index ac45421..2362db2 100644
--- a/hbase-common/pom.xml
+++ b/hbase-common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.48-SNAPSHOT</version>
+        <version>0.8.1.48</version>
     </parent>
 
     <artifactId>hbase-common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/0b88b0bc/hbase-coprocessor/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-coprocessor/pom.xml b/hbase-coprocessor/pom.xml
index 405fde1..41b0fc3 100644
--- a/hbase-coprocessor/pom.xml
+++ b/hbase-coprocessor/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.48-SNAPSHOT</version>
+        <version>0.8.1.48</version>
     </parent>
 
     <artifactId>hbase-coprocessor</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/0b88b0bc/hbase-shims/hbase-0/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-0/pom.xml b/hbase-shims/hbase-0/pom.xml
index 6dab82f..0a52505 100644
--- a/hbase-shims/hbase-0/pom.xml
+++ b/hbase-shims/hbase-0/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.48-SNAPSHOT</version>
+        <version>0.8.1.48</version>
     </parent>
 
     <artifactId>hbase0-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/0b88b0bc/hbase-shims/hbase-1/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-1/pom.xml b/hbase-shims/hbase-1/pom.xml
index 4183e3a..8f3b570 100644
--- a/hbase-shims/hbase-1/pom.xml
+++ b/hbase-shims/hbase-1/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.48-SNAPSHOT</version>
+        <version>0.8.1.48</version>
     </parent>
 
     <artifactId>hbase1-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/0b88b0bc/hbase-shims/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/pom.xml b/hbase-shims/pom.xml
index 432fbe9..e28bfbb 100644
--- a/hbase-shims/pom.xml
+++ b/hbase-shims/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.48-SNAPSHOT</version>
+        <version>0.8.1.48</version>
     </parent>
 
     <artifactId>omid-shims-aggregator</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/0b88b0bc/hbase-tools/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-tools/pom.xml b/hbase-tools/pom.xml
index 312bec4..a997bf1 100644
--- a/hbase-tools/pom.xml
+++ b/hbase-tools/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.48-SNAPSHOT</version>
+        <version>0.8.1.48</version>
     </parent>
 
     <artifactId>hbase-tools</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/0b88b0bc/metrics/pom.xml
----------------------------------------------------------------------
diff --git a/metrics/pom.xml b/metrics/pom.xml
index 41b37b7..5b7d151 100644
--- a/metrics/pom.xml
+++ b/metrics/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.48-SNAPSHOT</version>
+        <version>0.8.1.48</version>
     </parent>
 
     <artifactId>metrics</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/0b88b0bc/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 32e0532..a6b1b6f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
     <artifactId>omid</artifactId>
     <packaging>pom</packaging>
     <!-- WARNING: do not update version manually, use mvn versions:set -->
-    <version>0.8.1.48-SNAPSHOT</version>
+    <version>0.8.1.48</version>
 
     <organization>
         <name>Apache Software Foundation</name>
@@ -105,7 +105,7 @@
         <connection>scm:git:git://github.com/yahoo/omid.git</connection>
         <developerConnection>scm:git:https://${GH_TOKEN}@github.com/yahoo/omid.git</developerConnection>
         <url>https://github.com/yahoo/omid</url>
-        <tag>master</tag>
+        <tag>omid-0.8.1.48</tag>
     </scm>
 
     <distributionManagement>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/0b88b0bc/statemachine/pom.xml
----------------------------------------------------------------------
diff --git a/statemachine/pom.xml b/statemachine/pom.xml
index 9db6e9b..84ac019 100644
--- a/statemachine/pom.xml
+++ b/statemachine/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.48-SNAPSHOT</version>
+        <version>0.8.1.48</version>
     </parent>
 
     <name>State Machine</name>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/0b88b0bc/timestamp-storage/pom.xml
----------------------------------------------------------------------
diff --git a/timestamp-storage/pom.xml b/timestamp-storage/pom.xml
index 5392e26..87ea156 100644
--- a/timestamp-storage/pom.xml
+++ b/timestamp-storage/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.48-SNAPSHOT</version>
+        <version>0.8.1.48</version>
     </parent>
 
     <artifactId>timestamp-storage</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/0b88b0bc/transaction-client/pom.xml
----------------------------------------------------------------------
diff --git a/transaction-client/pom.xml b/transaction-client/pom.xml
index 8b4efff..578b358 100644
--- a/transaction-client/pom.xml
+++ b/transaction-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.48-SNAPSHOT</version>
+        <version>0.8.1.48</version>
     </parent>
 
     <artifactId>transaction-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/0b88b0bc/tso-server/pom.xml
----------------------------------------------------------------------
diff --git a/tso-server/pom.xml b/tso-server/pom.xml
index 3a520d8..aef2fe1 100644
--- a/tso-server/pom.xml
+++ b/tso-server/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.48-SNAPSHOT</version>
+        <version>0.8.1.48</version>
     </parent>
 
     <artifactId>tso-server</artifactId>


[49/50] [abbrv] incubator-omid git commit: [ci skip]prepare release omid-0.8.1.50

Posted by fp...@apache.org.
[ci skip]prepare release omid-0.8.1.50


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

Branch: refs/heads/master
Commit: ef6de6a5d4fbcc3ab3e176a481f57dc422c18f33
Parents: 6ab0725
Author: Omid CI <om...@yahoo-inc.com>
Authored: Wed May 11 18:01:51 2016 +0000
Committer: Omid CI <om...@yahoo-inc.com>
Committed: Wed May 11 18:01:51 2016 +0000

----------------------------------------------------------------------
 benchmarks/pom.xml          | 2 +-
 codahale-metrics/pom.xml    | 2 +-
 commit-table/pom.xml        | 2 +-
 common/pom.xml              | 2 +-
 examples/pom.xml            | 2 +-
 hbase-client/pom.xml        | 2 +-
 hbase-commit-table/pom.xml  | 2 +-
 hbase-common/pom.xml        | 2 +-
 hbase-coprocessor/pom.xml   | 2 +-
 hbase-shims/hbase-0/pom.xml | 2 +-
 hbase-shims/hbase-1/pom.xml | 2 +-
 hbase-shims/pom.xml         | 2 +-
 hbase-tools/pom.xml         | 2 +-
 metrics/pom.xml             | 2 +-
 pom.xml                     | 4 ++--
 statemachine/pom.xml        | 2 +-
 timestamp-storage/pom.xml   | 2 +-
 transaction-client/pom.xml  | 2 +-
 tso-server/pom.xml          | 2 +-
 19 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/ef6de6a5/benchmarks/pom.xml
----------------------------------------------------------------------
diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml
index e48827e..3f3d69a 100644
--- a/benchmarks/pom.xml
+++ b/benchmarks/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.50-SNAPSHOT</version>
+        <version>0.8.1.50</version>
     </parent>
 
     <artifactId>benchmarks</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/ef6de6a5/codahale-metrics/pom.xml
----------------------------------------------------------------------
diff --git a/codahale-metrics/pom.xml b/codahale-metrics/pom.xml
index 314d8aa..854f87f 100644
--- a/codahale-metrics/pom.xml
+++ b/codahale-metrics/pom.xml
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.50-SNAPSHOT</version>
+        <version>0.8.1.50</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/ef6de6a5/commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/commit-table/pom.xml b/commit-table/pom.xml
index 495d295..e331575 100644
--- a/commit-table/pom.xml
+++ b/commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.50-SNAPSHOT</version>
+        <version>0.8.1.50</version>
     </parent>
 
     <artifactId>commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/ef6de6a5/common/pom.xml
----------------------------------------------------------------------
diff --git a/common/pom.xml b/common/pom.xml
index 68f3e1a..97c5bd6 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.50-SNAPSHOT</version>
+        <version>0.8.1.50</version>
     </parent>
 
     <artifactId>common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/ef6de6a5/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index f1412c8..5d9e9f4 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.50-SNAPSHOT</version>
+        <version>0.8.1.50</version>
     </parent>
 
     <artifactId>examples</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/ef6de6a5/hbase-client/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml
index 70bd821..e28e8a9 100644
--- a/hbase-client/pom.xml
+++ b/hbase-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.50-SNAPSHOT</version>
+        <version>0.8.1.50</version>
     </parent>
 
     <artifactId>hbase-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/ef6de6a5/hbase-commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-commit-table/pom.xml b/hbase-commit-table/pom.xml
index e54c603..0470660 100644
--- a/hbase-commit-table/pom.xml
+++ b/hbase-commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.50-SNAPSHOT</version>
+        <version>0.8.1.50</version>
     </parent>
 
     <artifactId>hbase-commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/ef6de6a5/hbase-common/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml
index 439f010..072b6f8 100644
--- a/hbase-common/pom.xml
+++ b/hbase-common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.50-SNAPSHOT</version>
+        <version>0.8.1.50</version>
     </parent>
 
     <artifactId>hbase-common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/ef6de6a5/hbase-coprocessor/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-coprocessor/pom.xml b/hbase-coprocessor/pom.xml
index ad9c824..fa61620 100644
--- a/hbase-coprocessor/pom.xml
+++ b/hbase-coprocessor/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.50-SNAPSHOT</version>
+        <version>0.8.1.50</version>
     </parent>
 
     <artifactId>hbase-coprocessor</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/ef6de6a5/hbase-shims/hbase-0/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-0/pom.xml b/hbase-shims/hbase-0/pom.xml
index aa05aeb..dff912f 100644
--- a/hbase-shims/hbase-0/pom.xml
+++ b/hbase-shims/hbase-0/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.50-SNAPSHOT</version>
+        <version>0.8.1.50</version>
     </parent>
 
     <artifactId>hbase0-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/ef6de6a5/hbase-shims/hbase-1/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-1/pom.xml b/hbase-shims/hbase-1/pom.xml
index 7e99fcf..4376803 100644
--- a/hbase-shims/hbase-1/pom.xml
+++ b/hbase-shims/hbase-1/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.50-SNAPSHOT</version>
+        <version>0.8.1.50</version>
     </parent>
 
     <artifactId>hbase1-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/ef6de6a5/hbase-shims/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/pom.xml b/hbase-shims/pom.xml
index 4a7a59b..5f0eb03 100644
--- a/hbase-shims/pom.xml
+++ b/hbase-shims/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.50-SNAPSHOT</version>
+        <version>0.8.1.50</version>
     </parent>
 
     <artifactId>omid-shims-aggregator</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/ef6de6a5/hbase-tools/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-tools/pom.xml b/hbase-tools/pom.xml
index 3bb71a7..69290c6 100644
--- a/hbase-tools/pom.xml
+++ b/hbase-tools/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.50-SNAPSHOT</version>
+        <version>0.8.1.50</version>
     </parent>
 
     <artifactId>hbase-tools</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/ef6de6a5/metrics/pom.xml
----------------------------------------------------------------------
diff --git a/metrics/pom.xml b/metrics/pom.xml
index 935a2d2..abb75c6 100644
--- a/metrics/pom.xml
+++ b/metrics/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.50-SNAPSHOT</version>
+        <version>0.8.1.50</version>
     </parent>
 
     <artifactId>metrics</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/ef6de6a5/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 7b5b435..dfd4156 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
     <artifactId>omid</artifactId>
     <packaging>pom</packaging>
     <!-- WARNING: do not update version manually, use mvn versions:set -->
-    <version>0.8.1.50-SNAPSHOT</version>
+    <version>0.8.1.50</version>
 
     <organization>
         <name>Apache Software Foundation</name>
@@ -105,7 +105,7 @@
         <connection>scm:git:git://github.com/yahoo/omid.git</connection>
         <developerConnection>scm:git:https://${GH_TOKEN}@github.com/yahoo/omid.git</developerConnection>
         <url>https://github.com/yahoo/omid</url>
-        <tag>master</tag>
+        <tag>omid-0.8.1.50</tag>
     </scm>
 
     <distributionManagement>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/ef6de6a5/statemachine/pom.xml
----------------------------------------------------------------------
diff --git a/statemachine/pom.xml b/statemachine/pom.xml
index 02255a2..2a94cc0 100644
--- a/statemachine/pom.xml
+++ b/statemachine/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.50-SNAPSHOT</version>
+        <version>0.8.1.50</version>
     </parent>
 
     <name>State Machine</name>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/ef6de6a5/timestamp-storage/pom.xml
----------------------------------------------------------------------
diff --git a/timestamp-storage/pom.xml b/timestamp-storage/pom.xml
index 8707ae2..c7d02b3 100644
--- a/timestamp-storage/pom.xml
+++ b/timestamp-storage/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.50-SNAPSHOT</version>
+        <version>0.8.1.50</version>
     </parent>
 
     <artifactId>timestamp-storage</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/ef6de6a5/transaction-client/pom.xml
----------------------------------------------------------------------
diff --git a/transaction-client/pom.xml b/transaction-client/pom.xml
index 823fe13..9275efc 100644
--- a/transaction-client/pom.xml
+++ b/transaction-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.50-SNAPSHOT</version>
+        <version>0.8.1.50</version>
     </parent>
 
     <artifactId>transaction-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/ef6de6a5/tso-server/pom.xml
----------------------------------------------------------------------
diff --git a/tso-server/pom.xml b/tso-server/pom.xml
index e101335..a9fb59d 100644
--- a/tso-server/pom.xml
+++ b/tso-server/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.50-SNAPSHOT</version>
+        <version>0.8.1.50</version>
     </parent>
 
     <artifactId>tso-server</artifactId>


[29/50] [abbrv] incubator-omid git commit: Improve TSO performance: Parallel batched writes to CT

Posted by fp...@apache.org.
Improve TSO performance: Parallel batched writes to CT

The architecture mostly changed by adding batch events and creating
handlers under PersistenceProcessorImpl.

Old comments of squashed commits:

Scaling up the TSO by parallelizing the batched writes to the commit table. The architecture mostly changed by adding batch events and creating handlers under PersistenceProcessorImpl.
This commit increases the performance of Omid from 55K tps to 380K tps when using 6 region servers.
Please note that the addition of MonitoringContext significantly degrades performance and therefore, should becomes optional to achieve good performance.

Scaling up the TSO by parallelizing the batched writes to the commit table. The architecture mostly changed by adding batch events and creating handlers under PersistenceProcessorImpl.
This commit increases the performance of Omid from 55K tps to 380K tps when using 6 region servers.
Please note that the addition of MonitoringContext significantly degrades performance and therefore, should becomes optional to achieve good performance.

Integrating Igor's comments.

Integrating Igor's and Francisco's comments.

Scaling up the TSO by parallelizing the batched writes to the commit table. The architecture mostly changed by adding batch events and creating handlers under PersistenceProcessorImpl.
This commit increases the performance of Omid from 55K tps to 380K tps when using 6 region servers.
Please note that the addition of MonitoringContext significantly degrades performance and therefore, should becomes optional to achieve good performance.

Integrating Igor's comments.

Integrating Igor's and Francisco's comments.

Fixing a bug in the Batch handling for future reuse.

Removing busy-wait startegy from the batch allocation at the BatchPool.

Wrap wait operation with a loop to overcome spurious wakeups.

Rebase, resolve rebase errors, re-update license

Change-Id: I30727efae4fc8c0d7be328b4cd98d615f5b0fb8a

Move com.yahoo -> org.apache

Change-Id: Ieb02b4f2e0e74464ad007da8b9d0892622e1bfa6

Fix code formatting and add TODOs

No functional changes done

Change-Id: Ia32541da5bd482723375399a49bdb236db56dcf6

Asserts, style, unit tests, fixed most warning from findBugs

Change-Id: I22122894b71a69c8fc7396e7e9166aca1a489566

remove commneted out code,  leftovers of merges  '<<<<<<< '

Change-Id: If108c1a344447cef0533816a1b39a73a73657375


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

Branch: refs/heads/master
Commit: f6220a846210b202a4b41459c612434bc43297ac
Parents: 41d2e23
Author: Ohad Shacham <oh...@yahoo-inc.com>
Authored: Wed Mar 23 10:38:52 2016 +0200
Committer: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Committed: Fri Apr 29 09:38:48 2016 -0700

----------------------------------------------------------------------
 .../apache/omid/benchmarks/utils/Generator.java |   2 +-
 .../utils/ScrambledZipfianGenerator.java        |   2 +-
 .../org/apache/omid/transaction/TTable.java     |  38 +-
 .../apache/omid/transaction/TestTSOModule.java  |  13 +
 .../TSOForHBaseCompactorTestModule.java         |  12 +
 .../omid/tools/hbase/OmidTableManager.java      |  12 +-
 .../main/java/org/apache/omid/tso/Batch.java    | 146 +++++++
 .../java/org/apache/omid/tso/BatchPool.java     |  85 ++++
 .../apache/omid/tso/FatalExceptionHandler.java  |   4 +-
 .../org/apache/omid/tso/LeaseManagement.java    |   3 +-
 .../java/org/apache/omid/tso/PersistEvent.java  | 117 ++++++
 .../apache/omid/tso/PersistenceProcessor.java   |  22 +-
 .../omid/tso/PersistenceProcessorHandler.java   | 135 ++++++
 .../omid/tso/PersistenceProcessorImpl.java      | 417 ++++---------------
 .../org/apache/omid/tso/ReplyProcessor.java     |  17 +-
 .../org/apache/omid/tso/ReplyProcessorImpl.java | 273 +++++++-----
 .../apache/omid/tso/RequestProcessorImpl.java   |  79 +++-
 .../org/apache/omid/tso/RetryProcessorImpl.java |  53 +--
 .../java/org/apache/omid/tso/TSOModule.java     |  17 +-
 .../org/apache/omid/tso/TSOServerConfig.java    |  26 ++
 .../org/apache/omid/tso/TSOStateManager.java    |   6 +-
 .../apache/omid/tso/TSOStateManagerImpl.java    |   4 +-
 .../org/apache/omid/tso/VoidLeaseManager.java   |   2 +-
 tso-server/src/main/resources/default-omid.yml  |   3 +
 .../java/org/apache/omid/tso/TSOMockModule.java |  11 +
 .../java/org/apache/omid/tso/TestBatch.java     |  67 ++-
 .../java/org/apache/omid/tso/TestPanicker.java  |  64 ++-
 .../omid/tso/TestPersistenceProcessor.java      | 340 +++++++++------
 .../apache/omid/tso/TestRequestProcessor.java   |  10 +-
 .../org/apache/omid/tso/TestRetryProcessor.java |  23 +-
 30 files changed, 1303 insertions(+), 700 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/benchmarks/src/main/java/org/apache/omid/benchmarks/utils/Generator.java
----------------------------------------------------------------------
diff --git a/benchmarks/src/main/java/org/apache/omid/benchmarks/utils/Generator.java b/benchmarks/src/main/java/org/apache/omid/benchmarks/utils/Generator.java
index 159d5f9..ced6c82 100644
--- a/benchmarks/src/main/java/org/apache/omid/benchmarks/utils/Generator.java
+++ b/benchmarks/src/main/java/org/apache/omid/benchmarks/utils/Generator.java
@@ -1,5 +1,5 @@
 /**
- * Copyright (c) 2010 Yahoo! Inc. All rights reserved.                                                                                                                             
+ * Copyright (c) 2010 Yahoo! Inc. All rights reserved.
  *
  *   http://www.apache.org/licenses/LICENSE-2.0
  *

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/benchmarks/src/main/java/org/apache/omid/benchmarks/utils/ScrambledZipfianGenerator.java
----------------------------------------------------------------------
diff --git a/benchmarks/src/main/java/org/apache/omid/benchmarks/utils/ScrambledZipfianGenerator.java b/benchmarks/src/main/java/org/apache/omid/benchmarks/utils/ScrambledZipfianGenerator.java
index 1a5c429..e5e484a 100644
--- a/benchmarks/src/main/java/org/apache/omid/benchmarks/utils/ScrambledZipfianGenerator.java
+++ b/benchmarks/src/main/java/org/apache/omid/benchmarks/utils/ScrambledZipfianGenerator.java
@@ -1,5 +1,5 @@
 /**
- * Copyright (c) 2010 Yahoo! Inc. All rights reserved.                                                                                                                             
+ * Copyright (c) 2010 Yahoo! Inc. All rights reserved.
  *
  *   http://www.apache.org/licenses/LICENSE-2.0
  *

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/hbase-client/src/main/java/org/apache/omid/transaction/TTable.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/omid/transaction/TTable.java b/hbase-client/src/main/java/org/apache/omid/transaction/TTable.java
index 285facb..2c673ff 100644
--- a/hbase-client/src/main/java/org/apache/omid/transaction/TTable.java
+++ b/hbase-client/src/main/java/org/apache/omid/transaction/TTable.java
@@ -23,8 +23,6 @@ import com.google.common.base.Predicate;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Multimaps;
-import org.apache.omid.committable.CommitTable.CommitTimestamp;
-import org.apache.omid.transaction.HBaseTransactionManager.CommitTimestampLocatorImpl;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CellUtil;
@@ -44,6 +42,8 @@ import org.apache.hadoop.hbase.client.ResultScanner;
 import org.apache.hadoop.hbase.client.Scan;
 import org.apache.hadoop.hbase.io.TimeRange;
 import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.omid.committable.CommitTable.CommitTimestamp;
+import org.apache.omid.transaction.HBaseTransactionManager.CommitTimestampLocatorImpl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -189,10 +189,10 @@ public class TTable implements Closeable {
                                     CellUtils.DELETE_TOMBSTONE);
                         transaction.addWriteSetElement(
                                 new HBaseCellId(table,
-                                        delete.getRow(),
-                                        CellUtil.cloneFamily(cell),
-                                        CellUtil.cloneQualifier(cell),
-                                        cell.getTimestamp()));
+                                                delete.getRow(),
+                                                CellUtil.cloneFamily(cell),
+                                                CellUtil.cloneQualifier(cell),
+                                                cell.getTimestamp()));
                         break;
                     case DeleteFamily:
                         deleteG.addFamily(CellUtil.cloneFamily(cell));
@@ -206,10 +206,10 @@ public class TTable implements Closeable {
                                         CellUtils.DELETE_TOMBSTONE);
                             transaction.addWriteSetElement(
                                     new HBaseCellId(table,
-                                            delete.getRow(),
-                                            CellUtil.cloneFamily(cell),
-                                            CellUtil.cloneQualifier(cell),
-                                            cell.getTimestamp()));
+                                                    delete.getRow(),
+                                                    CellUtil.cloneFamily(cell),
+                                                    CellUtil.cloneQualifier(cell),
+                                                    cell.getTimestamp()));
                             break;
                         } else {
                             throw new UnsupportedOperationException(
@@ -268,10 +268,10 @@ public class TTable implements Closeable {
 
                 transaction.addWriteSetElement(
                         new HBaseCellId(table,
-                                CellUtil.cloneRow(kv),
-                                CellUtil.cloneFamily(kv),
-                                CellUtil.cloneQualifier(kv),
-                                kv.getTimestamp()));
+                                        CellUtil.cloneRow(kv),
+                                        CellUtil.cloneFamily(kv),
+                                        CellUtil.cloneQualifier(kv),
+                                        kv.getTimestamp()));
             }
         }
 
@@ -423,10 +423,10 @@ public class TTable implements Closeable {
                         epoch,
                         new CommitTimestampLocatorImpl(
                                 new HBaseCellId(table,
-                                        CellUtil.cloneRow(cell),
-                                        CellUtil.cloneFamily(cell),
-                                        CellUtil.cloneQualifier(cell),
-                                        cell.getTimestamp()),
+                                                CellUtil.cloneRow(cell),
+                                                CellUtil.cloneFamily(cell),
+                                                CellUtil.cloneQualifier(cell),
+                                                cell.getTimestamp()),
                                 commitCache));
 
         // If transaction that added the cell was invalidated
@@ -740,7 +740,7 @@ public class TTable implements Closeable {
         } else {
             throw new IllegalArgumentException(
                     String.format("The transaction object passed %s is not an instance of HBaseTransaction",
-                            tx.getClass().getName()));
+                                  tx.getClass().getName()));
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/hbase-client/src/test/java/org/apache/omid/transaction/TestTSOModule.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/test/java/org/apache/omid/transaction/TestTSOModule.java b/hbase-client/src/test/java/org/apache/omid/transaction/TestTSOModule.java
index 2d4479a..a8589bf 100644
--- a/hbase-client/src/test/java/org/apache/omid/transaction/TestTSOModule.java
+++ b/hbase-client/src/test/java/org/apache/omid/transaction/TestTSOModule.java
@@ -18,6 +18,7 @@
 package org.apache.omid.transaction;
 
 import com.google.inject.AbstractModule;
+import com.google.inject.Provider;
 import com.google.inject.Provides;
 import org.apache.omid.committable.CommitTable;
 import org.apache.omid.committable.hbase.HBaseCommitTable;
@@ -30,15 +31,18 @@ import org.apache.omid.tso.RuntimeExceptionPanicker;
 import org.apache.omid.tso.NetworkInterfaceUtils;
 import org.apache.omid.tso.Panicker;
 import org.apache.omid.tso.PausableTimestampOracle;
+import org.apache.omid.tso.PersistenceProcessorHandler;
 import org.apache.omid.tso.TSOChannelHandler;
 import org.apache.omid.tso.TSOServerConfig;
 import org.apache.omid.tso.TSOStateManager;
 import org.apache.omid.tso.TSOStateManagerImpl;
 import org.apache.omid.tso.TimestampOracle;
+
 import org.apache.hadoop.conf.Configuration;
 
 import javax.inject.Named;
 import javax.inject.Singleton;
+
 import java.net.SocketException;
 import java.net.UnknownHostException;
 
@@ -95,4 +99,13 @@ class TestTSOModule extends AbstractModule {
         return NetworkInterfaceUtils.getTSOHostAndPort(config);
     }
 
+    @Provides
+    PersistenceProcessorHandler[] getPersistenceProcessorHandler(Provider<PersistenceProcessorHandler> provider) {
+        PersistenceProcessorHandler[] persistenceProcessorHandlers = new PersistenceProcessorHandler[config.getPersistHandlerNum()];
+        for (int i = 0; i < persistenceProcessorHandlers.length; i++) {
+            persistenceProcessorHandlers[i] = provider.get();
+        }
+        return persistenceProcessorHandlers;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/hbase-coprocessor/src/test/java/org/apache/omid/transaction/TSOForHBaseCompactorTestModule.java
----------------------------------------------------------------------
diff --git a/hbase-coprocessor/src/test/java/org/apache/omid/transaction/TSOForHBaseCompactorTestModule.java b/hbase-coprocessor/src/test/java/org/apache/omid/transaction/TSOForHBaseCompactorTestModule.java
index 7a3b550..96afbd2 100644
--- a/hbase-coprocessor/src/test/java/org/apache/omid/transaction/TSOForHBaseCompactorTestModule.java
+++ b/hbase-coprocessor/src/test/java/org/apache/omid/transaction/TSOForHBaseCompactorTestModule.java
@@ -18,6 +18,7 @@
 package org.apache.omid.transaction;
 
 import com.google.inject.AbstractModule;
+import com.google.inject.Provider;
 import com.google.inject.Provides;
 import org.apache.omid.committable.CommitTable;
 import org.apache.omid.committable.hbase.HBaseCommitTable;
@@ -30,6 +31,7 @@ import org.apache.omid.tso.LeaseManagement;
 import org.apache.omid.tso.MockPanicker;
 import org.apache.omid.tso.NetworkInterfaceUtils;
 import org.apache.omid.tso.Panicker;
+import org.apache.omid.tso.PersistenceProcessorHandler;
 import org.apache.omid.tso.TSOChannelHandler;
 import org.apache.omid.tso.TSOServerConfig;
 import org.apache.omid.tso.TSOStateManager;
@@ -37,12 +39,14 @@ import org.apache.omid.tso.TSOStateManagerImpl;
 import org.apache.omid.tso.TimestampOracle;
 import org.apache.omid.tso.TimestampOracleImpl;
 import org.apache.omid.tso.VoidLeaseManager;
+
 import org.apache.commons.io.FileUtils;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 
 import javax.inject.Named;
 import javax.inject.Singleton;
+
 import java.io.File;
 import java.io.IOException;
 import java.net.SocketException;
@@ -115,6 +119,14 @@ class TSOForHBaseCompactorTestModule extends AbstractModule {
     @Named(TSO_HOST_AND_PORT_KEY)
     String provideTSOHostAndPort() throws SocketException, UnknownHostException {
         return NetworkInterfaceUtils.getTSOHostAndPort(config);
+    }
 
+    @Provides
+    PersistenceProcessorHandler[] getPersistenceProcessorHandler(Provider<PersistenceProcessorHandler> provider) {
+        PersistenceProcessorHandler[] persistenceProcessorHandlers = new PersistenceProcessorHandler[config.getPersistHandlerNum()];
+        for (int i = 0; i < persistenceProcessorHandlers.length; i++) {
+            persistenceProcessorHandlers[i] = provider.get();
+        }
+        return persistenceProcessorHandlers;
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/hbase-tools/src/main/java/org/apache/omid/tools/hbase/OmidTableManager.java
----------------------------------------------------------------------
diff --git a/hbase-tools/src/main/java/org/apache/omid/tools/hbase/OmidTableManager.java b/hbase-tools/src/main/java/org/apache/omid/tools/hbase/OmidTableManager.java
index 735ad1e..126cb99 100644
--- a/hbase-tools/src/main/java/org/apache/omid/tools/hbase/OmidTableManager.java
+++ b/hbase-tools/src/main/java/org/apache/omid/tools/hbase/OmidTableManager.java
@@ -23,12 +23,6 @@ import com.beust.jcommander.Parameter;
 import com.beust.jcommander.ParameterException;
 import com.beust.jcommander.Parameters;
 import com.beust.jcommander.ParametersDelegate;
-import org.apache.omid.HBaseShims;
-import org.apache.omid.committable.hbase.HBaseCommitTableConfig;
-import org.apache.omid.committable.hbase.KeyGenerator;
-import org.apache.omid.committable.hbase.KeyGeneratorImplementations;
-import org.apache.omid.committable.hbase.RegionSplitter;
-import org.apache.omid.timestamp.storage.HBaseTimestampStorageConfig;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HColumnDescriptor;
@@ -36,6 +30,12 @@ import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.omid.HBaseShims;
+import org.apache.omid.committable.hbase.HBaseCommitTableConfig;
+import org.apache.omid.committable.hbase.KeyGenerator;
+import org.apache.omid.committable.hbase.KeyGeneratorImplementations;
+import org.apache.omid.committable.hbase.RegionSplitter;
+import org.apache.omid.timestamp.storage.HBaseTimestampStorageConfig;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/tso-server/src/main/java/org/apache/omid/tso/Batch.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/Batch.java b/tso-server/src/main/java/org/apache/omid/tso/Batch.java
new file mode 100644
index 0000000..8f665e1
--- /dev/null
+++ b/tso-server/src/main/java/org/apache/omid/tso/Batch.java
@@ -0,0 +1,146 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.omid.tso;
+
+import com.google.common.base.Preconditions;
+import org.apache.omid.tso.PersistEvent.Type;
+import org.jboss.netty.channel.Channel;
+
+public class Batch {
+
+    private final PersistEvent[] events;
+    private final int maxBatchSize;
+    private final BatchPool batchPool;
+    private final int id;
+    private int numEvents;
+
+    Batch(int maxBatchSize) {
+
+        this(maxBatchSize, 0, null);
+
+    }
+
+    Batch(int size, int id, BatchPool batchPool) {
+        Preconditions.checkArgument(size > 0, "Size must be positive");
+        this.maxBatchSize = size;
+        this.batchPool = batchPool;
+        this.id = id;
+        this.numEvents = 0;
+        this.events = new PersistEvent[size];
+        for (int i = 0; i < size; i++) {
+            this.events[i] = new PersistEvent();
+        }
+
+    }
+
+    boolean isFull() {
+        Preconditions.checkState(numEvents <= maxBatchSize, "numEvents > maxBatchSize");
+        return numEvents == maxBatchSize;
+
+    }
+
+    boolean isEmpty() {
+
+        return numEvents == 0;
+
+    }
+
+    boolean isLastEntryEmpty() {
+        Preconditions.checkState(numEvents <= maxBatchSize, "numEvents > maxBatchSize");
+        return numEvents == (maxBatchSize - 1);
+
+    }
+
+    int getNumEvents() {
+        return numEvents;
+    }
+
+    PersistEvent getEvent(int i) {
+
+        assert (0 <= i && i < numEvents);
+        return events[i];
+
+    }
+
+    void clear() {
+
+        numEvents = 0;
+        if (batchPool != null) {
+            batchPool.notifyEmptyBatch(id);
+        }
+
+    }
+
+    void addCommit(long startTimestamp, long commitTimestamp, Channel c, MonitoringContext context) {
+        Preconditions.checkState(!isFull(), "batch is full");
+        int index = numEvents++;
+        PersistEvent e = events[index];
+        e.makePersistCommit(startTimestamp, commitTimestamp, c, context);
+
+    }
+
+    void addAbort(long startTimestamp, boolean isRetry, Channel c, MonitoringContext context) {
+        Preconditions.checkState(!isFull(), "batch is full");
+        int index = numEvents++;
+        PersistEvent e = events[index];
+        e.makePersistAbort(startTimestamp, isRetry, c, context);
+
+    }
+
+    void addTimestamp(long startTimestamp, Channel c, MonitoringContext context) {
+        Preconditions.checkState(!isFull(), "batch is full");
+        int index = numEvents++;
+        PersistEvent e = events[index];
+        e.makePersistTimestamp(startTimestamp, c, context);
+
+    }
+
+    void addLowWatermark(long lowWatermark, MonitoringContext context) {
+        Preconditions.checkState(!isFull(), "batch is full");
+        int index = numEvents++;
+        PersistEvent e = events[index];
+        e.makePersistLowWatermark(lowWatermark, context);
+
+    }
+
+    void sendReply(ReplyProcessor reply, RetryProcessor retryProc, long batchID, boolean isTSOInstanceMaster) {
+        int i = 0;
+        while (i < numEvents) {
+            PersistEvent e = events[i];
+            if (e.getType() == Type.ABORT && e.isRetry()) {
+                retryProc.disambiguateRetryRequestHeuristically(e.getStartTimestamp(), e.getChannel(), e.getMonCtx());
+                PersistEvent tmp = events[i];
+                //TODO: why assign it?
+                events[i] = events[numEvents - 1];
+                events[numEvents - 1] = tmp;
+                if (numEvents == 1) {
+                    clear();
+                    reply.batchResponse(null, batchID, !isTSOInstanceMaster);
+                    return;
+                }
+                numEvents--;
+                continue;
+            }
+            i++;
+        }
+
+        reply.batchResponse(this, batchID, !isTSOInstanceMaster);
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/tso-server/src/main/java/org/apache/omid/tso/BatchPool.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/BatchPool.java b/tso-server/src/main/java/org/apache/omid/tso/BatchPool.java
new file mode 100644
index 0000000..96bed25
--- /dev/null
+++ b/tso-server/src/main/java/org/apache/omid/tso/BatchPool.java
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.omid.tso;
+
+import javax.inject.Inject;
+import java.util.Stack;
+
+class BatchPool {
+
+    final private Batch[] batches;
+    final private int poolSize;
+    final private Stack<Integer> availableBatches;
+
+    @Inject
+    public BatchPool(TSOServerConfig config) {
+
+        int numBuffersPerHandler = (config.getNumBuffersPerHandler() >= 2) ? config.getNumBuffersPerHandler() : 2;
+        poolSize = config.getPersistHandlerNum() * numBuffersPerHandler;
+        batches = new Batch[poolSize];
+        int batchSize = (config.getMaxBatchSize() / config.getPersistHandlerNum() > 0) ? (config.getMaxBatchSize() / config.getPersistHandlerNum()) : 2;
+
+        for (int i = 0; i < poolSize; i++) {
+            batches[i] = new Batch(batchSize, i, this);
+        }
+
+        availableBatches = new Stack<>();
+
+        for (int i = (poolSize - 1); i >= 0; i--) {
+            availableBatches.push(i);
+        }
+
+    }
+
+    Batch getNextEmptyBatch() throws InterruptedException {
+
+        synchronized (availableBatches) {
+            while (availableBatches.isEmpty()) {
+                availableBatches.wait();
+            }
+
+            Integer batchIdx = availableBatches.pop();
+            return batches[batchIdx];
+        }
+
+    }
+
+    void notifyEmptyBatch(int batchIdx) {
+
+        synchronized (availableBatches) {
+            availableBatches.push(batchIdx);
+            availableBatches.notify();
+        }
+
+    }
+
+    public void reset() {
+
+        for (int i = 0; i < poolSize; i++) {
+            batches[i].clear();
+        }
+
+        availableBatches.clear();
+
+        for (int i = (poolSize - 1); i >= 0; i--) {
+            availableBatches.push(i);
+        }
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/tso-server/src/main/java/org/apache/omid/tso/FatalExceptionHandler.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/FatalExceptionHandler.java b/tso-server/src/main/java/org/apache/omid/tso/FatalExceptionHandler.java
index 44c2156..2a9f77b 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/FatalExceptionHandler.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/FatalExceptionHandler.java
@@ -21,7 +21,8 @@ import com.lmax.disruptor.ExceptionHandler;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class FatalExceptionHandler implements ExceptionHandler {
+class FatalExceptionHandler implements ExceptionHandler {
+
     private static final Logger LOG = LoggerFactory.getLogger(FatalExceptionHandler.class);
 
     Panicker panicker;
@@ -47,4 +48,5 @@ public class FatalExceptionHandler implements ExceptionHandler {
     public void handleOnStartException(Throwable ex) {
         panicker.panic("Uncaught exception starting up", ex);
     }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/tso-server/src/main/java/org/apache/omid/tso/LeaseManagement.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/LeaseManagement.java b/tso-server/src/main/java/org/apache/omid/tso/LeaseManagement.java
index 6908e7f..81d0e0a 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/LeaseManagement.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/LeaseManagement.java
@@ -36,8 +36,9 @@ public interface LeaseManagement {
 
     /**
      * Allows to start the service implementing the lease management
+     * @throws InterruptedException
      */
-    void startService() throws LeaseManagementException;
+    void startService() throws LeaseManagementException, InterruptedException;
 
     /**
      * Allows to stop the service implementing the lease management

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/tso-server/src/main/java/org/apache/omid/tso/PersistEvent.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/PersistEvent.java b/tso-server/src/main/java/org/apache/omid/tso/PersistEvent.java
new file mode 100644
index 0000000..e816149
--- /dev/null
+++ b/tso-server/src/main/java/org/apache/omid/tso/PersistEvent.java
@@ -0,0 +1,117 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.omid.tso;
+
+import org.jboss.netty.channel.Channel;
+
+public final class PersistEvent {
+
+    private MonitoringContext monCtx;
+
+    enum Type {
+        TIMESTAMP, COMMIT, ABORT, LOW_WATERMARK
+    }
+
+    private Type type = null;
+    private Channel channel = null;
+
+    private boolean isRetry = false;
+    private long startTimestamp = 0L;
+    private long commitTimestamp = 0L;
+    private long lowWatermark = 0L;
+
+    void makePersistCommit(long startTimestamp, long commitTimestamp, Channel c, MonitoringContext monCtx) {
+
+        this.type = Type.COMMIT;
+        this.startTimestamp = startTimestamp;
+        this.commitTimestamp = commitTimestamp;
+        this.channel = c;
+        this.monCtx = monCtx;
+
+    }
+
+    void makePersistAbort(long startTimestamp, boolean isRetry, Channel c, MonitoringContext monCtx) {
+
+        this.type = Type.ABORT;
+        this.startTimestamp = startTimestamp;
+        this.isRetry = isRetry;
+        this.channel = c;
+        this.monCtx = monCtx;
+
+    }
+
+    void makePersistTimestamp(long startTimestamp, Channel c, MonitoringContext monCtx) {
+
+        this.type = Type.TIMESTAMP;
+        this.startTimestamp = startTimestamp;
+        this.channel = c;
+        this.monCtx = monCtx;
+
+    }
+
+    void makePersistLowWatermark(long lowWatermark, MonitoringContext monCtx) {
+
+        this.type = Type.LOW_WATERMARK;
+        this.lowWatermark = lowWatermark;
+        this.monCtx = monCtx;
+
+    }
+
+    MonitoringContext getMonCtx() {
+
+        return monCtx;
+
+    }
+
+    Type getType() {
+
+        return type;
+
+    }
+
+    Channel getChannel() {
+
+        return channel;
+
+    }
+
+    boolean isRetry() {
+
+        return isRetry;
+
+    }
+
+    long getStartTimestamp() {
+
+        return startTimestamp;
+
+    }
+
+    long getCommitTimestamp() {
+
+        return commitTimestamp;
+
+    }
+
+    long getLowWatermark() {
+
+        return lowWatermark;
+
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessor.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessor.java b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessor.java
index e1b2092..823198b 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessor.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessor.java
@@ -19,12 +19,26 @@ package org.apache.omid.tso;
 
 import org.jboss.netty.channel.Channel;
 
+// TODO Check the names of all methods as they do not persist anything anymore
 interface PersistenceProcessor {
-    void persistCommit(long startTimestamp, long commitTimestamp, Channel c, MonitoringContext monCtx);
 
-    void persistAbort(long startTimestamp, boolean isRetry, Channel c, MonitoringContext monCtx);
+    // TODO maybe it should be called addCommit(...) or addCommitToBatch(...)
+    void persistCommit(long startTimestamp, long commitTimestamp, Channel c, MonitoringContext monCtx)
+            throws InterruptedException;
 
-    void persistTimestamp(long startTimestamp, Channel c, MonitoringContext monCtx);
+    // TODO maybe it should be called addAbort(...) or addAbortToBatch(...)
+    void persistAbort(long startTimestamp, boolean isRetry, Channel c, MonitoringContext monCtx)
+            throws InterruptedException;
+
+    // TODO maybe it should be called addTimestamp(...) or addTimestampToBatch(...)
+    void persistTimestamp(long startTimestamp, Channel c, MonitoringContext monCtx) throws InterruptedException;
+
+    // TODO maybe it should be called addLowWatermark(...) or addLowWatermarkToBatch(...)
+    void persistLowWatermark(long lowWatermark, MonitoringContext monCtx);
+
+    // TODO The name of this method is weird. Rename to "persist"
+    void persistFlush() throws InterruptedException;
+
+    void reset() throws InterruptedException;
 
-    void persistLowWatermark(long lowWatermark);
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java
new file mode 100644
index 0000000..36b1959
--- /dev/null
+++ b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java
@@ -0,0 +1,135 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.omid.tso;
+
+import com.lmax.disruptor.WorkHandler;
+import org.apache.omid.committable.CommitTable;
+import org.apache.omid.metrics.Histogram;
+import org.apache.omid.metrics.MetricsRegistry;
+import org.apache.omid.metrics.Timer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.inject.Inject;
+import java.io.IOException;
+import java.util.concurrent.ExecutionException;
+
+import static com.codahale.metrics.MetricRegistry.name;
+
+public class PersistenceProcessorHandler implements WorkHandler<PersistenceProcessorImpl.PersistBatchEvent> {
+
+    private static final Logger LOG = LoggerFactory.getLogger(PersistenceProcessorHandler.class);
+
+    private final String tsoHostAndPort;
+    private final LeaseManagement leaseManager;
+
+    private final ReplyProcessor replyProcessor;
+    private final RetryProcessor retryProc;
+    private final CommitTable.Writer writer;
+    final Panicker panicker;
+
+    private final Timer flushTimer;
+    private final Histogram batchSizeHistogram;
+
+    @Inject
+    PersistenceProcessorHandler(MetricsRegistry metrics,
+                                String tsoHostAndPort,
+                                LeaseManagement leaseManager,
+                                CommitTable commitTable,
+                                ReplyProcessor replyProcessor,
+                                RetryProcessor retryProc,
+                                Panicker panicker)
+    throws InterruptedException, ExecutionException, IOException {
+
+        this.tsoHostAndPort = tsoHostAndPort;
+        this.leaseManager = leaseManager;
+        this.writer = commitTable.getWriter();
+        this.replyProcessor = replyProcessor;
+        this.retryProc = retryProc;
+        this.panicker = panicker;
+
+        flushTimer = metrics.timer(name("tso", "persist", "flush"));
+        batchSizeHistogram = metrics.histogram(name("tso", "persist", "batchsize"));
+
+    }
+
+    @Override
+    public void onEvent(PersistenceProcessorImpl.PersistBatchEvent event) throws Exception {
+
+        Batch batch = event.getBatch();
+        for (int i=0; i < batch.getNumEvents(); ++i) {
+            PersistEvent localEvent = batch.getEvent(i);
+
+            switch (localEvent.getType()) {
+            case COMMIT:
+                localEvent.getMonCtx().timerStart("commitPersistProcessor");
+                // TODO: What happens when the IOException is thrown?
+                writer.addCommittedTransaction(localEvent.getStartTimestamp(), localEvent.getCommitTimestamp());
+                break;
+            case ABORT:
+                break;
+            case TIMESTAMP:
+                localEvent.getMonCtx().timerStart("timestampPersistProcessor");
+                break;
+            case LOW_WATERMARK:
+                writer.updateLowWatermark(localEvent.getLowWatermark());
+                break;
+            default:
+                throw new RuntimeException("Unknown event type: " + localEvent.getType().name());
+            }
+        }
+        flush(batch, event.getBatchID());
+
+    }
+
+    // TODO Fix this method with the contents of PersistenceProcessor.flush() in master branch
+    // TODO This is related to the changes in TestPersistenceProcessor.testCommitPersistenceWithHALeaseManager().
+    // TODO Check also that test in the master branch
+    private void flush(Batch batch, long batchID) throws IOException {
+
+        long startFlushTimeInNs = System.nanoTime();
+
+        boolean areWeStillMaster = true;
+        if (!leaseManager.stillInLeasePeriod()) {
+            // The master TSO replica has changed, so we must inform the
+            // clients about it when sending the replies and avoid flushing
+            // the current batch of TXs
+            areWeStillMaster = false;
+            // We need also to clear the data in the buffer
+            writer.clearWriteBuffer();
+            LOG.trace("Replica {} lost mastership before flushing data", tsoHostAndPort);
+        } else {
+            try {
+                writer.flush();
+            } catch (IOException e) {
+                panicker.panic("Error persisting commit batch", e.getCause());
+            }
+            batchSizeHistogram.update(batch.getNumEvents());
+            if (!leaseManager.stillInLeasePeriod()) {
+                // If after flushing this TSO server is not the master
+                // replica we need inform the client about it
+                areWeStillMaster = false;
+                LOG.warn("Replica {} lost mastership after flushing data", tsoHostAndPort);
+            }
+        }
+        flushTimer.update((System.nanoTime() - startFlushTimeInNs));
+        batch.sendReply(replyProcessor, retryProc, batchID, areWeStillMaster);
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java
index bc1d43c..e82f0b1 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java
@@ -19,401 +19,154 @@ package org.apache.omid.tso;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
-import com.lmax.disruptor.BatchEventProcessor;
+import com.lmax.disruptor.BusySpinWaitStrategy;
 import com.lmax.disruptor.EventFactory;
-import com.lmax.disruptor.EventHandler;
 import com.lmax.disruptor.RingBuffer;
-import com.lmax.disruptor.SequenceBarrier;
-import com.lmax.disruptor.TimeoutBlockingWaitStrategy;
-import com.lmax.disruptor.TimeoutHandler;
-import org.apache.omid.committable.CommitTable;
-import org.apache.omid.metrics.Histogram;
-import org.apache.omid.metrics.Meter;
-import org.apache.omid.metrics.MetricsRegistry;
-import org.apache.omid.metrics.Timer;
+import com.lmax.disruptor.WorkerPool;
 import org.jboss.netty.channel.Channel;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import javax.inject.Inject;
-import javax.inject.Named;
 import java.io.IOException;
+import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicLong;
 
-import static org.apache.omid.metrics.MetricsUtils.name;
-import static org.apache.omid.tso.TSOServer.TSO_HOST_AND_PORT_KEY;
+class PersistenceProcessorImpl implements PersistenceProcessor {
 
-class PersistenceProcessorImpl
-        implements EventHandler<PersistenceProcessorImpl.PersistEvent>, PersistenceProcessor, TimeoutHandler {
+    private static final long INITIAL_LWM_VALUE = -1L;
 
-    private static final Logger LOG = LoggerFactory.getLogger(PersistenceProcessor.class);
+    private final ReplyProcessor replyProcessor;
+    private final RingBuffer<PersistBatchEvent> persistRing;
 
-    private final String tsoHostAndPort;
-    private final LeaseManagement leaseManager;
-    final ReplyProcessor reply;
-    final RetryProcessor retryProc;
-    final CommitTable.Client commitTableClient;
-    final CommitTable.Writer writer;
-    final Panicker panicker;
-    final RingBuffer<PersistEvent> persistRing;
-    final Batch batch;
-    final Timer flushTimer;
-    final Histogram batchSizeHistogram;
-    final Meter timeoutMeter;
-    final int batchPersistTimeoutInMs;
+    private final BatchPool batchPool;
+    @VisibleForTesting
+    Batch batch;
+
+    // TODO Next two need to be either int or AtomicLong
+    volatile private long batchIDCnt;
+    volatile private long lowWatermark = INITIAL_LWM_VALUE;
 
-    AtomicLong lastFlush = new AtomicLong(System.nanoTime());
+    private MonitoringContext lowWatermarkContext;
 
     @Inject
     PersistenceProcessorImpl(TSOServerConfig config,
-                             MetricsRegistry metrics,
-                             @Named(TSO_HOST_AND_PORT_KEY) String tsoHostAndPort,
-                             LeaseManagement leaseManager,
-                             CommitTable commitTable,
-                             ReplyProcessor reply,
-                             RetryProcessor retryProc,
-                             Panicker panicker)
-            throws IOException {
-
-        this(config,
-             metrics,
-             tsoHostAndPort,
-             new Batch(config.getMaxBatchSize()),
-             leaseManager,
-             commitTable,
-             reply,
-             retryProc,
-             panicker);
+                             BatchPool batchPool,
+                             ReplyProcessor replyProcessor,
+                             Panicker panicker,
+                             PersistenceProcessorHandler[] handlers)
+            throws InterruptedException, ExecutionException, IOException {
 
-    }
+        this.batchIDCnt = 0L;
+        this.batchPool = batchPool;
+        this.batch = batchPool.getNextEmptyBatch();
 
-    @VisibleForTesting
-    PersistenceProcessorImpl(TSOServerConfig config,
-                             MetricsRegistry metrics,
-                             String tsoHostAndPort,
-                             Batch batch,
-                             LeaseManagement leaseManager,
-                             CommitTable commitTable,
-                             ReplyProcessor reply,
-                             RetryProcessor retryProc,
-                             Panicker panicker)
-            throws IOException {
-
-        this.tsoHostAndPort = tsoHostAndPort;
-        this.batch = batch;
-        this.batchPersistTimeoutInMs = config.getBatchPersistTimeoutInMs();
-        this.leaseManager = leaseManager;
-        this.commitTableClient = commitTable.getClient();
-        this.writer = commitTable.getWriter();
-        this.reply = reply;
-        this.retryProc = retryProc;
-        this.panicker = panicker;
-
-        LOG.info("Creating the persist processor with batch size {}, and timeout {}ms",
-                 config.getMaxBatchSize(), batchPersistTimeoutInMs);
-
-        flushTimer = metrics.timer(name("tso", "persist", "flush"));
-        batchSizeHistogram = metrics.histogram(name("tso", "persist", "batchsize"));
-        timeoutMeter = metrics.meter(name("tso", "persist", "timeout"));
-
-        // FIXME consider putting something more like a phased strategy here to avoid
-        // all the syscalls
-        final TimeoutBlockingWaitStrategy timeoutStrategy
-                = new TimeoutBlockingWaitStrategy(config.getBatchPersistTimeoutInMs(), TimeUnit.MILLISECONDS);
-
-        persistRing = RingBuffer.createSingleProducer(
-                PersistEvent.EVENT_FACTORY, 1 << 20, timeoutStrategy); // 2^20 entries in ringbuffer
-        SequenceBarrier persistSequenceBarrier = persistRing.newBarrier();
-        BatchEventProcessor<PersistEvent> persistProcessor = new BatchEventProcessor<>(
-                persistRing,
-                persistSequenceBarrier,
-                this);
-        persistRing.addGatingSequences(persistProcessor.getSequence());
-        persistProcessor.setExceptionHandler(new FatalExceptionHandler(panicker));
-
-        ExecutorService persistExec = Executors.newSingleThreadExecutor(
-                new ThreadFactoryBuilder().setNameFormat("persist-%d").build());
-        persistExec.submit(persistProcessor);
+        this.replyProcessor = replyProcessor;
 
-    }
+        this.persistRing = RingBuffer.createSingleProducer(
+                PersistBatchEvent.EVENT_FACTORY, 1 << 20, new BusySpinWaitStrategy());
 
-    @Override
-    public void onEvent(PersistEvent event, long sequence, boolean endOfBatch) throws Exception {
-
-        switch (event.getType()) {
-            case COMMIT:
-                event.getMonCtx().timerStart("commitPersistProcessor");
-                // TODO: What happens when the IOException is thrown?
-                writer.addCommittedTransaction(event.getStartTimestamp(), event.getCommitTimestamp());
-                batch.addCommit(event.getStartTimestamp(), event.getCommitTimestamp(), event.getChannel(),
-                                event.getMonCtx());
-                break;
-            case ABORT:
-                sendAbortOrIdentifyFalsePositive(event.getStartTimestamp(), event.isRetry(), event.getChannel(),
-                                                 event.getMonCtx());
-                break;
-            case TIMESTAMP:
-                event.getMonCtx().timerStart("timestampPersistProcessor");
-                batch.addTimestamp(event.getStartTimestamp(), event.getChannel(), event.getMonCtx());
-                break;
-        }
-        if (batch.isFull() || endOfBatch) {
-            maybeFlushBatch();
-        }
+        WorkerPool<PersistBatchEvent> persistProcessor = new WorkerPool<>(persistRing,
+                                                                          persistRing.newBarrier(),
+                                                                          new FatalExceptionHandler(panicker),
+                                                                          handlers);
+        this.persistRing.addGatingSequences(persistProcessor.getWorkerSequences());
 
-    }
-
-    private void sendAbortOrIdentifyFalsePositive(long startTimestamp, boolean isRetry, Channel channel,
-                                                  MonitoringContext monCtx) {
-
-        if (!isRetry) {
-            reply.abortResponse(startTimestamp, channel, monCtx);
-            return;
-        }
+        ExecutorService requestExec = Executors.newFixedThreadPool(config.getPersistHandlerNum(),
+                                                                   new ThreadFactoryBuilder().setNameFormat("persist-%d").build());
+        persistProcessor.start(requestExec);
 
-        // If is a retry, we must check if it is a already committed request abort.
-        // This can happen because a client could have missed the reply, so it
-        // retried the request after a timeout. So we added to the batch and when
-        // it's flushed we'll add events to the retry processor in order to check
-        // for false positive aborts. It needs to be done after the flush in case
-        // the commit has occurred but it hasn't been persisted yet.
-        batch.addUndecidedRetriedRequest(startTimestamp, channel, monCtx);
     }
 
-    // no event has been received in the timeout period
     @Override
-    public void onTimeout(final long sequence) {
-        maybeFlushBatch();
-    }
-
-    /**
-     * Flush the current batch if it's full, or the timeout has been elapsed since the last flush.
-     */
-    private void maybeFlushBatch() {
-        if (batch.isFull()) {
-            flush();
-        } else if ((System.nanoTime() - lastFlush.get()) > TimeUnit.MILLISECONDS.toNanos(batchPersistTimeoutInMs)) {
-            timeoutMeter.mark();
-            flush();
-        }
-    }
+    public void reset() throws InterruptedException {
 
-    synchronized private void flush() {
-
-        if (batch.getNumEvents() > 0) {
-            lastFlush.set(System.nanoTime());
-            commitSuicideIfNotMaster();
-            try {
-                writer.flush();
-                batchSizeHistogram.update(batch.getNumEvents());
-            } catch (IOException e) {
-                panicker.panic("Error persisting commit batch", e);
-            }
-            commitSuicideIfNotMaster(); // TODO Here, we can return the client responses before committing suicide
-            flushTimer.update((System.nanoTime() - lastFlush.get()));
-            batch.sendRepliesAndReset(reply, retryProc);
-        }
+        batchIDCnt = 0L;
+        batchPool.reset();
+        batch = batchPool.getNextEmptyBatch();
+        replyProcessor.reset();
 
     }
 
-    private void commitSuicideIfNotMaster() {
-        if (!leaseManager.stillInLeasePeriod()) {
-            panicker.panic("Replica " + tsoHostAndPort + " lost mastership whilst flushing data. Committing suicide");
-        }
-    }
-
     @Override
-    public void persistCommit(long startTimestamp, long commitTimestamp, Channel c, MonitoringContext monCtx) {
-        long seq = persistRing.next();
-        PersistEvent e = persistRing.get(seq);
-        PersistEvent.makePersistCommit(e, startTimestamp, commitTimestamp, c, monCtx);
-        persistRing.publish(seq);
-    }
+    public void persistFlush() throws InterruptedException {
 
-    @Override
-    public void persistAbort(long startTimestamp, boolean isRetry, Channel c, MonitoringContext monCtx) {
+        if (batch.isEmpty()) {
+            return;
+        }
+        batch.addLowWatermark(this.lowWatermark, this.lowWatermarkContext);
         long seq = persistRing.next();
-        PersistEvent e = persistRing.get(seq);
-        PersistEvent.makePersistAbort(e, startTimestamp, isRetry, c, monCtx);
+        PersistBatchEvent e = persistRing.get(seq);
+        PersistBatchEvent.makePersistBatch(e, batch, batchIDCnt++);
         persistRing.publish(seq);
-    }
+        batch = batchPool.getNextEmptyBatch();
 
-    @Override
-    public void persistTimestamp(long startTimestamp, Channel c, MonitoringContext monCtx) {
-        long seq = persistRing.next();
-        PersistEvent e = persistRing.get(seq);
-        PersistEvent.makePersistTimestamp(e, startTimestamp, c, monCtx);
-        persistRing.publish(seq);
     }
 
     @Override
-    public void persistLowWatermark(long lowWatermark) {
-        try {
-            writer.updateLowWatermark(lowWatermark);
-        } catch (IOException e) {
-            LOG.error("Should not be thrown");
-        }
-    }
-
-    public static class Batch {
-
-        final PersistEvent[] events;
-        final int maxBatchSize;
-        int numEvents;
-
-        Batch(int maxBatchSize) {
-            assert (maxBatchSize > 0);
-            LOG.info("Creating the Batch with {} elements", maxBatchSize);
-            this.maxBatchSize = maxBatchSize;
-            events = new PersistEvent[maxBatchSize];
-            numEvents = 0;
-            for (int i = 0; i < maxBatchSize; i++) {
-                events[i] = new PersistEvent();
-            }
-        }
-
-        boolean isFull() {
-            assert (numEvents <= maxBatchSize);
-            return numEvents == maxBatchSize;
-        }
+    public void persistCommit(long startTimestamp, long commitTimestamp, Channel c, MonitoringContext monCtx)
+            throws InterruptedException {
 
-        int getNumEvents() {
-            return numEvents;
+        batch.addCommit(startTimestamp, commitTimestamp, c, monCtx);
+        if (batch.isLastEntryEmpty()) {
+            persistFlush();
         }
 
-        void addCommit(long startTimestamp, long commitTimestamp, Channel c, MonitoringContext monCtx) {
-            if (isFull()) {
-                throw new IllegalStateException("batch full");
-            }
-            int index = numEvents++;
-            PersistEvent e = events[index];
-            PersistEvent.makePersistCommit(e, startTimestamp, commitTimestamp, c, monCtx);
-        }
-
-        void addUndecidedRetriedRequest(long startTimestamp, Channel c, MonitoringContext monCtx) {
-            if (isFull()) {
-                throw new IllegalStateException("batch full");
-            }
-            int index = numEvents++;
-            PersistEvent e = events[index];
-            // We mark the event as an ABORT retry to identify the events to send
-            // to the retry processor
-            PersistEvent.makePersistAbort(e, startTimestamp, true, c, monCtx);
-        }
+    }
 
-        void addTimestamp(long startTimestamp, Channel c, MonitoringContext monCtx) {
-            if (isFull()) {
-                throw new IllegalStateException("batch full");
-            }
-            int index = numEvents++;
-            PersistEvent e = events[index];
-            PersistEvent.makePersistTimestamp(e, startTimestamp, c, monCtx);
-        }
+    @Override
+    public void persistAbort(long startTimestamp, boolean isRetry, Channel c, MonitoringContext context)
+            throws InterruptedException {
 
-        void sendRepliesAndReset(ReplyProcessor reply, RetryProcessor retryProc) {
-            for (int i = 0; i < numEvents; i++) {
-                PersistEvent e = events[i];
-                switch (e.getType()) {
-                    case TIMESTAMP:
-                        e.getMonCtx().timerStop("timestampPersistProcessor");
-                        reply.timestampResponse(e.getStartTimestamp(), e.getChannel(), e.getMonCtx());
-                        break;
-                    case COMMIT:
-                        e.getMonCtx().timerStop("commitPersistProcessor");
-
-                        reply.commitResponse(e.getStartTimestamp(), e.getCommitTimestamp(), e.getChannel(), e.getMonCtx());
-                        break;
-                    case ABORT:
-                        if (e.isRetry()) {
-                            retryProc.disambiguateRetryRequestHeuristically(e.getStartTimestamp(), e.getChannel(),
-                                                                            e.getMonCtx());
-                        } else {
-                            LOG.error("We should not be receiving non-retried aborted requests in here");
-                        }
-                        break;
-                    default:
-                        LOG.error("We should receive only COMMIT or ABORT event types. Received {}", e.getType());
-                        break;
-                }
-            }
-            numEvents = 0;
+        batch.addAbort(startTimestamp, isRetry, c, context);
+        if (batch.isLastEntryEmpty()) {
+            persistFlush();
         }
 
     }
 
-    public final static class PersistEvent {
-
-        private MonitoringContext monCtx;
+    @Override
+    public void persistTimestamp(long startTimestamp, Channel c, MonitoringContext context)
+            throws InterruptedException {
 
-        enum Type {
-            TIMESTAMP, COMMIT, ABORT
+        batch.addTimestamp(startTimestamp, c, context);
+        if (batch.isLastEntryEmpty()) {
+            persistFlush();
         }
 
-        private Type type = null;
-        private Channel channel = null;
-
-        private boolean isRetry = false;
-        private long startTimestamp = 0;
-        private long commitTimestamp = 0;
-
-        static void makePersistCommit(PersistEvent e, long startTimestamp, long commitTimestamp, Channel c,
-                                      MonitoringContext monCtx) {
-            e.type = Type.COMMIT;
-            e.startTimestamp = startTimestamp;
-            e.commitTimestamp = commitTimestamp;
-            e.channel = c;
-            e.monCtx = monCtx;
-        }
+    }
 
-        static void makePersistAbort(PersistEvent e, long startTimestamp, boolean isRetry, Channel c,
-                                     MonitoringContext monCtx) {
-            e.type = Type.ABORT;
-            e.startTimestamp = startTimestamp;
-            e.isRetry = isRetry;
-            e.channel = c;
-            e.monCtx = monCtx;
-        }
+    @Override
+    public void persistLowWatermark(long lowWatermark, MonitoringContext context) {
 
-        static void makePersistTimestamp(PersistEvent e, long startTimestamp, Channel c, MonitoringContext monCtx) {
-            e.type = Type.TIMESTAMP;
-            e.startTimestamp = startTimestamp;
-            e.channel = c;
-            e.monCtx = monCtx;
-        }
+        this.lowWatermark = lowWatermark;
+        this.lowWatermarkContext = context;
 
-        MonitoringContext getMonCtx() {
-            return monCtx;
-        }
+    }
 
-        Type getType() {
-            return type;
-        }
+    final static class PersistBatchEvent {
 
-        Channel getChannel() {
-            return channel;
-        }
+        private Batch batch;
+        private long batchID;
 
-        boolean isRetry() {
-            return isRetry;
+        static void makePersistBatch(PersistBatchEvent e, Batch batch, long batchID) {
+            e.batch = batch;
+            e.batchID = batchID;
         }
 
-        long getStartTimestamp() {
-            return startTimestamp;
+        Batch getBatch() {
+            return batch;
         }
 
-        long getCommitTimestamp() {
-            return commitTimestamp;
+        long getBatchID() {
+            return batchID;
         }
 
-        public final static EventFactory<PersistEvent> EVENT_FACTORY = new EventFactory<PersistEvent>() {
-            @Override
-            public PersistEvent newInstance() {
-                return new PersistEvent();
+        final static EventFactory<PersistBatchEvent> EVENT_FACTORY = new EventFactory<PersistBatchEvent>() {
+            public PersistBatchEvent newInstance() {
+                return new PersistBatchEvent();
             }
         };
+
     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessor.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessor.java b/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessor.java
index 6aa6faa..0a3a00d 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessor.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessor.java
@@ -20,9 +20,17 @@ package org.apache.omid.tso;
 import org.jboss.netty.channel.Channel;
 
 interface ReplyProcessor {
+
+    // TODO This documentation does not corresponds to the method below anymore. Put in the right place or remove
     /**
      * Informs the client about the outcome of the Tx it was trying to commit.
      *
+     * @param batch
+     *            the batch of operations
+     * @param batchID
+     *            the id of the batch, used to enforce order between replies
+     * @param makeHeuristicDecision
+     *            informs about whether heuristic actions are needed or not
      * @param startTimestamp
      *            the start timestamp of the transaction (a.k.a. tx id)
      * @param commitTimestamp
@@ -30,10 +38,13 @@ interface ReplyProcessor {
      * @param channel
      *            the communication channed with the client
      */
-    void commitResponse(long startTimestamp, long commitTimestamp, Channel channel, MonitoringContext monCtx);
+    void batchResponse(Batch batch, long batchID, boolean makeHeuristicDecision);
+
+    void addAbort(Batch batch, long startTimestamp, Channel c, MonitoringContext context);
+
+    void addCommit(Batch batch, long startTimestamp, long commitTimestamp, Channel c, MonitoringContext context);
 
-    void abortResponse(long startTimestamp, Channel c, MonitoringContext monCtx);
+    void reset();
 
-    void timestampResponse(long startTimestamp, Channel c, MonitoringContext monCtx);
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java b/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java
index d87f9a7..55162c7 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java
@@ -18,6 +18,7 @@
 package org.apache.omid.tso;
 
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
+import com.google.inject.Inject;
 import com.lmax.disruptor.BatchEventProcessor;
 import com.lmax.disruptor.BusySpinWaitStrategy;
 import com.lmax.disruptor.EventFactory;
@@ -27,102 +28,181 @@ import com.lmax.disruptor.SequenceBarrier;
 import org.apache.omid.metrics.Meter;
 import org.apache.omid.metrics.MetricsRegistry;
 import org.apache.omid.proto.TSOProto;
+
 import org.jboss.netty.channel.Channel;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.inject.Inject;
+import java.util.Comparator;
+import java.util.PriorityQueue;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.atomic.AtomicLong;
 
-import static org.apache.omid.metrics.MetricsUtils.name;
+import static com.codahale.metrics.MetricRegistry.name;
 
-class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyEvent>, ReplyProcessor {
+class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyBatchEvent>, ReplyProcessor {
 
     private static final Logger LOG = LoggerFactory.getLogger(ReplyProcessorImpl.class);
 
-    final RingBuffer<ReplyEvent> replyRing;
-    final Meter abortMeter;
-    final Meter commitMeter;
-    final Meter timestampMeter;
+    private static final int NO_ORDER = (-1);
+
+    private final RingBuffer<ReplyBatchEvent> replyRing;
+
+    private AtomicLong nextIDToHandle = new AtomicLong();
+
+    private PriorityQueue<ReplyBatchEvent> futureEvents;
+
+    // Metrics
+    private final Meter abortMeter;
+    private final Meter commitMeter;
+    private final Meter timestampMeter;
 
     @Inject
     ReplyProcessorImpl(MetricsRegistry metrics, Panicker panicker) {
-        replyRing = RingBuffer.createMultiProducer(ReplyEvent.EVENT_FACTORY, 1 << 12, new BusySpinWaitStrategy());
+
+        this.nextIDToHandle.set(0);
+
+        this.replyRing = RingBuffer.createMultiProducer(ReplyBatchEvent.EVENT_FACTORY, 1 << 12, new BusySpinWaitStrategy());
+
         SequenceBarrier replySequenceBarrier = replyRing.newBarrier();
-        BatchEventProcessor<ReplyEvent> replyProcessor = new BatchEventProcessor<ReplyEvent>(
-                replyRing, replySequenceBarrier, this);
+        BatchEventProcessor<ReplyBatchEvent> replyProcessor = new BatchEventProcessor<>(replyRing, replySequenceBarrier, this);
         replyProcessor.setExceptionHandler(new FatalExceptionHandler(panicker));
 
         replyRing.addGatingSequences(replyProcessor.getSequence());
 
-        ExecutorService replyExec = Executors.newSingleThreadExecutor(
-                new ThreadFactoryBuilder().setNameFormat("reply-%d").build());
+        ThreadFactory threadFactory = new ThreadFactoryBuilder().setNameFormat("reply-%d").build();
+        ExecutorService replyExec = Executors.newSingleThreadExecutor(threadFactory);
         replyExec.submit(replyProcessor);
 
-        abortMeter = metrics.meter(name("tso", "aborts"));
-        commitMeter = metrics.meter(name("tso", "commits"));
-        timestampMeter = metrics.meter(name("tso", "timestampAllocation"));
+        this.futureEvents = new PriorityQueue<>(10, new Comparator<ReplyBatchEvent>() {
+            public int compare(ReplyBatchEvent replyBatchEvent1, ReplyBatchEvent replyBatchEvent2) {
+                return Long.compare(replyBatchEvent1.getBatchID(), replyBatchEvent2.getBatchID());
+            }
+        });
+
+        this.abortMeter = metrics.meter(name("tso", "aborts"));
+        this.commitMeter = metrics.meter(name("tso", "commits"));
+        this.timestampMeter = metrics.meter(name("tso", "timestampAllocation"));
+
     }
 
-    public void onEvent(ReplyEvent event, long sequence, boolean endOfBatch) throws Exception {
-        String name = null;
-        try {
-            switch (event.getType()) {
-                case COMMIT:
-                    name = "commitReplyProcessor";
-                    event.getMonCtx().timerStart(name);
-                    handleCommitResponse(event.getStartTimestamp(), event.getCommitTimestamp(), event.getChannel());
-                    break;
-                case ABORT:
-                    name = "abortReplyProcessor";
-                    event.getMonCtx().timerStart(name);
-                    handleAbortResponse(event.getStartTimestamp(), event.getChannel());
-                    break;
-                case TIMESTAMP:
-                    name = "timestampReplyProcessor";
-                    event.getMonCtx().timerStart(name);
-                    handleTimestampResponse(event.getStartTimestamp(), event.getChannel());
-                    break;
-                default:
-                    LOG.error("Unknown event {}", event.getType());
-                    break;
-            }
-        } finally {
-            if (name != null) {
-                event.getMonCtx().timerStop(name);
+    public void reset() {
+        nextIDToHandle.set(0);
+    }
+
+    private void handleReplyBatchEvent(ReplyBatchEvent event) {
+
+        String name;
+        Batch batch = event.getBatch();
+        for (int i=0; batch != null && i < batch.getNumEvents(); ++i) {
+            PersistEvent localEvent = batch.getEvent(i);
+
+            switch (localEvent.getType()) {
+            case COMMIT:
+                name = "commitReplyProcessor";
+                localEvent.getMonCtx().timerStart(name);
+                handleCommitResponse(localEvent.getStartTimestamp(), localEvent.getCommitTimestamp(), localEvent.getChannel(), event.getMakeHeuristicDecision());
+                localEvent.getMonCtx().timerStop(name);
+                 break;
+            case ABORT:
+                name = "abortReplyProcessor";
+                localEvent.getMonCtx().timerStart(name);
+                handleAbortResponse(localEvent.getStartTimestamp(), localEvent.getChannel());
+                localEvent.getMonCtx().timerStop(name);
+                break;
+            case TIMESTAMP:
+                name = "timestampReplyProcessor";
+                localEvent.getMonCtx().timerStart(name);
+                handleTimestampResponse(localEvent.getStartTimestamp(), localEvent.getChannel());
+                localEvent.getMonCtx().timerStop(name);
+                break;
+            case LOW_WATERMARK:
+                break;
+            default:
+                LOG.error("Unknown event {}", localEvent.getType());
+                break;
             }
+            localEvent.getMonCtx().publish();
+        }
+
+        if (batch != null) {
+            batch.clear();
         }
-        event.getMonCtx().publish();
+
+    }
+
+    private void processWaitingEvents() {
+
+        while (!futureEvents.isEmpty() && futureEvents.peek().getBatchID() == nextIDToHandle.get()) {
+            ReplyBatchEvent e = futureEvents.poll();
+            handleReplyBatchEvent(e);
+            nextIDToHandle.incrementAndGet();
+        }
+
+    }
+
+    public void onEvent(ReplyBatchEvent event, long sequence, boolean endOfBatch) throws Exception {
+
+        // Order of event's reply need to be guaranteed in order to preserve snapshot isolation.
+        // This is done in order to present a scenario where a start id of N is returned
+        // while commit smaller than still does not appear in the commit table.
+
+        // If previous events were not processed yet (events contain smaller id)
+        if (event.getBatchID() > nextIDToHandle.get()) {
+            futureEvents.add(event);
+            return;
+         }
+
+        handleReplyBatchEvent(event);
+
+        if (event.getBatchID() == NO_ORDER) {
+            return;
+        }
+
+        nextIDToHandle.incrementAndGet();
+
+        // Process events that arrived before and kept in futureEvents.
+        processWaitingEvents();
+
     }
 
     @Override
-    public void commitResponse(long startTimestamp, long commitTimestamp, Channel c, MonitoringContext monCtx) {
+    public void batchResponse(Batch batch, long batchID, boolean makeHeuristicDecision) {
+
         long seq = replyRing.next();
-        ReplyEvent e = replyRing.get(seq);
-        ReplyEvent.makeCommitResponse(e, startTimestamp, commitTimestamp, c, monCtx);
+        ReplyBatchEvent e = replyRing.get(seq);
+        ReplyBatchEvent.makeReplyBatch(e, batch, batchID, makeHeuristicDecision);
         replyRing.publish(seq);
+
     }
 
     @Override
-    public void abortResponse(long startTimestamp, Channel c, MonitoringContext monCtx) {
-        long seq = replyRing.next();
-        ReplyEvent e = replyRing.get(seq);
-        ReplyEvent.makeAbortResponse(e, startTimestamp, c, monCtx);
-        replyRing.publish(seq);
+    public void addAbort(Batch batch, long startTimestamp, Channel c, MonitoringContext context) {
+
+        batch.addAbort(startTimestamp, true, c, context);
+        batchResponse(batch, NO_ORDER, false);
+
     }
 
     @Override
-    public void timestampResponse(long startTimestamp, Channel c, MonitoringContext monCtx) {
-        long seq = replyRing.next();
-        ReplyEvent e = replyRing.get(seq);
-        ReplyEvent.makeTimestampReponse(e, startTimestamp, c, monCtx);
-        replyRing.publish(seq);
+    public void addCommit(Batch batch, long startTimestamp, long commitTimestamp, Channel c, MonitoringContext context) {
+
+        batch.addCommit(startTimestamp, commitTimestamp, c, context);
+        batchResponse(batch, NO_ORDER, false);
+
     }
 
-    void handleCommitResponse(long startTimestamp, long commitTimestamp, Channel c) {
+    private void handleCommitResponse(long startTimestamp, long commitTimestamp, Channel c,
+                                      boolean makeHeuristicDecision) {
+
         TSOProto.Response.Builder builder = TSOProto.Response.newBuilder();
         TSOProto.CommitResponse.Builder commitBuilder = TSOProto.CommitResponse.newBuilder();
+        // TODO Remove heuristic decissions as is not in the protocol anymore
+        if (makeHeuristicDecision) { // If the commit is ambiguous is due to a new master TSO
+//            commitBuilder.setMakeHeuristicDecision(true);
+        }
         commitBuilder.setAborted(false)
                 .setStartTimestamp(startTimestamp)
                 .setCommitTimestamp(commitTimestamp);
@@ -130,20 +210,24 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyEvent>,
         c.write(builder.build());
 
         commitMeter.mark();
+
     }
 
-    void handleAbortResponse(long startTimestamp, Channel c) {
+    private void handleAbortResponse(long startTimestamp, Channel c) {
+
         TSOProto.Response.Builder builder = TSOProto.Response.newBuilder();
         TSOProto.CommitResponse.Builder commitBuilder = TSOProto.CommitResponse.newBuilder();
-        commitBuilder.setAborted(true)
-                .setStartTimestamp(startTimestamp);
+        commitBuilder.setAborted(true);
+        commitBuilder.setStartTimestamp(startTimestamp);
         builder.setCommitResponse(commitBuilder.build());
         c.write(builder.build());
 
         abortMeter.mark();
+
     }
 
-    void handleTimestampResponse(long startTimestamp, Channel c) {
+    private void handleTimestampResponse(long startTimestamp, Channel c) {
+
         TSOProto.Response.Builder builder = TSOProto.Response.newBuilder();
         TSOProto.TimestampResponse.Builder respBuilder = TSOProto.TimestampResponse.newBuilder();
         respBuilder.setStartTimestamp(startTimestamp);
@@ -151,69 +235,36 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyEvent>,
         c.write(builder.build());
 
         timestampMeter.mark();
-    }
-
-    public final static class ReplyEvent {
-
-        enum Type {
-            TIMESTAMP, COMMIT, ABORT
-        }
-
-        private Type type = null;
-        private Channel channel = null;
-
-        private long startTimestamp = 0;
-        private long commitTimestamp = 0;
-        private MonitoringContext monCtx;
 
-        Type getType() {
-            return type;
-        }
+    }
 
-        Channel getChannel() {
-            return channel;
-        }
+    final static class ReplyBatchEvent {
 
-        long getStartTimestamp() {
-            return startTimestamp;
-        }
+        private Batch batch;
+        private long batchID;
+        private boolean makeHeuristicDecision;
 
-        long getCommitTimestamp() {
-            return commitTimestamp;
+        static void makeReplyBatch(ReplyBatchEvent e, Batch batch, long batchID, boolean makeHeuristicDecision) {
+            e.batch = batch;
+            e.batchID = batchID;
+            e.makeHeuristicDecision = makeHeuristicDecision;
         }
 
-        MonitoringContext getMonCtx() {
-            return monCtx;
+        Batch getBatch() {
+            return batch;
         }
 
-        static void makeTimestampReponse(ReplyEvent e, long startTimestamp, Channel c, MonitoringContext monCtx) {
-            e.type = Type.TIMESTAMP;
-            e.startTimestamp = startTimestamp;
-            e.channel = c;
-            e.monCtx = monCtx;
-        }
-
-        static void makeCommitResponse(ReplyEvent e, long startTimestamp,
-                                       long commitTimestamp, Channel c, MonitoringContext monCtx) {
-
-            e.type = Type.COMMIT;
-            e.startTimestamp = startTimestamp;
-            e.commitTimestamp = commitTimestamp;
-            e.channel = c;
-            e.monCtx = monCtx;
+        long getBatchID() {
+            return batchID;
         }
 
-        static void makeAbortResponse(ReplyEvent e, long startTimestamp, Channel c, MonitoringContext monCtx) {
-            e.type = Type.ABORT;
-            e.startTimestamp = startTimestamp;
-            e.channel = c;
-            e.monCtx = monCtx;
+        boolean getMakeHeuristicDecision() {
+            return makeHeuristicDecision;
         }
 
-        public final static EventFactory<ReplyEvent> EVENT_FACTORY = new EventFactory<ReplyEvent>() {
-            @Override
-            public ReplyEvent newInstance() {
-                return new ReplyEvent();
+        final static EventFactory<ReplyBatchEvent> EVENT_FACTORY = new EventFactory<ReplyBatchEvent>() {
+            public ReplyBatchEvent newInstance() {
+                return new ReplyBatchEvent();
             }
         };
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java b/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java
index cf4b44d..709a529 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java
@@ -19,11 +19,12 @@ package org.apache.omid.tso;
 
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
 import com.lmax.disruptor.BatchEventProcessor;
-import com.lmax.disruptor.BusySpinWaitStrategy;
 import com.lmax.disruptor.EventFactory;
 import com.lmax.disruptor.EventHandler;
 import com.lmax.disruptor.RingBuffer;
 import com.lmax.disruptor.SequenceBarrier;
+import com.lmax.disruptor.TimeoutBlockingWaitStrategy;
+import com.lmax.disruptor.TimeoutHandler;
 import org.apache.omid.metrics.MetricsRegistry;
 import org.apache.omid.tso.TSOStateManager.TSOState;
 import org.jboss.netty.channel.Channel;
@@ -37,25 +38,26 @@ import java.util.Iterator;
 import java.util.NoSuchElementException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
 
-public class RequestProcessorImpl implements EventHandler<RequestProcessorImpl.RequestEvent>, RequestProcessor {
+class RequestProcessorImpl implements EventHandler<RequestProcessorImpl.RequestEvent>, RequestProcessor, TimeoutHandler {
 
     private static final Logger LOG = LoggerFactory.getLogger(RequestProcessorImpl.class);
 
     private final TimestampOracle timestampOracle;
-    public final CommitHashMap hashmap;
+    private final CommitHashMap hashmap;
     private final MetricsRegistry metrics;
     private final PersistenceProcessor persistProc;
     private final RingBuffer<RequestEvent> requestRing;
     private long lowWatermark = -1L;
-    private long epoch = -1L;
 
     @Inject
-    RequestProcessorImpl(TSOServerConfig config,
-                         MetricsRegistry metrics,
+    RequestProcessorImpl(MetricsRegistry metrics,
                          TimestampOracle timestampOracle,
                          PersistenceProcessor persistProc,
-                         Panicker panicker) throws IOException {
+                         Panicker panicker,
+                         TSOServerConfig config)
+            throws IOException {
 
         this.metrics = metrics;
 
@@ -64,11 +66,14 @@ public class RequestProcessorImpl implements EventHandler<RequestProcessorImpl.R
 
         this.hashmap = new CommitHashMap(config.getMaxItems());
 
+        final TimeoutBlockingWaitStrategy timeoutStrategy
+                = new TimeoutBlockingWaitStrategy(config.getBatchPersistTimeoutInMs(), TimeUnit.MILLISECONDS);
+
         // Set up the disruptor thread
-        requestRing = RingBuffer.createMultiProducer(RequestEvent.EVENT_FACTORY, 1 << 12, new BusySpinWaitStrategy());
+        requestRing = RingBuffer.createMultiProducer(RequestEvent.EVENT_FACTORY, 1 << 12, timeoutStrategy);
         SequenceBarrier requestSequenceBarrier = requestRing.newBarrier();
         BatchEventProcessor<RequestEvent> requestProcessor =
-                new BatchEventProcessor<RequestEvent>(requestRing, requestSequenceBarrier, this);
+                new BatchEventProcessor<>(requestRing, requestSequenceBarrier, this);
         requestRing.addGatingSequences(requestProcessor.getSequence());
         requestProcessor.setExceptionHandler(new FatalExceptionHandler(panicker));
 
@@ -83,16 +88,17 @@ public class RequestProcessorImpl implements EventHandler<RequestProcessorImpl.R
      * This should be called when the TSO gets leadership
      */
     @Override
-    public void update(TSOState state) {
+    public void update(TSOState state) throws InterruptedException {
         LOG.info("Initializing RequestProcessor...");
         this.lowWatermark = state.getLowWatermark();
-        persistProc.persistLowWatermark(lowWatermark);
-        this.epoch = state.getEpoch();
-        LOG.info("RequestProcessor initialized with LWMs {} and Epoch {}", lowWatermark, epoch);
+        persistProc.persistLowWatermark(lowWatermark, new MonitoringContext(metrics));
+        persistProc.reset();
+        LOG.info("RequestProcessor initialized with LWMs {} and Epoch {}", lowWatermark, state.getEpoch());
     }
 
     @Override
     public void onEvent(RequestEvent event, long sequence, boolean endOfBatch) throws Exception {
+
         String name = null;
         try {
             if (event.getType() == RequestEvent.Type.TIMESTAMP) {
@@ -110,25 +116,42 @@ public class RequestProcessorImpl implements EventHandler<RequestProcessorImpl.R
             }
         }
 
+        if (endOfBatch) {
+            persistProc.persistFlush();
+        }
+
+    }
+
+    @Override
+    public void onTimeout(long sequence) throws Exception {
+
+        persistProc.persistFlush();
+
     }
 
     @Override
     public void timestampRequest(Channel c, MonitoringContext monCtx) {
+
         long seq = requestRing.next();
         RequestEvent e = requestRing.get(seq);
         RequestEvent.makeTimestampRequest(e, c, monCtx);
         requestRing.publish(seq);
+
     }
 
     @Override
-    public void commitRequest(long startTimestamp, Collection<Long> writeSet, boolean isRetry, Channel c, MonitoringContext monCtx) {
+    public void commitRequest(long startTimestamp, Collection<Long> writeSet, boolean isRetry, Channel c,
+                              MonitoringContext monCtx) {
+
         long seq = requestRing.next();
         RequestEvent e = requestRing.get(seq);
         RequestEvent.makeCommitRequest(e, startTimestamp, monCtx, writeSet, isRetry, c);
         requestRing.publish(seq);
+
     }
 
-    public void handleTimestamp(RequestEvent requestEvent) {
+    private void handleTimestamp(RequestEvent requestEvent) throws InterruptedException {
+
         long timestamp;
 
         try {
@@ -139,15 +162,17 @@ public class RequestProcessorImpl implements EventHandler<RequestProcessorImpl.R
         }
 
         persistProc.persistTimestamp(timestamp, requestEvent.getChannel(), requestEvent.getMonCtx());
+
     }
 
-    public long handleCommit(RequestEvent event) {
+    private long handleCommit(RequestEvent event) throws InterruptedException {
+
         long startTimestamp = event.getStartTimestamp();
         Iterable<Long> writeSet = event.writeSet();
         boolean isRetry = event.isRetry();
         Channel c = event.getChannel();
 
-        boolean committed = false;
+        boolean committed;
         long commitTimestamp = 0L;
 
         int numCellsInWriteset = 0;
@@ -183,7 +208,7 @@ public class RequestProcessorImpl implements EventHandler<RequestProcessorImpl.R
                     if (newLowWatermark != lowWatermark) {
                         LOG.trace("Setting new low Watermark to {}", newLowWatermark);
                         lowWatermark = newLowWatermark;
-                        persistProc.persistLowWatermark(newLowWatermark);
+                        persistProc.persistLowWatermark(newLowWatermark, event.getMonCtx());
                     }
                 }
                 persistProc.persistCommit(startTimestamp, commitTimestamp, c, event.getMonCtx());
@@ -195,6 +220,7 @@ public class RequestProcessorImpl implements EventHandler<RequestProcessorImpl.R
         }
 
         return commitTimestamp;
+
     }
 
     final static class RequestEvent implements Iterable<Long> {
@@ -222,8 +248,11 @@ public class RequestProcessorImpl implements EventHandler<RequestProcessorImpl.R
         }
 
         static void makeCommitRequest(RequestEvent e,
-                                      long startTimestamp, MonitoringContext monCtx, Collection<Long> writeSet,
-                                      boolean isRetry, Channel c) {
+                                      long startTimestamp,
+                                      MonitoringContext monCtx,
+                                      Collection<Long> writeSet,
+                                      boolean isRetry,
+                                      Channel c) {
             e.monCtx = monCtx;
             e.type = Type.COMMIT;
             e.channel = c;
@@ -241,6 +270,7 @@ public class RequestProcessorImpl implements EventHandler<RequestProcessorImpl.R
                     i++;
                 }
             }
+
         }
 
         MonitoringContext getMonCtx() {
@@ -261,9 +291,11 @@ public class RequestProcessorImpl implements EventHandler<RequestProcessorImpl.R
 
         @Override
         public Iterator<Long> iterator() {
+
             if (writeSetAsCollection != null) {
                 return writeSetAsCollection.iterator();
             }
+
             return new Iterator<Long>() {
                 int i = 0;
 
@@ -285,23 +317,26 @@ public class RequestProcessorImpl implements EventHandler<RequestProcessorImpl.R
                     throw new UnsupportedOperationException();
                 }
             };
+
         }
 
         Iterable<Long> writeSet() {
+
             return this;
+
         }
 
         boolean isRetry() {
             return isRetry;
         }
 
-        public final static EventFactory<RequestEvent> EVENT_FACTORY
-                = new EventFactory<RequestEvent>() {
+        final static EventFactory<RequestEvent> EVENT_FACTORY = new EventFactory<RequestEvent>() {
             @Override
             public RequestEvent newInstance() {
                 return new RequestEvent();
             }
         };
+
     }
 
 }


[09/50] [abbrv] incubator-omid git commit: Avoid TSO resets

Posted by fp...@apache.org.
Avoid TSO resets

TSO reset state-related methods have been removed and changed for a single-shot
initialization

Change-Id: I9b874c923937c1be8d09cf6a41d87e6367acafa5


Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/811ec48f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/811ec48f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/811ec48f

Branch: refs/heads/master
Commit: 811ec48f28d22a2d2ca2e4652a05c1dfe34911bf
Parents: 10fea27
Author: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Authored: Mon Apr 25 10:36:05 2016 -0700
Committer: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Committed: Mon Apr 25 13:51:03 2016 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/omid/tso/Cache.java    |  2 --
 .../java/org/apache/omid/tso/CommitHashMap.java |  5 ----
 .../java/org/apache/omid/tso/LeaseManager.java  | 20 +++++++---------
 .../java/org/apache/omid/tso/LongCache.java     |  9 -------
 .../java/org/apache/omid/tso/MockPanicker.java  |  7 ++++++
 .../main/java/org/apache/omid/tso/Panicker.java |  4 ++++
 .../apache/omid/tso/RequestProcessorImpl.java   | 11 ++++-----
 .../omid/tso/RuntimeExceptionPanicker.java      |  6 +++++
 .../java/org/apache/omid/tso/TSOServer.java     |  2 --
 .../org/apache/omid/tso/TSOStateManager.java    |  6 ++---
 .../apache/omid/tso/TSOStateManagerImpl.java    |  8 ++++---
 .../org/apache/omid/tso/VoidLeaseManager.java   |  2 +-
 .../org/apache/omid/tso/TestLeaseManager.java   | 25 ++++++++++----------
 .../java/org/apache/omid/tso/TestLongCache.java | 21 ++++------------
 .../apache/omid/tso/TestRequestProcessor.java   |  4 ++--
 .../apache/omid/tso/TestTSOStateManager.java    | 22 ++++++++---------
 16 files changed, 68 insertions(+), 86 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/811ec48f/tso-server/src/main/java/org/apache/omid/tso/Cache.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/Cache.java b/tso-server/src/main/java/org/apache/omid/tso/Cache.java
index 5904c60..53abf3d 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/Cache.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/Cache.java
@@ -23,8 +23,6 @@ package org.apache.omid.tso;
  */
 public interface Cache {
 
-    void reset();
-
     long set(long key, long value);
 
     long get(long key);

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/811ec48f/tso-server/src/main/java/org/apache/omid/tso/CommitHashMap.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/CommitHashMap.java b/tso-server/src/main/java/org/apache/omid/tso/CommitHashMap.java
index cdb64b8..df7544d 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/CommitHashMap.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/CommitHashMap.java
@@ -66,11 +66,6 @@ class CommitHashMap {
         LOG.info("CellId -> CommitTS map created with [{}] buckets (32 elems/bucket)", size);
     }
 
-    public void reset() {
-        cellIdToCommitMap.reset();
-        LOG.info("CellId -> CommitTS map reset");
-    }
-
     public long getLatestWriteForCell(long hash) {
         return cellIdToCommitMap.get(hash);
     }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/811ec48f/tso-server/src/main/java/org/apache/omid/tso/LeaseManager.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/LeaseManager.java b/tso-server/src/main/java/org/apache/omid/tso/LeaseManager.java
index 4944869..6b726b2 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/LeaseManager.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/LeaseManager.java
@@ -17,14 +17,13 @@
  */
 package org.apache.omid.tso;
 
-import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Charsets;
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.AbstractScheduledService;
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
-import org.apache.omid.tso.TSOStateManager.TSOState;
 import org.apache.curator.framework.CuratorFramework;
 import org.apache.curator.utils.EnsurePath;
+import org.apache.omid.tso.TSOStateManager.TSOState;
 import org.apache.zookeeper.KeeperException;
 import org.apache.zookeeper.data.Stat;
 import org.slf4j.Logger;
@@ -127,13 +126,13 @@ class LeaseManager extends AbstractScheduledService implements LeaseManagement {
         if (canAcquireLease()) {
             endLeaseInMs.set(baseTimeInMs.get() + leasePeriodInMs);
             LOG.info("{} got the lease (Master) Ver. {}/End of lease: {}ms", tsoHostAndPort,
-                    leaseNodeVersion, new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(endLeaseInMs));
+                     leaseNodeVersion, new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(endLeaseInMs));
             tsoStateInitializer.submit(new Runnable() {
                 // TSO State initialization
                 @Override
                 public void run() {
                     try {
-                        TSOState newTSOState = stateManager.reset();
+                        TSOState newTSOState = stateManager.initialize();
                         advertiseTSOServerInfoThroughZK(newTSOState.getEpoch());
                         tsoChannelHandler.reconnect();
                     } catch (Exception e) {
@@ -159,18 +158,15 @@ class LeaseManager extends AbstractScheduledService implements LeaseManagement {
         if (canAcquireLease()) {
             if (System.currentTimeMillis() > getEndLeaseInMs()) {
                 endLeaseInMs.set(0L);
-                LOG.warn("{} expired lease! Releasing lease to start Master re-election", tsoHostAndPort);
-                tsoChannelHandler.closeConnection();
+                panicker.panic(tsoHostAndPort + " expired lease! Master is committing suicide");
             } else {
                 endLeaseInMs.set(baseTimeInMs.get() + leasePeriodInMs);
                 LOG.trace("{} renewed lease: Version {}/End of lease at {}ms",
-                        tsoHostAndPort, leaseNodeVersion, endLeaseInMs);
+                          tsoHostAndPort, leaseNodeVersion, endLeaseInMs);
             }
         } else {
             endLeaseInMs.set(0L);
-            LOG.warn("{} lost the lease (Ver. {})! Other instance is now Master",
-                    tsoHostAndPort, leaseNodeVersion);
-            tsoChannelHandler.closeConnection();
+            panicker.panic(tsoHostAndPort + " lease lost (Ver. " + leaseNodeVersion + ")! Other instance is Master. Committing suicide...");
         }
     }
 
@@ -240,13 +236,13 @@ class LeaseManager extends AbstractScheduledService implements LeaseManagement {
                     Stat stat = zkClient.checkExists().forPath(leasePath);
                     leaseNodeVersion = stat.getVersion();
                     LOG.trace("{} will try to get lease (with Ver. {}) in {}ms", tsoHostAndPort, leaseNodeVersion,
-                            leasePeriodInMs);
+                              leasePeriodInMs);
                     // ...and wait the lease period
                     return new Schedule(leasePeriodInMs, TimeUnit.MILLISECONDS);
                 } else {
                     long waitTimeInMs = getEndLeaseInMs() - System.currentTimeMillis() - guardLeasePeriodInMs;
                     LOG.trace("{} will try to renew lease (with Ver. {}) in {}ms", tsoHostAndPort,
-                            leaseNodeVersion, waitTimeInMs);
+                              leaseNodeVersion, waitTimeInMs);
                     return new Schedule(waitTimeInMs, TimeUnit.MILLISECONDS);
                 }
             }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/811ec48f/tso-server/src/main/java/org/apache/omid/tso/LongCache.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/LongCache.java b/tso-server/src/main/java/org/apache/omid/tso/LongCache.java
index b269a0b..ecd6cd1 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/LongCache.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/LongCache.java
@@ -17,12 +17,8 @@
  */
 package org.apache.omid.tso;
 
-import java.util.Arrays;
-
 public class LongCache implements Cache {
 
-    public static final long RESET_VALUE = 0L;
-
     private final long[] cache;
     private final int size;
     private final int associativity;
@@ -33,11 +29,6 @@ public class LongCache implements Cache {
         this.associativity = associativity;
     }
 
-    @Override
-    public void reset() {
-        Arrays.fill(cache, RESET_VALUE);
-    }
-
     /* (non-Javadoc)
      * @see org.apache.omid.tso.Cache#set(long, long)
      */

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/811ec48f/tso-server/src/main/java/org/apache/omid/tso/MockPanicker.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/MockPanicker.java b/tso-server/src/main/java/org/apache/omid/tso/MockPanicker.java
index 9e3cd5f..fdf8476 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/MockPanicker.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/MockPanicker.java
@@ -21,10 +21,17 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class MockPanicker implements Panicker {
+
     private static final Logger LOG = LoggerFactory.getLogger(MockPanicker.class);
 
     @Override
+    public void panic(String reason) {
+        LOG.error("PANICKING: {}", reason);
+    }
+
+    @Override
     public void panic(String reason, Throwable cause) {
         LOG.error("PANICKING: {}", reason, cause);
     }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/811ec48f/tso-server/src/main/java/org/apache/omid/tso/Panicker.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/Panicker.java b/tso-server/src/main/java/org/apache/omid/tso/Panicker.java
index 2823f84..c821b5a 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/Panicker.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/Panicker.java
@@ -18,5 +18,9 @@
 package org.apache.omid.tso;
 
 public interface Panicker {
+
+    void panic(String reason);
+
     void panic(String reason, Throwable cause);
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/811ec48f/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java b/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java
index c853da0..cf4b44d 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java
@@ -68,9 +68,7 @@ public class RequestProcessorImpl implements EventHandler<RequestProcessorImpl.R
         requestRing = RingBuffer.createMultiProducer(RequestEvent.EVENT_FACTORY, 1 << 12, new BusySpinWaitStrategy());
         SequenceBarrier requestSequenceBarrier = requestRing.newBarrier();
         BatchEventProcessor<RequestEvent> requestProcessor =
-                new BatchEventProcessor<RequestEvent>(requestRing,
-                        requestSequenceBarrier,
-                        this);
+                new BatchEventProcessor<RequestEvent>(requestRing, requestSequenceBarrier, this);
         requestRing.addGatingSequences(requestProcessor.getSequence());
         requestProcessor.setExceptionHandler(new FatalExceptionHandler(panicker));
 
@@ -82,15 +80,14 @@ public class RequestProcessorImpl implements EventHandler<RequestProcessorImpl.R
     }
 
     /**
-     * This should be called when the TSO gets initialized or gets leadership
+     * This should be called when the TSO gets leadership
      */
     @Override
-    public void update(TSOState state) throws IOException {
-        LOG.info("Reseting RequestProcessor...");
+    public void update(TSOState state) {
+        LOG.info("Initializing RequestProcessor...");
         this.lowWatermark = state.getLowWatermark();
         persistProc.persistLowWatermark(lowWatermark);
         this.epoch = state.getEpoch();
-        hashmap.reset();
         LOG.info("RequestProcessor initialized with LWMs {} and Epoch {}", lowWatermark, epoch);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/811ec48f/tso-server/src/main/java/org/apache/omid/tso/RuntimeExceptionPanicker.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/RuntimeExceptionPanicker.java b/tso-server/src/main/java/org/apache/omid/tso/RuntimeExceptionPanicker.java
index c1fbadb..657f0d2 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/RuntimeExceptionPanicker.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/RuntimeExceptionPanicker.java
@@ -20,7 +20,13 @@ package org.apache.omid.tso;
 class RuntimeExceptionPanicker implements Panicker {
 
     @Override
+    public void panic(String reason) {
+        panic(reason, new Throwable("TSO Error"));
+    }
+
+    @Override
     public void panic(String reason, Throwable cause) {
         throw new RuntimeException(reason, cause);
     }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/811ec48f/tso-server/src/main/java/org/apache/omid/tso/TSOServer.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/TSOServer.java b/tso-server/src/main/java/org/apache/omid/tso/TSOServer.java
index 82d2ade..c93a0b6 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/TSOServer.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/TSOServer.java
@@ -25,8 +25,6 @@ import com.google.inject.Injector;
 import com.google.inject.Module;
 import com.google.inject.Singleton;
 import org.apache.omid.metrics.MetricsRegistry;
-import org.apache.omid.tools.hbase.HBaseLogin;
-import org.apache.hadoop.conf.Configuration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/811ec48f/tso-server/src/main/java/org/apache/omid/tso/TSOStateManager.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/TSOStateManager.java b/tso-server/src/main/java/org/apache/omid/tso/TSOStateManager.java
index 2e69cad..10eabac 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/TSOStateManager.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/TSOStateManager.java
@@ -84,12 +84,12 @@ public interface TSOStateManager {
     void unregister(StateObserver observer);
 
     /**
-     * Allows to reset the state
+     * Allows to initialize the state
      *
-     * @return the new state after reset
+     * @return the new state
      * @throws IOException
      *             when problems resetting occur
      */
-    TSOState reset() throws IOException;
+    TSOState initialize() throws IOException;
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/811ec48f/tso-server/src/main/java/org/apache/omid/tso/TSOStateManagerImpl.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/TSOStateManagerImpl.java b/tso-server/src/main/java/org/apache/omid/tso/TSOStateManagerImpl.java
index ed0f600..a10c22f 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/TSOStateManagerImpl.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/TSOStateManagerImpl.java
@@ -58,8 +58,9 @@ public class TSOStateManagerImpl implements TSOStateManager {
     }
 
     @Override
-    public synchronized TSOState reset() throws IOException {
-        LOG.info("Reseting the TSO Server state...");
+    public TSOState initialize() throws IOException {
+
+        LOG.info("Initializing TSO Server state...");
         // The timestamp oracle dictates the new state
         timestampOracle.initialize();
         long lowWatermark = timestampOracle.getLast();
@@ -71,8 +72,9 @@ public class TSOStateManagerImpl implements TSOStateManager {
         for (StateObserver stateObserver : stateObservers) {
             stateObserver.update(state);
         }
-        LOG.info("New TSO Server state {}", state);
+        LOG.info("TSO Server state {}", state);
         return state;
+
     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/811ec48f/tso-server/src/main/java/org/apache/omid/tso/VoidLeaseManager.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/VoidLeaseManager.java b/tso-server/src/main/java/org/apache/omid/tso/VoidLeaseManager.java
index 25fb2a0..0b32885 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/VoidLeaseManager.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/VoidLeaseManager.java
@@ -32,7 +32,7 @@ public class VoidLeaseManager implements LeaseManagement {
     @Override
     public void startService() throws LeaseManagementException {
         try {
-            stateManager.reset();
+            stateManager.initialize();
             tsoChannelHandler.reconnect();
         } catch (IOException e) {
             throw new LeaseManagementException("Error initializing Lease Manager", e);

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/811ec48f/tso-server/src/test/java/org/apache/omid/tso/TestLeaseManager.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestLeaseManager.java b/tso-server/src/test/java/org/apache/omid/tso/TestLeaseManager.java
index 59a0220..60cefca 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestLeaseManager.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestLeaseManager.java
@@ -18,11 +18,11 @@
 package org.apache.omid.tso;
 
 import com.google.common.base.Charsets;
-import org.apache.omid.TestUtils;
-import org.apache.omid.tso.TSOStateManager.TSOState;
 import org.apache.curator.framework.CuratorFramework;
 import org.apache.curator.test.TestingServer;
 import org.apache.curator.utils.CloseableUtils;
+import org.apache.omid.TestUtils;
+import org.apache.omid.tso.TSOStateManager.TSOState;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 import org.slf4j.Logger;
@@ -105,7 +105,7 @@ public class TestLeaseManager {
 
         TSOChannelHandler tsoChannelHandler = mock(TSOChannelHandler.class);
         TSOStateManager stateManager = mock(TSOStateManager.class);
-        when(stateManager.reset()).thenThrow(new IOException());
+        when(stateManager.initialize()).thenThrow(new IOException());
         leaseManager1 = new PausableLeaseManager(LEASE_MGR_ID_1,
                                                  tsoChannelHandler,
                                                  stateManager,
@@ -126,8 +126,7 @@ public class TestLeaseManager {
     }
 
     @Test(timeOut = 60000)
-    public void testLeaseHolderDoesNotChangeWhenPausedForALongTimeAndTheresNoOtherInstance()
-            throws Exception {
+    public void testLeaseHolderDoesNotChangeWhenPausedForALongTimeAndTheresNoOtherInstance() throws Exception {
 
         final String TEST_TSO_LEASE_PATH = "/test1_tsolease";
         final String TEST_CURRENT_TSO_PATH = "/test1_currenttso";
@@ -135,7 +134,7 @@ public class TestLeaseManager {
         // Launch the instance under test...
         TSOChannelHandler tsoChannelHandler1 = mock(TSOChannelHandler.class);
         TSOStateManager stateManager1 = mock(TSOStateManager.class);
-        when(stateManager1.reset()).thenReturn(new TSOState(DUMMY_LOW_WATERMARK_1, DUMMY_EPOCH_1));
+        when(stateManager1.initialize()).thenReturn(new TSOState(DUMMY_LOW_WATERMARK_1, DUMMY_EPOCH_1));
         leaseManager1 = new PausableLeaseManager(LEASE_MGR_ID_1,
                                                  tsoChannelHandler1,
                                                  stateManager1,
@@ -173,7 +172,7 @@ public class TestLeaseManager {
         // ... and check again that nothing changed
         checkLeaseHolder(TEST_TSO_LEASE_PATH, LEASE_MGR_ID_1);
         checkInstanceId(TEST_CURRENT_TSO_PATH, INSTANCE_ID_1 + "1");
-        assertTrue(leaseManager1.stillInLeasePeriod());
+        assertFalse(leaseManager1.stillInLeasePeriod()); // Must not be master as it should have triggered and exception
 
     }
 
@@ -186,7 +185,7 @@ public class TestLeaseManager {
         // Launch the master instance...
         TSOChannelHandler tsoChannelHandler1 = mock(TSOChannelHandler.class);
         TSOStateManager stateManager1 = mock(TSOStateManager.class);
-        when(stateManager1.reset()).thenReturn(new TSOState(DUMMY_LOW_WATERMARK_1, DUMMY_EPOCH_1));
+        when(stateManager1.initialize()).thenReturn(new TSOState(DUMMY_LOW_WATERMARK_1, DUMMY_EPOCH_1));
         leaseManager1 = new PausableLeaseManager(LEASE_MGR_ID_1,
                                                  tsoChannelHandler1,
                                                  stateManager1,
@@ -209,7 +208,7 @@ public class TestLeaseManager {
         // Then launch another instance...
         TSOChannelHandler tsoChannelHandler2 = mock(TSOChannelHandler.class);
         TSOStateManager stateManager2 = mock(TSOStateManager.class);
-        when(stateManager2.reset()).thenReturn(new TSOState(DUMMY_LOW_WATERMARK_2, DUMMY_EPOCH_2));
+        when(stateManager2.initialize()).thenReturn(new TSOState(DUMMY_LOW_WATERMARK_2, DUMMY_EPOCH_2));
         leaseManager2 = new PausableLeaseManager(LEASE_MGR_ID_2,
                                                  tsoChannelHandler2,
                                                  stateManager2,
@@ -239,7 +238,7 @@ public class TestLeaseManager {
         // Launch the master instance...
         TSOChannelHandler tsoChannelHandler1 = mock(TSOChannelHandler.class);
         TSOStateManager stateManager1 = mock(TSOStateManager.class);
-        when(stateManager1.reset()).thenReturn(new TSOState(DUMMY_LOW_WATERMARK_1, DUMMY_EPOCH_1));
+        when(stateManager1.initialize()).thenReturn(new TSOState(DUMMY_LOW_WATERMARK_1, DUMMY_EPOCH_1));
         leaseManager1 = new PausableLeaseManager(LEASE_MGR_ID_1,
                                                  tsoChannelHandler1,
                                                  stateManager1,
@@ -262,7 +261,7 @@ public class TestLeaseManager {
         // Then launch another instance...
         TSOChannelHandler tsoChannelHandler2 = mock(TSOChannelHandler.class);
         TSOStateManager stateManager2 = mock(TSOStateManager.class);
-        when(stateManager2.reset()).thenReturn(new TSOState(DUMMY_LOW_WATERMARK_2, DUMMY_EPOCH_2));
+        when(stateManager2.initialize()).thenReturn(new TSOState(DUMMY_LOW_WATERMARK_2, DUMMY_EPOCH_2));
         leaseManager2 = new PausableLeaseManager(LEASE_MGR_ID_2,
                                                  tsoChannelHandler2,
                                                  stateManager2,
@@ -285,7 +284,7 @@ public class TestLeaseManager {
         assertTrue(leaseManager2.stillInLeasePeriod());
 
         // Now, lets resume the first instance...
-        when(stateManager1.reset()).thenReturn(new TSOState(DUMMY_LOW_WATERMARK_3, DUMMY_EPOCH_3));
+        when(stateManager1.initialize()).thenReturn(new TSOState(DUMMY_LOW_WATERMARK_3, DUMMY_EPOCH_3));
         leaseManager1.resume();
 
         // ... let the test run for some time...
@@ -334,7 +333,7 @@ public class TestLeaseManager {
 
         // Launch the master instance...
         TSOStateManager stateManager1 = mock(TSOStateManager.class);
-        when(stateManager1.reset()).thenReturn(new TSOState(DUMMY_LOW_WATERMARK_1, DUMMY_EPOCH_1));
+        when(stateManager1.initialize()).thenReturn(new TSOState(DUMMY_LOW_WATERMARK_1, DUMMY_EPOCH_1));
         PausableLeaseManager leaseManager = new PausableLeaseManager(LEASE_MGR_ID_1,
                                                                      mock(TSOChannelHandler.class),
                                                                      stateManager1,

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/811ec48f/tso-server/src/test/java/org/apache/omid/tso/TestLongCache.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestLongCache.java b/tso-server/src/test/java/org/apache/omid/tso/TestLongCache.java
index c6cad08..c02ed85 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestLongCache.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestLongCache.java
@@ -26,7 +26,7 @@ import java.util.Set;
 import java.util.TreeSet;
 
 import static org.testng.Assert.assertEquals;
-import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.Assert.assertTrue;
 
 public class TestLongCache {
 
@@ -37,7 +37,7 @@ public class TestLongCache {
     private Random random = new Random(System.currentTimeMillis());
 
     @Test
-    public void testAddAndGetElemsAndResetCache() {
+    public void testAddAndGetElems() {
 
         // Cache configuration
         final int CACHE_SIZE = 10_000_000;
@@ -47,7 +47,7 @@ public class TestLongCache {
         // After creation, cache values should be the default
         for (int i = 0; i < 1000; i++) {
             long position = random.nextLong();
-            assertEquals(cache.get(position), LongCache.RESET_VALUE);
+            assertEquals(cache.get(position), 0L);
         }
 
         Set<Long> testedKeys = new TreeSet<>();
@@ -63,17 +63,6 @@ public class TestLongCache {
             assertEquals(cache.get(key), TEST_VALUE);
         }
 
-        // Reset cache and check the values are the default again
-        long startTimeInMs = System.currentTimeMillis();
-        cache.reset();
-        long endTimeInMs = System.currentTimeMillis();
-        long resetTimeInMs = endTimeInMs - startTimeInMs;
-        LOG.info("Time in reseting cache of {}/{} elems/asoc {}ms", CACHE_SIZE, CACHE_ASSOCIATIVITY, resetTimeInMs);
-
-        for (long key : testedKeys) {
-            assertEquals(cache.get(key), LongCache.RESET_VALUE);
-        }
-
     }
 
     @Test(timeOut = 10000)
@@ -116,7 +105,7 @@ public class TestLongCache {
         double avgGap = totalAge / (double) removals;
         LOG.info("Avg gap: " + (tempAvg));
         LOG.info("Std dev gap: " + Math.sqrt((tempStdDev / entries)));
-        assertTrue("avgGap should be greater than entries * 0.6",
-                avgGap > entries * 0.6);
+        assertTrue(avgGap > entries * 0.6, "avgGap should be greater than entries * 0.6");
+
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/811ec48f/tso-server/src/test/java/org/apache/omid/tso/TestRequestProcessor.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestRequestProcessor.java b/tso-server/src/test/java/org/apache/omid/tso/TestRequestProcessor.java
index a9b32e6..d1272a7 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestRequestProcessor.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestRequestProcessor.java
@@ -75,7 +75,7 @@ public class TestRequestProcessor {
 
         // Initialize the state for the experiment
         stateManager.register(requestProc);
-        stateManager.reset();
+        stateManager.initialize();
 
     }
 
@@ -150,7 +150,7 @@ public class TestRequestProcessor {
 
         // ... simulate the reset of the RequestProcessor state (e.g. due to
         // a change in mastership) and...
-        stateManager.reset();
+        stateManager.initialize();
 
         // ...check that the transaction is aborted when trying to commit
         requestProc.commitRequest(startTS, writeSet, false, null, new MonitoringContext(metrics));

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/811ec48f/tso-server/src/test/java/org/apache/omid/tso/TestTSOStateManager.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestTSOStateManager.java b/tso-server/src/test/java/org/apache/omid/tso/TestTSOStateManager.java
index c69e77f..2b4b250 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestTSOStateManager.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestTSOStateManager.java
@@ -51,23 +51,23 @@ public class TestTSOStateManager {
     }
 
     @Test
-    public void testResetOfTSOServerState() throws Exception {
+    public void testTSOServerStateInitialization() throws Exception {
 
         // Reset the state and check we get the initial state values
-        TSOState initialState = stateManager.reset();
+        TSOState initialState = stateManager.initialize();
         assertEquals(initialState.getLowWatermark(), INITIAL_STATE_VALUE);
         assertEquals(initialState.getEpoch(), INITIAL_STATE_VALUE);
         assertTrue("In this implementation low watermark should be equal to epoch",
-                initialState.getLowWatermark() == initialState.getEpoch());
+                   initialState.getLowWatermark() == initialState.getEpoch());
 
         // Then, simulate a change in the state returned by the Timestamp Oracle...
         when(timestampOracle.getLast()).thenReturn(NEW_STATE_VALUE);
         // ... and again, reset the state and check we get the new values
-        TSOState secondState = stateManager.reset();
+        TSOState secondState = stateManager.initialize();
         assertEquals(secondState.getLowWatermark(), NEW_STATE_VALUE);
         assertEquals(secondState.getEpoch(), NEW_STATE_VALUE);
         assertTrue("In this implementation low watermark should be equal to epoch",
-                secondState.getLowWatermark() == secondState.getEpoch());
+                   secondState.getLowWatermark() == secondState.getEpoch());
 
     }
 
@@ -79,7 +79,7 @@ public class TestTSOStateManager {
         stateManager.register(observer1);
 
         // Reset the state to trigger observer notifications
-        TSOState state = stateManager.reset();
+        TSOState state = stateManager.initialize();
 
         // Check observer 1 was notified with the corresponding state
         verify(observer1, timeout(100).times(1)).update(eq(state));
@@ -89,7 +89,7 @@ public class TestTSOStateManager {
         stateManager.register(observer2);
 
         // Again, reset the state to trigger observer notifications
-        state = stateManager.reset();
+        state = stateManager.initialize();
 
         // Check both observers were notified with the corresponding state
         verify(observer1, timeout(100).times(1)).update(eq(state));
@@ -99,16 +99,16 @@ public class TestTSOStateManager {
         stateManager.unregister(observer1);
 
         // Again, reset the state to trigger observer notifications
-        state = stateManager.reset();
+        state = stateManager.initialize();
 
         // Check only observer 2 was notified
         verify(observer1, timeout(100).times(0)).update(eq(state));
         verify(observer2, timeout(100).times(1)).update(eq(state));
     }
 
-    // ------------------------------------------------------------------------
-    // -------------------------- Helper classes ------------------------------
-    // ------------------------------------------------------------------------
+    // ----------------------------------------------------------------------------------------------------------------
+    // Helper classes
+    // ----------------------------------------------------------------------------------------------------------------
 
     private class DummyObserver implements StateObserver {
 


[23/50] [abbrv] incubator-omid git commit: [ci skip]prepare for next development iteration

Posted by fp...@apache.org.
[ci skip]prepare for next development iteration


Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/5d7dfad7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/5d7dfad7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/5d7dfad7

Branch: refs/heads/master
Commit: 5d7dfad75da486ea69313819944fe7ff94a280e0
Parents: c4bd5db
Author: Omid CI <om...@yahoo-inc.com>
Authored: Thu Apr 28 23:16:18 2016 +0000
Committer: Omid CI <om...@yahoo-inc.com>
Committed: Thu Apr 28 23:16:18 2016 +0000

----------------------------------------------------------------------
 benchmarks/pom.xml          | 2 +-
 codahale-metrics/pom.xml    | 2 +-
 commit-table/pom.xml        | 2 +-
 common/pom.xml              | 2 +-
 examples/pom.xml            | 2 +-
 hbase-client/pom.xml        | 2 +-
 hbase-commit-table/pom.xml  | 2 +-
 hbase-common/pom.xml        | 2 +-
 hbase-coprocessor/pom.xml   | 2 +-
 hbase-shims/hbase-0/pom.xml | 2 +-
 hbase-shims/hbase-1/pom.xml | 2 +-
 hbase-shims/pom.xml         | 2 +-
 hbase-tools/pom.xml         | 2 +-
 metrics/pom.xml             | 2 +-
 pom.xml                     | 4 ++--
 statemachine/pom.xml        | 2 +-
 timestamp-storage/pom.xml   | 2 +-
 transaction-client/pom.xml  | 2 +-
 tso-server/pom.xml          | 2 +-
 19 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5d7dfad7/benchmarks/pom.xml
----------------------------------------------------------------------
diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml
index ce550a5..fa34b12 100644
--- a/benchmarks/pom.xml
+++ b/benchmarks/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.46</version>
+        <version>0.8.1.47-SNAPSHOT</version>
     </parent>
 
     <artifactId>benchmarks</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5d7dfad7/codahale-metrics/pom.xml
----------------------------------------------------------------------
diff --git a/codahale-metrics/pom.xml b/codahale-metrics/pom.xml
index 0dbf723..b5e9b8f 100644
--- a/codahale-metrics/pom.xml
+++ b/codahale-metrics/pom.xml
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.46</version>
+        <version>0.8.1.47-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5d7dfad7/commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/commit-table/pom.xml b/commit-table/pom.xml
index 7904657..a1f7394 100644
--- a/commit-table/pom.xml
+++ b/commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.46</version>
+        <version>0.8.1.47-SNAPSHOT</version>
     </parent>
 
     <artifactId>commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5d7dfad7/common/pom.xml
----------------------------------------------------------------------
diff --git a/common/pom.xml b/common/pom.xml
index 9b77ec3..0ae1910 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.46</version>
+        <version>0.8.1.47-SNAPSHOT</version>
     </parent>
 
     <artifactId>common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5d7dfad7/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index a7c3d58..eb27b2e 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.46</version>
+        <version>0.8.1.47-SNAPSHOT</version>
     </parent>
 
     <artifactId>examples</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5d7dfad7/hbase-client/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml
index e69180d..96c9ba1 100644
--- a/hbase-client/pom.xml
+++ b/hbase-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.46</version>
+        <version>0.8.1.47-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5d7dfad7/hbase-commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-commit-table/pom.xml b/hbase-commit-table/pom.xml
index 7c12bea..4f80486 100644
--- a/hbase-commit-table/pom.xml
+++ b/hbase-commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.46</version>
+        <version>0.8.1.47-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5d7dfad7/hbase-common/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml
index fd836c8..b32f89d 100644
--- a/hbase-common/pom.xml
+++ b/hbase-common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.46</version>
+        <version>0.8.1.47-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5d7dfad7/hbase-coprocessor/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-coprocessor/pom.xml b/hbase-coprocessor/pom.xml
index 06373d0..66f8e37 100644
--- a/hbase-coprocessor/pom.xml
+++ b/hbase-coprocessor/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.46</version>
+        <version>0.8.1.47-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-coprocessor</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5d7dfad7/hbase-shims/hbase-0/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-0/pom.xml b/hbase-shims/hbase-0/pom.xml
index 05ea0f6..333aa10 100644
--- a/hbase-shims/hbase-0/pom.xml
+++ b/hbase-shims/hbase-0/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.46</version>
+        <version>0.8.1.47-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase0-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5d7dfad7/hbase-shims/hbase-1/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-1/pom.xml b/hbase-shims/hbase-1/pom.xml
index 92d5c68..e920c1d 100644
--- a/hbase-shims/hbase-1/pom.xml
+++ b/hbase-shims/hbase-1/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.46</version>
+        <version>0.8.1.47-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase1-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5d7dfad7/hbase-shims/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/pom.xml b/hbase-shims/pom.xml
index 9af547b..9d9bfa7 100644
--- a/hbase-shims/pom.xml
+++ b/hbase-shims/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.46</version>
+        <version>0.8.1.47-SNAPSHOT</version>
     </parent>
 
     <artifactId>omid-shims-aggregator</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5d7dfad7/hbase-tools/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-tools/pom.xml b/hbase-tools/pom.xml
index 1ccb388..0359a4a 100644
--- a/hbase-tools/pom.xml
+++ b/hbase-tools/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.46</version>
+        <version>0.8.1.47-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-tools</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5d7dfad7/metrics/pom.xml
----------------------------------------------------------------------
diff --git a/metrics/pom.xml b/metrics/pom.xml
index 67cf31b..6d62a8e 100644
--- a/metrics/pom.xml
+++ b/metrics/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.46</version>
+        <version>0.8.1.47-SNAPSHOT</version>
     </parent>
 
     <artifactId>metrics</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5d7dfad7/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 329540e..fbf0a1b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
     <artifactId>omid</artifactId>
     <packaging>pom</packaging>
     <!-- WARNING: do not update version manually, use mvn versions:set -->
-    <version>0.8.1.46</version>
+    <version>0.8.1.47-SNAPSHOT</version>
 
     <organization>
         <name>Apache Software Foundation</name>
@@ -105,7 +105,7 @@
         <connection>scm:git:git://github.com/yahoo/omid.git</connection>
         <developerConnection>scm:git:https://${GH_TOKEN}@github.com/yahoo/omid.git</developerConnection>
         <url>https://github.com/yahoo/omid</url>
-        <tag>omid-0.8.1.46</tag>
+        <tag>master</tag>
     </scm>
 
     <distributionManagement>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5d7dfad7/statemachine/pom.xml
----------------------------------------------------------------------
diff --git a/statemachine/pom.xml b/statemachine/pom.xml
index bc85330..2057355 100644
--- a/statemachine/pom.xml
+++ b/statemachine/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.46</version>
+        <version>0.8.1.47-SNAPSHOT</version>
     </parent>
 
     <name>State Machine</name>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5d7dfad7/timestamp-storage/pom.xml
----------------------------------------------------------------------
diff --git a/timestamp-storage/pom.xml b/timestamp-storage/pom.xml
index 478b818..b0a2948 100644
--- a/timestamp-storage/pom.xml
+++ b/timestamp-storage/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.46</version>
+        <version>0.8.1.47-SNAPSHOT</version>
     </parent>
 
     <artifactId>timestamp-storage</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5d7dfad7/transaction-client/pom.xml
----------------------------------------------------------------------
diff --git a/transaction-client/pom.xml b/transaction-client/pom.xml
index a818db5..65655ae 100644
--- a/transaction-client/pom.xml
+++ b/transaction-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.46</version>
+        <version>0.8.1.47-SNAPSHOT</version>
     </parent>
 
     <artifactId>transaction-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/5d7dfad7/tso-server/pom.xml
----------------------------------------------------------------------
diff --git a/tso-server/pom.xml b/tso-server/pom.xml
index af27199..1d25f85 100644
--- a/tso-server/pom.xml
+++ b/tso-server/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.46</version>
+        <version>0.8.1.47-SNAPSHOT</version>
     </parent>
 
     <artifactId>tso-server</artifactId>


[38/50] [abbrv] incubator-omid git commit: Parallel execution example

Posted by fp...@apache.org.
Parallel execution example

Change-Id: Idd5cac8391845aa08293ea71104c7973caa6e357


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

Branch: refs/heads/master
Commit: e95a12fcd1d43be11db719965803b7a4c556105c
Parents: 41d2e23
Author: Igor Katkov <ka...@yahoo-inc.com>
Authored: Thu May 5 11:00:34 2016 -0700
Committer: Igor Katkov <ka...@yahoo-inc.com>
Committed: Fri May 6 09:33:16 2016 -0700

----------------------------------------------------------------------
 examples/pom.xml                                |   6 +
 examples/run.sh                                 |  11 +-
 .../apache/omid/examples/ParallelExecution.java |  94 ++++++++
 .../apache/omid/examples/RowIdGenerator.java    |  23 ++
 .../omid/examples/SnapshotIsolationExample.java | 215 +++++++++++--------
 pom.xml                                         |   2 +-
 6 files changed, 260 insertions(+), 91 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/e95a12fc/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 236e377..f0dc7ef 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -36,6 +36,12 @@
             <version>${slf4j.version}</version>
         </dependency>
 
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>apache-log4j-extras</artifactId>
+            <version>${log4j.version}</version>
+        </dependency>
+
     </dependencies>
 
     <build>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/e95a12fc/examples/run.sh
----------------------------------------------------------------------
diff --git a/examples/run.sh b/examples/run.sh
index 6785919..b9323c3 100755
--- a/examples/run.sh
+++ b/examples/run.sh
@@ -22,7 +22,7 @@ function show_help() {
     # $ $0 <example> [ tablename ] [column family name]
     #
     # where:
-    # - <example> can be [ basic | si | conf ]
+    # - <example> can be [ basic | si | conf | parallel ]
     #
     # Example execution:
     # ------------------
@@ -84,13 +84,16 @@ USER_OPTION=$1
 shift
 case ${USER_OPTION} in
     basic)
-        java -cp $KLASSPATH org.apache.omid.examples.BasicExample "$@"
+        java -cp $KLASSPATH -Dlog4j.configuration=file:${SCRIPTDIR}/conf/log4j.properties org.apache.omid.examples.BasicExample "$@"
         ;;
     si)
-        java -cp $KLASSPATH org.apache.omid.examples.SnapshotIsolationExample "$@"
+        java -cp $KLASSPATH -Dlog4j.configuration=file:${SCRIPTDIR}/conf/log4j.properties org.apache.omid.examples.SnapshotIsolationExample "$@"
+        ;;
+    parallel)
+        java -cp $KLASSPATH -Dlog4j.configuration=file:${SCRIPTDIR}/conf/log4j.properties org.apache.omid.examples.ParallelExecution "$@"
         ;;
     conf)
-        java -cp $KLASSPATH org.apache.omid.examples.ConfigurationExample "$@"
+        java -cp $KLASSPATH -Dlog4j.configuration=file:${SCRIPTDIR}/conf/log4j.properties org.apache.omid.examples.ConfigurationExample "$@"
         ;;
     *)
         show_help

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/e95a12fc/examples/src/main/java/org/apache/omid/examples/ParallelExecution.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/omid/examples/ParallelExecution.java b/examples/src/main/java/org/apache/omid/examples/ParallelExecution.java
new file mode 100644
index 0000000..0f6a543
--- /dev/null
+++ b/examples/src/main/java/org/apache/omid/examples/ParallelExecution.java
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.omid.examples;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.omid.transaction.RollbackException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.Random;
+
+/**
+ * ****************************************************************************************************************
+ *
+ * Same as SnapshotIsolationExample only executes multiple transactions concurrently
+ *
+ * ****************************************************************************************************************
+ *
+ * Please @see{SnapshotIsolationExample}
+ */
+public class ParallelExecution {
+
+    private static final Logger LOG = LoggerFactory.getLogger(ParallelExecution.class);
+    private static final long heartBeatInterval = 10_000;
+
+    public static void main(String[] args) throws Exception {
+
+        LOG.info("Parsing the command line arguments");
+        int maxThreads = Runtime.getRuntime().availableProcessors();
+        if (args != null && args.length > 2 && StringUtils.isNotEmpty(args[2])) {
+            maxThreads = Integer.parseInt(args[2]);
+        }
+        LOG.info("Execute '{}' concurrent threads", maxThreads);
+
+        for (int i = 0; i < maxThreads; i++) {
+            final SnapshotIsolationExample example = new SnapshotIsolationExample(args);
+            example.setRowIdGenerator(new RandomRowIdGenerator());
+            Thread t = new Thread(new Runnable() {
+                @Override
+                public void run() {
+                    long lastHeartBeatTime = System.currentTimeMillis();
+                    long counter = 0;
+                    long errorCounter = 0;
+                    while (true) {
+                        LOG.info("New cycle starts");
+                        try {
+                            example.execute();
+                            counter++;
+                        } catch (IOException | RollbackException | IllegalStateException e) {
+                            LOG.error("", e);
+                            errorCounter++;
+                        }
+                        if (System.currentTimeMillis() > lastHeartBeatTime + heartBeatInterval) {
+                            LOG.error(String.format("%s cycles executed, %s errors", counter, errorCounter));
+                            lastHeartBeatTime = System.currentTimeMillis();
+                        }
+                    }
+                }
+            });
+            t.setName(String.format("SnapshotIsolationExample thread %s/%s", i + 1, maxThreads));
+            t.start();
+        }
+
+    }
+
+    private static class RandomRowIdGenerator implements RowIdGenerator {
+
+        private Random random = new Random();
+
+        @Override
+        public byte[] getRowId() {
+            return Bytes.toBytes("id" + random.nextInt());
+        }
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/e95a12fc/examples/src/main/java/org/apache/omid/examples/RowIdGenerator.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/omid/examples/RowIdGenerator.java b/examples/src/main/java/org/apache/omid/examples/RowIdGenerator.java
new file mode 100644
index 0000000..4e5c631
--- /dev/null
+++ b/examples/src/main/java/org/apache/omid/examples/RowIdGenerator.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.omid.examples;
+
+interface RowIdGenerator {
+
+    byte[] getRowId();
+}

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/e95a12fc/examples/src/main/java/org/apache/omid/examples/SnapshotIsolationExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/omid/examples/SnapshotIsolationExample.java b/examples/src/main/java/org/apache/omid/examples/SnapshotIsolationExample.java
index a68d81a..60b82da 100644
--- a/examples/src/main/java/org/apache/omid/examples/SnapshotIsolationExample.java
+++ b/examples/src/main/java/org/apache/omid/examples/SnapshotIsolationExample.java
@@ -17,33 +17,37 @@
  */
 package org.apache.omid.examples;
 
-import org.apache.omid.transaction.HBaseTransactionManager;
-import org.apache.omid.transaction.RollbackException;
-import org.apache.omid.transaction.TTable;
-import org.apache.omid.transaction.Transaction;
-import org.apache.omid.transaction.TransactionManager;
+import com.google.common.base.Preconditions;
+
+import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.hadoop.hbase.client.Get;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.omid.transaction.HBaseTransactionManager;
+import org.apache.omid.transaction.RollbackException;
+import org.apache.omid.transaction.TTable;
+import org.apache.omid.transaction.Transaction;
+import org.apache.omid.transaction.TransactionManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.IOException;
 import java.util.Arrays;
 
 /**
  * ****************************************************************************************************************
  *
- *  Example code which demonstrates the preservation of Snapshot Isolation when writing shared data concurrently
+ * Example code which demonstrates the preservation of Snapshot Isolation when writing shared data concurrently
  *
  * ****************************************************************************************************************
  *
  * Please @see{BasicExample} first
  *
  * In the code below, two concurrent transactions (Tx1 & Tx2), try to update the same column in HBase. This will result
- * in the rollback of Tx2 -the last one trying to commit- due to conflicts in the writeset with the previously
- * committed transaction Tx1. Also shows how Tx2 reads the right values from its own snapshot in HBase data.
+ * in the rollback of Tx2 -the last one trying to commit- due to conflicts in the writeset with the previously committed
+ * transaction Tx1. Also shows how Tx2 reads the right values from its own snapshot in HBase data.
  *
  * After building the package with 'mvn clean package' find the resulting examples-<version>-bin.tar.gz file in the
  * 'examples/target' folder. Copy it to the target host and expand with 'tar -zxvf examples-<version>-bin.tar.gz'.
@@ -52,8 +56,8 @@ import java.util.Arrays;
  * command line arguments. If a secure HBase deployment is needed, use also command line arguments to specify the
  * principal (user) and keytab file.
  *
- * The example requires a user table to perform transactional read/write operations. A table is already specified in
- * the default configuration, and can be created with the following command using the 'hbase shell':
+ * The example requires a user table to perform transactional read/write operations. A table is already specified in the
+ * default configuration, and can be created with the following command using the 'hbase shell':
  *
  * <pre>
  * create 'MY_TX_TABLE', {NAME => 'MY_CF', VERSIONS => '2147483647', TTL => '2147483647'}
@@ -74,101 +78,140 @@ import java.util.Arrays;
 public class SnapshotIsolationExample {
 
     private static final Logger LOG = LoggerFactory.getLogger(SnapshotIsolationExample.class);
+    private final byte[] qualifier;
+    private final byte[] initialData;
+    private final byte[] dataValue1;
+    private final byte[] dataValue2;
+    private RowIdGenerator rowIdGenerator = new StaticRowIdGenerator();
+    private String userTableName;
+    private byte[] family;
+    private TransactionManager tm;
+    private TTable txTable;
 
     public static void main(String[] args) throws Exception {
+        SnapshotIsolationExample example = new SnapshotIsolationExample(args);
+        example.execute();
+        example.close();
+    }
 
+    SnapshotIsolationExample(String[] args) throws IOException, InterruptedException {
         LOG.info("Parsing the command line arguments");
-        String userTableName = "MY_TX_TABLE";
+        userTableName = "MY_TX_TABLE";
         if (args != null && args.length > 0 && StringUtils.isNotEmpty(args[0])) {
             userTableName = args[0];
         }
-        byte[] family = Bytes.toBytes("MY_CF");
+        family = Bytes.toBytes("MY_CF");
         if (args != null && args.length > 1 && StringUtils.isNotEmpty(args[1])) {
             family = Bytes.toBytes(args[1]);
         }
         LOG.info("Table '{}', column family '{}'", userTableName, Bytes.toString(family));
 
-        byte[] exampleRow = Bytes.toBytes("EXAMPLE_ROW");
-        byte[] qualifier = Bytes.toBytes("MY_Q");
-        byte[] initialData = Bytes.toBytes("initialVal");
-        byte[] dataValue1 = Bytes.toBytes("val1");
-        byte[] dataValue2 = Bytes.toBytes("val2");
+        qualifier = Bytes.toBytes("MY_Q");
+        initialData = Bytes.toBytes("initialVal");
+        dataValue1 = Bytes.toBytes("val1");
+        dataValue2 = Bytes.toBytes("val2");
 
-        LOG.info("--------------------------------------------------------------------------------------------------");
+        LOG.info("--------");
         LOG.info("NOTE: All Transactions in the Example access column {}:{}/{}/{} [TABLE:ROW/CF/Q]",
-                 userTableName, Bytes.toString(exampleRow), Bytes.toString(family), Bytes.toString(qualifier));
-        LOG.info("--------------------------------------------------------------------------------------------------");
+                 userTableName, Bytes.toString(rowIdGenerator.getRowId()), Bytes.toString(family),
+                 Bytes.toString(qualifier));
+        LOG.info("--------");
 
         LOG.info("Creating access to Omid Transaction Manager & Transactional Table '{}'", userTableName);
-        try (TransactionManager tm = HBaseTransactionManager.newInstance();
-             TTable txTable = new TTable(userTableName))
-        {
-
-            // A transaction Tx0 sets an initial value to a particular column in an specific row
-            Transaction tx0 = tm.begin();
-            Put initialPut = new Put(exampleRow);
-            initialPut.add(family, qualifier, initialData);
-            txTable.put(tx0, initialPut);
-            tm.commit(tx0);
-            LOG.info("Initial Transaction {} COMMITTED. Base value written in {}:{}/{}/{} = {}",
-                     tx0, userTableName, Bytes.toString(exampleRow), Bytes.toString(family),
-                     Bytes.toString(qualifier), Bytes.toString(initialData));
-
-            // Transaction Tx1 starts, creates its own snapshot of the current data in HBase and writes new data
-            Transaction tx1 = tm.begin();
-            LOG.info("Transaction {} STARTED", tx1);
-            Put tx1Put = new Put(exampleRow);
-            tx1Put.add(family, qualifier, dataValue1);
-            txTable.put(tx1, tx1Put);
-            LOG.info("Transaction {} updates base value in {}:{}/{}/{} = {} in its own Snapshot",
-                     tx1, userTableName, Bytes.toString(exampleRow), Bytes.toString(family),
-                     Bytes.toString(qualifier), Bytes.toString(dataValue1));
-
-            // A concurrent transaction Tx2 starts, creates its own snapshot and reads the column value
-            Transaction tx2 = tm.begin();
-            LOG.info("Concurrent Transaction {} STARTED", tx2);
-            Get tx2Get = new Get(exampleRow);
-            tx2Get.addColumn(family, qualifier);
-            // As Tx1 is not yet committed, it should read the value set by Tx0 not the value written by Tx1
-            Result tx2GetResult = txTable.get(tx2, tx2Get);
-            assert Arrays.equals(tx2GetResult.value(), initialData);
-            LOG.info("Concurrent Transaction {} should read base value in {}:{}/{}/{} from its Snapshot | Value read = {}",
-                     tx2, userTableName, Bytes.toString(exampleRow), Bytes.toString(family),
-                     Bytes.toString(qualifier), Bytes.toString(tx2GetResult.value()));
-
-            // Transaction Tx1 tries to commit and as there're no conflicting changes, persists the new value in HBase
-            tm.commit(tx1);
-            LOG.info("Transaction {} COMMITTED. New column value {}:{}/{}/{} = {}",
-                     tx1, userTableName, Bytes.toString(exampleRow), Bytes.toString(family),
-                     Bytes.toString(qualifier), Bytes.toString(dataValue1));
-
-            // Tx2 reading again after Tx1 commit must read data from its snapshot...
-            tx2Get = new Get(exampleRow);
-            tx2Get.addColumn(family, qualifier);
-            tx2GetResult = txTable.get(tx2, tx2Get);
-            // ...so it must read the initial value written by Tx0
-            LOG.info("Concurrent Transaction {} should read again base value in {}:{}/{}/{} from its Snapshot | Value read = {}",
-                     tx2, userTableName, Bytes.toString(exampleRow), Bytes.toString(family),
-                     Bytes.toString(qualifier), Bytes.toString(tx2GetResult.value()));
-
-            // Tx2 tries to write the column written by the committed concurrent transaction Tx1...
-            Put tx2Put = new Put(exampleRow);
-            tx2Put.add(family, qualifier, dataValue2);
-            txTable.put(tx2, tx2Put);
-            LOG.info("Concurrent Transaction {} updates {}:{}/{}/{} = {} in its own Snapshot (Will conflict with {} at commit time)",
-                     tx2, userTableName, Bytes.toString(exampleRow), Bytes.toString(family),
-                     Bytes.toString(qualifier), Bytes.toString(dataValue1), tx1);
-
-            // ... and when committing, Tx2 has to abort due to concurrent conflicts with committed transaction Tx1
-            try {
-                LOG.info("Concurrent Transaction {} TRYING TO COMMIT", tx2);
-                tm.commit(tx2);
-            } catch (RollbackException e) {
-                LOG.error("Concurrent Transaction {} ROLLED-BACK!!! : {}", tx2, e.getMessage());
-            }
+        tm = HBaseTransactionManager.newInstance();
+        txTable = new TTable(userTableName);
+    }
 
+    void execute() throws IOException, RollbackException {
+
+        // A transaction Tx0 sets an initial value to a particular column in an specific row
+        Transaction tx0 = tm.begin();
+        byte[] rowId = rowIdGenerator.getRowId();
+        Put initialPut = new Put(rowId);
+        initialPut.add(family, qualifier, initialData);
+        txTable.put(tx0, initialPut);
+        tm.commit(tx0);
+        LOG.info("Initial Transaction {} COMMITTED. Base value written in {}:{}/{}/{} = {}",
+                 tx0, userTableName, Bytes.toString(rowId), Bytes.toString(family),
+                 Bytes.toString(qualifier), Bytes.toString(initialData));
+
+        // Transaction Tx1 starts, creates its own snapshot of the current data in HBase and writes new data
+        Transaction tx1 = tm.begin();
+        LOG.info("Transaction {} STARTED", tx1);
+        Put tx1Put = new Put(rowId);
+        tx1Put.add(family, qualifier, dataValue1);
+        txTable.put(tx1, tx1Put);
+        LOG.info("Transaction {} updates base value in {}:{}/{}/{} = {} in its own Snapshot",
+                 tx1, userTableName, Bytes.toString(rowId), Bytes.toString(family),
+                 Bytes.toString(qualifier), Bytes.toString(dataValue1));
+
+        // A concurrent transaction Tx2 starts, creates its own snapshot and reads the column value
+        Transaction tx2 = tm.begin();
+        LOG.info("Concurrent Transaction {} STARTED", tx2);
+        Get tx2Get = new Get(rowId);
+        tx2Get.addColumn(family, qualifier);
+        Result tx2GetResult = txTable.get(tx2, tx2Get);
+        Preconditions.checkState(Arrays.equals(tx2GetResult.value(), initialData),
+                                 "As Tx1 is not yet committed, Tx2 should read the value set by Tx0 not the value written by Tx1");
+        LOG.info(
+            "Concurrent Transaction {} should read base value in {}:{}/{}/{} from its Snapshot | Value read = {}",
+            tx2, userTableName, Bytes.toString(rowId), Bytes.toString(family),
+            Bytes.toString(qualifier), Bytes.toString(tx2GetResult.value()));
+
+        // Transaction Tx1 tries to commit and as there're no conflicting changes, persists the new value in HBase
+        tm.commit(tx1);
+        LOG.info("Transaction {} COMMITTED. New column value {}:{}/{}/{} = {}",
+                 tx1, userTableName, Bytes.toString(rowId), Bytes.toString(family),
+                 Bytes.toString(qualifier), Bytes.toString(dataValue1));
+
+        // Tx2 reading again after Tx1 commit must read data from its snapshot...
+        tx2Get = new Get(rowId);
+        tx2Get.addColumn(family, qualifier);
+        tx2GetResult = txTable.get(tx2, tx2Get);
+        // ...so it must read the initial value written by Tx0
+        LOG.info(
+            "Concurrent Transaction {} should read again base value in {}:{}/{}/{} from its Snapshot | Value read = {}",
+            tx2, userTableName, Bytes.toString(rowId), Bytes.toString(family),
+            Bytes.toString(qualifier), Bytes.toString(tx2GetResult.value()));
+        Preconditions.checkState(Arrays.equals(tx2GetResult.value(), initialData),
+                                 "Tx2 must read the initial value written by Tx0");
+
+        // Tx2 tries to write the column written by the committed concurrent transaction Tx1...
+        Put tx2Put = new Put(rowId);
+        tx2Put.add(family, qualifier, dataValue2);
+        txTable.put(tx2, tx2Put);
+        LOG.info(
+            "Concurrent Transaction {} updates {}:{}/{}/{} = {} in its own Snapshot (Will conflict with {} at commit time)",
+            tx2, userTableName, Bytes.toString(rowId), Bytes.toString(family),
+            Bytes.toString(qualifier), Bytes.toString(dataValue1), tx1);
+
+        // ... and when committing, Tx2 has to abort due to concurrent conflicts with committed transaction Tx1
+        try {
+            LOG.info("Concurrent Transaction {} TRYING TO COMMIT", tx2);
+            tm.commit(tx2);
+            // should throw an exception
+            Preconditions.checkState(false, "Should have thrown RollbackException");
+        } catch (RollbackException e) {
+            LOG.info("Concurrent Transaction {} ROLLED-BACK : {}", tx2, e.getMessage());
         }
+    }
+
+    private void close() throws IOException {
+        tm.close();
+        txTable.close();
+    }
 
+
+    void setRowIdGenerator(RowIdGenerator rowIdGenerator) {
+        this.rowIdGenerator = rowIdGenerator;
     }
 
+    private class StaticRowIdGenerator implements RowIdGenerator {
+
+        @Override
+        public byte[] getRowId() {
+            return Bytes.toBytes("EXAMPLE_ROW");
+        }
+    }
 }
+

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/e95a12fc/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 84881d5..32e0532 100644
--- a/pom.xml
+++ b/pom.xml
@@ -139,7 +139,7 @@
         <guice.version>3.0</guice.version>
         <testng.version>6.8.8</testng.version>
         <slf4j.version>1.7.7</slf4j.version>
-        <log4j.version>1.2.14</log4j.version>
+        <log4j.version>1.2.17</log4j.version>
         <netty.version>3.2.6.Final</netty.version>
         <protobuf.version>2.5.0</protobuf.version>
         <mockito.version>1.9.5</mockito.version>


[03/50] [abbrv] incubator-omid git commit: [ci skip]prepare release omid-0.8.1.42

Posted by fp...@apache.org.
[ci skip]prepare release omid-0.8.1.42


Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/6d087c82
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/6d087c82
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/6d087c82

Branch: refs/heads/master
Commit: 6d087c82ed09e97486fb56623a348675c3c3a761
Parents: fd3eeff
Author: Omid CI <om...@yahoo-inc.com>
Authored: Thu Apr 21 20:05:52 2016 +0000
Committer: Omid CI <om...@yahoo-inc.com>
Committed: Thu Apr 21 20:05:52 2016 +0000

----------------------------------------------------------------------
 benchmarks/pom.xml          | 2 +-
 codahale-metrics/pom.xml    | 2 +-
 commit-table/pom.xml        | 2 +-
 common/pom.xml              | 2 +-
 examples/pom.xml            | 2 +-
 hbase-client/pom.xml        | 2 +-
 hbase-commit-table/pom.xml  | 2 +-
 hbase-common/pom.xml        | 2 +-
 hbase-coprocessor/pom.xml   | 2 +-
 hbase-shims/hbase-0/pom.xml | 2 +-
 hbase-shims/hbase-1/pom.xml | 2 +-
 hbase-shims/pom.xml         | 2 +-
 hbase-tools/pom.xml         | 2 +-
 metrics/pom.xml             | 2 +-
 pom.xml                     | 4 ++--
 statemachine/pom.xml        | 2 +-
 timestamp-storage/pom.xml   | 2 +-
 transaction-client/pom.xml  | 2 +-
 tso-server/pom.xml          | 2 +-
 19 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6d087c82/benchmarks/pom.xml
----------------------------------------------------------------------
diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml
index 9469cde..d125230 100644
--- a/benchmarks/pom.xml
+++ b/benchmarks/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.42-SNAPSHOT</version>
+        <version>0.8.1.42</version>
     </parent>
 
     <artifactId>benchmarks</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6d087c82/codahale-metrics/pom.xml
----------------------------------------------------------------------
diff --git a/codahale-metrics/pom.xml b/codahale-metrics/pom.xml
index 8d1eafa..7dd1150 100644
--- a/codahale-metrics/pom.xml
+++ b/codahale-metrics/pom.xml
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.42-SNAPSHOT</version>
+        <version>0.8.1.42</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6d087c82/commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/commit-table/pom.xml b/commit-table/pom.xml
index a81d994..77ab17f 100644
--- a/commit-table/pom.xml
+++ b/commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.42-SNAPSHOT</version>
+        <version>0.8.1.42</version>
     </parent>
 
     <artifactId>commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6d087c82/common/pom.xml
----------------------------------------------------------------------
diff --git a/common/pom.xml b/common/pom.xml
index 8a8dbb2..c989bcc 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.42-SNAPSHOT</version>
+        <version>0.8.1.42</version>
     </parent>
 
     <artifactId>common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6d087c82/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index bcbac02..d8262f1 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.42-SNAPSHOT</version>
+        <version>0.8.1.42</version>
     </parent>
 
     <artifactId>examples</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6d087c82/hbase-client/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml
index 655e028..adac8b0 100644
--- a/hbase-client/pom.xml
+++ b/hbase-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.42-SNAPSHOT</version>
+        <version>0.8.1.42</version>
     </parent>
 
     <artifactId>hbase-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6d087c82/hbase-commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-commit-table/pom.xml b/hbase-commit-table/pom.xml
index d565bd9..b91c192 100644
--- a/hbase-commit-table/pom.xml
+++ b/hbase-commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.42-SNAPSHOT</version>
+        <version>0.8.1.42</version>
     </parent>
 
     <artifactId>hbase-commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6d087c82/hbase-common/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml
index debfee5..f1dbb68 100644
--- a/hbase-common/pom.xml
+++ b/hbase-common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.42-SNAPSHOT</version>
+        <version>0.8.1.42</version>
     </parent>
 
     <artifactId>hbase-common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6d087c82/hbase-coprocessor/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-coprocessor/pom.xml b/hbase-coprocessor/pom.xml
index 1cbd5a8..5692df5 100644
--- a/hbase-coprocessor/pom.xml
+++ b/hbase-coprocessor/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.42-SNAPSHOT</version>
+        <version>0.8.1.42</version>
     </parent>
 
     <artifactId>hbase-coprocessor</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6d087c82/hbase-shims/hbase-0/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-0/pom.xml b/hbase-shims/hbase-0/pom.xml
index 4f6e925..1bfd67f 100644
--- a/hbase-shims/hbase-0/pom.xml
+++ b/hbase-shims/hbase-0/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.42-SNAPSHOT</version>
+        <version>0.8.1.42</version>
     </parent>
 
     <artifactId>hbase0-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6d087c82/hbase-shims/hbase-1/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-1/pom.xml b/hbase-shims/hbase-1/pom.xml
index b9958a4..86d1e41 100644
--- a/hbase-shims/hbase-1/pom.xml
+++ b/hbase-shims/hbase-1/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.42-SNAPSHOT</version>
+        <version>0.8.1.42</version>
     </parent>
 
     <artifactId>hbase1-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6d087c82/hbase-shims/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/pom.xml b/hbase-shims/pom.xml
index d72aba0..abd3fff 100644
--- a/hbase-shims/pom.xml
+++ b/hbase-shims/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.42-SNAPSHOT</version>
+        <version>0.8.1.42</version>
     </parent>
 
     <artifactId>omid-shims-aggregator</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6d087c82/hbase-tools/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-tools/pom.xml b/hbase-tools/pom.xml
index 33929e4..f63fc31 100644
--- a/hbase-tools/pom.xml
+++ b/hbase-tools/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.42-SNAPSHOT</version>
+        <version>0.8.1.42</version>
     </parent>
 
     <artifactId>hbase-tools</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6d087c82/metrics/pom.xml
----------------------------------------------------------------------
diff --git a/metrics/pom.xml b/metrics/pom.xml
index d9b38eb..176827f 100644
--- a/metrics/pom.xml
+++ b/metrics/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.42-SNAPSHOT</version>
+        <version>0.8.1.42</version>
     </parent>
 
     <artifactId>metrics</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6d087c82/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 980b4a9..7834cb0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
     <artifactId>omid</artifactId>
     <packaging>pom</packaging>
     <!-- WARNING: do not update version manually, use mvn versions:set -->
-    <version>0.8.1.42-SNAPSHOT</version>
+    <version>0.8.1.42</version>
 
     <organization>
         <name>Apache Software Foundation</name>
@@ -105,7 +105,7 @@
         <connection>scm:git:git://github.com/yahoo/omid.git</connection>
         <developerConnection>scm:git:https://${GH_TOKEN}@github.com/yahoo/omid.git</developerConnection>
         <url>https://github.com/yahoo/omid</url>
-        <tag>master</tag>
+        <tag>omid-0.8.1.42</tag>
     </scm>
 
     <distributionManagement>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6d087c82/statemachine/pom.xml
----------------------------------------------------------------------
diff --git a/statemachine/pom.xml b/statemachine/pom.xml
index 4791230..59893fe 100644
--- a/statemachine/pom.xml
+++ b/statemachine/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.42-SNAPSHOT</version>
+        <version>0.8.1.42</version>
     </parent>
 
     <name>State Machine</name>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6d087c82/timestamp-storage/pom.xml
----------------------------------------------------------------------
diff --git a/timestamp-storage/pom.xml b/timestamp-storage/pom.xml
index ca101b9..6902887 100644
--- a/timestamp-storage/pom.xml
+++ b/timestamp-storage/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.42-SNAPSHOT</version>
+        <version>0.8.1.42</version>
     </parent>
 
     <artifactId>timestamp-storage</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6d087c82/transaction-client/pom.xml
----------------------------------------------------------------------
diff --git a/transaction-client/pom.xml b/transaction-client/pom.xml
index 97ac14b..cd56f72 100644
--- a/transaction-client/pom.xml
+++ b/transaction-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.42-SNAPSHOT</version>
+        <version>0.8.1.42</version>
     </parent>
 
     <artifactId>transaction-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6d087c82/tso-server/pom.xml
----------------------------------------------------------------------
diff --git a/tso-server/pom.xml b/tso-server/pom.xml
index 7a19793..c2c2e08 100644
--- a/tso-server/pom.xml
+++ b/tso-server/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.42-SNAPSHOT</version>
+        <version>0.8.1.42</version>
     </parent>
 
     <artifactId>tso-server</artifactId>


[31/50] [abbrv] incubator-omid git commit: Remove reset()

Posted by fp...@apache.org.
Remove reset()

Change-Id: I449fa5a71e41f6a57fe654c5f8cf2344de9be0f6


Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/43261a3c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/43261a3c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/43261a3c

Branch: refs/heads/master
Commit: 43261a3c628a96ccd1c9fb8118922ecd6817acb6
Parents: 3e5b674
Author: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Authored: Thu Apr 28 14:05:19 2016 -0700
Committer: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Committed: Tue May 3 16:19:17 2016 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/omid/tso/Batch.java    |  11 +-
 .../java/org/apache/omid/tso/BatchPool.java     |  35 ++--
 .../apache/omid/tso/PersistenceProcessor.java   |   2 -
 .../omid/tso/PersistenceProcessorHandler.java   |  40 ++--
 .../omid/tso/PersistenceProcessorImpl.java      |  14 +-
 .../org/apache/omid/tso/ReplyProcessor.java     |   4 +-
 .../org/apache/omid/tso/ReplyProcessorImpl.java |  29 +--
 .../apache/omid/tso/RequestProcessorImpl.java   |   2 +-
 .../java/org/apache/omid/tso/TestBatch.java     |  14 +-
 .../omid/tso/TestPersistenceProcessor.java      | 207 +++++++++++--------
 10 files changed, 177 insertions(+), 181 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/43261a3c/tso-server/src/main/java/org/apache/omid/tso/Batch.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/Batch.java b/tso-server/src/main/java/org/apache/omid/tso/Batch.java
index 8f665e1..e778eee 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/Batch.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/Batch.java
@@ -20,9 +20,13 @@ package org.apache.omid.tso;
 import com.google.common.base.Preconditions;
 import org.apache.omid.tso.PersistEvent.Type;
 import org.jboss.netty.channel.Channel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class Batch {
 
+    private static final Logger LOG = LoggerFactory.getLogger(Batch.class);
+
     private final PersistEvent[] events;
     private final int maxBatchSize;
     private final BatchPool batchPool;
@@ -37,6 +41,7 @@ public class Batch {
 
     Batch(int size, int id, BatchPool batchPool) {
         Preconditions.checkArgument(size > 0, "Size must be positive");
+        LOG.info("Batch id {} created with size {}", id, size);
         this.maxBatchSize = size;
         this.batchPool = batchPool;
         this.id = id;
@@ -118,7 +123,7 @@ public class Batch {
 
     }
 
-    void sendReply(ReplyProcessor reply, RetryProcessor retryProc, long batchID, boolean isTSOInstanceMaster) {
+    void sendReply(ReplyProcessor reply, RetryProcessor retryProc, long batchID) {
         int i = 0;
         while (i < numEvents) {
             PersistEvent e = events[i];
@@ -130,7 +135,7 @@ public class Batch {
                 events[numEvents - 1] = tmp;
                 if (numEvents == 1) {
                     clear();
-                    reply.batchResponse(null, batchID, !isTSOInstanceMaster);
+                    reply.batchResponse(null, batchID);
                     return;
                 }
                 numEvents--;
@@ -139,7 +144,7 @@ public class Batch {
             i++;
         }
 
-        reply.batchResponse(this, batchID, !isTSOInstanceMaster);
+        reply.batchResponse(this, batchID);
 
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/43261a3c/tso-server/src/main/java/org/apache/omid/tso/BatchPool.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/BatchPool.java b/tso-server/src/main/java/org/apache/omid/tso/BatchPool.java
index 6b5307e..88cfd1e 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/BatchPool.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/BatchPool.java
@@ -17,23 +17,32 @@
  */
 package org.apache.omid.tso;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import javax.inject.Inject;
 import java.util.Stack;
 
 public class BatchPool {
 
-    final private Batch[] batches;
-    final private int poolSize;
-    final private Stack<Integer> availableBatches;
+    private static final Logger LOG = LoggerFactory.getLogger(BatchPool.class);
+
+    private final Batch[] batches;
+    private final int poolSize;
+    private final Stack<Integer> availableBatches;
 
     @Inject
     public BatchPool(TSOServerConfig config) {
 
         int numBuffersPerHandler = (config.getNumBuffersPerHandler() >= 2) ? config.getNumBuffersPerHandler() : 2;
         poolSize = config.getPersistHandlerNum() * numBuffersPerHandler;
+        LOG.info("Config param maxBatchSize {}", config.getMaxBatchSize());
+        LOG.info("Persistent Handlers {} ; Buffers per handler {}", config.getPersistHandlerNum(), numBuffersPerHandler);
         batches = new Batch[poolSize];
-        int batchSize = (config.getMaxBatchSize() / config.getPersistHandlerNum() > 0) ? (config.getMaxBatchSize() / config.getPersistHandlerNum()) : 2;
+        // TODO The + 1 is because the low watermark is added in each flush and needs one extra position. Fix and clarify initialization
+        int batchSize = (config.getMaxBatchSize() / config.getPersistHandlerNum() > 0) ? (config.getMaxBatchSize() / config.getPersistHandlerNum()) + 1 : 2;
 
+        LOG.info("Creating {} Batches with {} elements each", poolSize, batchSize);
         for (int i = 0; i < poolSize; i++) {
             batches[i] = new Batch(batchSize, i, this);
         }
@@ -48,7 +57,7 @@ public class BatchPool {
 
     Batch getNextEmptyBatch() throws InterruptedException {
 
-        synchronized (availableBatches) {
+        synchronized (availableBatches) { // TODO Synchronized can be put at the method level
             while (availableBatches.isEmpty()) {
                 availableBatches.wait();
             }
@@ -61,25 +70,11 @@ public class BatchPool {
 
     void notifyEmptyBatch(int batchIdx) {
 
-        synchronized (availableBatches) {
+        synchronized (availableBatches) { // TODO Synchronized can be put at the method level
             availableBatches.push(batchIdx);
             availableBatches.notify();
         }
 
     }
 
-    public void reset() {
-
-        for (int i = 0; i < poolSize; i++) {
-            batches[i].clear();
-        }
-
-        availableBatches.clear();
-
-        for (int i = (poolSize - 1); i >= 0; i--) {
-            availableBatches.push(i);
-        }
-
-    }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/43261a3c/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessor.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessor.java b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessor.java
index 823198b..47dc56b 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessor.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessor.java
@@ -39,6 +39,4 @@ interface PersistenceProcessor {
     // TODO The name of this method is weird. Rename to "persist"
     void persistFlush() throws InterruptedException;
 
-    void reset() throws InterruptedException;
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/43261a3c/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java
index 36b1959..19b6b77 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java
@@ -100,36 +100,28 @@ public class PersistenceProcessorHandler implements WorkHandler<PersistenceProce
     // TODO Fix this method with the contents of PersistenceProcessor.flush() in master branch
     // TODO This is related to the changes in TestPersistenceProcessor.testCommitPersistenceWithHALeaseManager().
     // TODO Check also that test in the master branch
-    private void flush(Batch batch, long batchID) throws IOException {
+    private void flush(Batch batch, long batchID) {
 
-        long startFlushTimeInNs = System.nanoTime();
-
-        boolean areWeStillMaster = true;
-        if (!leaseManager.stillInLeasePeriod()) {
-            // The master TSO replica has changed, so we must inform the
-            // clients about it when sending the replies and avoid flushing
-            // the current batch of TXs
-            areWeStillMaster = false;
-            // We need also to clear the data in the buffer
-            writer.clearWriteBuffer();
-            LOG.trace("Replica {} lost mastership before flushing data", tsoHostAndPort);
-        } else {
+        if (batch.getNumEvents() > 0) {
+            commitSuicideIfNotMaster();
             try {
+                long startFlushTimeInNs = System.nanoTime();
                 writer.flush();
+                flushTimer.update(System.nanoTime() - startFlushTimeInNs);
+                batchSizeHistogram.update(batch.getNumEvents());
             } catch (IOException e) {
-                panicker.panic("Error persisting commit batch", e.getCause());
-            }
-            batchSizeHistogram.update(batch.getNumEvents());
-            if (!leaseManager.stillInLeasePeriod()) {
-                // If after flushing this TSO server is not the master
-                // replica we need inform the client about it
-                areWeStillMaster = false;
-                LOG.warn("Replica {} lost mastership after flushing data", tsoHostAndPort);
+                panicker.panic("Error persisting commit batch", e);
             }
+            commitSuicideIfNotMaster(); // TODO Here, we can return the client responses before committing suicide
+            batch.sendReply(replyProcessor, retryProc, batchID);
         }
-        flushTimer.update((System.nanoTime() - startFlushTimeInNs));
-        batch.sendReply(replyProcessor, retryProc, batchID, areWeStillMaster);
 
     }
 
-}
+    private void commitSuicideIfNotMaster() {
+        if (!leaseManager.stillInLeasePeriod()) {
+            panicker.panic("Replica " + tsoHostAndPort + " lost mastership whilst flushing data. Committing suicide");
+        }
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/43261a3c/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java
index e82f0b1..e57cda3 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java
@@ -24,6 +24,8 @@ import com.lmax.disruptor.EventFactory;
 import com.lmax.disruptor.RingBuffer;
 import com.lmax.disruptor.WorkerPool;
 import org.jboss.netty.channel.Channel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.inject.Inject;
 import java.io.IOException;
@@ -33,6 +35,8 @@ import java.util.concurrent.Executors;
 
 class PersistenceProcessorImpl implements PersistenceProcessor {
 
+    private static final Logger LOG = LoggerFactory.getLogger(PersistenceProcessorImpl.class);
+
     private static final long INITIAL_LWM_VALUE = -1L;
 
     private final ReplyProcessor replyProcessor;
@@ -78,16 +82,6 @@ class PersistenceProcessorImpl implements PersistenceProcessor {
     }
 
     @Override
-    public void reset() throws InterruptedException {
-
-        batchIDCnt = 0L;
-        batchPool.reset();
-        batch = batchPool.getNextEmptyBatch();
-        replyProcessor.reset();
-
-    }
-
-    @Override
     public void persistFlush() throws InterruptedException {
 
         if (batch.isEmpty()) {

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/43261a3c/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessor.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessor.java b/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessor.java
index 0a3a00d..37a9dd9 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessor.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessor.java
@@ -38,13 +38,11 @@ interface ReplyProcessor {
      * @param channel
      *            the communication channed with the client
      */
-    void batchResponse(Batch batch, long batchID, boolean makeHeuristicDecision);
+    void batchResponse(Batch batch, long batchID);
 
     void addAbort(Batch batch, long startTimestamp, Channel c, MonitoringContext context);
 
     void addCommit(Batch batch, long startTimestamp, long commitTimestamp, Channel c, MonitoringContext context);
 
-    void reset();
-
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/43261a3c/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java b/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java
index 55162c7..85f465c 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java
@@ -88,10 +88,6 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyBatchEv
 
     }
 
-    public void reset() {
-        nextIDToHandle.set(0);
-    }
-
     private void handleReplyBatchEvent(ReplyBatchEvent event) {
 
         String name;
@@ -103,7 +99,7 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyBatchEv
             case COMMIT:
                 name = "commitReplyProcessor";
                 localEvent.getMonCtx().timerStart(name);
-                handleCommitResponse(localEvent.getStartTimestamp(), localEvent.getCommitTimestamp(), localEvent.getChannel(), event.getMakeHeuristicDecision());
+                handleCommitResponse(localEvent.getStartTimestamp(), localEvent.getCommitTimestamp(), localEvent.getChannel());
                 localEvent.getMonCtx().timerStop(name);
                  break;
             case ABORT:
@@ -169,11 +165,11 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyBatchEv
     }
 
     @Override
-    public void batchResponse(Batch batch, long batchID, boolean makeHeuristicDecision) {
+    public void batchResponse(Batch batch, long batchID) {
 
         long seq = replyRing.next();
         ReplyBatchEvent e = replyRing.get(seq);
-        ReplyBatchEvent.makeReplyBatch(e, batch, batchID, makeHeuristicDecision);
+        ReplyBatchEvent.makeReplyBatch(e, batch, batchID);
         replyRing.publish(seq);
 
     }
@@ -182,7 +178,7 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyBatchEv
     public void addAbort(Batch batch, long startTimestamp, Channel c, MonitoringContext context) {
 
         batch.addAbort(startTimestamp, true, c, context);
-        batchResponse(batch, NO_ORDER, false);
+        batchResponse(batch, NO_ORDER);
 
     }
 
@@ -190,19 +186,14 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyBatchEv
     public void addCommit(Batch batch, long startTimestamp, long commitTimestamp, Channel c, MonitoringContext context) {
 
         batch.addCommit(startTimestamp, commitTimestamp, c, context);
-        batchResponse(batch, NO_ORDER, false);
+        batchResponse(batch, NO_ORDER);
 
     }
 
-    private void handleCommitResponse(long startTimestamp, long commitTimestamp, Channel c,
-                                      boolean makeHeuristicDecision) {
+    private void handleCommitResponse(long startTimestamp, long commitTimestamp, Channel c) {
 
         TSOProto.Response.Builder builder = TSOProto.Response.newBuilder();
         TSOProto.CommitResponse.Builder commitBuilder = TSOProto.CommitResponse.newBuilder();
-        // TODO Remove heuristic decissions as is not in the protocol anymore
-        if (makeHeuristicDecision) { // If the commit is ambiguous is due to a new master TSO
-//            commitBuilder.setMakeHeuristicDecision(true);
-        }
         commitBuilder.setAborted(false)
                 .setStartTimestamp(startTimestamp)
                 .setCommitTimestamp(commitTimestamp);
@@ -242,12 +233,10 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyBatchEv
 
         private Batch batch;
         private long batchID;
-        private boolean makeHeuristicDecision;
 
-        static void makeReplyBatch(ReplyBatchEvent e, Batch batch, long batchID, boolean makeHeuristicDecision) {
+        static void makeReplyBatch(ReplyBatchEvent e, Batch batch, long batchID) {
             e.batch = batch;
             e.batchID = batchID;
-            e.makeHeuristicDecision = makeHeuristicDecision;
         }
 
         Batch getBatch() {
@@ -258,10 +247,6 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyBatchEv
             return batchID;
         }
 
-        boolean getMakeHeuristicDecision() {
-            return makeHeuristicDecision;
-        }
-
         final static EventFactory<ReplyBatchEvent> EVENT_FACTORY = new EventFactory<ReplyBatchEvent>() {
             public ReplyBatchEvent newInstance() {
                 return new ReplyBatchEvent();

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/43261a3c/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java b/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java
index 709a529..2bbf1cf 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java
@@ -92,7 +92,7 @@ class RequestProcessorImpl implements EventHandler<RequestProcessorImpl.RequestE
         LOG.info("Initializing RequestProcessor...");
         this.lowWatermark = state.getLowWatermark();
         persistProc.persistLowWatermark(lowWatermark, new MonitoringContext(metrics));
-        persistProc.reset();
+        persistProc.persistFlush();
         LOG.info("RequestProcessor initialized with LWMs {} and Epoch {}", lowWatermark, state.getEpoch());
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/43261a3c/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java b/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
index 177e54d..08b38be 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
@@ -118,12 +118,8 @@ public class TestBatch {
 //        assertFalse(batch.isFull(), "Batch shouldn't be full");
 //        assertEquals(batch.getNumEvents(), 0, "Num events should be 0");
 //=======
-        final boolean MASTER_INSTANCE = true;
-
-        final boolean SHOULD_MAKE_HEURISTIC_DECISION = true;
-        batch.sendReply(replyProcessor, retryProcessor, (-1), MASTER_INSTANCE);
-        verify(replyProcessor, timeout(100).times(1))
-               .batchResponse(batch, (-1), !SHOULD_MAKE_HEURISTIC_DECISION);
+        batch.sendReply(replyProcessor, retryProcessor, (-1));
+        verify(replyProcessor, timeout(100).times(1)).batchResponse(batch, (-1));
         assertTrue(batch.isFull(), "Batch shouldn't be empty");
     }
 
@@ -148,11 +144,9 @@ public class TestBatch {
         // Test that sending replies empties the batch also when the replica
         // is NOT master and calls the ambiguousCommitResponse() method on the
         // reply processor
-        final boolean MASTER_INSTANCE = true;
-        final boolean SHOULD_MAKE_HEURISTIC_DECISION = true;
-        batch.sendReply(replyProcessor, retryProcessor, (-1), !MASTER_INSTANCE);
+        batch.sendReply(replyProcessor, retryProcessor, (-1));
         verify(replyProcessor, timeout(100).times(1))
-               .batchResponse(batch, (-1), SHOULD_MAKE_HEURISTIC_DECISION);
+               .batchResponse(batch, (-1));
         assertTrue(batch.isFull(), "Batch should be full");
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/43261a3c/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java b/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java
index b48cf8b..bc0b0f0 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java
@@ -20,6 +20,7 @@ package org.apache.omid.tso;
 import org.apache.omid.committable.CommitTable;
 import org.apache.omid.metrics.MetricsRegistry;
 import org.apache.omid.metrics.NullMetricsProvider;
+import org.jboss.netty.channel.Channel;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
@@ -34,22 +35,22 @@ import java.io.IOException;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyLong;
 import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.reset;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.timeout;
+import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 
+// TODO Add timers
+// TODO Make visible currentBatch in PersistenceProcessorImpl to add proper verifications
 public class TestPersistenceProcessor {
 
     private static final Logger LOG = LoggerFactory.getLogger(TestPersistenceProcessor.class);
 
     @Mock
-    private Batch batch;
-    @Mock
     private CommitTable.Writer mockWriter;
     @Mock
     private CommitTable.Client mockClient;
@@ -69,7 +70,7 @@ public class TestPersistenceProcessor {
         MockitoAnnotations.initMocks(this);
 
         // Configure mock writer to flush successfully
-        doThrow(new IOException("Unable to write")).when(mockWriter).flush();
+//        doThrow(new IOException("Unable to write")).when(mockWriter).flush();
 
         // Configure null metrics provider
         metrics = new NullMetricsProvider();
@@ -86,6 +87,7 @@ public class TestPersistenceProcessor {
                 return mockClient;
             }
         };
+
     }
 
     @AfterMethod
@@ -96,12 +98,16 @@ public class TestPersistenceProcessor {
     @Test
     public void testCommitPersistenceWithMultiHandlers() throws Exception {
 
+        final int MAX_BATCH_SIZE = 4;
+        final int NUM_PERSIST_HANDLERS = 4;
+
         // Init a non-HA lease manager
         VoidLeaseManager leaseManager = spy(new VoidLeaseManager(mock(TSOChannelHandler.class),
-                mock(TSOStateManager.class)));
+                                                                 mock(TSOStateManager.class)));
 
         TSOServerConfig tsoConfig = new TSOServerConfig();
-        tsoConfig.setPersistHandlerNum(4);
+        tsoConfig.setMaxBatchSize(MAX_BATCH_SIZE);
+        tsoConfig.setPersistHandlerNum(NUM_PERSIST_HANDLERS);
 
         PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[tsoConfig.getPersistHandlerNum()];
         for (int i = 0; i < tsoConfig.getPersistHandlerNum(); i++) {
@@ -114,39 +120,45 @@ public class TestPersistenceProcessor {
         }
 
         // Component under test
+        BatchPool batchPool = spy(new BatchPool(tsoConfig));
+
         PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig,
-                                                                 new BatchPool(tsoConfig),
-                                                                 replyProcessor,
-                                                                 panicker,
-                                                                 handlers);
+                                                                     batchPool,
+                                                                     replyProcessor,
+                                                                     panicker,
+                                                                     handlers);
 
-        MonitoringContext monCtx = new MonitoringContext(metrics);
-        proc.batch = batch;
-        proc.persistCommit(1, 2, null, monCtx);
+        verify(batchPool, times(1)).getNextEmptyBatch();
+
+        proc.persistCommit(1, 2, mock(Channel.class), mock(MonitoringContext.class));
         proc.persistFlush();
-        proc.batch = batch;
-        proc.persistCommit(3, 4, null, monCtx);
+
+        proc.persistCommit(3, 4, mock(Channel.class), mock(MonitoringContext.class));
         proc.persistFlush();
-        proc.batch = batch;
-        proc.persistCommit(5, 6, null, monCtx);
+
+        proc.persistCommit(5, 6, mock(Channel.class), mock(MonitoringContext.class));
         proc.persistFlush();
-        proc.batch = batch;
-        proc.persistCommit(7, 8, null, monCtx);
+
+        proc.persistCommit(7, 8, mock(Channel.class), mock(MonitoringContext.class));
         proc.persistFlush();
-        verify(batch, timeout(1000).times(4)).sendReply(any(ReplyProcessor.class),
-                                                        any(RetryProcessor.class),
-                                                        any(Long.class), eq(true));
+
+        verify(batchPool, times(5)).getNextEmptyBatch(); // 5 Times: 1 in initialization + 4 when flushing above
+
     }
 
     @Test
-    public void testCommitPersistenceWithSingleHanlderInMultiHandlersEnvironment() throws Exception {
+    public void testCommitPersistenceWithSingleHandlerInMultiHandlersEnvironment() throws Exception {
+
+        final int MAX_BATCH_SIZE = 16;
+        final int NUM_PERSIST_HANDLERS = 4;
 
         // Init a non-HA lease manager
         VoidLeaseManager leaseManager = spy(new VoidLeaseManager(mock(TSOChannelHandler.class),
-                mock(TSOStateManager.class)));
+                                                                 mock(TSOStateManager.class)));
 
         TSOServerConfig tsoConfig = new TSOServerConfig();
-        tsoConfig.setPersistHandlerNum(4);
+        tsoConfig.setMaxBatchSize(MAX_BATCH_SIZE);
+        tsoConfig.setPersistHandlerNum(NUM_PERSIST_HANDLERS);
 
         PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[tsoConfig.getPersistHandlerNum()];
         for (int i = 0; i < tsoConfig.getPersistHandlerNum(); i++) {
@@ -160,51 +172,60 @@ public class TestPersistenceProcessor {
         }
 
         // Component under test
+        BatchPool batchPool = spy(new BatchPool(tsoConfig));
         PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig,
-                                                                 new BatchPool(tsoConfig),
-                                                                 replyProcessor,
-                                                                 panicker,
-                                                                 handlers);
+                                                                     batchPool,
+                                                                     replyProcessor,
+                                                                     panicker,
+                                                                     handlers);
 
-        MonitoringContext monCtx = new MonitoringContext(metrics);
-        proc.batch = batch;
-        proc.persistCommit(1, 2, null, monCtx);
+        verify(batchPool, times(1)).getNextEmptyBatch();
 
-        proc.persistCommit(3, 4, null, monCtx);
-        proc.persistCommit(5, 6, null, monCtx);
-        proc.persistCommit(7, 8, null, monCtx);
-        verify(batch, timeout(1000).times(0)).sendReply(any(ReplyProcessor.class),
-                any(RetryProcessor.class),
-                any(Long.class), eq(true));
+        // Fill one Batch completely
+        proc.persistCommit(1, 2, mock(Channel.class), mock(MonitoringContext.class));
+        proc.persistCommit(3, 4, mock(Channel.class), mock(MonitoringContext.class));
+        proc.persistCommit(5, 6, mock(Channel.class), mock(MonitoringContext.class));
+        verify(batchPool, times(1)).getNextEmptyBatch();
+        proc.persistCommit(7, 8, mock(Channel.class), mock(MonitoringContext.class)); // Should be full here
+        verify(batchPool, times(2)).getNextEmptyBatch();
+
+        // Test empty flush does not trigger response in getting a new batch
         proc.persistFlush();
-        verify(batch, timeout(1000).times(1)).sendReply(any(ReplyProcessor.class),
-                                                        any(RetryProcessor.class),
-                                                        any(Long.class), eq(true));
-        proc.batch = batch;
-        proc.persistCommit(1, 2, null, monCtx);
-        proc.persistCommit(3, 4, null, monCtx);
-        proc.persistCommit(5, 6, null, monCtx);
-        proc.persistCommit(7, 8, null, monCtx);
-        verify(batch, timeout(1000).times(1)).sendReply(any(ReplyProcessor.class),
-                any(RetryProcessor.class),
-                any(Long.class), eq(true));
+        verify(batchPool, times(2)).getNextEmptyBatch();
+
+        // Fill a second Batch completely
+        proc.persistCommit(1, 2, mock(Channel.class), mock(MonitoringContext.class));
+        proc.persistCommit(3, 4, mock(Channel.class), mock(MonitoringContext.class));
+        proc.persistCommit(5, 6, mock(Channel.class), mock(MonitoringContext.class));
+        proc.persistCommit(7, 8, mock(Channel.class), mock(MonitoringContext.class)); // Should be full here
+        verify(batchPool, times(3)).getNextEmptyBatch();
+
+        // Start filling a new batch and flush it immediately
+        proc.persistCommit(9, 10, mock(Channel.class), mock(MonitoringContext.class));
+        verify(batchPool, times(3)).getNextEmptyBatch();
         proc.persistFlush();
-        verify(batch, timeout(1000).times(2)).sendReply(any(ReplyProcessor.class),
-                any(RetryProcessor.class),
-                any(Long.class), eq(true));
-        proc.batch = batch;
+        verify(batchPool, times(4)).getNextEmptyBatch();
 
         // Test empty flush does not trigger response
         proc.persistFlush();
-        verify(batch, timeout(1000).times(2)).sendReply(any(ReplyProcessor.class),
-                any(RetryProcessor.class),
-                any(Long.class), eq(true));
+        proc.persistFlush();
+        proc.persistFlush();
+        proc.persistFlush();
+        proc.persistFlush();
+        verify(batchPool, times(4)).getNextEmptyBatch();
+
     }
 
     @Test
     public void testCommitPersistenceWithNonHALeaseManager() throws Exception {
 
+        final int MAX_BATCH_SIZE = 4;
+        final int NUM_PERSIST_HANDLERS = 4;
+
         TSOServerConfig tsoConfig = new TSOServerConfig();
+        tsoConfig.setMaxBatchSize(MAX_BATCH_SIZE);
+        tsoConfig.setPersistHandlerNum(NUM_PERSIST_HANDLERS);
+        tsoConfig.setBatchPersistTimeoutInMs(100);
 
         // Init a non-HA lease manager
         VoidLeaseManager leaseManager = spy(new VoidLeaseManager(mock(TSOChannelHandler.class),
@@ -222,35 +243,41 @@ public class TestPersistenceProcessor {
         }
 
         // Component under test
+        BatchPool batchPool = spy(new BatchPool(tsoConfig));
         PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig,
-                                                                 new BatchPool(tsoConfig),
-                                                                 replyProcessor,
-                                                                 panicker,
-                                                                 handlers);
+                                                                     batchPool,
+                                                                     replyProcessor,
+                                                                     panicker,
+                                                                     handlers);
 
         // The non-ha lease manager always return true for
         // stillInLeasePeriod(), so verify the batch sends replies as master
-        MonitoringContext monCtx = new MonitoringContext(metrics);
-        proc.batch = batch;
-        proc.persistCommit(1, 2, null, monCtx);
+        proc.persistCommit(1, 2, mock(Channel.class), mock(MonitoringContext.class));
         proc.persistFlush();
         verify(leaseManager, timeout(1000).times(2)).stillInLeasePeriod();
-        verify(batch, timeout(1000).times(1)).sendReply(any(ReplyProcessor.class),
-                                                        any(RetryProcessor.class),
-                                                        any(Long.class), eq(true));
+        verify(batchPool, times(2)).getNextEmptyBatch();
+
     }
 
     @Test
     public void testCommitPersistenceWithHALeaseManagerMultiHandlers() throws Exception {
+        final int MAX_BATCH_SIZE = 4;
+        final int NUM_PERSIST_HANDLERS = 4;
+
         TSOServerConfig tsoConfig = new TSOServerConfig();
-        tsoConfig.setPersistHandlerNum(4);
+        tsoConfig.setMaxBatchSize(MAX_BATCH_SIZE);
+        tsoConfig.setPersistHandlerNum(NUM_PERSIST_HANDLERS);
+        tsoConfig.setBatchPersistTimeoutInMs(100);
 
         testCommitPersistenceWithHALeaseManagerPerConfig(tsoConfig);
     }
 
     @Test
     public void testCommitPersistenceWithHALeaseManager() throws Exception {
-        testCommitPersistenceWithHALeaseManagerPerConfig(new TSOServerConfig());
+
+        TSOServerConfig tsoConfig = new TSOServerConfig();
+        testCommitPersistenceWithHALeaseManagerPerConfig(tsoConfig);
+
     }
 
     // TODO Recheck this tests comparing with previous master
@@ -267,49 +294,56 @@ public class TestPersistenceProcessor {
                                                           commitTable,
                                                           replyProcessor,
                                                           retryProcessor,
-                                                          panicker);
+                                                          new RuntimeExceptionPanicker());
         }
 
         // Component under test
+        BatchPool batchPool = spy(new BatchPool(tsoConfig));
         PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig,
-                                                                     new BatchPool(tsoConfig),
+                                                                     batchPool,
                                                                      replyProcessor,
                                                                      panicker,
                                                                      handlers);
 
         doReturn(true).when(leaseManager).stillInLeasePeriod();
         MonitoringContext monCtx = new MonitoringContext(metrics);
-        proc.batch = batch;
-        proc.persistCommit(1, 2, null, monCtx);
+        proc.persistCommit(1, 2, mock(Channel.class), mock(MonitoringContext.class));
         proc.persistFlush();
         verify(leaseManager, timeout(1000).times(2)).stillInLeasePeriod();
-        verify(batch, timeout(1000).times(1))
-                .sendReply(any(ReplyProcessor.class), any(RetryProcessor.class), any(Long.class), eq(true));
+        verify(batchPool, times(2)).getNextEmptyBatch();
 
-        // Test 2: Configure the lease manager to return true first and false later for stillInLeasePeriod, so verify
-        // the batch sends replies as non-master
+        // Test 2: Configure the lease manager to return true first and false later for stillInLeasePeriod
 
         // Reset stuff
         reset(leaseManager);
-        reset(batch);
-        proc.batch = batch;
         doReturn(true).doReturn(false).when(leaseManager).stillInLeasePeriod();
-        proc.persistCommit(1, 2, null, monCtx);
+        proc.persistCommit(1, 2, mock(Channel.class), mock(MonitoringContext.class));
         proc.persistFlush();
         verify(leaseManager, timeout(1000).times(2)).stillInLeasePeriod();
-        verify(batch, timeout(1000).times(1))
-                .sendReply(any(ReplyProcessor.class), any(RetryProcessor.class), any(Long.class), eq(false));
+        verify(batchPool, times(3)).getNextEmptyBatch();
+
+        // Test 3: Configure the lease manager to return false for stillInLeasePeriod
 
         // Reset stuff
         reset(leaseManager);
-        reset(batch);
-        proc.batch = batch;
         doReturn(false).when(leaseManager).stillInLeasePeriod();
-        proc.persistCommit(1, 2, null, monCtx);
+        proc.persistCommit(1, 2, mock(Channel.class), mock(MonitoringContext.class));
+        proc.persistFlush();
+        verify(leaseManager, timeout(1000).times(1)).stillInLeasePeriod();
+        verify(batchPool, times(4)).getNextEmptyBatch();
+
+        // Test 4: Configure the lease manager to return true first and false later for stillInLeasePeriod and raise
+        // an exception when flush
+
+        // Reset stuff
+        reset(leaseManager);
+        // Configure mock writer to flush successfully
+        doThrow(new IOException("Unable to write")).when(mockWriter).flush();
+        doReturn(true).doReturn(false).when(leaseManager).stillInLeasePeriod();
+        proc.persistCommit(1, 2, mock(Channel.class), mock(MonitoringContext.class));
         proc.persistFlush();
         verify(leaseManager, timeout(1000).times(1)).stillInLeasePeriod();
-        verify(batch, timeout(1000).times(1))
-                .sendReply(any(ReplyProcessor.class), any(RetryProcessor.class), any(Long.class), eq(false));
+        verify(batchPool, times(5)).getNextEmptyBatch();
     }
 
     @Test
@@ -382,6 +416,7 @@ public class TestPersistenceProcessor {
         proc.persistCommit(1, 2, null, monCtx);
         proc.persistFlush();
         verify(panicker, timeout(1000).atLeastOnce()).panic(anyString(), any(Throwable.class));
+
     }
 
 }



[42/50] [abbrv] incubator-omid git commit: Pre-create batch objects in pool

Posted by fp...@apache.org.
Pre-create batch objects in pool

Change-Id: I7e67e2c47435afdf12af2c1a8b276b3cff731ebd


Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/1e748637
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/1e748637
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/1e748637

Branch: refs/heads/master
Commit: 1e748637471bff3139d80b444965433951d27c17
Parents: b759eb8
Author: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Authored: Sat May 7 12:56:20 2016 -0700
Committer: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Committed: Sat May 7 12:56:20 2016 -0700

----------------------------------------------------------------------
 .../org/apache/omid/tso/BatchPoolModule.java    | 21 +++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/1e748637/tso-server/src/main/java/org/apache/omid/tso/BatchPoolModule.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/BatchPoolModule.java b/tso-server/src/main/java/org/apache/omid/tso/BatchPoolModule.java
index 8820f36..96e8717 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/BatchPoolModule.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/BatchPoolModule.java
@@ -26,6 +26,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import javax.inject.Singleton;
+import java.util.ArrayList;
+import java.util.List;
 
 public class BatchPoolModule extends AbstractModule {
 
@@ -43,18 +45,27 @@ public class BatchPoolModule extends AbstractModule {
 
     @Provides
     @Singleton
-    ObjectPool<Batch> getBatchPool() {
+    ObjectPool<Batch> getBatchPool() throws Exception {
+
         int poolSize = config.getNumConcurrentCTWriters();
         int batchSize = config.getBatchSizePerCTWriter() + 1; // Add 1 element to batch size for storing LWM
 
-        LOG.info("Pool Size (Batches) {}; Batch Size {} (including LWM bucket)", poolSize, batchSize);
+        LOG.info("Pool Size (# of Batches) {}; Batch Size {} (including LWM bucket)", poolSize, batchSize);
         LOG.info("Total Batch Size (Pool size * Batch Size): {}", poolSize * batchSize);
         GenericObjectPoolConfig config = new GenericObjectPoolConfig();
         config.setMaxTotal(poolSize);
-        config.setMinIdle(poolSize);
-        config.setMaxIdle(poolSize);
         config.setBlockWhenExhausted(true);
-        return new GenericObjectPool<>(new Batch.BatchFactory(batchSize), config);
+        GenericObjectPool<Batch> batchPool = new GenericObjectPool<>(new Batch.BatchFactory(batchSize), config);
+        LOG.info("Pre-creating objects in the pool..."); // TODO There should be a better way to do this
+        List<Batch> batches = new ArrayList<>(poolSize);
+        for (int i = 0; i < poolSize; i++) {
+            batches.add(batchPool.borrowObject());
+        }
+        for (Batch batch : batches) {
+            batchPool.returnObject(batch);
+        }
+        return batchPool;
+
     }
 
 }


[45/50] [abbrv] incubator-omid git commit: [ci skip]prepare release omid-0.8.1.49

Posted by fp...@apache.org.
[ci skip]prepare release omid-0.8.1.49


Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/06bd23c1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/06bd23c1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/06bd23c1

Branch: refs/heads/master
Commit: 06bd23c182e9e6c2600673e63c4550e41112d270
Parents: ccd2249
Author: Omid CI <om...@yahoo-inc.com>
Authored: Wed May 11 01:22:20 2016 +0000
Committer: Omid CI <om...@yahoo-inc.com>
Committed: Wed May 11 01:22:20 2016 +0000

----------------------------------------------------------------------
 benchmarks/pom.xml          | 2 +-
 codahale-metrics/pom.xml    | 2 +-
 commit-table/pom.xml        | 2 +-
 common/pom.xml              | 2 +-
 examples/pom.xml            | 2 +-
 hbase-client/pom.xml        | 2 +-
 hbase-commit-table/pom.xml  | 2 +-
 hbase-common/pom.xml        | 2 +-
 hbase-coprocessor/pom.xml   | 2 +-
 hbase-shims/hbase-0/pom.xml | 2 +-
 hbase-shims/hbase-1/pom.xml | 2 +-
 hbase-shims/pom.xml         | 2 +-
 hbase-tools/pom.xml         | 2 +-
 metrics/pom.xml             | 2 +-
 pom.xml                     | 4 ++--
 statemachine/pom.xml        | 2 +-
 timestamp-storage/pom.xml   | 2 +-
 transaction-client/pom.xml  | 2 +-
 tso-server/pom.xml          | 2 +-
 19 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06bd23c1/benchmarks/pom.xml
----------------------------------------------------------------------
diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml
index 07bba68..b4e9cf1 100644
--- a/benchmarks/pom.xml
+++ b/benchmarks/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.49-SNAPSHOT</version>
+        <version>0.8.1.49</version>
     </parent>
 
     <artifactId>benchmarks</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06bd23c1/codahale-metrics/pom.xml
----------------------------------------------------------------------
diff --git a/codahale-metrics/pom.xml b/codahale-metrics/pom.xml
index 98a84ba..fad6b84 100644
--- a/codahale-metrics/pom.xml
+++ b/codahale-metrics/pom.xml
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.49-SNAPSHOT</version>
+        <version>0.8.1.49</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06bd23c1/commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/commit-table/pom.xml b/commit-table/pom.xml
index 1ba2a97..d2962c7 100644
--- a/commit-table/pom.xml
+++ b/commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.49-SNAPSHOT</version>
+        <version>0.8.1.49</version>
     </parent>
 
     <artifactId>commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06bd23c1/common/pom.xml
----------------------------------------------------------------------
diff --git a/common/pom.xml b/common/pom.xml
index 52f3233..baeb35e 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.49-SNAPSHOT</version>
+        <version>0.8.1.49</version>
     </parent>
 
     <artifactId>common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06bd23c1/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index c44d33f..90af3cb 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.49-SNAPSHOT</version>
+        <version>0.8.1.49</version>
     </parent>
 
     <artifactId>examples</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06bd23c1/hbase-client/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml
index 8dd1ca2..f29066d 100644
--- a/hbase-client/pom.xml
+++ b/hbase-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.49-SNAPSHOT</version>
+        <version>0.8.1.49</version>
     </parent>
 
     <artifactId>hbase-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06bd23c1/hbase-commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-commit-table/pom.xml b/hbase-commit-table/pom.xml
index 74ed26b..20c6291 100644
--- a/hbase-commit-table/pom.xml
+++ b/hbase-commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.49-SNAPSHOT</version>
+        <version>0.8.1.49</version>
     </parent>
 
     <artifactId>hbase-commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06bd23c1/hbase-common/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml
index 51cd197..29d7f3a 100644
--- a/hbase-common/pom.xml
+++ b/hbase-common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.49-SNAPSHOT</version>
+        <version>0.8.1.49</version>
     </parent>
 
     <artifactId>hbase-common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06bd23c1/hbase-coprocessor/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-coprocessor/pom.xml b/hbase-coprocessor/pom.xml
index 375df65..653a435 100644
--- a/hbase-coprocessor/pom.xml
+++ b/hbase-coprocessor/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.49-SNAPSHOT</version>
+        <version>0.8.1.49</version>
     </parent>
 
     <artifactId>hbase-coprocessor</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06bd23c1/hbase-shims/hbase-0/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-0/pom.xml b/hbase-shims/hbase-0/pom.xml
index 146f574..3c451eb 100644
--- a/hbase-shims/hbase-0/pom.xml
+++ b/hbase-shims/hbase-0/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.49-SNAPSHOT</version>
+        <version>0.8.1.49</version>
     </parent>
 
     <artifactId>hbase0-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06bd23c1/hbase-shims/hbase-1/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-1/pom.xml b/hbase-shims/hbase-1/pom.xml
index e957db0..fc5721e 100644
--- a/hbase-shims/hbase-1/pom.xml
+++ b/hbase-shims/hbase-1/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.49-SNAPSHOT</version>
+        <version>0.8.1.49</version>
     </parent>
 
     <artifactId>hbase1-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06bd23c1/hbase-shims/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/pom.xml b/hbase-shims/pom.xml
index 214168a..6556289 100644
--- a/hbase-shims/pom.xml
+++ b/hbase-shims/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.49-SNAPSHOT</version>
+        <version>0.8.1.49</version>
     </parent>
 
     <artifactId>omid-shims-aggregator</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06bd23c1/hbase-tools/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-tools/pom.xml b/hbase-tools/pom.xml
index 27dfdba..5d479f1 100644
--- a/hbase-tools/pom.xml
+++ b/hbase-tools/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.49-SNAPSHOT</version>
+        <version>0.8.1.49</version>
     </parent>
 
     <artifactId>hbase-tools</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06bd23c1/metrics/pom.xml
----------------------------------------------------------------------
diff --git a/metrics/pom.xml b/metrics/pom.xml
index 7c133cf..514afbb 100644
--- a/metrics/pom.xml
+++ b/metrics/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.49-SNAPSHOT</version>
+        <version>0.8.1.49</version>
     </parent>
 
     <artifactId>metrics</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06bd23c1/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 6eb839d..a572667 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
     <artifactId>omid</artifactId>
     <packaging>pom</packaging>
     <!-- WARNING: do not update version manually, use mvn versions:set -->
-    <version>0.8.1.49-SNAPSHOT</version>
+    <version>0.8.1.49</version>
 
     <organization>
         <name>Apache Software Foundation</name>
@@ -105,7 +105,7 @@
         <connection>scm:git:git://github.com/yahoo/omid.git</connection>
         <developerConnection>scm:git:https://${GH_TOKEN}@github.com/yahoo/omid.git</developerConnection>
         <url>https://github.com/yahoo/omid</url>
-        <tag>master</tag>
+        <tag>omid-0.8.1.49</tag>
     </scm>
 
     <distributionManagement>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06bd23c1/statemachine/pom.xml
----------------------------------------------------------------------
diff --git a/statemachine/pom.xml b/statemachine/pom.xml
index 6c50c2c..47c7be3 100644
--- a/statemachine/pom.xml
+++ b/statemachine/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.49-SNAPSHOT</version>
+        <version>0.8.1.49</version>
     </parent>
 
     <name>State Machine</name>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06bd23c1/timestamp-storage/pom.xml
----------------------------------------------------------------------
diff --git a/timestamp-storage/pom.xml b/timestamp-storage/pom.xml
index c12e886..5edd473 100644
--- a/timestamp-storage/pom.xml
+++ b/timestamp-storage/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.49-SNAPSHOT</version>
+        <version>0.8.1.49</version>
     </parent>
 
     <artifactId>timestamp-storage</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06bd23c1/transaction-client/pom.xml
----------------------------------------------------------------------
diff --git a/transaction-client/pom.xml b/transaction-client/pom.xml
index d102326..3d8e6a0 100644
--- a/transaction-client/pom.xml
+++ b/transaction-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.49-SNAPSHOT</version>
+        <version>0.8.1.49</version>
     </parent>
 
     <artifactId>transaction-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06bd23c1/tso-server/pom.xml
----------------------------------------------------------------------
diff --git a/tso-server/pom.xml b/tso-server/pom.xml
index ae0936a..1ba655d 100644
--- a/tso-server/pom.xml
+++ b/tso-server/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.49-SNAPSHOT</version>
+        <version>0.8.1.49</version>
     </parent>
 
     <artifactId>tso-server</artifactId>


[28/50] [abbrv] incubator-omid git commit: Improve TSO performance: Parallel batched writes to CT

Posted by fp...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/tso-server/src/main/java/org/apache/omid/tso/RetryProcessorImpl.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/RetryProcessorImpl.java b/tso-server/src/main/java/org/apache/omid/tso/RetryProcessorImpl.java
index 7503d8a..ccf60c7 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/RetryProcessorImpl.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/RetryProcessorImpl.java
@@ -30,20 +30,24 @@ import org.apache.omid.committable.CommitTable;
 import org.apache.omid.committable.CommitTable.CommitTimestamp;
 import org.apache.omid.metrics.Meter;
 import org.apache.omid.metrics.MetricsRegistry;
+
 import org.jboss.netty.channel.Channel;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import javax.inject.Inject;
+
 import java.io.IOException;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
+import java.util.concurrent.ThreadFactory;
 
-import static org.apache.omid.metrics.MetricsUtils.name;
+import static com.codahale.metrics.MetricRegistry.name;
 
 /**
- * Manages the retry requests that clients can send when they did  not received the response in the specified timeout
+ * Manages the retry requests that clients can send when they did not received the response in the specified timeout.
  */
 class RetryProcessorImpl implements EventHandler<RetryProcessorImpl.RetryEvent>, RetryProcessor {
 
@@ -54,35 +58,38 @@ class RetryProcessorImpl implements EventHandler<RetryProcessorImpl.RetryEvent>,
     final RingBuffer<RetryEvent> retryRing;
 
     final CommitTable.Client commitTableClient;
-    final CommitTable.Writer writer;
+    final CommitTable.Writer writer; // TODO This is not used. Remove
+    final BatchPool batchPool;
 
     // Metrics
     final Meter retriesMeter;
 
     @Inject
-    RetryProcessorImpl(MetricsRegistry metrics, CommitTable commitTable, ReplyProcessor replyProc, Panicker panicker)
-            throws IOException
-    {
+    RetryProcessorImpl(MetricsRegistry metrics,
+                       CommitTable commitTable,
+                       ReplyProcessor replyProc,
+                       Panicker panicker,
+                       BatchPool batchPool)
+            throws InterruptedException, ExecutionException, IOException {
 
         this.commitTableClient = commitTable.getClient();
         this.writer = commitTable.getWriter();
         this.replyProc = replyProc;
+        this.batchPool = batchPool;
 
-        WaitStrategy strategy = new YieldingWaitStrategy();
-
-        retryRing = RingBuffer.createSingleProducer(RetryEvent.EVENT_FACTORY, 1 << 12, strategy);
-        SequenceBarrier retrySeqBarrier = retryRing.newBarrier();
-        BatchEventProcessor<RetryEvent> retryProcessor = new BatchEventProcessor<>(retryRing, retrySeqBarrier, this);
+        retryRing = RingBuffer.createSingleProducer(RetryEvent.EVENT_FACTORY, 1 << 12, new YieldingWaitStrategy());
+        SequenceBarrier retrySequenceBarrier = retryRing.newBarrier();
+        BatchEventProcessor<RetryEvent> retryProcessor = new BatchEventProcessor<>(retryRing, retrySequenceBarrier, this);
         retryProcessor.setExceptionHandler(new FatalExceptionHandler(panicker));
-
         retryRing.addGatingSequences(retryProcessor.getSequence());
 
-        ExecutorService retryExec = Executors.newSingleThreadExecutor(
-                new ThreadFactoryBuilder().setNameFormat("retry-%d").build());
+        ThreadFactory threadFactory = new ThreadFactoryBuilder().setNameFormat("retry-%d").build();
+        ExecutorService retryExec = Executors.newSingleThreadExecutor(threadFactory);
         retryExec.submit(retryProcessor);
 
-        // Metrics
+        // Metrics configuration
         retriesMeter = metrics.meter(name("tso", "retries"));
+
     }
 
     @Override
@@ -102,23 +109,21 @@ class RetryProcessorImpl implements EventHandler<RetryProcessorImpl.RetryEvent>,
     }
 
     private void handleCommitRetry(RetryEvent event) throws InterruptedException, ExecutionException {
-
         long startTimestamp = event.getStartTimestamp();
-
         try {
             Optional<CommitTimestamp> commitTimestamp = commitTableClient.getCommitTimestamp(startTimestamp).get();
-            if (commitTimestamp.isPresent()) {
+            Batch batch = batchPool.getNextEmptyBatch();
+            if(commitTimestamp.isPresent()) {
                 if (commitTimestamp.get().isValid()) {
                     LOG.trace("Valid commit TS found in Commit Table");
-                    replyProc.commitResponse(startTimestamp, commitTimestamp.get().getValue(),
-                            event.getChannel(), event.getMonCtx());
+                    replyProc.addCommit(batch, startTimestamp, commitTimestamp.get().getValue(), event.getChannel(), event.getMonCtx());
                 } else {
                     LOG.trace("Invalid commit TS found in Commit Table");
-                    replyProc.abortResponse(startTimestamp, event.getChannel(), event.getMonCtx());
+                    replyProc.addAbort(batch, startTimestamp, event.getChannel(), event.getMonCtx());
                 }
             } else {
                 LOG.trace("No commit TS found in Commit Table");
-                replyProc.abortResponse(startTimestamp, event.getChannel(), event.getMonCtx());
+                replyProc.addAbort(batch, startTimestamp, event.getChannel(), event.getMonCtx());
             }
         } catch (InterruptedException e) {
             LOG.error("Interrupted reading from commit table");
@@ -173,13 +178,13 @@ class RetryProcessorImpl implements EventHandler<RetryProcessorImpl.RetryEvent>,
             return startTimestamp;
         }
 
-        public final static EventFactory<RetryEvent> EVENT_FACTORY
-                = new EventFactory<RetryEvent>() {
+        public final static EventFactory<RetryEvent> EVENT_FACTORY = new EventFactory<RetryEvent>() {
             @Override
             public RetryEvent newInstance() {
                 return new RetryEvent();
             }
         };
+
     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/tso-server/src/main/java/org/apache/omid/tso/TSOModule.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/TSOModule.java b/tso-server/src/main/java/org/apache/omid/tso/TSOModule.java
index c15ec99..bd9e0f9 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/TSOModule.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/TSOModule.java
@@ -18,21 +18,19 @@
 package org.apache.omid.tso;
 
 import com.google.inject.AbstractModule;
+import com.google.inject.Provider;
 import com.google.inject.Provides;
-import com.google.inject.name.Names;
-import org.apache.omid.committable.CommitTable;
-import org.apache.omid.committable.hbase.HBaseCommitTableConfig;
-import org.apache.omid.timestamp.storage.TimestampStorage;
-import org.apache.omid.tools.hbase.SecureHBaseConfig;
 
 import javax.inject.Named;
 import javax.inject.Singleton;
+
 import java.net.SocketException;
 import java.net.UnknownHostException;
 
 import static org.apache.omid.tso.TSOServer.TSO_HOST_AND_PORT_KEY;
 
 class TSOModule extends AbstractModule {
+
     private final TSOServerConfig config;
 
     TSOModule(TSOServerConfig config) {
@@ -64,4 +62,13 @@ class TSOModule extends AbstractModule {
 
     }
 
+    @Provides
+    PersistenceProcessorHandler[] getPersistenceProcessorHandler(Provider<PersistenceProcessorHandler> provider) {
+        PersistenceProcessorHandler[] persistenceProcessorHandlers = new PersistenceProcessorHandler[config.getPersistHandlerNum()];
+        for (int i = 0; i < persistenceProcessorHandlers.length; i++) {
+            persistenceProcessorHandlers[i] = provider.get();
+        }
+        return persistenceProcessorHandlers;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/tso-server/src/main/java/org/apache/omid/tso/TSOServerConfig.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/TSOServerConfig.java b/tso-server/src/main/java/org/apache/omid/tso/TSOServerConfig.java
index 8e52428..c1fb5d2 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/TSOServerConfig.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/TSOServerConfig.java
@@ -76,6 +76,12 @@ public class TSOServerConfig extends SecureHBaseConfig {
 
     private int batchPersistTimeoutInMs;
 
+    // TODO Rename this (e.g. numOfConcurrentWriters)
+    private int persistHandlerNum;
+
+    // TODO Rename this
+    private int numBuffersPerHandler;
+
     private String networkIfaceName = getDefaultNetworkInterface();
 
     public int getPort() {
@@ -150,6 +156,26 @@ public class TSOServerConfig extends SecureHBaseConfig {
         this.metrics = metrics;
     }
 
+    // TODO Rename this (e.g. numOfConcurrentWriters)
+    public int getPersistHandlerNum() {
+        return persistHandlerNum;
+    }
+
+    // TODO Rename this
+    public void setPersistHandlerNum(int persistHandlerNum) {
+        this.persistHandlerNum = persistHandlerNum;
+    }
+
+    // TODO Rename this
+    public int getNumBuffersPerHandler() {
+        return numBuffersPerHandler;
+    }
+
+    // TODO Rename this
+    public void setNumBuffersPerHandler(int numBuffersPerHandler) {
+        this.numBuffersPerHandler = numBuffersPerHandler;
+    }
+
     // ----------------------------------------------------------------------------------------------------------------
     // Helper methods
     // ----------------------------------------------------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/tso-server/src/main/java/org/apache/omid/tso/TSOStateManager.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/TSOStateManager.java b/tso-server/src/main/java/org/apache/omid/tso/TSOStateManager.java
index 10eabac..6836554 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/TSOStateManager.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/TSOStateManager.java
@@ -62,8 +62,9 @@ public interface TSOStateManager {
          * Notifies the observer about the change in state
          * @param state
          *            the new TSOState
+         * @throws InterruptedException
          */
-        void update(TSOState state) throws IOException;
+        void update(TSOState state) throws IOException, InterruptedException;
 
     }
 
@@ -89,7 +90,8 @@ public interface TSOStateManager {
      * @return the new state
      * @throws IOException
      *             when problems resetting occur
+     * @throws InterruptedException
      */
-    TSOState initialize() throws IOException;
+    TSOState initialize() throws IOException, InterruptedException;
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/tso-server/src/main/java/org/apache/omid/tso/TSOStateManagerImpl.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/TSOStateManagerImpl.java b/tso-server/src/main/java/org/apache/omid/tso/TSOStateManagerImpl.java
index a10c22f..5d32fc3 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/TSOStateManagerImpl.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/TSOStateManagerImpl.java
@@ -18,10 +18,12 @@
 package org.apache.omid.tso;
 
 import com.google.common.base.Preconditions;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import javax.inject.Inject;
+
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
@@ -58,7 +60,7 @@ public class TSOStateManagerImpl implements TSOStateManager {
     }
 
     @Override
-    public TSOState initialize() throws IOException {
+    public TSOState initialize() throws IOException, InterruptedException {
 
         LOG.info("Initializing TSO Server state...");
         // The timestamp oracle dictates the new state

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/tso-server/src/main/java/org/apache/omid/tso/VoidLeaseManager.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/VoidLeaseManager.java b/tso-server/src/main/java/org/apache/omid/tso/VoidLeaseManager.java
index 0b32885..b53f147 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/VoidLeaseManager.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/VoidLeaseManager.java
@@ -30,7 +30,7 @@ public class VoidLeaseManager implements LeaseManagement {
     }
 
     @Override
-    public void startService() throws LeaseManagementException {
+    public void startService() throws LeaseManagementException, InterruptedException {
         try {
             stateManager.initialize();
             tsoChannelHandler.reconnect();

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/tso-server/src/main/resources/default-omid.yml
----------------------------------------------------------------------
diff --git a/tso-server/src/main/resources/default-omid.yml b/tso-server/src/main/resources/default-omid.yml
index 4cffe98..e3e559d 100644
--- a/tso-server/src/main/resources/default-omid.yml
+++ b/tso-server/src/main/resources/default-omid.yml
@@ -17,6 +17,9 @@ port: 54758
 maxItems: 100000000
 maxBatchSize: 25
 batchPersistTimeoutInMs: 10
+# TODO rename the next two parameters properly (e.g. numOfConcurrentWriters...)
+persistHandlerNum: 1
+numBuffersPerHandler: 10
 
 # Default module configuration (No TSO High Availability & in-memory storage for timestamp and commit tables)
 timestampStoreModule: !!org.apache.omid.tso.InMemoryTimestampStorageModule [ ]

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/tso-server/src/test/java/org/apache/omid/tso/TSOMockModule.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TSOMockModule.java b/tso-server/src/test/java/org/apache/omid/tso/TSOMockModule.java
index 9f9b3a6..29e06ed 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TSOMockModule.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TSOMockModule.java
@@ -18,6 +18,7 @@
 package org.apache.omid.tso;
 
 import com.google.inject.AbstractModule;
+import com.google.inject.Provider;
 import com.google.inject.Provides;
 import org.apache.omid.committable.CommitTable;
 import org.apache.omid.committable.InMemoryCommitTable;
@@ -28,6 +29,7 @@ import org.apache.omid.tso.TimestampOracleImpl.InMemoryTimestampStorage;
 
 import javax.inject.Named;
 import javax.inject.Singleton;
+
 import java.net.SocketException;
 import java.net.UnknownHostException;
 
@@ -73,4 +75,13 @@ public class TSOMockModule extends AbstractModule {
         return NetworkInterfaceUtils.getTSOHostAndPort(config);
     }
 
+    @Provides
+    PersistenceProcessorHandler[] getPersistenceProcessorHandler(Provider<PersistenceProcessorHandler> provider) {
+        PersistenceProcessorHandler[] persistenceProcessorHandlers = new PersistenceProcessorHandler[config.getPersistHandlerNum()];
+        for (int i = 0; i < persistenceProcessorHandlers.length; i++) {
+            persistenceProcessorHandlers[i] = provider.get();
+        }
+        return persistenceProcessorHandlers;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java b/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
index 844a98d..177e54d 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
@@ -25,17 +25,15 @@ import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyLong;
 import static org.mockito.Mockito.timeout;
 import static org.mockito.Mockito.verify;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
 
 public class TestBatch {
 
@@ -52,14 +50,15 @@ public class TestBatch {
     private ReplyProcessor replyProcessor;
 
     // The batch element to test
-    private PersistenceProcessorImpl.Batch batch;
+    private Batch batch;
 
     @BeforeMethod(alwaysRun = true, timeOut = 30_000)
     public void initMocksAndComponents() {
         MockitoAnnotations.initMocks(this);
-        batch = new PersistenceProcessorImpl.Batch(BATCH_SIZE);
+        batch = new Batch(BATCH_SIZE);
     }
 
+    // TODO. Check this test with the contents of the master branch. See commented asserts below
     @Test
     public void testBatchFunctionality() {
 
@@ -69,7 +68,7 @@ public class TestBatch {
         RetryProcessor retryProcessor = Mockito.mock(RetryProcessor.class);
 
         // The batch element to test
-        PersistenceProcessorImpl.Batch batch = new PersistenceProcessorImpl.Batch(BATCH_SIZE);
+        Batch batch = new Batch(BATCH_SIZE);
 
         // Test initial state is OK
         assertFalse(batch.isFull(), "Batch shouldn't be full");
@@ -102,21 +101,59 @@ public class TestBatch {
             monCtx = new MonitoringContext(metrics);
             monCtx.timerStart("commitPersistProcessor");
             batch.addCommit(0, 1, channel, new MonitoringContext(metrics));
-            Assert.fail("Should throw an IllegalStateException");
+            fail("Should throw an IllegalStateException");
         } catch (IllegalStateException e) {
-            assertEquals(e.getMessage(), "batch full", "message returned doesn't match");
+            assertEquals(e.getMessage(), "batch is full", "message returned doesn't match");
             LOG.debug("IllegalStateException catched properly");
         }
 
         // Test that sending replies empties the batch
-        batch.sendRepliesAndReset(replyProcessor, retryProcessor);
-        verify(replyProcessor, timeout(100).times(BATCH_SIZE / 2))
-                .timestampResponse(anyLong(), any(Channel.class), any(MonitoringContext.class));
-        verify(replyProcessor, timeout(100).times(BATCH_SIZE / 2))
-                .commitResponse(anyLong(), anyLong(), any(Channel.class), any(MonitoringContext.class));
-        assertFalse(batch.isFull(), "Batch shouldn't be full");
-        assertEquals(batch.getNumEvents(), 0, "Num events should be 0");
+// TODO. Fix these asserts in new code
+//<<<<<<< HEAD
+//        batch.sendRepliesAndReset(replyProcessor, retryProcessor);
+//        verify(replyProcessor, timeout(100).times(BATCH_SIZE / 2))
+//                .timestampResponse(anyLong(), any(Channel.class), any(MonitoringContext.class));
+//        verify(replyProcessor, timeout(100).times(BATCH_SIZE / 2))
+//                .commitResponse(anyLong(), anyLong(), any(Channel.class), any(MonitoringContext.class));
+//        assertFalse(batch.isFull(), "Batch shouldn't be full");
+//        assertEquals(batch.getNumEvents(), 0, "Num events should be 0");
+//=======
+        final boolean MASTER_INSTANCE = true;
+
+        final boolean SHOULD_MAKE_HEURISTIC_DECISION = true;
+        batch.sendReply(replyProcessor, retryProcessor, (-1), MASTER_INSTANCE);
+        verify(replyProcessor, timeout(100).times(1))
+               .batchResponse(batch, (-1), !SHOULD_MAKE_HEURISTIC_DECISION);
+        assertTrue(batch.isFull(), "Batch shouldn't be empty");
+    }
+
+    // TODO Check this test with the contents of the master branch
+    @Test
+    public void testBatchFunctionalityWhenMastershipIsLost() {
+        Channel channel = Mockito.mock(Channel.class);
+
+        // Fill the batch with events till full
+        for (int i = 0; i < BATCH_SIZE; i++) {
+            if (i % 2 == 0) {
+                MonitoringContext monCtx = new MonitoringContext(metrics);
+                monCtx.timerStart("timestampPersistProcessor");
+                batch.addTimestamp(i, channel, monCtx);
+            } else {
+                MonitoringContext monCtx = new MonitoringContext(metrics);
+                monCtx.timerStart("commitPersistProcessor");
+                batch.addCommit(i, i + 1, channel, monCtx);
+            }
+        }
 
+        // Test that sending replies empties the batch also when the replica
+        // is NOT master and calls the ambiguousCommitResponse() method on the
+        // reply processor
+        final boolean MASTER_INSTANCE = true;
+        final boolean SHOULD_MAKE_HEURISTIC_DECISION = true;
+        batch.sendReply(replyProcessor, retryProcessor, (-1), !MASTER_INSTANCE);
+        verify(replyProcessor, timeout(100).times(1))
+               .batchResponse(batch, (-1), SHOULD_MAKE_HEURISTIC_DECISION);
+        assertTrue(batch.isFull(), "Batch should be full");
     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/tso-server/src/test/java/org/apache/omid/tso/TestPanicker.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestPanicker.java b/tso-server/src/test/java/org/apache/omid/tso/TestPanicker.java
index 80cda48..0343716 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestPanicker.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestPanicker.java
@@ -41,7 +41,6 @@ import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.timeout;
 import static org.mockito.Mockito.verify;
 
-@SuppressWarnings({"UnusedDeclaration"})
 public class TestPanicker {
 
     private static final Logger LOG = LoggerFactory.getLogger(TestPanicker.class);
@@ -66,6 +65,7 @@ public class TestPanicker {
     // Please, remove me in a future commit
     @Test
     public void testTimestampOraclePanic() throws Exception {
+
         TimestampStorage storage = spy(new TimestampOracleImpl.InMemoryTimestampStorage());
         Panicker panicker = spy(new MockPanicker());
 
@@ -88,6 +88,7 @@ public class TestPanicker {
         allocThread.start();
 
         verify(panicker, timeout(1000).atLeastOnce()).panic(anyString(), any(Throwable.class));
+
     }
 
     // Note this test has been moved and refactored to TestPersistenceProcessor because
@@ -95,6 +96,7 @@ public class TestPanicker {
     // Please, remove me in a future commit
     @Test
     public void testCommitTablePanic() throws Exception {
+
         Panicker panicker = spy(new MockPanicker());
 
         doThrow(new IOException("Unable to write@TestPanicker")).when(mockWriter).flush();
@@ -114,16 +116,32 @@ public class TestPanicker {
 
         LeaseManager leaseManager = mock(LeaseManager.class);
         doReturn(true).when(leaseManager).stillInLeasePeriod();
-        PersistenceProcessor proc = new PersistenceProcessorImpl(new TSOServerConfig(),
-                                                                 metrics,
-                                                                 "localhost:1234",
-                                                                 leaseManager,
-                                                                 commitTable,
+        TSOServerConfig config = new TSOServerConfig();
+        BatchPool batchPool = new BatchPool(config);
+
+        PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[config.getPersistHandlerNum()];
+        for (int i = 0; i < config.getPersistHandlerNum(); i++) {
+            handlers[i] = new PersistenceProcessorHandler(metrics,
+                                                          "localhost:1234",
+                                                          leaseManager,
+                                                          commitTable,
+                                                          mock(ReplyProcessor.class),
+                                                          mock(RetryProcessor.class),
+                                                          panicker);
+        }
+
+        PersistenceProcessor proc = new PersistenceProcessorImpl(config,
+                                                                 batchPool,
                                                                  mock(ReplyProcessor.class),
-                                                                 mock(RetryProcessor.class),
-                                                                 panicker);
+                                                                 panicker,
+                                                                 handlers);
+
         proc.persistCommit(1, 2, null, new MonitoringContext(metrics));
+
+        new RequestProcessorImpl(metrics, mock(TimestampOracle.class), proc, panicker, mock(TSOServerConfig.class));
+
         verify(panicker, timeout(1000).atLeastOnce()).panic(anyString(), any(Throwable.class));
+
     }
 
     // Note this test has been moved and refactored to TestPersistenceProcessor because
@@ -131,6 +149,7 @@ public class TestPanicker {
     // Please, remove me in a future commit
     @Test
     public void testRuntimeExceptionTakesDownDaemon() throws Exception {
+
         Panicker panicker = spy(new MockPanicker());
 
         final CommitTable.Writer mockWriter = mock(CommitTable.Writer.class);
@@ -148,16 +167,31 @@ public class TestPanicker {
                 return mockClient;
             }
         };
-        PersistenceProcessor proc = new PersistenceProcessorImpl(new TSOServerConfig(),
-                                                                 metrics,
-                                                                 "localhost:1234",
-                                                                 mock(LeaseManager.class),
-                                                                 commitTable,
+        TSOServerConfig config = new TSOServerConfig();
+        BatchPool batchPool = new BatchPool(config);
+
+        PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[config.getPersistHandlerNum()];
+        for (int i = 0; i < config.getPersistHandlerNum(); i++) {
+            handlers[i] = new PersistenceProcessorHandler(metrics,
+                                                          "localhost:1234",
+                                                          mock(LeaseManager.class),
+                                                          commitTable,
+                                                          mock(ReplyProcessor.class),
+                                                          mock(RetryProcessor.class),
+                                                          panicker);
+        }
+
+        PersistenceProcessor proc = new PersistenceProcessorImpl(config,
+                                                                 batchPool,
                                                                  mock(ReplyProcessor.class),
-                                                                 mock(RetryProcessor.class),
-                                                                 panicker);
+                                                                 panicker,
+                                                                 handlers);
         proc.persistCommit(1, 2, null, new MonitoringContext(metrics));
+
+        new RequestProcessorImpl(metrics, mock(TimestampOracle.class), proc, panicker, mock(TSOServerConfig.class));
+
         verify(panicker, timeout(1000).atLeastOnce()).panic(anyString(), any(Throwable.class));
+
     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java b/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java
index 73d10dd..b48cf8b 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java
@@ -18,14 +18,13 @@
 package org.apache.omid.tso;
 
 import org.apache.omid.committable.CommitTable;
-import org.apache.omid.committable.InMemoryCommitTable;
 import org.apache.omid.metrics.MetricsRegistry;
 import org.apache.omid.metrics.NullMetricsProvider;
-import org.apache.omid.tso.PersistenceProcessorImpl.Batch;
-import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
@@ -35,21 +34,19 @@ import java.io.IOException;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyLong;
 import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.isA;
+import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.reset;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.timeout;
 import static org.mockito.Mockito.verify;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertTrue;
 
-@SuppressWarnings({"UnusedDeclaration"})
 public class TestPersistenceProcessor {
 
+    private static final Logger LOG = LoggerFactory.getLogger(TestPersistenceProcessor.class);
+
     @Mock
     private Batch batch;
     @Mock
@@ -97,144 +94,222 @@ public class TestPersistenceProcessor {
     }
 
     @Test
-    public void testCommitPersistenceWithNonHALeaseManager() throws Exception {
+    public void testCommitPersistenceWithMultiHandlers() throws Exception {
+
+        // Init a non-HA lease manager
+        VoidLeaseManager leaseManager = spy(new VoidLeaseManager(mock(TSOChannelHandler.class),
+                mock(TSOStateManager.class)));
+
+        TSOServerConfig tsoConfig = new TSOServerConfig();
+        tsoConfig.setPersistHandlerNum(4);
+
+        PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[tsoConfig.getPersistHandlerNum()];
+        for (int i = 0; i < tsoConfig.getPersistHandlerNum(); i++) {
+            handlers[i] = new PersistenceProcessorHandler(metrics, "localhost:1234",
+                                                          leaseManager,
+                                                          commitTable,
+                                                          replyProcessor,
+                                                          retryProcessor,
+                                                          panicker);
+        }
+
+        // Component under test
+        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig,
+                                                                 new BatchPool(tsoConfig),
+                                                                 replyProcessor,
+                                                                 panicker,
+                                                                 handlers);
+
+        MonitoringContext monCtx = new MonitoringContext(metrics);
+        proc.batch = batch;
+        proc.persistCommit(1, 2, null, monCtx);
+        proc.persistFlush();
+        proc.batch = batch;
+        proc.persistCommit(3, 4, null, monCtx);
+        proc.persistFlush();
+        proc.batch = batch;
+        proc.persistCommit(5, 6, null, monCtx);
+        proc.persistFlush();
+        proc.batch = batch;
+        proc.persistCommit(7, 8, null, monCtx);
+        proc.persistFlush();
+        verify(batch, timeout(1000).times(4)).sendReply(any(ReplyProcessor.class),
+                                                        any(RetryProcessor.class),
+                                                        any(Long.class), eq(true));
+    }
+
+    @Test
+    public void testCommitPersistenceWithSingleHanlderInMultiHandlersEnvironment() throws Exception {
 
         // Init a non-HA lease manager
         VoidLeaseManager leaseManager = spy(new VoidLeaseManager(mock(TSOChannelHandler.class),
-                                                                 mock(TSOStateManager.class)));
+                mock(TSOStateManager.class)));
+
+        TSOServerConfig tsoConfig = new TSOServerConfig();
+        tsoConfig.setPersistHandlerNum(4);
+
+        PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[tsoConfig.getPersistHandlerNum()];
+        for (int i = 0; i < tsoConfig.getPersistHandlerNum(); i++) {
+            handlers[i] = new PersistenceProcessorHandler(metrics,
+                                                          "localhost:1234",
+                                                          leaseManager,
+                                                          commitTable,
+                                                          replyProcessor,
+                                                          retryProcessor,
+                                                          panicker);
+        }
+
+        // Component under test
+        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig,
+                                                                 new BatchPool(tsoConfig),
+                                                                 replyProcessor,
+                                                                 panicker,
+                                                                 handlers);
+
+        MonitoringContext monCtx = new MonitoringContext(metrics);
+        proc.batch = batch;
+        proc.persistCommit(1, 2, null, monCtx);
+
+        proc.persistCommit(3, 4, null, monCtx);
+        proc.persistCommit(5, 6, null, monCtx);
+        proc.persistCommit(7, 8, null, monCtx);
+        verify(batch, timeout(1000).times(0)).sendReply(any(ReplyProcessor.class),
+                any(RetryProcessor.class),
+                any(Long.class), eq(true));
+        proc.persistFlush();
+        verify(batch, timeout(1000).times(1)).sendReply(any(ReplyProcessor.class),
+                                                        any(RetryProcessor.class),
+                                                        any(Long.class), eq(true));
+        proc.batch = batch;
+        proc.persistCommit(1, 2, null, monCtx);
+        proc.persistCommit(3, 4, null, monCtx);
+        proc.persistCommit(5, 6, null, monCtx);
+        proc.persistCommit(7, 8, null, monCtx);
+        verify(batch, timeout(1000).times(1)).sendReply(any(ReplyProcessor.class),
+                any(RetryProcessor.class),
+                any(Long.class), eq(true));
+        proc.persistFlush();
+        verify(batch, timeout(1000).times(2)).sendReply(any(ReplyProcessor.class),
+                any(RetryProcessor.class),
+                any(Long.class), eq(true));
+        proc.batch = batch;
+
+        // Test empty flush does not trigger response
+        proc.persistFlush();
+        verify(batch, timeout(1000).times(2)).sendReply(any(ReplyProcessor.class),
+                any(RetryProcessor.class),
+                any(Long.class), eq(true));
+    }
+
+    @Test
+    public void testCommitPersistenceWithNonHALeaseManager() throws Exception {
 
-        TSOServerConfig tsoServerConfig = new TSOServerConfig();
-        tsoServerConfig.setBatchPersistTimeoutInMs(100);
+        TSOServerConfig tsoConfig = new TSOServerConfig();
 
-        Batch batch = spy(new Batch(1));
+        // Init a non-HA lease manager
+        VoidLeaseManager leaseManager = spy(new VoidLeaseManager(mock(TSOChannelHandler.class),
+                mock(TSOStateManager.class)));
+
+        PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[tsoConfig.getPersistHandlerNum()];
+        for (int i = 0; i < tsoConfig.getPersistHandlerNum(); i++) {
+            handlers[i] = new PersistenceProcessorHandler(metrics,
+                                                          "localhost:1234",
+                                                          leaseManager,
+                                                          commitTable,
+                                                          replyProcessor,
+                                                          retryProcessor,
+                                                          panicker);
+        }
 
         // Component under test
-        PersistenceProcessor proc = new PersistenceProcessorImpl(tsoServerConfig,
-                                                                 metrics,
-                                                                 "localhost:1234",
-                                                                 batch,
-                                                                 leaseManager,
-                                                                 commitTable,
+        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig,
+                                                                 new BatchPool(tsoConfig),
                                                                  replyProcessor,
-                                                                 retryProcessor,
-                                                                 panicker);
+                                                                 panicker,
+                                                                 handlers);
 
         // The non-ha lease manager always return true for
         // stillInLeasePeriod(), so verify the batch sends replies as master
         MonitoringContext monCtx = new MonitoringContext(metrics);
-        proc.persistCommit(0, 1, null, monCtx);
+        proc.batch = batch;
+        proc.persistCommit(1, 2, null, monCtx);
+        proc.persistFlush();
         verify(leaseManager, timeout(1000).times(2)).stillInLeasePeriod();
-        verify(batch, timeout(1000).times(1)).sendRepliesAndReset(any(ReplyProcessor.class),
-                                                                  any(RetryProcessor.class));
+        verify(batch, timeout(1000).times(1)).sendReply(any(ReplyProcessor.class),
+                                                        any(RetryProcessor.class),
+                                                        any(Long.class), eq(true));
     }
 
     @Test
-    public void testCommitPersistenceWithHALeaseManager() throws Exception {
+    public void testCommitPersistenceWithHALeaseManagerMultiHandlers() throws Exception {
+        TSOServerConfig tsoConfig = new TSOServerConfig();
+        tsoConfig.setPersistHandlerNum(4);
 
-        TSOServerConfig tsoServerConfig = new TSOServerConfig();
-        tsoServerConfig.setBatchPersistTimeoutInMs(100);
+        testCommitPersistenceWithHALeaseManagerPerConfig(tsoConfig);
+    }
 
-        MonitoringContext monCtx = new MonitoringContext(metrics);
+    @Test
+    public void testCommitPersistenceWithHALeaseManager() throws Exception {
+        testCommitPersistenceWithHALeaseManagerPerConfig(new TSOServerConfig());
+    }
 
-        // Test 1: Configure the lease manager to always return true for stillInLeasePeriod, so verify the batch sends
-        // replies as master
+    // TODO Recheck this tests comparing with previous master
+    private void testCommitPersistenceWithHALeaseManagerPerConfig (TSOServerConfig tsoConfig) throws Exception {
 
-        // Init stuff
-        ArgumentCaptor<String> msg = ArgumentCaptor.forClass(String.class);
-        Panicker panicker = spy(new RuntimeExceptionPanicker());
+        // Init a HA lease manager
         LeaseManager leaseManager = mock(LeaseManager.class);
-        Batch batch = spy(new Batch(1));
+
+        PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[tsoConfig.getPersistHandlerNum()];
+        for (int i = 0; i < tsoConfig.getPersistHandlerNum(); i++) {
+            handlers[i] = new PersistenceProcessorHandler(metrics,
+                                                          "localhost:1234",
+                                                          leaseManager,
+                                                          commitTable,
+                                                          replyProcessor,
+                                                          retryProcessor,
+                                                          panicker);
+        }
+
         // Component under test
-        PersistenceProcessor proc = new PersistenceProcessorImpl(tsoServerConfig,
-                                                                 metrics,
-                                                                 "localhost:1234",
-                                                                 batch,
-                                                                 leaseManager,
-                                                                 new InMemoryCommitTable(),
-                                                                 replyProcessor,
-                                                                 retryProcessor,
-                                                                 panicker);
+        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig,
+                                                                     new BatchPool(tsoConfig),
+                                                                     replyProcessor,
+                                                                     panicker,
+                                                                     handlers);
 
         doReturn(true).when(leaseManager).stillInLeasePeriod();
+        MonitoringContext monCtx = new MonitoringContext(metrics);
+        proc.batch = batch;
         proc.persistCommit(1, 2, null, monCtx);
+        proc.persistFlush();
         verify(leaseManager, timeout(1000).times(2)).stillInLeasePeriod();
-        verify(batch).sendRepliesAndReset(any(ReplyProcessor.class), any(RetryProcessor.class));
-        verify(panicker, never()).panic(msg.capture(), any(Throwable.class));
+        verify(batch, timeout(1000).times(1))
+                .sendReply(any(ReplyProcessor.class), any(RetryProcessor.class), any(Long.class), eq(true));
 
         // Test 2: Configure the lease manager to return true first and false later for stillInLeasePeriod, so verify
         // the batch sends replies as non-master
 
         // Reset stuff
         reset(leaseManager);
-        batch = spy(new Batch(1));
-        msg = ArgumentCaptor.forClass(String.class);
-        panicker = spy(new RuntimeExceptionPanicker());
-        // Component under test
-        proc = new PersistenceProcessorImpl(tsoServerConfig,
-                                            metrics,
-                                            "localhost:1234",
-                                            batch,
-                                            leaseManager,
-                                            new InMemoryCommitTable(),
-                                            replyProcessor,
-                                            retryProcessor,
-                                            panicker);
+        reset(batch);
+        proc.batch = batch;
         doReturn(true).doReturn(false).when(leaseManager).stillInLeasePeriod();
         proc.persistCommit(1, 2, null, monCtx);
+        proc.persistFlush();
         verify(leaseManager, timeout(1000).times(2)).stillInLeasePeriod();
-        verify(batch, never()).sendRepliesAndReset(any(ReplyProcessor.class), any(RetryProcessor.class));
-        verify(panicker).panic(msg.capture());
-        assertTrue(msg.getValue().contains("Committing suicide"));
-
-        // Test 3:  Configure the lease manager to always return false for stillInLeasePeriod, so verify the batch
-        // sends replies as non-master
+        verify(batch, timeout(1000).times(1))
+                .sendReply(any(ReplyProcessor.class), any(RetryProcessor.class), any(Long.class), eq(false));
 
         // Reset stuff
         reset(leaseManager);
-        batch = spy(new Batch(1));
-        msg = ArgumentCaptor.forClass(String.class);
-        panicker = spy(new RuntimeExceptionPanicker());
-        // Component under test
-        proc = new PersistenceProcessorImpl(tsoServerConfig,
-                                            metrics,
-                                            "localhost:1234",
-                                            batch,
-                                            leaseManager,
-                                            commitTable,
-                                            replyProcessor,
-                                            retryProcessor,
-                                            panicker);
+        reset(batch);
+        proc.batch = batch;
         doReturn(false).when(leaseManager).stillInLeasePeriod();
         proc.persistCommit(1, 2, null, monCtx);
+        proc.persistFlush();
         verify(leaseManager, timeout(1000).times(1)).stillInLeasePeriod();
-        verify(batch, never()).sendRepliesAndReset(any(ReplyProcessor.class), any(RetryProcessor.class));
-        verify(panicker).panic(msg.capture());
-        assertTrue(msg.getValue().contains("Committing suicide"));
-
-        // Test 4: Test when flushing data fails to the database
-
-        // Reset stuff
-        reset(leaseManager);
-        batch = spy(new Batch(1));
-        msg = ArgumentCaptor.forClass(String.class);
-        panicker = spy(new RuntimeExceptionPanicker());
-        // Component under test
-        proc = new PersistenceProcessorImpl(tsoServerConfig,
-                                            metrics,
-                                            "localhost:1234",
-                                            batch,
-                                            leaseManager,
-                                            commitTable, // Commit table writer will fail and launch a panic
-                                            replyProcessor,
-                                            retryProcessor,
-                                            panicker);
-        doReturn(true).when(leaseManager).stillInLeasePeriod();
-        proc.persistCommit(1, 2, null, monCtx);
-        verify(leaseManager, timeout(1000).times(1)).stillInLeasePeriod();
-        verify(batch, never()).sendRepliesAndReset(any(ReplyProcessor.class), any(RetryProcessor.class));
-        verify(panicker).panic(msg.capture(), isA(IOException.class));
-        assertEquals(msg.getValue(), "Error persisting commit batch");
-
+        verify(batch, timeout(1000).times(1))
+                .sendReply(any(ReplyProcessor.class), any(RetryProcessor.class), any(Long.class), eq(false));
     }
 
     @Test
@@ -242,14 +317,26 @@ public class TestPersistenceProcessor {
 
         // Init lease management (doesn't matter if HA or not)
         LeaseManagement leaseManager = mock(LeaseManagement.class);
-        PersistenceProcessor proc = new PersistenceProcessorImpl(new TSOServerConfig(),
-                                                                 metrics,
-                                                                 "localhost:1234",
-                                                                 leaseManager,
-                                                                 commitTable,
+        TSOServerConfig config = new TSOServerConfig();
+        BatchPool batchPool = new BatchPool(config);
+
+        PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[config.getPersistHandlerNum()];
+        for (int i = 0; i < config.getPersistHandlerNum(); i++) {
+            handlers[i] = new PersistenceProcessorHandler(metrics,
+                                                          "localhost:1234",
+                                                          leaseManager,
+                                                          commitTable,
+                                                          mock(ReplyProcessor.class),
+                                                          mock(RetryProcessor.class),
+                                                          panicker);
+        }
+
+        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(config,
+                                                                 batchPool,
                                                                  mock(ReplyProcessor.class),
-                                                                 mock(RetryProcessor.class),
-                                                                 panicker);
+                                                                 panicker,
+                                                                 handlers);
+
         MonitoringContext monCtx = new MonitoringContext(metrics);
 
         // Configure lease manager to work normally
@@ -260,21 +347,32 @@ public class TestPersistenceProcessor {
 
         // Check the panic is extended!
         proc.persistCommit(1, 2, null, monCtx);
+        proc.persistFlush();
         verify(panicker, timeout(1000).atLeastOnce()).panic(anyString(), any(Throwable.class));
-
     }
 
     @Test
     public void testRuntimeExceptionOnCommitPersistenceTakesDownDaemon() throws Exception {
 
-        PersistenceProcessor proc = new PersistenceProcessorImpl(new TSOServerConfig(),
-                                                                 metrics,
-                                                                 "localhost:1234",
-                                                                 mock(LeaseManagement.class),
-                                                                 commitTable,
+        TSOServerConfig config = new TSOServerConfig();
+        BatchPool batchPool = new BatchPool(config);
+
+        PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[config.getPersistHandlerNum()];
+        for (int i = 0; i < config.getPersistHandlerNum(); i++) {
+            handlers[i] = new PersistenceProcessorHandler(metrics,
+                                                          "localhost:1234",
+                                                          mock(LeaseManager.class),
+                                                          commitTable,
+                                                          replyProcessor,
+                                                          retryProcessor,
+                                                          panicker);
+        }
+
+        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(config,
+                                                                 batchPool,
                                                                  replyProcessor,
-                                                                 retryProcessor,
-                                                                 panicker);
+                                                                 panicker,
+                                                                 handlers);
 
         // Configure writer to explode with a runtime exception
         doThrow(new RuntimeException("Kaboom!")).when(mockWriter).addCommittedTransaction(anyLong(), anyLong());
@@ -282,8 +380,8 @@ public class TestPersistenceProcessor {
 
         // Check the panic is extended!
         proc.persistCommit(1, 2, null, monCtx);
+        proc.persistFlush();
         verify(panicker, timeout(1000).atLeastOnce()).panic(anyString(), any(Throwable.class));
-
     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/tso-server/src/test/java/org/apache/omid/tso/TestRequestProcessor.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestRequestProcessor.java b/tso-server/src/test/java/org/apache/omid/tso/TestRequestProcessor.java
index 8dd66d3..2c612a4 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestRequestProcessor.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestRequestProcessor.java
@@ -71,7 +71,7 @@ public class TestRequestProcessor {
         TSOServerConfig config = new TSOServerConfig();
         config.setMaxItems(CONFLICT_MAP_SIZE);
 
-        requestProc = new RequestProcessorImpl(config, metrics, timestampOracle, persist, new MockPanicker());
+        requestProc = new RequestProcessorImpl(metrics, timestampOracle, persist, new MockPanicker(), config);
 
         // Initialize the state for the experiment
         stateManager.register(requestProc);
@@ -165,7 +165,7 @@ public class TestRequestProcessor {
         final long FIRST_COMMIT_TS_EVICTED = 1L;
         final long NEXT_COMMIT_TS_THAT_SHOULD_BE_EVICTED = 2L;
 
-        // Fill the cache to provoke a cache eviction
+                // Fill the cache to provoke a cache eviction
         for (long i = 0; i < CONFLICT_MAP_SIZE + CONFLICT_MAP_ASSOCIATIVITY; i++) {
             long writeSetElementHash = i + 1; // This is to match the assigned CT: K/V in cache = WS Element Hash/CT
             List<Long> writeSet = Lists.newArrayList(writeSetElementHash);
@@ -175,11 +175,11 @@ public class TestRequestProcessor {
         Thread.currentThread().sleep(3000); // Allow the Request processor to finish the request processing
 
         // Check that first time its called is on init
-        verify(persist, timeout(100).times(1)).persistLowWatermark(0L);
+        verify(persist, timeout(100).times(1)).persistLowWatermark(eq(0L), any(MonitoringContext.class));
         // Then, check it is called when cache is full and the first element is evicted (should be a 1)
-        verify(persist, timeout(100).times(1)).persistLowWatermark(FIRST_COMMIT_TS_EVICTED);
+        verify(persist, timeout(100).times(1)).persistLowWatermark(eq(FIRST_COMMIT_TS_EVICTED), any(MonitoringContext.class));
         // Finally it should never be called with the next element
-        verify(persist, timeout(100).never()).persistLowWatermark(NEXT_COMMIT_TS_THAT_SHOULD_BE_EVICTED);
+        verify(persist, timeout(100).never()).persistLowWatermark(eq(NEXT_COMMIT_TS_THAT_SHOULD_BE_EVICTED), any(MonitoringContext.class));
 
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/f6220a84/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java b/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java
index 7c4afac..c5270c0 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java
@@ -47,7 +47,6 @@ public class TestRetryProcessor {
     private static long NON_EXISTING_ST_TX = 1000;
     private static long ST_TX_1 = 0;
     private static long CT_TX_1 = 1;
-    private static long ST_TX_2 = 2;
 
     @Mock
     private Channel channel;
@@ -64,30 +63,33 @@ public class TestRetryProcessor {
         // Init components
         commitTable = new InMemoryCommitTable();
         metrics = new NullMetricsProvider();
-
     }
 
     @Test(timeOut = 10_000)
     public void testBasicFunctionality() throws Exception {
 
+        commitTable.getWriter().addCommittedTransaction(ST_TX_1, CT_TX_1);
+
+        BatchPool batchPool = new BatchPool(new TSOServerConfig());
+
         // The element to test
-        RetryProcessor retryProc = new RetryProcessorImpl(metrics, commitTable, replyProc, panicker);
+        RetryProcessor retryProc = new RetryProcessorImpl(metrics, commitTable, replyProc, panicker, batchPool);
 
         // Test we'll reply with an abort for a retry request when the start timestamp IS NOT in the commit table
         retryProc.disambiguateRetryRequestHeuristically(NON_EXISTING_ST_TX, channel, new MonitoringContext(metrics));
         ArgumentCaptor<Long> firstTScapture = ArgumentCaptor.forClass(Long.class);
-        verify(replyProc, timeout(100).times(1)).abortResponse(firstTScapture.capture(), any(Channel.class), any(MonitoringContext.class));
 
+        verify(replyProc, timeout(100).times(1))
+                .addAbort(any(Batch.class), firstTScapture.capture(), any(Channel.class), any(MonitoringContext.class));
         long startTS = firstTScapture.getValue();
         assertEquals(startTS, NON_EXISTING_ST_TX, "Captured timestamp should be the same as NON_EXISTING_ST_TX");
 
         // Test we'll reply with a commit for a retry request when the start timestamp IS in the commit table
-        commitTable.getWriter().addCommittedTransaction(ST_TX_1, CT_TX_1); // Add a tx to commit table
-
         retryProc.disambiguateRetryRequestHeuristically(ST_TX_1, channel, new MonitoringContext(metrics));
         ArgumentCaptor<Long> secondTScapture = ArgumentCaptor.forClass(Long.class);
+
         verify(replyProc, timeout(100).times(1))
-                .commitResponse(firstTScapture.capture(), secondTScapture.capture(), any(Channel.class), any(MonitoringContext.class));
+                .addCommit(any(Batch.class), firstTScapture.capture(), secondTScapture.capture(), any(Channel.class), any(MonitoringContext.class));
 
         startTS = firstTScapture.getValue();
         long commitTS = secondTScapture.getValue();
@@ -107,15 +109,16 @@ public class TestRetryProcessor {
         Assert.assertTrue(invalidTxMarker.isPresent());
         Assert.assertEquals(invalidTxMarker.get().getValue(), InMemoryCommitTable.INVALID_TRANSACTION_MARKER);
 
+        BatchPool batchPool = new BatchPool(new TSOServerConfig());
+
         // The element to test
-        RetryProcessor retryProc = new RetryProcessorImpl(metrics, commitTable, replyProc, panicker);
+        RetryProcessor retryProc = new RetryProcessorImpl(metrics, commitTable, replyProc, panicker, batchPool);
 
         // Test we'll reply with an abort for a retry request when the
         // transaction id IS in the commit table BUT invalidated
         retryProc.disambiguateRetryRequestHeuristically(ST_TX_1, channel, new MonitoringContext(metrics));
         ArgumentCaptor<Long> startTScapture = ArgumentCaptor.forClass(Long.class);
-        verify(replyProc, timeout(100).times(1)).abortResponse(startTScapture.capture(), any(Channel.class), any(MonitoringContext.class));
-
+        verify(replyProc, timeout(100).times(1)).addAbort(any(Batch.class), startTScapture.capture(), any(Channel.class), any(MonitoringContext.class));
         long startTS = startTScapture.getValue();
         Assert.assertEquals(startTS, ST_TX_1, "Captured timestamp should be the same as NON_EXISTING_ST_TX");
 


[33/50] [abbrv] incubator-omid git commit: Simplify Batch(Pool) initialization and fix tests

Posted by fp...@apache.org.
Simplify Batch(Pool) initialization and fix tests

Also improve naming of variables and methods that have now different semantics

Change-Id: I262b0f5ad2c2dc47a02f41f049c5075c8b6a357e


Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/1d60f21d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/1d60f21d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/1d60f21d

Branch: refs/heads/master
Commit: 1d60f21df8d239412939f0692f398e1c01294568
Parents: 43261a3
Author: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Authored: Tue May 3 11:16:17 2016 -0700
Committer: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Committed: Wed May 4 09:50:57 2016 -0700

----------------------------------------------------------------------
 .../apache/omid/transaction/TestTSOModule.java  |   4 +-
 .../TSOForHBaseCompactorTestModule.java         |   2 +-
 .../main/java/org/apache/omid/tso/Batch.java    |  45 ++-
 .../java/org/apache/omid/tso/BatchPool.java     |  11 +-
 .../java/org/apache/omid/tso/PersistEvent.java  |  12 +
 .../apache/omid/tso/PersistenceProcessor.java   |  16 +-
 .../omid/tso/PersistenceProcessorHandler.java   |  10 +-
 .../omid/tso/PersistenceProcessorImpl.java      |  79 ++--
 .../org/apache/omid/tso/ReplyProcessor.java     |  23 +-
 .../org/apache/omid/tso/ReplyProcessorImpl.java |  10 +-
 .../apache/omid/tso/RequestProcessorImpl.java   |  16 +-
 .../java/org/apache/omid/tso/TSOModule.java     |   4 +-
 .../org/apache/omid/tso/TSOServerConfig.java    |  74 ++--
 tso-server/src/main/resources/default-omid.yml  |  14 +-
 .../java/org/apache/omid/tso/TSOMockModule.java |   4 +-
 .../java/org/apache/omid/tso/TestBatch.java     |  22 +-
 .../java/org/apache/omid/tso/TestPanicker.java  |  14 +-
 .../omid/tso/TestPersistenceProcessor.java      | 382 +++++++++++--------
 .../apache/omid/tso/TestRequestProcessor.java   |  32 +-
 .../org/apache/omid/tso/TestRetryProcessor.java |  41 +-
 ...stTSOClientRequestAndResponseBehaviours.java |   1 +
 tso-server/src/test/resources/test-omid.yml     |   2 +-
 22 files changed, 436 insertions(+), 382 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/1d60f21d/hbase-client/src/test/java/org/apache/omid/transaction/TestTSOModule.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/test/java/org/apache/omid/transaction/TestTSOModule.java b/hbase-client/src/test/java/org/apache/omid/transaction/TestTSOModule.java
index 5d84b8b..79b84de 100644
--- a/hbase-client/src/test/java/org/apache/omid/transaction/TestTSOModule.java
+++ b/hbase-client/src/test/java/org/apache/omid/transaction/TestTSOModule.java
@@ -17,6 +17,7 @@
  */
 package org.apache.omid.transaction;
 
+import com.google.common.base.Preconditions;
 import com.google.inject.AbstractModule;
 import com.google.inject.Provider;
 import com.google.inject.Provides;
@@ -55,6 +56,7 @@ class TestTSOModule extends AbstractModule {
     private final TSOServerConfig config;
 
     TestTSOModule(Configuration hBaseConfig, TSOServerConfig config) {
+        Preconditions.checkArgument(config.getNumConcurrentCTWriters() >= 2, "# of Commit Table writers must be >= 2");
         this.hBaseConfig = hBaseConfig;
         this.config = config;
     }
@@ -104,7 +106,7 @@ class TestTSOModule extends AbstractModule {
 
     @Provides
     PersistenceProcessorHandler[] getPersistenceProcessorHandler(Provider<PersistenceProcessorHandler> provider) {
-        PersistenceProcessorHandler[] persistenceProcessorHandlers = new PersistenceProcessorHandler[config.getPersistHandlerNum()];
+        PersistenceProcessorHandler[] persistenceProcessorHandlers = new PersistenceProcessorHandler[config.getNumConcurrentCTWriters()];
         for (int i = 0; i < persistenceProcessorHandlers.length; i++) {
             persistenceProcessorHandlers[i] = provider.get();
         }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/1d60f21d/hbase-coprocessor/src/test/java/org/apache/omid/transaction/TSOForHBaseCompactorTestModule.java
----------------------------------------------------------------------
diff --git a/hbase-coprocessor/src/test/java/org/apache/omid/transaction/TSOForHBaseCompactorTestModule.java b/hbase-coprocessor/src/test/java/org/apache/omid/transaction/TSOForHBaseCompactorTestModule.java
index 96afbd2..7c7e643 100644
--- a/hbase-coprocessor/src/test/java/org/apache/omid/transaction/TSOForHBaseCompactorTestModule.java
+++ b/hbase-coprocessor/src/test/java/org/apache/omid/transaction/TSOForHBaseCompactorTestModule.java
@@ -123,7 +123,7 @@ class TSOForHBaseCompactorTestModule extends AbstractModule {
 
     @Provides
     PersistenceProcessorHandler[] getPersistenceProcessorHandler(Provider<PersistenceProcessorHandler> provider) {
-        PersistenceProcessorHandler[] persistenceProcessorHandlers = new PersistenceProcessorHandler[config.getPersistHandlerNum()];
+        PersistenceProcessorHandler[] persistenceProcessorHandlers = new PersistenceProcessorHandler[config.getNumConcurrentCTWriters()];
         for (int i = 0; i < persistenceProcessorHandlers.length; i++) {
             persistenceProcessorHandlers[i] = provider.get();
         }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/1d60f21d/tso-server/src/main/java/org/apache/omid/tso/Batch.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/Batch.java b/tso-server/src/main/java/org/apache/omid/tso/Batch.java
index e778eee..2b17f23 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/Batch.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/Batch.java
@@ -17,32 +17,29 @@
  */
 package org.apache.omid.tso;
 
+import com.google.common.base.Objects;
 import com.google.common.base.Preconditions;
 import org.apache.omid.tso.PersistEvent.Type;
 import org.jboss.netty.channel.Channel;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.Arrays;
+
 public class Batch {
 
     private static final Logger LOG = LoggerFactory.getLogger(Batch.class);
 
-    private final PersistEvent[] events;
-    private final int maxBatchSize;
-    private final BatchPool batchPool;
     private final int id;
+    private final int size;
     private int numEvents;
-
-    Batch(int maxBatchSize) {
-
-        this(maxBatchSize, 0, null);
-
-    }
+    private final PersistEvent[] events;
+    private final BatchPool batchPool;
 
     Batch(int size, int id, BatchPool batchPool) {
+
         Preconditions.checkArgument(size > 0, "Size must be positive");
-        LOG.info("Batch id {} created with size {}", id, size);
-        this.maxBatchSize = size;
+        this.size = size;
         this.batchPool = batchPool;
         this.id = id;
         this.numEvents = 0;
@@ -50,12 +47,14 @@ public class Batch {
         for (int i = 0; i < size; i++) {
             this.events[i] = new PersistEvent();
         }
+        LOG.info("Batch id {} created with size {}", id, size);
 
     }
 
     boolean isFull() {
-        Preconditions.checkState(numEvents <= maxBatchSize, "numEvents > maxBatchSize");
-        return numEvents == maxBatchSize;
+
+        Preconditions.checkState(numEvents <= size, "numEvents > size");
+        return numEvents == size;
 
     }
 
@@ -66,8 +65,9 @@ public class Batch {
     }
 
     boolean isLastEntryEmpty() {
-        Preconditions.checkState(numEvents <= maxBatchSize, "numEvents > maxBatchSize");
-        return numEvents == (maxBatchSize - 1);
+
+        Preconditions.checkState(numEvents <= size, "numEvents > size");
+        return numEvents == (size - 1);
 
     }
 
@@ -124,6 +124,7 @@ public class Batch {
     }
 
     void sendReply(ReplyProcessor reply, RetryProcessor retryProc, long batchID) {
+
         int i = 0;
         while (i < numEvents) {
             PersistEvent e = events[i];
@@ -135,7 +136,7 @@ public class Batch {
                 events[numEvents - 1] = tmp;
                 if (numEvents == 1) {
                     clear();
-                    reply.batchResponse(null, batchID);
+                    reply.manageResponsesBatch(batchID, null);
                     return;
                 }
                 numEvents--;
@@ -144,8 +145,18 @@ public class Batch {
             i++;
         }
 
-        reply.batchResponse(this, batchID);
+        reply.manageResponsesBatch(batchID, this);
+
+    }
 
+    @Override
+    public String toString() {
+        return Objects.toStringHelper(this)
+                .add("id", id)
+                .add("size", size)
+                .add("num events", numEvents)
+                .add("events", Arrays.toString(events))
+                .toString();
     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/1d60f21d/tso-server/src/main/java/org/apache/omid/tso/BatchPool.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/BatchPool.java b/tso-server/src/main/java/org/apache/omid/tso/BatchPool.java
index 88cfd1e..a5d7759 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/BatchPool.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/BatchPool.java
@@ -34,13 +34,12 @@ public class BatchPool {
     @Inject
     public BatchPool(TSOServerConfig config) {
 
-        int numBuffersPerHandler = (config.getNumBuffersPerHandler() >= 2) ? config.getNumBuffersPerHandler() : 2;
-        poolSize = config.getPersistHandlerNum() * numBuffersPerHandler;
-        LOG.info("Config param maxBatchSize {}", config.getMaxBatchSize());
-        LOG.info("Persistent Handlers {} ; Buffers per handler {}", config.getPersistHandlerNum(), numBuffersPerHandler);
+        poolSize = config.getNumConcurrentCTWriters();
+        int batchSize = config.getBatchSizePerCTWriter() + 1; // Add 1 element to batch size for storing LWM
+
+        LOG.info("Pool Size (Batches) {}; Batch Size {} (including LWM bucket)", poolSize, batchSize);
+        LOG.info("Total Batch Size (Pool size * Batch Size): {}", poolSize * batchSize);
         batches = new Batch[poolSize];
-        // TODO The + 1 is because the low watermark is added in each flush and needs one extra position. Fix and clarify initialization
-        int batchSize = (config.getMaxBatchSize() / config.getPersistHandlerNum() > 0) ? (config.getMaxBatchSize() / config.getPersistHandlerNum()) + 1 : 2;
 
         LOG.info("Creating {} Batches with {} elements each", poolSize, batchSize);
         for (int i = 0; i < poolSize; i++) {

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/1d60f21d/tso-server/src/main/java/org/apache/omid/tso/PersistEvent.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/PersistEvent.java b/tso-server/src/main/java/org/apache/omid/tso/PersistEvent.java
index e816149..32820f6 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/PersistEvent.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/PersistEvent.java
@@ -17,6 +17,7 @@
  */
 package org.apache.omid.tso;
 
+import com.google.common.base.Objects;
 import org.jboss.netty.channel.Channel;
 
 public final class PersistEvent {
@@ -114,4 +115,15 @@ public final class PersistEvent {
 
     }
 
+    @Override
+    public String toString() {
+        return Objects.toStringHelper(this)
+                .add("type", type)
+                .add("isRetry", isRetry)
+                .add("ST", startTimestamp)
+                .add("CT", commitTimestamp)
+                .add("LWM", lowWatermark)
+                .toString();
+    }
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/1d60f21d/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessor.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessor.java b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessor.java
index 47dc56b..aa0e7df 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessor.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessor.java
@@ -19,24 +19,18 @@ package org.apache.omid.tso;
 
 import org.jboss.netty.channel.Channel;
 
-// TODO Check the names of all methods as they do not persist anything anymore
 interface PersistenceProcessor {
 
-    // TODO maybe it should be called addCommit(...) or addCommitToBatch(...)
-    void persistCommit(long startTimestamp, long commitTimestamp, Channel c, MonitoringContext monCtx)
+    void addCommitToBatch(long startTimestamp, long commitTimestamp, Channel c, MonitoringContext monCtx)
             throws InterruptedException;
 
-    // TODO maybe it should be called addAbort(...) or addAbortToBatch(...)
-    void persistAbort(long startTimestamp, boolean isRetry, Channel c, MonitoringContext monCtx)
+    void addAbortToBatch(long startTimestamp, boolean isRetry, Channel c, MonitoringContext monCtx)
             throws InterruptedException;
 
-    // TODO maybe it should be called addTimestamp(...) or addTimestampToBatch(...)
-    void persistTimestamp(long startTimestamp, Channel c, MonitoringContext monCtx) throws InterruptedException;
+    void addTimestampToBatch(long startTimestamp, Channel c, MonitoringContext monCtx) throws InterruptedException;
 
-    // TODO maybe it should be called addLowWatermark(...) or addLowWatermarkToBatch(...)
-    void persistLowWatermark(long lowWatermark, MonitoringContext monCtx);
+    void addLowWatermarkToBatch(long lowWatermark, MonitoringContext monCtx);
 
-    // TODO The name of this method is weird. Rename to "persist"
-    void persistFlush() throws InterruptedException;
+    void triggerCurrentBatchFlush() throws InterruptedException;
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/1d60f21d/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java
index 19b6b77..84890b9 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java
@@ -17,6 +17,7 @@
  */
 package org.apache.omid.tso;
 
+import com.lmax.disruptor.LifecycleAware;
 import com.lmax.disruptor.WorkHandler;
 import org.apache.omid.committable.CommitTable;
 import org.apache.omid.metrics.Histogram;
@@ -93,14 +94,11 @@ public class PersistenceProcessorHandler implements WorkHandler<PersistenceProce
                 throw new RuntimeException("Unknown event type: " + localEvent.getType().name());
             }
         }
-        flush(batch, event.getBatchID());
+        flush(batch, event.getBatchSequence());
 
     }
 
-    // TODO Fix this method with the contents of PersistenceProcessor.flush() in master branch
-    // TODO This is related to the changes in TestPersistenceProcessor.testCommitPersistenceWithHALeaseManager().
-    // TODO Check also that test in the master branch
-    private void flush(Batch batch, long batchID) {
+    private void flush(Batch batch, long batchSequence) {
 
         if (batch.getNumEvents() > 0) {
             commitSuicideIfNotMaster();
@@ -113,7 +111,7 @@ public class PersistenceProcessorHandler implements WorkHandler<PersistenceProce
                 panicker.panic("Error persisting commit batch", e);
             }
             commitSuicideIfNotMaster(); // TODO Here, we can return the client responses before committing suicide
-            batch.sendReply(replyProcessor, retryProc, batchID);
+            batch.sendReply(replyProcessor, retryProc, batchSequence);
         }
 
     }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/1d60f21d/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java
index e57cda3..4d1eb4c 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java
@@ -18,6 +18,7 @@
 package org.apache.omid.tso;
 
 import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Objects;
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
 import com.lmax.disruptor.BusySpinWaitStrategy;
 import com.lmax.disruptor.EventFactory;
@@ -33,21 +34,23 @@ import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
+import static org.apache.omid.tso.PersistenceProcessorImpl.PersistBatchEvent.EVENT_FACTORY;
+import static org.apache.omid.tso.PersistenceProcessorImpl.PersistBatchEvent.makePersistBatch;
+
 class PersistenceProcessorImpl implements PersistenceProcessor {
 
     private static final Logger LOG = LoggerFactory.getLogger(PersistenceProcessorImpl.class);
 
     private static final long INITIAL_LWM_VALUE = -1L;
 
-    private final ReplyProcessor replyProcessor;
     private final RingBuffer<PersistBatchEvent> persistRing;
 
     private final BatchPool batchPool;
     @VisibleForTesting
-    Batch batch;
+    Batch currentBatch;
 
     // TODO Next two need to be either int or AtomicLong
-    volatile private long batchIDCnt;
+    volatile private long batchSequence;
     volatile private long lowWatermark = INITIAL_LWM_VALUE;
 
     private MonitoringContext lowWatermarkContext;
@@ -55,82 +58,80 @@ class PersistenceProcessorImpl implements PersistenceProcessor {
     @Inject
     PersistenceProcessorImpl(TSOServerConfig config,
                              BatchPool batchPool,
-                             ReplyProcessor replyProcessor,
                              Panicker panicker,
                              PersistenceProcessorHandler[] handlers)
             throws InterruptedException, ExecutionException, IOException {
 
-        this.batchIDCnt = 0L;
+        this.batchSequence = 0L;
         this.batchPool = batchPool;
-        this.batch = batchPool.getNextEmptyBatch();
+        this.currentBatch = batchPool.getNextEmptyBatch();
 
-        this.replyProcessor = replyProcessor;
+        // Disruptor configuration
+        this.persistRing = RingBuffer.createSingleProducer(EVENT_FACTORY, 1 << 20, new BusySpinWaitStrategy());
 
-        this.persistRing = RingBuffer.createSingleProducer(
-                PersistBatchEvent.EVENT_FACTORY, 1 << 20, new BusySpinWaitStrategy());
+        ThreadFactoryBuilder threadFactory = new ThreadFactoryBuilder().setNameFormat("persist-%d");
+        ExecutorService requestExec = Executors.newFixedThreadPool(config.getNumConcurrentCTWriters(),
+                                                                   threadFactory.build());
 
         WorkerPool<PersistBatchEvent> persistProcessor = new WorkerPool<>(persistRing,
                                                                           persistRing.newBarrier(),
                                                                           new FatalExceptionHandler(panicker),
                                                                           handlers);
         this.persistRing.addGatingSequences(persistProcessor.getWorkerSequences());
-
-        ExecutorService requestExec = Executors.newFixedThreadPool(config.getPersistHandlerNum(),
-                                                                   new ThreadFactoryBuilder().setNameFormat("persist-%d").build());
         persistProcessor.start(requestExec);
 
     }
 
     @Override
-    public void persistFlush() throws InterruptedException {
+    public void triggerCurrentBatchFlush() throws InterruptedException {
 
-        if (batch.isEmpty()) {
+        if (currentBatch.isEmpty()) {
             return;
         }
-        batch.addLowWatermark(this.lowWatermark, this.lowWatermarkContext);
+        currentBatch.addLowWatermark(this.lowWatermark, this.lowWatermarkContext);
         long seq = persistRing.next();
         PersistBatchEvent e = persistRing.get(seq);
-        PersistBatchEvent.makePersistBatch(e, batch, batchIDCnt++);
+        makePersistBatch(e, batchSequence++, currentBatch);
         persistRing.publish(seq);
-        batch = batchPool.getNextEmptyBatch();
+        currentBatch = batchPool.getNextEmptyBatch();
 
     }
 
     @Override
-    public void persistCommit(long startTimestamp, long commitTimestamp, Channel c, MonitoringContext monCtx)
+    public void addCommitToBatch(long startTimestamp, long commitTimestamp, Channel c, MonitoringContext monCtx)
             throws InterruptedException {
 
-        batch.addCommit(startTimestamp, commitTimestamp, c, monCtx);
-        if (batch.isLastEntryEmpty()) {
-            persistFlush();
+        currentBatch.addCommit(startTimestamp, commitTimestamp, c, monCtx);
+        if (currentBatch.isLastEntryEmpty()) {
+            triggerCurrentBatchFlush();
         }
 
     }
 
     @Override
-    public void persistAbort(long startTimestamp, boolean isRetry, Channel c, MonitoringContext context)
+    public void addAbortToBatch(long startTimestamp, boolean isRetry, Channel c, MonitoringContext context)
             throws InterruptedException {
 
-        batch.addAbort(startTimestamp, isRetry, c, context);
-        if (batch.isLastEntryEmpty()) {
-            persistFlush();
+        currentBatch.addAbort(startTimestamp, isRetry, c, context);
+        if (currentBatch.isLastEntryEmpty()) {
+            triggerCurrentBatchFlush();
         }
 
     }
 
     @Override
-    public void persistTimestamp(long startTimestamp, Channel c, MonitoringContext context)
+    public void addTimestampToBatch(long startTimestamp, Channel c, MonitoringContext context)
             throws InterruptedException {
 
-        batch.addTimestamp(startTimestamp, c, context);
-        if (batch.isLastEntryEmpty()) {
-            persistFlush();
+        currentBatch.addTimestamp(startTimestamp, c, context);
+        if (currentBatch.isLastEntryEmpty()) {
+            triggerCurrentBatchFlush();
         }
 
     }
 
     @Override
-    public void persistLowWatermark(long lowWatermark, MonitoringContext context) {
+    public void addLowWatermarkToBatch(long lowWatermark, MonitoringContext context) {
 
         this.lowWatermark = lowWatermark;
         this.lowWatermarkContext = context;
@@ -139,20 +140,20 @@ class PersistenceProcessorImpl implements PersistenceProcessor {
 
     final static class PersistBatchEvent {
 
+        private long batchSequence;
         private Batch batch;
-        private long batchID;
 
-        static void makePersistBatch(PersistBatchEvent e, Batch batch, long batchID) {
+        static void makePersistBatch(PersistBatchEvent e, long batchSequence, Batch batch) {
             e.batch = batch;
-            e.batchID = batchID;
+            e.batchSequence = batchSequence;
         }
 
         Batch getBatch() {
             return batch;
         }
 
-        long getBatchID() {
-            return batchID;
+        long getBatchSequence() {
+            return batchSequence;
         }
 
         final static EventFactory<PersistBatchEvent> EVENT_FACTORY = new EventFactory<PersistBatchEvent>() {
@@ -161,6 +162,14 @@ class PersistenceProcessorImpl implements PersistenceProcessor {
             }
         };
 
+        @Override
+        public String toString() {
+            return Objects.toStringHelper(this)
+                    .add("batchSequence", batchSequence)
+                    .add("batch", batch)
+                    .toString();
+        }
+
     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/1d60f21d/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessor.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessor.java b/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessor.java
index 37a9dd9..04f40cc 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessor.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessor.java
@@ -21,27 +21,20 @@ import org.jboss.netty.channel.Channel;
 
 interface ReplyProcessor {
 
-    // TODO This documentation does not corresponds to the method below anymore. Put in the right place or remove
     /**
-     * Informs the client about the outcome of the Tx it was trying to commit.
+     * The each reply to a transactional operation for a client is contained in a batch. The batch must be ordered
+     * before sending the replies in order to not to break snapshot isolation properties.
      *
+     * @param batchSequence
+     *            a batch sequence number, used to enforce order between replies
      * @param batch
-     *            the batch of operations
-     * @param batchID
-     *            the id of the batch, used to enforce order between replies
-     * @param makeHeuristicDecision
-     *            informs about whether heuristic actions are needed or not
-     * @param startTimestamp
-     *            the start timestamp of the transaction (a.k.a. tx id)
-     * @param commitTimestamp
-     *            the commit timestamp of the transaction
-     * @param channel
-     *            the communication channed with the client
+     *            a batch containing the transaction operations
      */
-    void batchResponse(Batch batch, long batchID);
+    void manageResponsesBatch(long batchSequence, Batch batch);
 
+    // TODO This method can be removed if we return the responses from the retry processor
     void addAbort(Batch batch, long startTimestamp, Channel c, MonitoringContext context);
-
+    // TODO This method can be removed if we return the responses from the retry processor
     void addCommit(Batch batch, long startTimestamp, long commitTimestamp, Channel c, MonitoringContext context);
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/1d60f21d/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java b/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java
index 85f465c..0f5fcb4 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java
@@ -165,28 +165,30 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyBatchEv
     }
 
     @Override
-    public void batchResponse(Batch batch, long batchID) {
+    public void manageResponsesBatch(long batchSequence, Batch batch) {
 
         long seq = replyRing.next();
         ReplyBatchEvent e = replyRing.get(seq);
-        ReplyBatchEvent.makeReplyBatch(e, batch, batchID);
+        ReplyBatchEvent.makeReplyBatch(e, batch, batchSequence);
         replyRing.publish(seq);
 
     }
 
+    // TODO This method can be removed if we return the responses from the retry processor
     @Override
     public void addAbort(Batch batch, long startTimestamp, Channel c, MonitoringContext context) {
 
         batch.addAbort(startTimestamp, true, c, context);
-        batchResponse(batch, NO_ORDER);
+        manageResponsesBatch(NO_ORDER, batch);
 
     }
 
+    // TODO This method can be removed if we return the responses from the retry processor
     @Override
     public void addCommit(Batch batch, long startTimestamp, long commitTimestamp, Channel c, MonitoringContext context) {
 
         batch.addCommit(startTimestamp, commitTimestamp, c, context);
-        batchResponse(batch, NO_ORDER);
+        manageResponsesBatch(NO_ORDER, batch);
 
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/1d60f21d/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java b/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java
index 2bbf1cf..ba0cb74 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java
@@ -91,8 +91,8 @@ class RequestProcessorImpl implements EventHandler<RequestProcessorImpl.RequestE
     public void update(TSOState state) throws InterruptedException {
         LOG.info("Initializing RequestProcessor...");
         this.lowWatermark = state.getLowWatermark();
-        persistProc.persistLowWatermark(lowWatermark, new MonitoringContext(metrics));
-        persistProc.persistFlush();
+        persistProc.addLowWatermarkToBatch(lowWatermark, new MonitoringContext(metrics));
+        persistProc.triggerCurrentBatchFlush();
         LOG.info("RequestProcessor initialized with LWMs {} and Epoch {}", lowWatermark, state.getEpoch());
     }
 
@@ -117,7 +117,7 @@ class RequestProcessorImpl implements EventHandler<RequestProcessorImpl.RequestE
         }
 
         if (endOfBatch) {
-            persistProc.persistFlush();
+            persistProc.triggerCurrentBatchFlush();
         }
 
     }
@@ -125,7 +125,7 @@ class RequestProcessorImpl implements EventHandler<RequestProcessorImpl.RequestE
     @Override
     public void onTimeout(long sequence) throws Exception {
 
-        persistProc.persistFlush();
+        persistProc.triggerCurrentBatchFlush();
 
     }
 
@@ -161,7 +161,7 @@ class RequestProcessorImpl implements EventHandler<RequestProcessorImpl.RequestE
             return;
         }
 
-        persistProc.persistTimestamp(timestamp, requestEvent.getChannel(), requestEvent.getMonCtx());
+        persistProc.addTimestampToBatch(timestamp, requestEvent.getChannel(), requestEvent.getMonCtx());
 
     }
 
@@ -208,15 +208,15 @@ class RequestProcessorImpl implements EventHandler<RequestProcessorImpl.RequestE
                     if (newLowWatermark != lowWatermark) {
                         LOG.trace("Setting new low Watermark to {}", newLowWatermark);
                         lowWatermark = newLowWatermark;
-                        persistProc.persistLowWatermark(newLowWatermark, event.getMonCtx());
+                        persistProc.addLowWatermarkToBatch(newLowWatermark, event.getMonCtx());
                     }
                 }
-                persistProc.persistCommit(startTimestamp, commitTimestamp, c, event.getMonCtx());
+                persistProc.addCommitToBatch(startTimestamp, commitTimestamp, c, event.getMonCtx());
             } catch (IOException e) {
                 LOG.error("Error committing", e);
             }
         } else { // add it to the aborted list
-            persistProc.persistAbort(startTimestamp, isRetry, c, event.getMonCtx());
+            persistProc.addAbortToBatch(startTimestamp, isRetry, c, event.getMonCtx());
         }
 
         return commitTimestamp;

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/1d60f21d/tso-server/src/main/java/org/apache/omid/tso/TSOModule.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/TSOModule.java b/tso-server/src/main/java/org/apache/omid/tso/TSOModule.java
index f195ebb..bfa88ef 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/TSOModule.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/TSOModule.java
@@ -17,6 +17,7 @@
  */
 package org.apache.omid.tso;
 
+import com.google.common.base.Preconditions;
 import com.google.inject.AbstractModule;
 import com.google.inject.Provider;
 import com.google.inject.Provides;
@@ -34,6 +35,7 @@ class TSOModule extends AbstractModule {
     private final TSOServerConfig config;
 
     TSOModule(TSOServerConfig config) {
+        Preconditions.checkArgument(config.getNumConcurrentCTWriters() >= 2, "# of Commit Table writers must be >= 2");
         this.config = config;
     }
 
@@ -65,7 +67,7 @@ class TSOModule extends AbstractModule {
 
     @Provides
     PersistenceProcessorHandler[] getPersistenceProcessorHandler(Provider<PersistenceProcessorHandler> provider) {
-        PersistenceProcessorHandler[] persistenceProcessorHandlers = new PersistenceProcessorHandler[config.getPersistHandlerNum()];
+        PersistenceProcessorHandler[] persistenceProcessorHandlers = new PersistenceProcessorHandler[config.getNumConcurrentCTWriters()];
         for (int i = 0; i < persistenceProcessorHandlers.length; i++) {
             persistenceProcessorHandlers[i] = provider.get();
         }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/1d60f21d/tso-server/src/main/java/org/apache/omid/tso/TSOServerConfig.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/TSOServerConfig.java b/tso-server/src/main/java/org/apache/omid/tso/TSOServerConfig.java
index c1fb5d2..05cb3f4 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/TSOServerConfig.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/TSOServerConfig.java
@@ -72,15 +72,11 @@ public class TSOServerConfig extends SecureHBaseConfig {
 
     private int maxItems;
 
-    private int maxBatchSize;
+    private int numConcurrentCTWriters;
 
-    private int batchPersistTimeoutInMs;
-
-    // TODO Rename this (e.g. numOfConcurrentWriters)
-    private int persistHandlerNum;
+    private int batchSizePerCTWriter;
 
-    // TODO Rename this
-    private int numBuffersPerHandler;
+    private int batchPersistTimeoutInMs;
 
     private String networkIfaceName = getDefaultNetworkInterface();
 
@@ -92,8 +88,32 @@ public class TSOServerConfig extends SecureHBaseConfig {
         this.port = port;
     }
 
-    public void setMaxBatchSize(int maxBatchSize) {
-        this.maxBatchSize = maxBatchSize;
+    public int getMaxItems() {
+        return maxItems;
+    }
+
+    public void setMaxItems(int maxItems) {
+        this.maxItems = maxItems;
+    }
+
+    public int getNumConcurrentCTWriters() {
+        return numConcurrentCTWriters;
+    }
+
+    public void setNumConcurrentCTWriters(int numConcurrentCTWriters) {
+        this.numConcurrentCTWriters = numConcurrentCTWriters;
+    }
+
+    public int getBatchSizePerCTWriter() {
+        return batchSizePerCTWriter;
+    }
+
+    public void setBatchSizePerCTWriter(int batchSizePerCTWriter) {
+        this.batchSizePerCTWriter = batchSizePerCTWriter;
+    }
+
+    public int getBatchPersistTimeoutInMs() {
+        return batchPersistTimeoutInMs;
     }
 
     public void setBatchPersistTimeoutInMs(int value) {
@@ -132,22 +152,6 @@ public class TSOServerConfig extends SecureHBaseConfig {
         this.leaseModule = leaseModule;
     }
 
-    public int getMaxItems() {
-        return maxItems;
-    }
-
-    public void setMaxItems(int maxItems) {
-        this.maxItems = maxItems;
-    }
-
-    public int getMaxBatchSize() {
-        return maxBatchSize;
-    }
-
-    public int getBatchPersistTimeoutInMs() {
-        return batchPersistTimeoutInMs;
-    }
-
     public MetricsRegistry getMetrics() {
         return metrics;
     }
@@ -156,26 +160,6 @@ public class TSOServerConfig extends SecureHBaseConfig {
         this.metrics = metrics;
     }
 
-    // TODO Rename this (e.g. numOfConcurrentWriters)
-    public int getPersistHandlerNum() {
-        return persistHandlerNum;
-    }
-
-    // TODO Rename this
-    public void setPersistHandlerNum(int persistHandlerNum) {
-        this.persistHandlerNum = persistHandlerNum;
-    }
-
-    // TODO Rename this
-    public int getNumBuffersPerHandler() {
-        return numBuffersPerHandler;
-    }
-
-    // TODO Rename this
-    public void setNumBuffersPerHandler(int numBuffersPerHandler) {
-        this.numBuffersPerHandler = numBuffersPerHandler;
-    }
-
     // ----------------------------------------------------------------------------------------------------------------
     // Helper methods
     // ----------------------------------------------------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/1d60f21d/tso-server/src/main/resources/default-omid.yml
----------------------------------------------------------------------
diff --git a/tso-server/src/main/resources/default-omid.yml b/tso-server/src/main/resources/default-omid.yml
index e3e559d..552a77a 100644
--- a/tso-server/src/main/resources/default-omid.yml
+++ b/tso-server/src/main/resources/default-omid.yml
@@ -5,7 +5,6 @@
 # ---------------------------------------------------------------------------------------------------------------------
 # Basic configuration parameters
 # ---------------------------------------------------------------------------------------------------------------------
-# TODO Explain rest of the parameters and/or rename properly
 
 # Network interface for TSO server communication. Uncomment the following line to use a specific interface
 # networkIfaceName: eth0
@@ -14,12 +13,16 @@
 
 # Port reserved by the Status Oracle
 port: 54758
+# The number of elements reserved in the conflict map to perform conflict resolution
+# TODO Rename to conflictMapSize
 maxItems: 100000000
-maxBatchSize: 25
+# The number of Commit Table writers that persist data concurrently to the datastore. It has to be at least 2.
+numConcurrentCTWriters: 2
+# The size of the batch of operations that each Commit Table writes has. The maximum number of operations that can be
+# batched in the system at a certain point in time is: numConcurrentCTWriters * batchSizePerCTWriter
+batchSizePerCTWriter: 25
+# When this timeout expires, the contents of the batch are flushed to the datastore
 batchPersistTimeoutInMs: 10
-# TODO rename the next two parameters properly (e.g. numOfConcurrentWriters...)
-persistHandlerNum: 1
-numBuffersPerHandler: 10
 
 # Default module configuration (No TSO High Availability & in-memory storage for timestamp and commit tables)
 timestampStoreModule: !!org.apache.omid.tso.InMemoryTimestampStorageModule [ ]
@@ -64,7 +67,6 @@ metrics: !!org.apache.omid.metrics.NullMetricsProvider [ ]
 #     }
 # ]
 
-
 # Example of multiple reporter configuration (to CSV files and console)
 #
 # metrics: !!org.apache.omid.metrics.CodahaleMetricsProvider [

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/1d60f21d/tso-server/src/test/java/org/apache/omid/tso/TSOMockModule.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TSOMockModule.java b/tso-server/src/test/java/org/apache/omid/tso/TSOMockModule.java
index c10df9d..92582f6 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TSOMockModule.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TSOMockModule.java
@@ -17,6 +17,7 @@
  */
 package org.apache.omid.tso;
 
+import com.google.common.base.Preconditions;
 import com.google.inject.AbstractModule;
 import com.google.inject.Provider;
 import com.google.inject.Provides;
@@ -40,6 +41,7 @@ public class TSOMockModule extends AbstractModule {
     private final TSOServerConfig config;
 
     public TSOMockModule(TSOServerConfig config) {
+        Preconditions.checkArgument(config.getNumConcurrentCTWriters() >= 2, "# of Commit Table writers must be >= 2");
         this.config = config;
     }
 
@@ -78,7 +80,7 @@ public class TSOMockModule extends AbstractModule {
 
     @Provides
     PersistenceProcessorHandler[] getPersistenceProcessorHandler(Provider<PersistenceProcessorHandler> provider) {
-        PersistenceProcessorHandler[] persistenceProcessorHandlers = new PersistenceProcessorHandler[config.getPersistHandlerNum()];
+        PersistenceProcessorHandler[] persistenceProcessorHandlers = new PersistenceProcessorHandler[config.getNumConcurrentCTWriters()];
         for (int i = 0; i < persistenceProcessorHandlers.length; i++) {
             persistenceProcessorHandlers[i] = provider.get();
         }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/1d60f21d/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java b/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
index 08b38be..c003f34 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
@@ -55,21 +55,13 @@ public class TestBatch {
     @BeforeMethod(alwaysRun = true, timeOut = 30_000)
     public void initMocksAndComponents() {
         MockitoAnnotations.initMocks(this);
-        batch = new Batch(BATCH_SIZE);
+        batch = new Batch(BATCH_SIZE, 0, null);
     }
 
-    // TODO. Check this test with the contents of the master branch. See commented asserts below
+    // TODO. Refactor the batch and test it properly. See commented asserts below
     @Test
     public void testBatchFunctionality() {
 
-        // Required mocks
-        Channel channel = Mockito.mock(Channel.class);
-        ReplyProcessor replyProcessor = Mockito.mock(ReplyProcessor.class);
-        RetryProcessor retryProcessor = Mockito.mock(RetryProcessor.class);
-
-        // The batch element to test
-        Batch batch = new Batch(BATCH_SIZE);
-
         // Test initial state is OK
         assertFalse(batch.isFull(), "Batch shouldn't be full");
         assertEquals(batch.getNumEvents(), 0, "Num events should be 0");
@@ -119,7 +111,7 @@ public class TestBatch {
 //        assertEquals(batch.getNumEvents(), 0, "Num events should be 0");
 //=======
         batch.sendReply(replyProcessor, retryProcessor, (-1));
-        verify(replyProcessor, timeout(100).times(1)).batchResponse(batch, (-1));
+        verify(replyProcessor, timeout(100).times(1)).manageResponsesBatch((-1), batch);
         assertTrue(batch.isFull(), "Batch shouldn't be empty");
     }
 
@@ -141,12 +133,10 @@ public class TestBatch {
             }
         }
 
-        // Test that sending replies empties the batch also when the replica
-        // is NOT master and calls the ambiguousCommitResponse() method on the
-        // reply processor
+        // Test that sending replies empties the batch also when the replica  is NOT master and calls the
+        // ambiguousCommitResponse() method on the reply processor
         batch.sendReply(replyProcessor, retryProcessor, (-1));
-        verify(replyProcessor, timeout(100).times(1))
-               .batchResponse(batch, (-1));
+        verify(replyProcessor, timeout(100).times(1)).manageResponsesBatch((-1), batch);
         assertTrue(batch.isFull(), "Batch should be full");
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/1d60f21d/tso-server/src/test/java/org/apache/omid/tso/TestPanicker.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestPanicker.java b/tso-server/src/test/java/org/apache/omid/tso/TestPanicker.java
index 0343716..e8dd8ad 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestPanicker.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestPanicker.java
@@ -119,8 +119,8 @@ public class TestPanicker {
         TSOServerConfig config = new TSOServerConfig();
         BatchPool batchPool = new BatchPool(config);
 
-        PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[config.getPersistHandlerNum()];
-        for (int i = 0; i < config.getPersistHandlerNum(); i++) {
+        PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[config.getNumConcurrentCTWriters()];
+        for (int i = 0; i < config.getNumConcurrentCTWriters(); i++) {
             handlers[i] = new PersistenceProcessorHandler(metrics,
                                                           "localhost:1234",
                                                           leaseManager,
@@ -132,11 +132,10 @@ public class TestPanicker {
 
         PersistenceProcessor proc = new PersistenceProcessorImpl(config,
                                                                  batchPool,
-                                                                 mock(ReplyProcessor.class),
                                                                  panicker,
                                                                  handlers);
 
-        proc.persistCommit(1, 2, null, new MonitoringContext(metrics));
+        proc.addCommitToBatch(1, 2, null, new MonitoringContext(metrics));
 
         new RequestProcessorImpl(metrics, mock(TimestampOracle.class), proc, panicker, mock(TSOServerConfig.class));
 
@@ -170,8 +169,8 @@ public class TestPanicker {
         TSOServerConfig config = new TSOServerConfig();
         BatchPool batchPool = new BatchPool(config);
 
-        PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[config.getPersistHandlerNum()];
-        for (int i = 0; i < config.getPersistHandlerNum(); i++) {
+        PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[config.getNumConcurrentCTWriters()];
+        for (int i = 0; i < config.getNumConcurrentCTWriters(); i++) {
             handlers[i] = new PersistenceProcessorHandler(metrics,
                                                           "localhost:1234",
                                                           mock(LeaseManager.class),
@@ -183,10 +182,9 @@ public class TestPanicker {
 
         PersistenceProcessor proc = new PersistenceProcessorImpl(config,
                                                                  batchPool,
-                                                                 mock(ReplyProcessor.class),
                                                                  panicker,
                                                                  handlers);
-        proc.persistCommit(1, 2, null, new MonitoringContext(metrics));
+        proc.addCommitToBatch(1, 2, null, new MonitoringContext(metrics));
 
         new RequestProcessorImpl(metrics, mock(TimestampOracle.class), proc, panicker, mock(TSOServerConfig.class));
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/1d60f21d/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java b/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java
index bc0b0f0..8e18119 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java
@@ -44,12 +44,15 @@ import static org.mockito.Mockito.timeout;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 
-// TODO Add timers
-// TODO Make visible currentBatch in PersistenceProcessorImpl to add proper verifications
+// TODO Refactor: Make visible currentBatch in PersistenceProcessorImpl to add proper verifications
 public class TestPersistenceProcessor {
 
     private static final Logger LOG = LoggerFactory.getLogger(TestPersistenceProcessor.class);
 
+    private static final long ANY_LWM = 0L;
+    private static final int ANY_ST = 0;
+    private static final int ANY_CT = 1;
+
     @Mock
     private CommitTable.Writer mockWriter;
     @Mock
@@ -57,8 +60,6 @@ public class TestPersistenceProcessor {
     @Mock
     private RetryProcessor retryProcessor;
     @Mock
-    private ReplyProcessor replyProcessor;
-    @Mock
     private Panicker panicker;
 
     private MetricsRegistry metrics;
@@ -69,9 +70,6 @@ public class TestPersistenceProcessor {
 
         MockitoAnnotations.initMocks(this);
 
-        // Configure mock writer to flush successfully
-//        doThrow(new IOException("Unable to write")).when(mockWriter).flush();
-
         // Configure null metrics provider
         metrics = new NullMetricsProvider();
 
@@ -96,21 +94,23 @@ public class TestPersistenceProcessor {
     }
 
     @Test
-    public void testCommitPersistenceWithMultiHandlers() throws Exception {
+    public void testCommitPersistenceWithSingleCommitTableWriter() throws Exception {
 
-        final int MAX_BATCH_SIZE = 4;
-        final int NUM_PERSIST_HANDLERS = 4;
+        final int NUM_CT_WRITERS = 1;
+        final int BATCH_SIZE_PER_CT_WRITER = 2;
 
         // Init a non-HA lease manager
         VoidLeaseManager leaseManager = spy(new VoidLeaseManager(mock(TSOChannelHandler.class),
                                                                  mock(TSOStateManager.class)));
 
         TSOServerConfig tsoConfig = new TSOServerConfig();
-        tsoConfig.setMaxBatchSize(MAX_BATCH_SIZE);
-        tsoConfig.setPersistHandlerNum(NUM_PERSIST_HANDLERS);
+        tsoConfig.setBatchSizePerCTWriter(BATCH_SIZE_PER_CT_WRITER);
+        tsoConfig.setNumConcurrentCTWriters(NUM_CT_WRITERS);
 
-        PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[tsoConfig.getPersistHandlerNum()];
-        for (int i = 0; i < tsoConfig.getPersistHandlerNum(); i++) {
+        ReplyProcessor replyProcessor = new ReplyProcessorImpl(metrics, panicker);
+
+        PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[tsoConfig.getNumConcurrentCTWriters()];
+        for (int i = 0; i < tsoConfig.getNumConcurrentCTWriters(); i++) {
             handlers[i] = new PersistenceProcessorHandler(metrics, "localhost:1234",
                                                           leaseManager,
                                                           commitTable,
@@ -122,46 +122,39 @@ public class TestPersistenceProcessor {
         // Component under test
         BatchPool batchPool = spy(new BatchPool(tsoConfig));
 
-        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig,
-                                                                     batchPool,
-                                                                     replyProcessor,
-                                                                     panicker,
-                                                                     handlers);
-
-        verify(batchPool, times(1)).getNextEmptyBatch();
-
-        proc.persistCommit(1, 2, mock(Channel.class), mock(MonitoringContext.class));
-        proc.persistFlush();
+        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig, batchPool, panicker, handlers);
 
-        proc.persistCommit(3, 4, mock(Channel.class), mock(MonitoringContext.class));
-        proc.persistFlush();
+        proc.addLowWatermarkToBatch(ANY_LWM, new MonitoringContext(metrics)); // Add a fake LWM
 
-        proc.persistCommit(5, 6, mock(Channel.class), mock(MonitoringContext.class));
-        proc.persistFlush();
+        verify(batchPool, times(1)).getNextEmptyBatch(); // Called during initialization
 
-        proc.persistCommit(7, 8, mock(Channel.class), mock(MonitoringContext.class));
-        proc.persistFlush();
+        proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class));
+        proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class)); // Flush: batch full
+        proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class));
+        proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class)); // Flush: batch full
 
-        verify(batchPool, times(5)).getNextEmptyBatch(); // 5 Times: 1 in initialization + 4 when flushing above
+        verify(batchPool, times(1 + BATCH_SIZE_PER_CT_WRITER)).getNextEmptyBatch(); // 3: 1 in init + 2 when flushing
 
     }
 
-    @Test
-    public void testCommitPersistenceWithSingleHandlerInMultiHandlersEnvironment() throws Exception {
+    @Test(timeOut=10_000)
+    public void testCommitPersistenceWithMultipleCommitTableWriters() throws Exception {
 
-        final int MAX_BATCH_SIZE = 16;
-        final int NUM_PERSIST_HANDLERS = 4;
+        final int NUM_CT_WRITERS = 2;
+        final int BATCH_SIZE_PER_CT_WRITER = 2;
 
         // Init a non-HA lease manager
         VoidLeaseManager leaseManager = spy(new VoidLeaseManager(mock(TSOChannelHandler.class),
                                                                  mock(TSOStateManager.class)));
 
         TSOServerConfig tsoConfig = new TSOServerConfig();
-        tsoConfig.setMaxBatchSize(MAX_BATCH_SIZE);
-        tsoConfig.setPersistHandlerNum(NUM_PERSIST_HANDLERS);
+        tsoConfig.setBatchSizePerCTWriter(BATCH_SIZE_PER_CT_WRITER);
+        tsoConfig.setNumConcurrentCTWriters(NUM_CT_WRITERS);
+
+        ReplyProcessor replyProcessor = new ReplyProcessorImpl(metrics, panicker);
 
-        PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[tsoConfig.getPersistHandlerNum()];
-        for (int i = 0; i < tsoConfig.getPersistHandlerNum(); i++) {
+        PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[tsoConfig.getNumConcurrentCTWriters()];
+        for (int i = 0; i < tsoConfig.getNumConcurrentCTWriters(); i++) {
             handlers[i] = new PersistenceProcessorHandler(metrics,
                                                           "localhost:1234",
                                                           leaseManager,
@@ -173,66 +166,66 @@ public class TestPersistenceProcessor {
 
         // Component under test
         BatchPool batchPool = spy(new BatchPool(tsoConfig));
-        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig,
-                                                                     batchPool,
-                                                                     replyProcessor,
-                                                                     panicker,
-                                                                     handlers);
-
-        verify(batchPool, times(1)).getNextEmptyBatch();
-
-        // Fill one Batch completely
-        proc.persistCommit(1, 2, mock(Channel.class), mock(MonitoringContext.class));
-        proc.persistCommit(3, 4, mock(Channel.class), mock(MonitoringContext.class));
-        proc.persistCommit(5, 6, mock(Channel.class), mock(MonitoringContext.class));
-        verify(batchPool, times(1)).getNextEmptyBatch();
-        proc.persistCommit(7, 8, mock(Channel.class), mock(MonitoringContext.class)); // Should be full here
-        verify(batchPool, times(2)).getNextEmptyBatch();
+        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig, batchPool, panicker, handlers);
 
-        // Test empty flush does not trigger response in getting a new batch
-        proc.persistFlush();
-        verify(batchPool, times(2)).getNextEmptyBatch();
+        proc.addLowWatermarkToBatch(ANY_LWM, mock(MonitoringContext.class)); // Add a fake LWM
+
+        verify(batchPool, times(1)).getNextEmptyBatch(); // Called during initialization
 
-        // Fill a second Batch completely
-        proc.persistCommit(1, 2, mock(Channel.class), mock(MonitoringContext.class));
-        proc.persistCommit(3, 4, mock(Channel.class), mock(MonitoringContext.class));
-        proc.persistCommit(5, 6, mock(Channel.class), mock(MonitoringContext.class));
-        proc.persistCommit(7, 8, mock(Channel.class), mock(MonitoringContext.class)); // Should be full here
+        // Fill 1st handler Batches completely
+        proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class));
+        proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class)); // 1st batch full
+        verify(batchPool, times(2)).getNextEmptyBatch();
+        proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class));
+        proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class)); // 2nd batch full
         verify(batchPool, times(3)).getNextEmptyBatch();
 
-        // Start filling a new batch and flush it immediately
-        proc.persistCommit(9, 10, mock(Channel.class), mock(MonitoringContext.class));
+        // Test empty flush does not trigger response in getting a new currentBatch
+        proc.triggerCurrentBatchFlush();
         verify(batchPool, times(3)).getNextEmptyBatch();
-        proc.persistFlush();
-        verify(batchPool, times(4)).getNextEmptyBatch();
+
+        // Fill 2nd handler Batches completely
+        proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class));
+        proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class)); // 1st batch full
+        proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class));
+        proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class)); // 2nd batch full
+        verify(batchPool, times(1 + (NUM_CT_WRITERS * BATCH_SIZE_PER_CT_WRITER))).getNextEmptyBatch();
+
+        // Start filling a new currentBatch and flush it immediately
+        proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class)); // Batch not full
+        verify(batchPool, times(5)).getNextEmptyBatch();
+        proc.triggerCurrentBatchFlush(); // Flushing should provoke invocation of a new batch
+        verify(batchPool, times(6)).getNextEmptyBatch();
 
         // Test empty flush does not trigger response
-        proc.persistFlush();
-        proc.persistFlush();
-        proc.persistFlush();
-        proc.persistFlush();
-        proc.persistFlush();
-        verify(batchPool, times(4)).getNextEmptyBatch();
+        proc.triggerCurrentBatchFlush();
+        proc.triggerCurrentBatchFlush();
+        proc.triggerCurrentBatchFlush();
+        proc.triggerCurrentBatchFlush();
+        proc.triggerCurrentBatchFlush();
+        verify(batchPool, times(6)).getNextEmptyBatch();
 
     }
 
-    @Test
+    @Test(timeOut=10_000)
     public void testCommitPersistenceWithNonHALeaseManager() throws Exception {
 
-        final int MAX_BATCH_SIZE = 4;
-        final int NUM_PERSIST_HANDLERS = 4;
+        final int NUM_CT_WRITERS = 1;
+        final int BATCH_SIZE_PER_CT_WRITER = 1;
 
         TSOServerConfig tsoConfig = new TSOServerConfig();
-        tsoConfig.setMaxBatchSize(MAX_BATCH_SIZE);
-        tsoConfig.setPersistHandlerNum(NUM_PERSIST_HANDLERS);
+        tsoConfig.setBatchSizePerCTWriter(NUM_CT_WRITERS);
+        tsoConfig.setNumConcurrentCTWriters(BATCH_SIZE_PER_CT_WRITER);
         tsoConfig.setBatchPersistTimeoutInMs(100);
 
+        ReplyProcessor replyProcessor = new ReplyProcessorImpl(metrics, panicker);
+
         // Init a non-HA lease manager
         VoidLeaseManager leaseManager = spy(new VoidLeaseManager(mock(TSOChannelHandler.class),
                 mock(TSOStateManager.class)));
 
-        PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[tsoConfig.getPersistHandlerNum()];
-        for (int i = 0; i < tsoConfig.getPersistHandlerNum(); i++) {
+        PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[tsoConfig.getNumConcurrentCTWriters()];
+        for (int i = 0; i < tsoConfig.getNumConcurrentCTWriters(); i++) {
             handlers[i] = new PersistenceProcessorHandler(metrics,
                                                           "localhost:1234",
                                                           leaseManager,
@@ -242,111 +235,160 @@ public class TestPersistenceProcessor {
                                                           panicker);
         }
 
-        // Component under test
         BatchPool batchPool = spy(new BatchPool(tsoConfig));
-        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig,
-                                                                     batchPool,
-                                                                     replyProcessor,
-                                                                     panicker,
-                                                                     handlers);
+
+        // Component under test
+        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig, batchPool, panicker, handlers);
+
+        proc.addLowWatermarkToBatch(ANY_LWM, new MonitoringContext(metrics)); // Add a fake LWM
 
         // The non-ha lease manager always return true for
-        // stillInLeasePeriod(), so verify the batch sends replies as master
-        proc.persistCommit(1, 2, mock(Channel.class), mock(MonitoringContext.class));
-        proc.persistFlush();
+        // stillInLeasePeriod(), so verify the currentBatch sends replies as master
+        proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class));
+        proc.triggerCurrentBatchFlush();
         verify(leaseManager, timeout(1000).times(2)).stillInLeasePeriod();
         verify(batchPool, times(2)).getNextEmptyBatch();
 
     }
 
-    @Test
-    public void testCommitPersistenceWithHALeaseManagerMultiHandlers() throws Exception {
-        final int MAX_BATCH_SIZE = 4;
-        final int NUM_PERSIST_HANDLERS = 4;
+    @Test(timeOut=10_000)
+    public void testCommitPersistenceWithHALeaseManagerAndSingleCommitTableWriter() throws Exception {
+
+        final int NUM_PERSIST_HANDLERS = 1;
 
         TSOServerConfig tsoConfig = new TSOServerConfig();
-        tsoConfig.setMaxBatchSize(MAX_BATCH_SIZE);
-        tsoConfig.setPersistHandlerNum(NUM_PERSIST_HANDLERS);
-        tsoConfig.setBatchPersistTimeoutInMs(100);
+        tsoConfig.setNumConcurrentCTWriters(NUM_PERSIST_HANDLERS);
+
+        testPersistenceWithHALeaseManagerPreservingLease(tsoConfig);
+        testPersistenceWithHALeaseManagerFailingToPreserveLease1(tsoConfig);
+        testPersistenceWithHALeaseManagerFailingToPreserveLease2(tsoConfig);
+        testPersistenceWithHALeaseManagerFailingToPreserveLease3(tsoConfig);
 
-        testCommitPersistenceWithHALeaseManagerPerConfig(tsoConfig);
     }
 
-    @Test
-    public void testCommitPersistenceWithHALeaseManager() throws Exception {
+    @Test(timeOut=10_000)
+    public void testCommitPersistenceWithHALeaseManagerAndMultipleCommitTableWriters() throws Exception {
+
+        final int NUM_CT_WRITERS = 4;
+        final int BATCH_SIZE_PER_CT_WRITER = 4;
 
         TSOServerConfig tsoConfig = new TSOServerConfig();
-        testCommitPersistenceWithHALeaseManagerPerConfig(tsoConfig);
+        tsoConfig.setNumConcurrentCTWriters(NUM_CT_WRITERS);
+        tsoConfig.setBatchSizePerCTWriter(BATCH_SIZE_PER_CT_WRITER);
+        tsoConfig.setBatchPersistTimeoutInMs(100);
+
+        testPersistenceWithHALeaseManagerPreservingLease(tsoConfig);
+        testPersistenceWithHALeaseManagerFailingToPreserveLease1(tsoConfig);
+        testPersistenceWithHALeaseManagerFailingToPreserveLease2(tsoConfig);
+        testPersistenceWithHALeaseManagerFailingToPreserveLease3(tsoConfig);
 
     }
 
-    // TODO Recheck this tests comparing with previous master
-    private void testCommitPersistenceWithHALeaseManagerPerConfig (TSOServerConfig tsoConfig) throws Exception {
+    private void testPersistenceWithHALeaseManagerPreservingLease(TSOServerConfig tsoConfig) throws Exception {
 
         // Init a HA lease manager
-        LeaseManager leaseManager = mock(LeaseManager.class);
+        LeaseManager simulatedHALeaseManager = mock(LeaseManager.class);
 
-        PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[tsoConfig.getPersistHandlerNum()];
-        for (int i = 0; i < tsoConfig.getPersistHandlerNum(); i++) {
-            handlers[i] = new PersistenceProcessorHandler(metrics,
-                                                          "localhost:1234",
-                                                          leaseManager,
-                                                          commitTable,
-                                                          replyProcessor,
-                                                          retryProcessor,
-                                                          new RuntimeExceptionPanicker());
-        }
+        PersistenceProcessorHandler[] handlers = configureHandlers (tsoConfig, simulatedHALeaseManager);
+
+        BatchPool batchPool = spy(new BatchPool(tsoConfig));
+
+        // Component under test
+        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig, batchPool, panicker, handlers);
+
+        proc.addLowWatermarkToBatch(ANY_LWM, new MonitoringContext(metrics)); // Add a fake LWM
+
+        // Test: Configure the lease manager to return true always
+        doReturn(true).when(simulatedHALeaseManager).stillInLeasePeriod();
+        proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class));
+        proc.triggerCurrentBatchFlush();
+        verify(simulatedHALeaseManager, timeout(1000).times(2)).stillInLeasePeriod();
+        verify(batchPool, times(2)).getNextEmptyBatch();
+    }
+
+    private void testPersistenceWithHALeaseManagerFailingToPreserveLease1(TSOServerConfig tsoConfig) throws Exception {
+
+        // Init a HA lease manager
+        LeaseManager simulatedHALeaseManager = mock(LeaseManager.class);
+
+        PersistenceProcessorHandler[] handlers = configureHandlers (tsoConfig, simulatedHALeaseManager);
+
+        BatchPool batchPool = spy(new BatchPool(tsoConfig));
 
         // Component under test
+        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig, batchPool, panicker, handlers);
+
+        // Test: Configure the lease manager to return true first and false later for stillInLeasePeriod
+        doReturn(true).doReturn(false).when(simulatedHALeaseManager).stillInLeasePeriod();
+        batchPool.notifyEmptyBatch(0); // Unlock this thread to check the panicker
+        proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class));
+        proc.triggerCurrentBatchFlush();
+        verify(simulatedHALeaseManager, timeout(1000).times(2)).stillInLeasePeriod();
+        verify(batchPool, times(2)).getNextEmptyBatch();
+    }
+
+    private void testPersistenceWithHALeaseManagerFailingToPreserveLease2(TSOServerConfig tsoConfig) throws Exception {
+
+        // Init a HA lease manager
+        LeaseManager simulatedHALeaseManager = mock(LeaseManager.class);
+
+        PersistenceProcessorHandler[] handlers = configureHandlers (tsoConfig, simulatedHALeaseManager);
+
         BatchPool batchPool = spy(new BatchPool(tsoConfig));
-        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig,
-                                                                     batchPool,
-                                                                     replyProcessor,
-                                                                     panicker,
-                                                                     handlers);
 
-        doReturn(true).when(leaseManager).stillInLeasePeriod();
-        MonitoringContext monCtx = new MonitoringContext(metrics);
-        proc.persistCommit(1, 2, mock(Channel.class), mock(MonitoringContext.class));
-        proc.persistFlush();
-        verify(leaseManager, timeout(1000).times(2)).stillInLeasePeriod();
+        // Component under test
+        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig, batchPool, panicker, handlers);
+
+        // Test: Configure the lease manager to return false for stillInLeasePeriod
+        doReturn(false).when(simulatedHALeaseManager).stillInLeasePeriod();
+        batchPool.notifyEmptyBatch(0); // Unlock this thread to check the panicker
+        proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class));
+        proc.triggerCurrentBatchFlush();
+        verify(simulatedHALeaseManager, timeout(1000).times(1)).stillInLeasePeriod();
         verify(batchPool, times(2)).getNextEmptyBatch();
+    }
 
-        // Test 2: Configure the lease manager to return true first and false later for stillInLeasePeriod
+    private void testPersistenceWithHALeaseManagerFailingToPreserveLease3(TSOServerConfig tsoConfig) throws Exception {
 
-        // Reset stuff
-        reset(leaseManager);
-        doReturn(true).doReturn(false).when(leaseManager).stillInLeasePeriod();
-        proc.persistCommit(1, 2, mock(Channel.class), mock(MonitoringContext.class));
-        proc.persistFlush();
-        verify(leaseManager, timeout(1000).times(2)).stillInLeasePeriod();
-        verify(batchPool, times(3)).getNextEmptyBatch();
+        // Init a HA lease manager
+        LeaseManager simulatedHALeaseManager = mock(LeaseManager.class);
 
-        // Test 3: Configure the lease manager to return false for stillInLeasePeriod
+        PersistenceProcessorHandler[] handlers = configureHandlers (tsoConfig, simulatedHALeaseManager);
 
-        // Reset stuff
-        reset(leaseManager);
-        doReturn(false).when(leaseManager).stillInLeasePeriod();
-        proc.persistCommit(1, 2, mock(Channel.class), mock(MonitoringContext.class));
-        proc.persistFlush();
-        verify(leaseManager, timeout(1000).times(1)).stillInLeasePeriod();
-        verify(batchPool, times(4)).getNextEmptyBatch();
+        BatchPool batchPool = spy(new BatchPool(tsoConfig));
 
-        // Test 4: Configure the lease manager to return true first and false later for stillInLeasePeriod and raise
-        // an exception when flush
+        // Component under test
+        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig, batchPool, panicker, handlers);
 
-        // Reset stuff
-        reset(leaseManager);
-        // Configure mock writer to flush successfully
+        // Test: Configure the lease manager to return true first and false later for stillInLeasePeriod and raise
+        // an exception when flush
+        // Configure mock writer to flush unsuccessfully
         doThrow(new IOException("Unable to write")).when(mockWriter).flush();
-        doReturn(true).doReturn(false).when(leaseManager).stillInLeasePeriod();
-        proc.persistCommit(1, 2, mock(Channel.class), mock(MonitoringContext.class));
-        proc.persistFlush();
-        verify(leaseManager, timeout(1000).times(1)).stillInLeasePeriod();
-        verify(batchPool, times(5)).getNextEmptyBatch();
+        doReturn(true).doReturn(false).when(simulatedHALeaseManager).stillInLeasePeriod();
+        batchPool.notifyEmptyBatch(0); // Unlock this thread to check the panicker
+        proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class));
+        proc.triggerCurrentBatchFlush();
+        verify(simulatedHALeaseManager, timeout(1000).times(1)).stillInLeasePeriod();
+        verify(batchPool, times(2)).getNextEmptyBatch();
+
     }
 
-    @Test
+    private PersistenceProcessorHandler[] configureHandlers(TSOServerConfig tsoConfig, LeaseManager leaseManager)
+            throws Exception {
+        PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[tsoConfig.getNumConcurrentCTWriters()];
+        for (int i = 0; i < tsoConfig.getNumConcurrentCTWriters(); i++) {
+            handlers[i] = new PersistenceProcessorHandler(metrics,
+                                                          "localhost:1234",
+                                                          leaseManager,
+                                                          commitTable,
+                                                          new ReplyProcessorImpl(metrics, panicker),
+                                                          retryProcessor,
+                                                          new RuntimeExceptionPanicker());
+        }
+        return handlers;
+    }
+
+    @Test(timeOut=10_000)
     public void testCommitTableExceptionOnCommitPersistenceTakesDownDaemon() throws Exception {
 
         // Init lease management (doesn't matter if HA or not)
@@ -354,22 +396,20 @@ public class TestPersistenceProcessor {
         TSOServerConfig config = new TSOServerConfig();
         BatchPool batchPool = new BatchPool(config);
 
-        PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[config.getPersistHandlerNum()];
-        for (int i = 0; i < config.getPersistHandlerNum(); i++) {
+        ReplyProcessor replyProcessor = new ReplyProcessorImpl(metrics, panicker);
+
+        PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[config.getNumConcurrentCTWriters()];
+        for (int i = 0; i < config.getNumConcurrentCTWriters(); i++) {
             handlers[i] = new PersistenceProcessorHandler(metrics,
                                                           "localhost:1234",
                                                           leaseManager,
                                                           commitTable,
-                                                          mock(ReplyProcessor.class),
+                                                          replyProcessor,
                                                           mock(RetryProcessor.class),
                                                           panicker);
         }
 
-        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(config,
-                                                                 batchPool,
-                                                                 mock(ReplyProcessor.class),
-                                                                 panicker,
-                                                                 handlers);
+        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(config, batchPool, panicker, handlers);
 
         MonitoringContext monCtx = new MonitoringContext(metrics);
 
@@ -379,20 +419,25 @@ public class TestPersistenceProcessor {
         // Configure commit table writer to explode when flushing changes to DB
         doThrow(new IOException("Unable to write@TestPersistenceProcessor2")).when(mockWriter).flush();
 
+        proc.addLowWatermarkToBatch(ANY_LWM, new MonitoringContext(metrics)); // Add a fake LWM
+
         // Check the panic is extended!
-        proc.persistCommit(1, 2, null, monCtx);
-        proc.persistFlush();
+        proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), monCtx);
+        proc.triggerCurrentBatchFlush();
         verify(panicker, timeout(1000).atLeastOnce()).panic(anyString(), any(Throwable.class));
+
     }
 
-    @Test
+    @Test(timeOut=10_000)
     public void testRuntimeExceptionOnCommitPersistenceTakesDownDaemon() throws Exception {
 
         TSOServerConfig config = new TSOServerConfig();
         BatchPool batchPool = new BatchPool(config);
 
-        PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[config.getPersistHandlerNum()];
-        for (int i = 0; i < config.getPersistHandlerNum(); i++) {
+        ReplyProcessor replyProcessor = new ReplyProcessorImpl(metrics, panicker);
+
+        PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[config.getNumConcurrentCTWriters()];
+        for (int i = 0; i < config.getNumConcurrentCTWriters(); i++) {
             handlers[i] = new PersistenceProcessorHandler(metrics,
                                                           "localhost:1234",
                                                           mock(LeaseManager.class),
@@ -402,19 +447,18 @@ public class TestPersistenceProcessor {
                                                           panicker);
         }
 
-        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(config,
-                                                                 batchPool,
-                                                                 replyProcessor,
-                                                                 panicker,
-                                                                 handlers);
+        PersistenceProcessorImpl proc = new PersistenceProcessorImpl(config, batchPool, panicker, handlers);
 
         // Configure writer to explode with a runtime exception
         doThrow(new RuntimeException("Kaboom!")).when(mockWriter).addCommittedTransaction(anyLong(), anyLong());
         MonitoringContext monCtx = new MonitoringContext(metrics);
 
+        proc.addLowWatermarkToBatch(ANY_LWM, new MonitoringContext(metrics)); // Add a fake LWM
+
+        batchPool.notifyEmptyBatch(0); // Unlock this thread to check the panicker
         // Check the panic is extended!
-        proc.persistCommit(1, 2, null, monCtx);
-        proc.persistFlush();
+        proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), monCtx);
+        proc.triggerCurrentBatchFlush();
         verify(panicker, timeout(1000).atLeastOnce()).panic(anyString(), any(Throwable.class));
 
     }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/1d60f21d/tso-server/src/test/java/org/apache/omid/tso/TestRequestProcessor.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestRequestProcessor.java b/tso-server/src/test/java/org/apache/omid/tso/TestRequestProcessor.java
index 2c612a4..11f1a99 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestRequestProcessor.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestRequestProcessor.java
@@ -84,14 +84,14 @@ public class TestRequestProcessor {
 
         requestProc.timestampRequest(null, new MonitoringContext(metrics));
         ArgumentCaptor<Long> firstTScapture = ArgumentCaptor.forClass(Long.class);
-        verify(persist, timeout(100).times(1)).persistTimestamp(
+        verify(persist, timeout(100).times(1)).addTimestampToBatch(
                 firstTScapture.capture(), any(Channel.class), any(MonitoringContext.class));
 
         long firstTS = firstTScapture.getValue();
         // verify that timestamps increase monotonically
         for (int i = 0; i < 100; i++) {
             requestProc.timestampRequest(null, new MonitoringContext(metrics));
-            verify(persist, timeout(100).times(1)).persistTimestamp(eq(firstTS++), any(Channel.class), any(MonitoringContext.class));
+            verify(persist, timeout(100).times(1)).addTimestampToBatch(eq(firstTS++), any(Channel.class), any(MonitoringContext.class));
         }
 
     }
@@ -101,37 +101,37 @@ public class TestRequestProcessor {
 
         requestProc.timestampRequest(null, new MonitoringContext(metrics));
         ArgumentCaptor<Long> TScapture = ArgumentCaptor.forClass(Long.class);
-        verify(persist, timeout(100).times(1)).persistTimestamp(
+        verify(persist, timeout(100).times(1)).addTimestampToBatch(
                 TScapture.capture(), any(Channel.class), any(MonitoringContext.class));
         long firstTS = TScapture.getValue();
 
         List<Long> writeSet = Lists.newArrayList(1L, 20L, 203L);
         requestProc.commitRequest(firstTS - 1, writeSet, false, null, new MonitoringContext(metrics));
-        verify(persist, timeout(100).times(1)).persistAbort(eq(firstTS - 1), anyBoolean(), any(Channel.class), any(MonitoringContext.class));
+        verify(persist, timeout(100).times(1)).addAbortToBatch(eq(firstTS - 1), anyBoolean(), any(Channel.class), any(MonitoringContext.class));
 
         requestProc.commitRequest(firstTS, writeSet, false, null, new MonitoringContext(metrics));
         ArgumentCaptor<Long> commitTScapture = ArgumentCaptor.forClass(Long.class);
 
-        verify(persist, timeout(100).times(1)).persistCommit(eq(firstTS), commitTScapture.capture(), any(Channel.class), any(MonitoringContext.class));
+        verify(persist, timeout(100).times(1)).addCommitToBatch(eq(firstTS), commitTScapture.capture(), any(Channel.class), any(MonitoringContext.class));
         assertTrue(commitTScapture.getValue() > firstTS, "Commit TS must be greater than start TS");
 
         // test conflict
         requestProc.timestampRequest(null, new MonitoringContext(metrics));
         TScapture = ArgumentCaptor.forClass(Long.class);
-        verify(persist, timeout(100).times(2)).persistTimestamp(
+        verify(persist, timeout(100).times(2)).addTimestampToBatch(
                 TScapture.capture(), any(Channel.class), any(MonitoringContext.class));
         long secondTS = TScapture.getValue();
 
         requestProc.timestampRequest(null, new MonitoringContext(metrics));
         TScapture = ArgumentCaptor.forClass(Long.class);
-        verify(persist, timeout(100).times(3)).persistTimestamp(
+        verify(persist, timeout(100).times(3)).addTimestampToBatch(
                 TScapture.capture(), any(Channel.class), any(MonitoringContext.class));
         long thirdTS = TScapture.getValue();
 
         requestProc.commitRequest(thirdTS, writeSet, false, null, new MonitoringContext(metrics));
-        verify(persist, timeout(100).times(1)).persistCommit(eq(thirdTS), anyLong(), any(Channel.class), any(MonitoringContext.class));
+        verify(persist, timeout(100).times(1)).addCommitToBatch(eq(thirdTS), anyLong(), any(Channel.class), any(MonitoringContext.class));
         requestProc.commitRequest(secondTS, writeSet, false, null, new MonitoringContext(metrics));
-        verify(persist, timeout(100).times(1)).persistAbort(eq(secondTS), anyBoolean(), any(Channel.class), any(MonitoringContext.class));
+        verify(persist, timeout(100).times(1)).addAbortToBatch(eq(secondTS), anyBoolean(), any(Channel.class), any(MonitoringContext.class));
 
     }
 
@@ -143,9 +143,9 @@ public class TestRequestProcessor {
         // Start a transaction...
         requestProc.timestampRequest(null, new MonitoringContext(metrics));
         ArgumentCaptor<Long> capturedTS = ArgumentCaptor.forClass(Long.class);
-        verify(persist, timeout(100).times(1)).persistTimestamp(capturedTS.capture(),
-                                                                any(Channel.class),
-                                                                any(MonitoringContext.class));
+        verify(persist, timeout(100).times(1)).addTimestampToBatch(capturedTS.capture(),
+                                                                   any(Channel.class),
+                                                                   any(MonitoringContext.class));
         long startTS = capturedTS.getValue();
 
         // ... simulate the reset of the RequestProcessor state (e.g. due to
@@ -154,7 +154,7 @@ public class TestRequestProcessor {
 
         // ...check that the transaction is aborted when trying to commit
         requestProc.commitRequest(startTS, writeSet, false, null, new MonitoringContext(metrics));
-        verify(persist, timeout(100).times(1)).persistAbort(eq(startTS), anyBoolean(), any(Channel.class), any(MonitoringContext.class));
+        verify(persist, timeout(100).times(1)).addAbortToBatch(eq(startTS), anyBoolean(), any(Channel.class), any(MonitoringContext.class));
 
     }
 
@@ -175,11 +175,11 @@ public class TestRequestProcessor {
         Thread.currentThread().sleep(3000); // Allow the Request processor to finish the request processing
 
         // Check that first time its called is on init
-        verify(persist, timeout(100).times(1)).persistLowWatermark(eq(0L), any(MonitoringContext.class));
+        verify(persist, timeout(100).times(1)).addLowWatermarkToBatch(eq(0L), any(MonitoringContext.class));
         // Then, check it is called when cache is full and the first element is evicted (should be a 1)
-        verify(persist, timeout(100).times(1)).persistLowWatermark(eq(FIRST_COMMIT_TS_EVICTED), any(MonitoringContext.class));
+        verify(persist, timeout(100).times(1)).addLowWatermarkToBatch(eq(FIRST_COMMIT_TS_EVICTED), any(MonitoringContext.class));
         // Finally it should never be called with the next element
-        verify(persist, timeout(100).never()).persistLowWatermark(eq(NEXT_COMMIT_TS_THAT_SHOULD_BE_EVICTED), any(MonitoringContext.class));
+        verify(persist, timeout(100).never()).addLowWatermarkToBatch(eq(NEXT_COMMIT_TS_THAT_SHOULD_BE_EVICTED), any(MonitoringContext.class));
 
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/1d60f21d/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java b/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java
index c5270c0..afa191e 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java
@@ -66,10 +66,7 @@ public class TestRetryProcessor {
     }
 
     @Test(timeOut = 10_000)
-    public void testBasicFunctionality() throws Exception {
-
-        commitTable.getWriter().addCommittedTransaction(ST_TX_1, CT_TX_1);
-
+    public void testRetriedRequestForANonExistingTxReturnsAbort() throws Exception {
         BatchPool batchPool = new BatchPool(new TSOServerConfig());
 
         // The element to test
@@ -77,22 +74,35 @@ public class TestRetryProcessor {
 
         // Test we'll reply with an abort for a retry request when the start timestamp IS NOT in the commit table
         retryProc.disambiguateRetryRequestHeuristically(NON_EXISTING_ST_TX, channel, new MonitoringContext(metrics));
-        ArgumentCaptor<Long> firstTScapture = ArgumentCaptor.forClass(Long.class);
+        ArgumentCaptor<Long> firstTSCapture = ArgumentCaptor.forClass(Long.class);
 
         verify(replyProc, timeout(100).times(1))
-                .addAbort(any(Batch.class), firstTScapture.capture(), any(Channel.class), any(MonitoringContext.class));
-        long startTS = firstTScapture.getValue();
+                .addAbort(any(Batch.class), firstTSCapture.capture(), any(Channel.class), any(MonitoringContext.class));
+        long startTS = firstTSCapture.getValue();
         assertEquals(startTS, NON_EXISTING_ST_TX, "Captured timestamp should be the same as NON_EXISTING_ST_TX");
+    }
+
+    @Test(timeOut = 10_000)
+    public void testRetriedRequestForAnExistingTxReturnsCommit() throws Exception {
+        BatchPool batchPool = new BatchPool(new TSOServerConfig());
+
+        // The element to test
+        RetryProcessor retryProc = new RetryProcessorImpl(metrics, commitTable, replyProc, panicker, batchPool);
 
         // Test we'll reply with a commit for a retry request when the start timestamp IS in the commit table
+        commitTable.getWriter().addCommittedTransaction(ST_TX_1, CT_TX_1);
         retryProc.disambiguateRetryRequestHeuristically(ST_TX_1, channel, new MonitoringContext(metrics));
-        ArgumentCaptor<Long> secondTScapture = ArgumentCaptor.forClass(Long.class);
+        ArgumentCaptor<Long> firstTSCapture = ArgumentCaptor.forClass(Long.class);
+        ArgumentCaptor<Long> secondTSCapture = ArgumentCaptor.forClass(Long.class);
 
-        verify(replyProc, timeout(100).times(1))
-                .addCommit(any(Batch.class), firstTScapture.capture(), secondTScapture.capture(), any(Channel.class), any(MonitoringContext.class));
+        verify(replyProc, timeout(100).times(1)).addCommit(any(Batch.class),
+                                                           firstTSCapture.capture(),
+                                                           secondTSCapture.capture(),
+                                                           any(Channel.class),
+                                                           any(MonitoringContext.class));
 
-        startTS = firstTScapture.getValue();
-        long commitTS = secondTScapture.getValue();
+        long startTS = firstTSCapture.getValue();
+        long commitTS = secondTSCapture.getValue();
         assertEquals(startTS, ST_TX_1, "Captured timestamp should be the same as ST_TX_1");
         assertEquals(commitTS, CT_TX_1, "Captured timestamp should be the same as CT_TX_1");
     }
@@ -117,9 +127,10 @@ public class TestRetryProcessor {
         // Test we'll reply with an abort for a retry request when the
         // transaction id IS in the commit table BUT invalidated
         retryProc.disambiguateRetryRequestHeuristically(ST_TX_1, channel, new MonitoringContext(metrics));
-        ArgumentCaptor<Long> startTScapture = ArgumentCaptor.forClass(Long.class);
-        verify(replyProc, timeout(100).times(1)).addAbort(any(Batch.class), startTScapture.capture(), any(Channel.class), any(MonitoringContext.class));
-        long startTS = startTScapture.getValue();
+        ArgumentCaptor<Long> startTSCapture = ArgumentCaptor.forClass(Long.class);
+        verify(replyProc, timeout(100).times(1))
+                .addAbort(any(Batch.class), startTSCapture.capture(), any(Channel.class), any(MonitoringContext.class));
+        long startTS = startTSCapture.getValue();
         Assert.assertEquals(startTS, ST_TX_1, "Captured timestamp should be the same as NON_EXISTING_ST_TX");
 
     }



[35/50] [abbrv] incubator-omid git commit: Use Apache pool instead of ad-hoc pool for batch. Add new batch tests.

Posted by fp...@apache.org.
Use Apache pool instead of ad-hoc pool for batch. Add new batch tests.

Change-Id: I71e4c8167fcbcf7fe74145323ddc20b01bc21512


Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/472c8283
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/472c8283
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/472c8283

Branch: refs/heads/master
Commit: 472c828311e5c332a33ae57cd7ca1bce630089d4
Parents: aa2651a
Author: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Authored: Thu May 5 10:58:08 2016 -0700
Committer: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Committed: Thu May 5 10:58:08 2016 -0700

----------------------------------------------------------------------
 .../apache/omid/transaction/TestTSOModule.java  |   4 +-
 .../TSOForHBaseCompactorTestModule.java         |   2 +
 pom.xml                                         |   1 +
 tso-server/pom.xml                              |   5 +
 .../main/java/org/apache/omid/tso/Batch.java    |  47 +++--
 .../java/org/apache/omid/tso/BatchPool.java     |  79 ---------
 .../org/apache/omid/tso/BatchPoolModule.java    |  60 +++++++
 .../org/apache/omid/tso/LeaseManagement.java    |  11 +-
 .../apache/omid/tso/PersistenceProcessor.java   |   9 +-
 .../omid/tso/PersistenceProcessorHandler.java   |   2 +-
 .../omid/tso/PersistenceProcessorImpl.java      |  21 ++-
 .../org/apache/omid/tso/ReplyProcessorImpl.java |  18 +-
 .../apache/omid/tso/RequestProcessorImpl.java   |   6 +-
 .../org/apache/omid/tso/RetryProcessorImpl.java |  11 +-
 .../java/org/apache/omid/tso/TSOModule.java     |   3 +-
 .../org/apache/omid/tso/TSOStateManager.java    |   4 +-
 .../apache/omid/tso/TSOStateManagerImpl.java    |   5 +-
 .../org/apache/omid/tso/VoidLeaseManager.java   |   4 +-
 .../java/org/apache/omid/tso/TSOMockModule.java |   3 +-
 .../java/org/apache/omid/tso/TestBatch.java     | 170 +++++++++++--------
 .../java/org/apache/omid/tso/TestPanicker.java  |   5 +-
 .../omid/tso/TestPersistenceProcessor.java      | 106 ++++++------
 .../org/apache/omid/tso/TestRetryProcessor.java |   7 +-
 tso-server/src/test/resources/test-omid.yml     |   1 +
 24 files changed, 309 insertions(+), 275 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/472c8283/hbase-client/src/test/java/org/apache/omid/transaction/TestTSOModule.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/test/java/org/apache/omid/transaction/TestTSOModule.java b/hbase-client/src/test/java/org/apache/omid/transaction/TestTSOModule.java
index 79b84de..623d255 100644
--- a/hbase-client/src/test/java/org/apache/omid/transaction/TestTSOModule.java
+++ b/hbase-client/src/test/java/org/apache/omid/transaction/TestTSOModule.java
@@ -27,7 +27,7 @@ import org.apache.omid.metrics.MetricsRegistry;
 import org.apache.omid.metrics.NullMetricsProvider;
 import org.apache.omid.timestamp.storage.HBaseTimestampStorage;
 import org.apache.omid.timestamp.storage.TimestampStorage;
-import org.apache.omid.tso.BatchPool;
+import org.apache.omid.tso.BatchPoolModule;
 import org.apache.omid.tso.DisruptorModule;
 import org.apache.omid.tso.RuntimeExceptionPanicker;
 import org.apache.omid.tso.NetworkInterfaceUtils;
@@ -73,7 +73,7 @@ class TestTSOModule extends AbstractModule {
         bind(TimestampOracle.class).to(PausableTimestampOracle.class).in(Singleton.class);
         bind(Panicker.class).to(RuntimeExceptionPanicker.class).in(Singleton.class);
 
-        bind(BatchPool.class).in(Singleton.class);
+        install(new BatchPoolModule(config));
 
         // Disruptor setup
         install(new DisruptorModule());

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/472c8283/hbase-coprocessor/src/test/java/org/apache/omid/transaction/TSOForHBaseCompactorTestModule.java
----------------------------------------------------------------------
diff --git a/hbase-coprocessor/src/test/java/org/apache/omid/transaction/TSOForHBaseCompactorTestModule.java b/hbase-coprocessor/src/test/java/org/apache/omid/transaction/TSOForHBaseCompactorTestModule.java
index 7c7e643..b46ee73 100644
--- a/hbase-coprocessor/src/test/java/org/apache/omid/transaction/TSOForHBaseCompactorTestModule.java
+++ b/hbase-coprocessor/src/test/java/org/apache/omid/transaction/TSOForHBaseCompactorTestModule.java
@@ -26,6 +26,7 @@ import org.apache.omid.metrics.MetricsRegistry;
 import org.apache.omid.metrics.NullMetricsProvider;
 import org.apache.omid.timestamp.storage.HBaseTimestampStorage;
 import org.apache.omid.timestamp.storage.TimestampStorage;
+import org.apache.omid.tso.BatchPoolModule;
 import org.apache.omid.tso.DisruptorModule;
 import org.apache.omid.tso.LeaseManagement;
 import org.apache.omid.tso.MockPanicker;
@@ -76,6 +77,7 @@ class TSOForHBaseCompactorTestModule extends AbstractModule {
         bind(TimestampStorage.class).to(HBaseTimestampStorage.class).in(Singleton.class);
         bind(TimestampOracle.class).to(TimestampOracleImpl.class).in(Singleton.class);
 
+        install(new BatchPoolModule(config));
         // DisruptorConfig
         install(new DisruptorModule());
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/472c8283/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 84881d5..69c49b3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -154,6 +154,7 @@
         <beanutils.version>1.8.3</beanutils.version>
         <commons-io.version>2.4</commons-io.version>
         <google.findbugs.version>3.0.1</google.findbugs.version>
+        <commons-pool2.version>2.4.2</commons-pool2.version>
 
         <!-- Maven Plugin Versioning -->
         <maven-antrun-plugin.version>1.7</maven-antrun-plugin.version>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/472c8283/tso-server/pom.xml
----------------------------------------------------------------------
diff --git a/tso-server/pom.xml b/tso-server/pom.xml
index 3a520d8..528e3c4 100644
--- a/tso-server/pom.xml
+++ b/tso-server/pom.xml
@@ -125,6 +125,11 @@
             <artifactId>jsr305</artifactId>
             <version>${google.findbugs.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-pool2</artifactId>
+            <version>${commons-pool2.version}</version>
+        </dependency>
 
         <!-- end utils -->
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/472c8283/tso-server/src/main/java/org/apache/omid/tso/Batch.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/Batch.java b/tso-server/src/main/java/org/apache/omid/tso/Batch.java
index b3b9eef..a36d2a7 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/Batch.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/Batch.java
@@ -19,7 +19,9 @@ package org.apache.omid.tso;
 
 import com.google.common.base.Objects;
 import com.google.common.base.Preconditions;
-import org.apache.omid.tso.PersistEvent.Type;
+import org.apache.commons.pool2.BasePooledObjectFactory;
+import org.apache.commons.pool2.PooledObject;
+import org.apache.commons.pool2.impl.DefaultPooledObject;
 import org.jboss.netty.channel.Channel;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -34,13 +36,11 @@ public class Batch {
     private final int size;
     private int numEvents;
     private final PersistEvent[] events;
-    private final BatchPool batchPool;
 
-    Batch(int size, int id, BatchPool batchPool) {
+    Batch(int id, int size) {
 
         Preconditions.checkArgument(size > 0, "Size must be positive");
         this.size = size;
-        this.batchPool = batchPool;
         this.id = id;
         this.numEvents = 0;
         this.events = new PersistEvent[size];
@@ -75,27 +75,19 @@ public class Batch {
         return numEvents;
     }
 
-    PersistEvent getEvent(int i) {
-
-        assert (0 <= i && i < numEvents);
-        return events[i];
-
-    }
-
     void clear() {
 
         numEvents = 0;
-        if (batchPool != null) {
-            batchPool.notifyEmptyBatch(id);
-        }
 
     }
 
     PersistEvent get(int idx) {
+        Preconditions.checkState(numEvents > 0  && 0 <= idx && idx < numEvents);
         return events[idx];
     }
 
     void set(int idx, PersistEvent event) {
+        Preconditions.checkState(0 <= idx && idx < numEvents);
         events[idx] = event;
     }
 
@@ -145,4 +137,31 @@ public class Batch {
                 .toString();
     }
 
+    public static class BatchFactory extends BasePooledObjectFactory<Batch> {
+
+        private static int batchId = 0;
+
+        private int batchSize;
+
+        BatchFactory(int batchSize) {
+            this.batchSize = batchSize;
+        }
+
+        @Override
+        public Batch create() throws Exception {
+            return new Batch(batchId++, batchSize);
+        }
+
+        @Override
+        public PooledObject<Batch> wrap(Batch batch) {
+            return new DefaultPooledObject<>(batch);
+        }
+
+        @Override
+        public void passivateObject(PooledObject<Batch> pooledObject) {
+            pooledObject.getObject().clear(); // Reset num events when returning the batch to the pool
+        }
+
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/472c8283/tso-server/src/main/java/org/apache/omid/tso/BatchPool.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/BatchPool.java b/tso-server/src/main/java/org/apache/omid/tso/BatchPool.java
deleted file mode 100644
index a5d7759..0000000
--- a/tso-server/src/main/java/org/apache/omid/tso/BatchPool.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.omid.tso;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.inject.Inject;
-import java.util.Stack;
-
-public class BatchPool {
-
-    private static final Logger LOG = LoggerFactory.getLogger(BatchPool.class);
-
-    private final Batch[] batches;
-    private final int poolSize;
-    private final Stack<Integer> availableBatches;
-
-    @Inject
-    public BatchPool(TSOServerConfig config) {
-
-        poolSize = config.getNumConcurrentCTWriters();
-        int batchSize = config.getBatchSizePerCTWriter() + 1; // Add 1 element to batch size for storing LWM
-
-        LOG.info("Pool Size (Batches) {}; Batch Size {} (including LWM bucket)", poolSize, batchSize);
-        LOG.info("Total Batch Size (Pool size * Batch Size): {}", poolSize * batchSize);
-        batches = new Batch[poolSize];
-
-        LOG.info("Creating {} Batches with {} elements each", poolSize, batchSize);
-        for (int i = 0; i < poolSize; i++) {
-            batches[i] = new Batch(batchSize, i, this);
-        }
-
-        availableBatches = new Stack<>();
-
-        for (int i = (poolSize - 1); i >= 0; i--) {
-            availableBatches.push(i);
-        }
-
-    }
-
-    Batch getNextEmptyBatch() throws InterruptedException {
-
-        synchronized (availableBatches) { // TODO Synchronized can be put at the method level
-            while (availableBatches.isEmpty()) {
-                availableBatches.wait();
-            }
-
-            Integer batchIdx = availableBatches.pop();
-            return batches[batchIdx];
-        }
-
-    }
-
-    void notifyEmptyBatch(int batchIdx) {
-
-        synchronized (availableBatches) { // TODO Synchronized can be put at the method level
-            availableBatches.push(batchIdx);
-            availableBatches.notify();
-        }
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/472c8283/tso-server/src/main/java/org/apache/omid/tso/BatchPoolModule.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/BatchPoolModule.java b/tso-server/src/main/java/org/apache/omid/tso/BatchPoolModule.java
new file mode 100644
index 0000000..8820f36
--- /dev/null
+++ b/tso-server/src/main/java/org/apache/omid/tso/BatchPoolModule.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.omid.tso;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.Provides;
+import org.apache.commons.pool2.ObjectPool;
+import org.apache.commons.pool2.impl.GenericObjectPool;
+import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.inject.Singleton;
+
+public class BatchPoolModule extends AbstractModule {
+
+    private static final Logger LOG = LoggerFactory.getLogger(BatchPoolModule.class);
+
+    private final TSOServerConfig config;
+
+    public BatchPoolModule(TSOServerConfig config) {
+        this.config = config;
+    }
+
+    @Override
+    protected void configure() {
+    }
+
+    @Provides
+    @Singleton
+    ObjectPool<Batch> getBatchPool() {
+        int poolSize = config.getNumConcurrentCTWriters();
+        int batchSize = config.getBatchSizePerCTWriter() + 1; // Add 1 element to batch size for storing LWM
+
+        LOG.info("Pool Size (Batches) {}; Batch Size {} (including LWM bucket)", poolSize, batchSize);
+        LOG.info("Total Batch Size (Pool size * Batch Size): {}", poolSize * batchSize);
+        GenericObjectPoolConfig config = new GenericObjectPoolConfig();
+        config.setMaxTotal(poolSize);
+        config.setMinIdle(poolSize);
+        config.setMaxIdle(poolSize);
+        config.setBlockWhenExhausted(true);
+        return new GenericObjectPool<>(new Batch.BatchFactory(batchSize), config);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/472c8283/tso-server/src/main/java/org/apache/omid/tso/LeaseManagement.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/LeaseManagement.java b/tso-server/src/main/java/org/apache/omid/tso/LeaseManagement.java
index 81d0e0a..f810309 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/LeaseManagement.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/LeaseManagement.java
@@ -35,18 +35,17 @@ public interface LeaseManagement {
     }
 
     /**
-     * Allows to start the service implementing the lease management
-     * @throws InterruptedException
+     * Allows to start the service implementing the lease management.
      */
-    void startService() throws LeaseManagementException, InterruptedException;
+    void startService() throws Exception;
 
     /**
-     * Allows to stop the service implementing the lease management
+     * Allows to stop the service implementing the lease management.
      */
-    void stopService() throws LeaseManagementException;
+    void stopService() throws Exception;
 
     /**
-     * Check if the instance is still is under the lease period
+     * Check if the instance is still is under the lease period.
      */
     boolean stillInLeasePeriod();
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/472c8283/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessor.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessor.java b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessor.java
index aa0e7df..9467c13 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessor.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessor.java
@@ -22,15 +22,14 @@ import org.jboss.netty.channel.Channel;
 interface PersistenceProcessor {
 
     void addCommitToBatch(long startTimestamp, long commitTimestamp, Channel c, MonitoringContext monCtx)
-            throws InterruptedException;
+            throws Exception;
 
-    void addAbortToBatch(long startTimestamp, boolean isRetry, Channel c, MonitoringContext monCtx)
-            throws InterruptedException;
+    void addAbortToBatch(long startTimestamp, boolean isRetry, Channel c, MonitoringContext monCtx) throws Exception;
 
-    void addTimestampToBatch(long startTimestamp, Channel c, MonitoringContext monCtx) throws InterruptedException;
+    void addTimestampToBatch(long startTimestamp, Channel c, MonitoringContext monCtx) throws Exception;
 
     void addLowWatermarkToBatch(long lowWatermark, MonitoringContext monCtx);
 
-    void triggerCurrentBatchFlush() throws InterruptedException;
+    void triggerCurrentBatchFlush() throws Exception;
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/472c8283/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java
index 099cf88..7e84539 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorHandler.java
@@ -73,7 +73,7 @@ public class PersistenceProcessorHandler implements WorkHandler<PersistenceProce
 
         Batch batch = event.getBatch();
         for (int i=0; i < batch.getNumEvents(); ++i) {
-            PersistEvent localEvent = batch.getEvent(i);
+            PersistEvent localEvent = batch.get(i);
 
             switch (localEvent.getType()) {
             case COMMIT:

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/472c8283/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java
index 4d1eb4c..b78ad1a 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java
@@ -24,13 +24,12 @@ import com.lmax.disruptor.BusySpinWaitStrategy;
 import com.lmax.disruptor.EventFactory;
 import com.lmax.disruptor.RingBuffer;
 import com.lmax.disruptor.WorkerPool;
+import org.apache.commons.pool2.ObjectPool;
 import org.jboss.netty.channel.Channel;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import javax.inject.Inject;
-import java.io.IOException;
-import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
@@ -45,7 +44,7 @@ class PersistenceProcessorImpl implements PersistenceProcessor {
 
     private final RingBuffer<PersistBatchEvent> persistRing;
 
-    private final BatchPool batchPool;
+    private final ObjectPool<Batch> batchPool;
     @VisibleForTesting
     Batch currentBatch;
 
@@ -57,14 +56,14 @@ class PersistenceProcessorImpl implements PersistenceProcessor {
 
     @Inject
     PersistenceProcessorImpl(TSOServerConfig config,
-                             BatchPool batchPool,
+                             ObjectPool<Batch> batchPool,
                              Panicker panicker,
                              PersistenceProcessorHandler[] handlers)
-            throws InterruptedException, ExecutionException, IOException {
+            throws Exception {
 
         this.batchSequence = 0L;
         this.batchPool = batchPool;
-        this.currentBatch = batchPool.getNextEmptyBatch();
+        this.currentBatch = batchPool.borrowObject();
 
         // Disruptor configuration
         this.persistRing = RingBuffer.createSingleProducer(EVENT_FACTORY, 1 << 20, new BusySpinWaitStrategy());
@@ -83,7 +82,7 @@ class PersistenceProcessorImpl implements PersistenceProcessor {
     }
 
     @Override
-    public void triggerCurrentBatchFlush() throws InterruptedException {
+    public void triggerCurrentBatchFlush() throws Exception {
 
         if (currentBatch.isEmpty()) {
             return;
@@ -93,13 +92,13 @@ class PersistenceProcessorImpl implements PersistenceProcessor {
         PersistBatchEvent e = persistRing.get(seq);
         makePersistBatch(e, batchSequence++, currentBatch);
         persistRing.publish(seq);
-        currentBatch = batchPool.getNextEmptyBatch();
+        currentBatch = batchPool.borrowObject();
 
     }
 
     @Override
     public void addCommitToBatch(long startTimestamp, long commitTimestamp, Channel c, MonitoringContext monCtx)
-            throws InterruptedException {
+            throws Exception {
 
         currentBatch.addCommit(startTimestamp, commitTimestamp, c, monCtx);
         if (currentBatch.isLastEntryEmpty()) {
@@ -110,7 +109,7 @@ class PersistenceProcessorImpl implements PersistenceProcessor {
 
     @Override
     public void addAbortToBatch(long startTimestamp, boolean isRetry, Channel c, MonitoringContext context)
-            throws InterruptedException {
+            throws Exception {
 
         currentBatch.addAbort(startTimestamp, isRetry, c, context);
         if (currentBatch.isLastEntryEmpty()) {
@@ -121,7 +120,7 @@ class PersistenceProcessorImpl implements PersistenceProcessor {
 
     @Override
     public void addTimestampToBatch(long startTimestamp, Channel c, MonitoringContext context)
-            throws InterruptedException {
+            throws Exception {
 
         currentBatch.addTimestamp(startTimestamp, c, context);
         if (currentBatch.isLastEntryEmpty()) {

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/472c8283/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java b/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java
index 0f5fcb4..a37f90f 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java
@@ -25,10 +25,10 @@ import com.lmax.disruptor.EventFactory;
 import com.lmax.disruptor.EventHandler;
 import com.lmax.disruptor.RingBuffer;
 import com.lmax.disruptor.SequenceBarrier;
+import org.apache.commons.pool2.ObjectPool;
 import org.apache.omid.metrics.Meter;
 import org.apache.omid.metrics.MetricsRegistry;
 import org.apache.omid.proto.TSOProto;
-
 import org.jboss.netty.channel.Channel;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -48,6 +48,8 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyBatchEv
 
     private static final int NO_ORDER = (-1);
 
+    private final ObjectPool<Batch> batchPool;
+
     private final RingBuffer<ReplyBatchEvent> replyRing;
 
     private AtomicLong nextIDToHandle = new AtomicLong();
@@ -60,7 +62,9 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyBatchEv
     private final Meter timestampMeter;
 
     @Inject
-    ReplyProcessorImpl(MetricsRegistry metrics, Panicker panicker) {
+    ReplyProcessorImpl(MetricsRegistry metrics, Panicker panicker, ObjectPool<Batch> batchPool) {
+
+        this.batchPool = batchPool;
 
         this.nextIDToHandle.set(0);
 
@@ -88,12 +92,12 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyBatchEv
 
     }
 
-    private void handleReplyBatchEvent(ReplyBatchEvent event) {
+    private void handleReplyBatchEvent(ReplyBatchEvent event) throws Exception {
 
         String name;
         Batch batch = event.getBatch();
         for (int i=0; batch != null && i < batch.getNumEvents(); ++i) {
-            PersistEvent localEvent = batch.getEvent(i);
+            PersistEvent localEvent = batch.get(i);
 
             switch (localEvent.getType()) {
             case COMMIT:
@@ -124,12 +128,12 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyBatchEv
         }
 
         if (batch != null) {
-            batch.clear();
+            batchPool.returnObject(batch);
         }
 
     }
 
-    private void processWaitingEvents() {
+    private void processWaitingEvents() throws Exception {
 
         while (!futureEvents.isEmpty() && futureEvents.peek().getBatchID() == nextIDToHandle.get()) {
             ReplyBatchEvent e = futureEvents.poll();
@@ -149,7 +153,7 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyBatchEv
         if (event.getBatchID() > nextIDToHandle.get()) {
             futureEvents.add(event);
             return;
-         }
+        }
 
         handleReplyBatchEvent(event);
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/472c8283/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java b/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java
index ba0cb74..9340977 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/RequestProcessorImpl.java
@@ -88,7 +88,7 @@ class RequestProcessorImpl implements EventHandler<RequestProcessorImpl.RequestE
      * This should be called when the TSO gets leadership
      */
     @Override
-    public void update(TSOState state) throws InterruptedException {
+    public void update(TSOState state) throws Exception {
         LOG.info("Initializing RequestProcessor...");
         this.lowWatermark = state.getLowWatermark();
         persistProc.addLowWatermarkToBatch(lowWatermark, new MonitoringContext(metrics));
@@ -150,7 +150,7 @@ class RequestProcessorImpl implements EventHandler<RequestProcessorImpl.RequestE
 
     }
 
-    private void handleTimestamp(RequestEvent requestEvent) throws InterruptedException {
+    private void handleTimestamp(RequestEvent requestEvent) throws Exception {
 
         long timestamp;
 
@@ -165,7 +165,7 @@ class RequestProcessorImpl implements EventHandler<RequestProcessorImpl.RequestE
 
     }
 
-    private long handleCommit(RequestEvent event) throws InterruptedException {
+    private long handleCommit(RequestEvent event) throws Exception {
 
         long startTimestamp = event.getStartTimestamp();
         Iterable<Long> writeSet = event.writeSet();

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/472c8283/tso-server/src/main/java/org/apache/omid/tso/RetryProcessorImpl.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/RetryProcessorImpl.java b/tso-server/src/main/java/org/apache/omid/tso/RetryProcessorImpl.java
index ccf60c7..7b67674 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/RetryProcessorImpl.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/RetryProcessorImpl.java
@@ -26,6 +26,7 @@ import com.lmax.disruptor.RingBuffer;
 import com.lmax.disruptor.SequenceBarrier;
 import com.lmax.disruptor.WaitStrategy;
 import com.lmax.disruptor.YieldingWaitStrategy;
+import org.apache.commons.pool2.ObjectPool;
 import org.apache.omid.committable.CommitTable;
 import org.apache.omid.committable.CommitTable.CommitTimestamp;
 import org.apache.omid.metrics.Meter;
@@ -59,7 +60,7 @@ class RetryProcessorImpl implements EventHandler<RetryProcessorImpl.RetryEvent>,
 
     final CommitTable.Client commitTableClient;
     final CommitTable.Writer writer; // TODO This is not used. Remove
-    final BatchPool batchPool;
+    final ObjectPool<Batch> batchPool;
 
     // Metrics
     final Meter retriesMeter;
@@ -69,7 +70,7 @@ class RetryProcessorImpl implements EventHandler<RetryProcessorImpl.RetryEvent>,
                        CommitTable commitTable,
                        ReplyProcessor replyProc,
                        Panicker panicker,
-                       BatchPool batchPool)
+                       ObjectPool<Batch> batchPool)
             throws InterruptedException, ExecutionException, IOException {
 
         this.commitTableClient = commitTable.getClient();
@@ -108,11 +109,13 @@ class RetryProcessorImpl implements EventHandler<RetryProcessorImpl.RetryEvent>,
 
     }
 
-    private void handleCommitRetry(RetryEvent event) throws InterruptedException, ExecutionException {
+    // TODO Reply to the client directly here instead of adding new workload to the reply processor. This avoids a lot
+    // of complexity
+    private void handleCommitRetry(RetryEvent event) throws Exception {
         long startTimestamp = event.getStartTimestamp();
         try {
             Optional<CommitTimestamp> commitTimestamp = commitTableClient.getCommitTimestamp(startTimestamp).get();
-            Batch batch = batchPool.getNextEmptyBatch();
+            Batch batch = batchPool.borrowObject();
             if(commitTimestamp.isPresent()) {
                 if (commitTimestamp.get().isValid()) {
                     LOG.trace("Valid commit TS found in Commit Table");

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/472c8283/tso-server/src/main/java/org/apache/omid/tso/TSOModule.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/TSOModule.java b/tso-server/src/main/java/org/apache/omid/tso/TSOModule.java
index bfa88ef..4b0d61e 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/TSOModule.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/TSOModule.java
@@ -24,7 +24,6 @@ import com.google.inject.Provides;
 
 import javax.inject.Named;
 import javax.inject.Singleton;
-
 import java.net.SocketException;
 import java.net.UnknownHostException;
 
@@ -46,8 +45,8 @@ class TSOModule extends AbstractModule {
         bind(TSOStateManager.class).to(TSOStateManagerImpl.class).in(Singleton.class);
         bind(TimestampOracle.class).to(TimestampOracleImpl.class).in(Singleton.class);
         bind(Panicker.class).to(RuntimeExceptionPanicker.class).in(Singleton.class);
-        bind(BatchPool.class).in(Singleton.class);
 
+        install(new BatchPoolModule(config));
         // Disruptor setup
         install(new DisruptorModule());
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/472c8283/tso-server/src/main/java/org/apache/omid/tso/TSOStateManager.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/TSOStateManager.java b/tso-server/src/main/java/org/apache/omid/tso/TSOStateManager.java
index 6836554..59d25cd 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/TSOStateManager.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/TSOStateManager.java
@@ -64,7 +64,7 @@ public interface TSOStateManager {
          *            the new TSOState
          * @throws InterruptedException
          */
-        void update(TSOState state) throws IOException, InterruptedException;
+        void update(TSOState state) throws Exception;
 
     }
 
@@ -92,6 +92,6 @@ public interface TSOStateManager {
      *             when problems resetting occur
      * @throws InterruptedException
      */
-    TSOState initialize() throws IOException, InterruptedException;
+    TSOState initialize() throws Exception;
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/472c8283/tso-server/src/main/java/org/apache/omid/tso/TSOStateManagerImpl.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/TSOStateManagerImpl.java b/tso-server/src/main/java/org/apache/omid/tso/TSOStateManagerImpl.java
index 5d32fc3..31be592 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/TSOStateManagerImpl.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/TSOStateManagerImpl.java
@@ -18,13 +18,10 @@
 package org.apache.omid.tso;
 
 import com.google.common.base.Preconditions;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import javax.inject.Inject;
-
-import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -60,7 +57,7 @@ public class TSOStateManagerImpl implements TSOStateManager {
     }
 
     @Override
-    public TSOState initialize() throws IOException, InterruptedException {
+    public TSOState initialize() throws Exception {
 
         LOG.info("Initializing TSO Server state...");
         // The timestamp oracle dictates the new state

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/472c8283/tso-server/src/main/java/org/apache/omid/tso/VoidLeaseManager.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/VoidLeaseManager.java b/tso-server/src/main/java/org/apache/omid/tso/VoidLeaseManager.java
index b53f147..0f2b522 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/VoidLeaseManager.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/VoidLeaseManager.java
@@ -30,7 +30,7 @@ public class VoidLeaseManager implements LeaseManagement {
     }
 
     @Override
-    public void startService() throws LeaseManagementException, InterruptedException {
+    public void startService() throws Exception {
         try {
             stateManager.initialize();
             tsoChannelHandler.reconnect();
@@ -40,7 +40,7 @@ public class VoidLeaseManager implements LeaseManagement {
     }
 
     @Override
-    public void stopService() throws LeaseManagementException {
+    public void stopService() throws Exception {
         tsoChannelHandler.closeConnection();
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/472c8283/tso-server/src/test/java/org/apache/omid/tso/TSOMockModule.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TSOMockModule.java b/tso-server/src/test/java/org/apache/omid/tso/TSOMockModule.java
index 92582f6..ec4b1ea 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TSOMockModule.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TSOMockModule.java
@@ -30,7 +30,6 @@ import org.apache.omid.tso.TimestampOracleImpl.InMemoryTimestampStorage;
 
 import javax.inject.Named;
 import javax.inject.Singleton;
-
 import java.net.SocketException;
 import java.net.UnknownHostException;
 
@@ -54,8 +53,8 @@ public class TSOMockModule extends AbstractModule {
         bind(TimestampStorage.class).to(InMemoryTimestampStorage.class).in(Singleton.class);
         bind(TimestampOracle.class).to(PausableTimestampOracle.class).in(Singleton.class);
         bind(Panicker.class).to(MockPanicker.class).in(Singleton.class);
-        bind(BatchPool.class).in(Singleton.class);
 
+        install(new BatchPoolModule(config));
         install(config.getLeaseModule());
         install(new DisruptorModule());
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/472c8283/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java b/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
index 2b8b318..45fa639 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
@@ -17,19 +17,13 @@
  */
 package org.apache.omid.tso;
 
-import org.apache.omid.metrics.MetricsRegistry;
-import org.apache.omid.metrics.NullMetricsProvider;
+import org.apache.commons.pool2.PooledObject;
 import org.jboss.netty.channel.Channel;
 import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import static org.mockito.Mockito.timeout;
-import static org.mockito.Mockito.verify;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertTrue;
@@ -40,104 +34,130 @@ public class TestBatch {
     private static final Logger LOG = LoggerFactory.getLogger(TestBatch.class);
 
     private static final int BATCH_SIZE = 1000;
-    private MetricsRegistry metrics = new NullMetricsProvider();
+
+    private static final long ANY_ST = 1231;
+    private static final long ANY_CT = 2241;
+
+    private static final int DUMMY_LWM = 212;
+    private static final int NEW_LWM = 123;
 
     @Mock
     private Channel channel;
     @Mock
-    private RetryProcessor retryProcessor;
-    @Mock
-    private ReplyProcessor replyProcessor;
-
-    // The batch element to test
-    private Batch batch;
+    private MonitoringContext monCtx;
 
-    @BeforeMethod(alwaysRun = true, timeOut = 30_000)
-    public void initMocksAndComponents() {
-        MockitoAnnotations.initMocks(this);
-        batch = new Batch(BATCH_SIZE, 0, null);
-    }
-
-    // TODO. Refactor the batch and test it properly. See commented asserts below
-    @Test
+    @Test(timeOut = 10_000)
     public void testBatchFunctionality() {
 
+        // Component to test
+        Batch batch = new Batch(0, BATCH_SIZE);
+
         // Test initial state is OK
+        assertTrue(batch.isEmpty(), "Batch should be empty");
         assertFalse(batch.isFull(), "Batch shouldn't be full");
         assertEquals(batch.getNumEvents(), 0, "Num events should be 0");
 
-        // Test adding a single commit event is OK
-        MonitoringContext monCtx = new MonitoringContext(metrics);
-        monCtx.timerStart("commitPersistProcessor");
-        batch.addCommit(0, 1, channel, monCtx);
-        assertFalse(batch.isFull(), "Batch shouldn't be full");
-        assertEquals(batch.getNumEvents(), 1, "Num events should be 1");
+        // Test getting or setting an element in the batch greater than the current number of events is illegal
+        try {
+            batch.get(1);
+            fail();
+        } catch (IllegalStateException ex) {
+            // Expected, as we can not access elements in the batch greater than the current number of events
+        }
+        try {
+            batch.set(1, new PersistEvent());
+            fail();
+        } catch (IllegalStateException ex) {
+            // Expected, as we can not access elements in the batch greater than the current number of events
+        }
 
-        // Test when filling the batch with events, batch is full
+        // Test when filling the batch with different types of events, that becomes full
         for (int i = 0; i < (BATCH_SIZE - 1); i++) {
-            if (i % 2 == 0) {
-                monCtx = new MonitoringContext(metrics);
-                monCtx.timerStart("timestampPersistProcessor");
-                batch.addTimestamp(i, channel, monCtx);
+            if (i % 3 == 0) {
+                batch.addTimestamp(ANY_ST, channel, monCtx);
+            } else if (i % 3 == 1) {
+                batch.addCommit(ANY_ST, ANY_CT, channel, monCtx);
             } else {
-                monCtx = new MonitoringContext(metrics);
-                monCtx.timerStart("commitPersistProcessor");
-                batch.addCommit(i, i + 1, channel, monCtx);
+                batch.addAbort(ANY_ST, false, channel, monCtx);
             }
         }
+        assertTrue(batch.isLastEntryEmpty(), "Should be only one entry left in the batch");
+        batch.addLowWatermark(DUMMY_LWM, monCtx); // Add DUMMY_LWM as last element
+        assertFalse(batch.isEmpty(), "Batch should contain elements");
         assertTrue(batch.isFull(), "Batch should be full");
         assertEquals(batch.getNumEvents(), BATCH_SIZE, "Num events should be " + BATCH_SIZE);
 
         // Test an exception is thrown when batch is full and a new element is going to be added
         try {
-            monCtx = new MonitoringContext(metrics);
-            monCtx.timerStart("commitPersistProcessor");
-            batch.addCommit(0, 1, channel, new MonitoringContext(metrics));
+            batch.addCommit(ANY_ST, ANY_CT, channel, monCtx);
             fail("Should throw an IllegalStateException");
         } catch (IllegalStateException e) {
             assertEquals(e.getMessage(), "batch is full", "message returned doesn't match");
             LOG.debug("IllegalStateException catched properly");
         }
+        assertTrue(batch.isFull(), "Batch shouldn't be empty");
+
+        // Check the first 3 events and the last one correspond to the filling done above
+        assertTrue(batch.get(0).getType().equals(PersistEvent.Type.TIMESTAMP));
+        assertTrue(batch.get(1).getType().equals(PersistEvent.Type.COMMIT));
+        assertTrue(batch.get(2).getType().equals(PersistEvent.Type.ABORT));
+        assertTrue(batch.get(BATCH_SIZE - 1).getType().equals(PersistEvent.Type.LOW_WATERMARK));
 
-        // Test that sending replies empties the batch
-// TODO. Fix these asserts in new code
-//<<<<<<< HEAD
-//        batch.sendRepliesAndReset(replyProcessor, retryProcessor);
-//        verify(replyProcessor, timeout(100).times(BATCH_SIZE / 2))
-//                .timestampResponse(anyLong(), any(Channel.class), any(MonitoringContext.class));
-//        verify(replyProcessor, timeout(100).times(BATCH_SIZE / 2))
-//                .commitResponse(anyLong(), anyLong(), any(Channel.class), any(MonitoringContext.class));
-//        assertFalse(batch.isFull(), "Batch shouldn't be full");
-//        assertEquals(batch.getNumEvents(), 0, "Num events should be 0");
-//=======
-//        batch.sendReply(replyProcessor, retryProcessor, (-1));
-        //verify(replyProcessor, timeout(100).times(1)).manageResponsesBatch((-1), batch);
+        // Set a new value for last element in Batch and check we obtain the right result
+        batch.decreaseNumEvents();
+        assertEquals(batch.getNumEvents(), BATCH_SIZE - 1, "Num events should be " + (BATCH_SIZE - 1));
+        assertTrue(batch.isLastEntryEmpty(), "Should be only one entry left in the batch");
+        try {
+            batch.get(BATCH_SIZE - 1);
+            fail();
+        } catch (IllegalStateException ex) {
+            // Expected, as we can not access elements in the batch greater than the current number of events
+        }
+        batch.addLowWatermark(NEW_LWM, monCtx); // Add new LWM as last element
+        assertTrue(batch.get(BATCH_SIZE - 1).getType().equals(PersistEvent.Type.LOW_WATERMARK));
+        assertEquals(batch.get(BATCH_SIZE - 1).getLowWatermark(), NEW_LWM);
+
+        // Re-check that batch is full again
         assertTrue(batch.isFull(), "Batch shouldn't be empty");
+
+        // Clear the batch and goes back to its initial state
+        batch.clear();
+        assertTrue(batch.isEmpty(), "Batch should be empty");
+        assertFalse(batch.isFull(), "Batch shouldn't be full");
+        assertEquals(batch.getNumEvents(), 0, "Num events should be 0");
+
     }
 
-    // TODO Check this test with the contents of the master branch
-    @Test
-    public void testBatchFunctionalityWhenMastershipIsLost() {
-        Channel channel = Mockito.mock(Channel.class);
-
-        // Fill the batch with events till full
-        for (int i = 0; i < BATCH_SIZE; i++) {
-            if (i % 2 == 0) {
-                MonitoringContext monCtx = new MonitoringContext(metrics);
-                monCtx.timerStart("timestampPersistProcessor");
-                batch.addTimestamp(i, channel, monCtx);
-            } else {
-                MonitoringContext monCtx = new MonitoringContext(metrics);
-                monCtx.timerStart("commitPersistProcessor");
-                batch.addCommit(i, i + 1, channel, monCtx);
-            }
-        }
+    @Test(timeOut = 10_000)
+    public void testBatchFactoryFunctionality() throws Exception {
+
+        // Component to test
+        Batch.BatchFactory factory = new Batch.BatchFactory(BATCH_SIZE);
+
+        // Check the factory creates a new batch properly...
+        Batch batch = factory.create();
+        assertTrue(batch.isEmpty(), "Batch should be empty");
+        assertFalse(batch.isFull(), "Batch shouldn't be full");
+        assertEquals(batch.getNumEvents(), 0, "Num events should be 0");
+
+        // ...and is wrapped in to a pooled object
+        PooledObject<Batch> pooledBatch = factory.wrap(batch);
+        assertEquals(pooledBatch.getObject(), batch);
+
+        // Put some elements in the batch...
+        batch.addTimestamp(ANY_ST, channel, monCtx);
+        batch.addCommit(ANY_ST, ANY_CT, channel, monCtx);
+        batch.addAbort(ANY_ST, false, channel, monCtx);
+        assertFalse(batch.isEmpty(), "Batch should contain elements");
+        assertFalse(batch.isFull(), "Batch should NOT be full");
+        assertEquals(batch.getNumEvents(), 3, "Num events should be 3");
+
+        // ... and passivate the object through the factory. It should reset the state of the batch
+        factory.passivateObject(pooledBatch);
+        assertTrue(batch.isEmpty(), "Batch should NOT contain elements");
+        assertFalse(batch.isFull(), "Batch should NOT be full");
+        assertEquals(batch.getNumEvents(), 0, "Num events should be 0");
 
-        // Test that sending replies empties the batch also when the replica  is NOT master and calls the
-        // ambiguousCommitResponse() method on the reply processor
-        //batch.sendReply(replyProcessor, retryProcessor, (-1));
-        //verify(replyProcessor, timeout(100).times(1)).manageResponsesBatch((-1), batch);
-        assertTrue(batch.isFull(), "Batch should be full");
     }
 
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/472c8283/tso-server/src/test/java/org/apache/omid/tso/TestPanicker.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestPanicker.java b/tso-server/src/test/java/org/apache/omid/tso/TestPanicker.java
index e8dd8ad..716f64f 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestPanicker.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestPanicker.java
@@ -17,6 +17,7 @@
  */
 package org.apache.omid.tso;
 
+import org.apache.commons.pool2.ObjectPool;
 import org.apache.omid.committable.CommitTable;
 import org.apache.omid.metrics.MetricsRegistry;
 import org.apache.omid.timestamp.storage.TimestampStorage;
@@ -117,7 +118,7 @@ public class TestPanicker {
         LeaseManager leaseManager = mock(LeaseManager.class);
         doReturn(true).when(leaseManager).stillInLeasePeriod();
         TSOServerConfig config = new TSOServerConfig();
-        BatchPool batchPool = new BatchPool(config);
+        ObjectPool<Batch> batchPool = new BatchPoolModule(config).getBatchPool();
 
         PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[config.getNumConcurrentCTWriters()];
         for (int i = 0; i < config.getNumConcurrentCTWriters(); i++) {
@@ -167,7 +168,7 @@ public class TestPanicker {
             }
         };
         TSOServerConfig config = new TSOServerConfig();
-        BatchPool batchPool = new BatchPool(config);
+        ObjectPool<Batch> batchPool = new BatchPoolModule(config).getBatchPool();
 
         PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[config.getNumConcurrentCTWriters()];
         for (int i = 0; i < config.getNumConcurrentCTWriters(); i++) {

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/472c8283/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java b/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java
index 8e18119..91b9504 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java
@@ -17,6 +17,7 @@
  */
 package org.apache.omid.tso;
 
+import org.apache.commons.pool2.ObjectPool;
 import org.apache.omid.committable.CommitTable;
 import org.apache.omid.metrics.MetricsRegistry;
 import org.apache.omid.metrics.NullMetricsProvider;
@@ -38,7 +39,6 @@ import static org.mockito.Matchers.anyString;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.reset;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.timeout;
 import static org.mockito.Mockito.times;
@@ -107,7 +107,9 @@ public class TestPersistenceProcessor {
         tsoConfig.setBatchSizePerCTWriter(BATCH_SIZE_PER_CT_WRITER);
         tsoConfig.setNumConcurrentCTWriters(NUM_CT_WRITERS);
 
-        ReplyProcessor replyProcessor = new ReplyProcessorImpl(metrics, panicker);
+        ObjectPool<Batch> batchPool = spy(new BatchPoolModule(tsoConfig).getBatchPool());
+
+        ReplyProcessor replyProcessor = new ReplyProcessorImpl(metrics, panicker, batchPool);
 
         PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[tsoConfig.getNumConcurrentCTWriters()];
         for (int i = 0; i < tsoConfig.getNumConcurrentCTWriters(); i++) {
@@ -120,20 +122,17 @@ public class TestPersistenceProcessor {
         }
 
         // Component under test
-        BatchPool batchPool = spy(new BatchPool(tsoConfig));
-
         PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig, batchPool, panicker, handlers);
+        proc.addLowWatermarkToBatch(ANY_LWM, new MonitoringContext(metrics)); // Add a fake DUMMY_LWM
 
-        proc.addLowWatermarkToBatch(ANY_LWM, new MonitoringContext(metrics)); // Add a fake LWM
-
-        verify(batchPool, times(1)).getNextEmptyBatch(); // Called during initialization
+        verify(batchPool, times(1)).borrowObject(); // Called during initialization
 
         proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class));
         proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class)); // Flush: batch full
         proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class));
         proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class)); // Flush: batch full
 
-        verify(batchPool, times(1 + BATCH_SIZE_PER_CT_WRITER)).getNextEmptyBatch(); // 3: 1 in init + 2 when flushing
+        verify(batchPool, times(1 + BATCH_SIZE_PER_CT_WRITER)).borrowObject(); // 3: 1 in init + 2 when flushing
 
     }
 
@@ -151,7 +150,9 @@ public class TestPersistenceProcessor {
         tsoConfig.setBatchSizePerCTWriter(BATCH_SIZE_PER_CT_WRITER);
         tsoConfig.setNumConcurrentCTWriters(NUM_CT_WRITERS);
 
-        ReplyProcessor replyProcessor = new ReplyProcessorImpl(metrics, panicker);
+        ObjectPool<Batch> batchPool = spy(new BatchPoolModule(tsoConfig).getBatchPool());
+
+        ReplyProcessor replyProcessor = new ReplyProcessorImpl(metrics, panicker, batchPool);
 
         PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[tsoConfig.getNumConcurrentCTWriters()];
         for (int i = 0; i < tsoConfig.getNumConcurrentCTWriters(); i++) {
@@ -165,37 +166,36 @@ public class TestPersistenceProcessor {
         }
 
         // Component under test
-        BatchPool batchPool = spy(new BatchPool(tsoConfig));
         PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig, batchPool, panicker, handlers);
 
-        proc.addLowWatermarkToBatch(ANY_LWM, mock(MonitoringContext.class)); // Add a fake LWM
+        proc.addLowWatermarkToBatch(ANY_LWM, mock(MonitoringContext.class)); // Add a fake DUMMY_LWM
 
-        verify(batchPool, times(1)).getNextEmptyBatch(); // Called during initialization
+        verify(batchPool, times(1)).borrowObject(); // Called during initialization
 
         // Fill 1st handler Batches completely
         proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class));
         proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class)); // 1st batch full
-        verify(batchPool, times(2)).getNextEmptyBatch();
+        verify(batchPool, times(2)).borrowObject();
         proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class));
         proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class)); // 2nd batch full
-        verify(batchPool, times(3)).getNextEmptyBatch();
+        verify(batchPool, times(3)).borrowObject();
 
         // Test empty flush does not trigger response in getting a new currentBatch
         proc.triggerCurrentBatchFlush();
-        verify(batchPool, times(3)).getNextEmptyBatch();
+        verify(batchPool, times(3)).borrowObject();
 
         // Fill 2nd handler Batches completely
         proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class));
         proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class)); // 1st batch full
         proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class));
         proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class)); // 2nd batch full
-        verify(batchPool, times(1 + (NUM_CT_WRITERS * BATCH_SIZE_PER_CT_WRITER))).getNextEmptyBatch();
+        verify(batchPool, times(1 + (NUM_CT_WRITERS * BATCH_SIZE_PER_CT_WRITER))).borrowObject();
 
         // Start filling a new currentBatch and flush it immediately
         proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class)); // Batch not full
-        verify(batchPool, times(5)).getNextEmptyBatch();
+        verify(batchPool, times(5)).borrowObject();
         proc.triggerCurrentBatchFlush(); // Flushing should provoke invocation of a new batch
-        verify(batchPool, times(6)).getNextEmptyBatch();
+        verify(batchPool, times(6)).borrowObject();
 
         // Test empty flush does not trigger response
         proc.triggerCurrentBatchFlush();
@@ -203,7 +203,7 @@ public class TestPersistenceProcessor {
         proc.triggerCurrentBatchFlush();
         proc.triggerCurrentBatchFlush();
         proc.triggerCurrentBatchFlush();
-        verify(batchPool, times(6)).getNextEmptyBatch();
+        verify(batchPool, times(6)).borrowObject();
 
     }
 
@@ -218,7 +218,9 @@ public class TestPersistenceProcessor {
         tsoConfig.setNumConcurrentCTWriters(BATCH_SIZE_PER_CT_WRITER);
         tsoConfig.setBatchPersistTimeoutInMs(100);
 
-        ReplyProcessor replyProcessor = new ReplyProcessorImpl(metrics, panicker);
+        ObjectPool<Batch> batchPool = spy(new BatchPoolModule(tsoConfig).getBatchPool());
+
+        ReplyProcessor replyProcessor = new ReplyProcessorImpl(metrics, panicker, batchPool);
 
         // Init a non-HA lease manager
         VoidLeaseManager leaseManager = spy(new VoidLeaseManager(mock(TSOChannelHandler.class),
@@ -235,26 +237,24 @@ public class TestPersistenceProcessor {
                                                           panicker);
         }
 
-        BatchPool batchPool = spy(new BatchPool(tsoConfig));
-
         // Component under test
         PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig, batchPool, panicker, handlers);
 
-        proc.addLowWatermarkToBatch(ANY_LWM, new MonitoringContext(metrics)); // Add a fake LWM
+        proc.addLowWatermarkToBatch(ANY_LWM, new MonitoringContext(metrics)); // Add a fake DUMMY_LWM
 
         // The non-ha lease manager always return true for
         // stillInLeasePeriod(), so verify the currentBatch sends replies as master
         proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class));
         proc.triggerCurrentBatchFlush();
         verify(leaseManager, timeout(1000).times(2)).stillInLeasePeriod();
-        verify(batchPool, times(2)).getNextEmptyBatch();
+        verify(batchPool, times(2)).borrowObject();
 
     }
 
     @Test(timeOut=10_000)
-    public void testCommitPersistenceWithHALeaseManagerAndSingleCommitTableWriter() throws Exception {
+    public void testCommitPersistenceWithHALeaseManagerAndMinimumCommitTableWriters() throws Exception {
 
-        final int NUM_PERSIST_HANDLERS = 1;
+        final int NUM_PERSIST_HANDLERS = 2; // Minimum commit table writers is 2
 
         TSOServerConfig tsoConfig = new TSOServerConfig();
         tsoConfig.setNumConcurrentCTWriters(NUM_PERSIST_HANDLERS);
@@ -289,21 +289,21 @@ public class TestPersistenceProcessor {
         // Init a HA lease manager
         LeaseManager simulatedHALeaseManager = mock(LeaseManager.class);
 
-        PersistenceProcessorHandler[] handlers = configureHandlers (tsoConfig, simulatedHALeaseManager);
+        ObjectPool<Batch> batchPool = spy(new BatchPoolModule(tsoConfig).getBatchPool());
 
-        BatchPool batchPool = spy(new BatchPool(tsoConfig));
+        PersistenceProcessorHandler[] handlers = configureHandlers (tsoConfig, simulatedHALeaseManager, batchPool);
 
         // Component under test
         PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig, batchPool, panicker, handlers);
 
-        proc.addLowWatermarkToBatch(ANY_LWM, new MonitoringContext(metrics)); // Add a fake LWM
+        proc.addLowWatermarkToBatch(ANY_LWM, new MonitoringContext(metrics)); // Add a fake DUMMY_LWM
 
         // Test: Configure the lease manager to return true always
         doReturn(true).when(simulatedHALeaseManager).stillInLeasePeriod();
         proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class));
         proc.triggerCurrentBatchFlush();
         verify(simulatedHALeaseManager, timeout(1000).times(2)).stillInLeasePeriod();
-        verify(batchPool, times(2)).getNextEmptyBatch();
+        verify(batchPool, times(2)).borrowObject();
     }
 
     private void testPersistenceWithHALeaseManagerFailingToPreserveLease1(TSOServerConfig tsoConfig) throws Exception {
@@ -311,20 +311,20 @@ public class TestPersistenceProcessor {
         // Init a HA lease manager
         LeaseManager simulatedHALeaseManager = mock(LeaseManager.class);
 
-        PersistenceProcessorHandler[] handlers = configureHandlers (tsoConfig, simulatedHALeaseManager);
+        ObjectPool<Batch> batchPool = spy(new BatchPoolModule(tsoConfig).getBatchPool());
 
-        BatchPool batchPool = spy(new BatchPool(tsoConfig));
+        PersistenceProcessorHandler[] handlers = configureHandlers (tsoConfig, simulatedHALeaseManager, batchPool);
 
         // Component under test
         PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig, batchPool, panicker, handlers);
 
         // Test: Configure the lease manager to return true first and false later for stillInLeasePeriod
         doReturn(true).doReturn(false).when(simulatedHALeaseManager).stillInLeasePeriod();
-        batchPool.notifyEmptyBatch(0); // Unlock this thread to check the panicker
+        //batchPool.notifyEmptyBatch(0); // Unlock this thread to check the panicker
         proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class));
         proc.triggerCurrentBatchFlush();
         verify(simulatedHALeaseManager, timeout(1000).times(2)).stillInLeasePeriod();
-        verify(batchPool, times(2)).getNextEmptyBatch();
+        verify(batchPool, times(2)).borrowObject();
     }
 
     private void testPersistenceWithHALeaseManagerFailingToPreserveLease2(TSOServerConfig tsoConfig) throws Exception {
@@ -332,20 +332,20 @@ public class TestPersistenceProcessor {
         // Init a HA lease manager
         LeaseManager simulatedHALeaseManager = mock(LeaseManager.class);
 
-        PersistenceProcessorHandler[] handlers = configureHandlers (tsoConfig, simulatedHALeaseManager);
+        ObjectPool<Batch> batchPool = spy(new BatchPoolModule(tsoConfig).getBatchPool());
 
-        BatchPool batchPool = spy(new BatchPool(tsoConfig));
+        PersistenceProcessorHandler[] handlers = configureHandlers (tsoConfig, simulatedHALeaseManager, batchPool);
 
         // Component under test
         PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig, batchPool, panicker, handlers);
 
         // Test: Configure the lease manager to return false for stillInLeasePeriod
         doReturn(false).when(simulatedHALeaseManager).stillInLeasePeriod();
-        batchPool.notifyEmptyBatch(0); // Unlock this thread to check the panicker
+        //batchPool.notifyEmptyBatch(0); // Unlock this thread to check the panicker
         proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class));
         proc.triggerCurrentBatchFlush();
         verify(simulatedHALeaseManager, timeout(1000).times(1)).stillInLeasePeriod();
-        verify(batchPool, times(2)).getNextEmptyBatch();
+        verify(batchPool, times(2)).borrowObject();
     }
 
     private void testPersistenceWithHALeaseManagerFailingToPreserveLease3(TSOServerConfig tsoConfig) throws Exception {
@@ -353,9 +353,9 @@ public class TestPersistenceProcessor {
         // Init a HA lease manager
         LeaseManager simulatedHALeaseManager = mock(LeaseManager.class);
 
-        PersistenceProcessorHandler[] handlers = configureHandlers (tsoConfig, simulatedHALeaseManager);
+        ObjectPool<Batch> batchPool = spy(new BatchPoolModule(tsoConfig).getBatchPool());
 
-        BatchPool batchPool = spy(new BatchPool(tsoConfig));
+        PersistenceProcessorHandler[] handlers = configureHandlers (tsoConfig, simulatedHALeaseManager, batchPool);
 
         // Component under test
         PersistenceProcessorImpl proc = new PersistenceProcessorImpl(tsoConfig, batchPool, panicker, handlers);
@@ -365,15 +365,17 @@ public class TestPersistenceProcessor {
         // Configure mock writer to flush unsuccessfully
         doThrow(new IOException("Unable to write")).when(mockWriter).flush();
         doReturn(true).doReturn(false).when(simulatedHALeaseManager).stillInLeasePeriod();
-        batchPool.notifyEmptyBatch(0); // Unlock this thread to check the panicker
+//        batchPool.notifyEmptyBatch(0); // Unlock this thread to check the panicker
         proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), mock(MonitoringContext.class));
         proc.triggerCurrentBatchFlush();
         verify(simulatedHALeaseManager, timeout(1000).times(1)).stillInLeasePeriod();
-        verify(batchPool, times(2)).getNextEmptyBatch();
+        verify(batchPool, times(2)).borrowObject();
 
     }
 
-    private PersistenceProcessorHandler[] configureHandlers(TSOServerConfig tsoConfig, LeaseManager leaseManager)
+    private PersistenceProcessorHandler[] configureHandlers(TSOServerConfig tsoConfig,
+                                                            LeaseManager leaseManager,
+                                                            ObjectPool<Batch> batchPool)
             throws Exception {
         PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[tsoConfig.getNumConcurrentCTWriters()];
         for (int i = 0; i < tsoConfig.getNumConcurrentCTWriters(); i++) {
@@ -381,7 +383,7 @@ public class TestPersistenceProcessor {
                                                           "localhost:1234",
                                                           leaseManager,
                                                           commitTable,
-                                                          new ReplyProcessorImpl(metrics, panicker),
+                                                          new ReplyProcessorImpl(metrics, panicker, batchPool),
                                                           retryProcessor,
                                                           new RuntimeExceptionPanicker());
         }
@@ -393,10 +395,12 @@ public class TestPersistenceProcessor {
 
         // Init lease management (doesn't matter if HA or not)
         LeaseManagement leaseManager = mock(LeaseManagement.class);
+
         TSOServerConfig config = new TSOServerConfig();
-        BatchPool batchPool = new BatchPool(config);
 
-        ReplyProcessor replyProcessor = new ReplyProcessorImpl(metrics, panicker);
+        ObjectPool<Batch> batchPool = spy(new BatchPoolModule(config).getBatchPool());
+
+        ReplyProcessor replyProcessor = new ReplyProcessorImpl(metrics, panicker, batchPool);
 
         PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[config.getNumConcurrentCTWriters()];
         for (int i = 0; i < config.getNumConcurrentCTWriters(); i++) {
@@ -419,7 +423,7 @@ public class TestPersistenceProcessor {
         // Configure commit table writer to explode when flushing changes to DB
         doThrow(new IOException("Unable to write@TestPersistenceProcessor2")).when(mockWriter).flush();
 
-        proc.addLowWatermarkToBatch(ANY_LWM, new MonitoringContext(metrics)); // Add a fake LWM
+        proc.addLowWatermarkToBatch(ANY_LWM, new MonitoringContext(metrics)); // Add a fake DUMMY_LWM
 
         // Check the panic is extended!
         proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), monCtx);
@@ -432,9 +436,10 @@ public class TestPersistenceProcessor {
     public void testRuntimeExceptionOnCommitPersistenceTakesDownDaemon() throws Exception {
 
         TSOServerConfig config = new TSOServerConfig();
-        BatchPool batchPool = new BatchPool(config);
 
-        ReplyProcessor replyProcessor = new ReplyProcessorImpl(metrics, panicker);
+        ObjectPool<Batch> batchPool = new BatchPoolModule(config).getBatchPool();
+
+        ReplyProcessor replyProcessor = new ReplyProcessorImpl(metrics, panicker, batchPool);
 
         PersistenceProcessorHandler[] handlers = new PersistenceProcessorHandler[config.getNumConcurrentCTWriters()];
         for (int i = 0; i < config.getNumConcurrentCTWriters(); i++) {
@@ -453,9 +458,8 @@ public class TestPersistenceProcessor {
         doThrow(new RuntimeException("Kaboom!")).when(mockWriter).addCommittedTransaction(anyLong(), anyLong());
         MonitoringContext monCtx = new MonitoringContext(metrics);
 
-        proc.addLowWatermarkToBatch(ANY_LWM, new MonitoringContext(metrics)); // Add a fake LWM
+        proc.addLowWatermarkToBatch(ANY_LWM, new MonitoringContext(metrics)); // Add a fake DUMMY_LWM
 
-        batchPool.notifyEmptyBatch(0); // Unlock this thread to check the panicker
         // Check the panic is extended!
         proc.addCommitToBatch(ANY_ST, ANY_CT, mock(Channel.class), monCtx);
         proc.triggerCurrentBatchFlush();

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/472c8283/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java b/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java
index afa191e..0a4fd44 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java
@@ -18,6 +18,7 @@
 package org.apache.omid.tso;
 
 import com.google.common.base.Optional;
+import org.apache.commons.pool2.ObjectPool;
 import org.apache.omid.committable.CommitTable;
 import org.apache.omid.committable.CommitTable.CommitTimestamp;
 import org.apache.omid.committable.InMemoryCommitTable;
@@ -67,7 +68,7 @@ public class TestRetryProcessor {
 
     @Test(timeOut = 10_000)
     public void testRetriedRequestForANonExistingTxReturnsAbort() throws Exception {
-        BatchPool batchPool = new BatchPool(new TSOServerConfig());
+        ObjectPool<Batch> batchPool = new BatchPoolModule(new TSOServerConfig()).getBatchPool();
 
         // The element to test
         RetryProcessor retryProc = new RetryProcessorImpl(metrics, commitTable, replyProc, panicker, batchPool);
@@ -84,7 +85,7 @@ public class TestRetryProcessor {
 
     @Test(timeOut = 10_000)
     public void testRetriedRequestForAnExistingTxReturnsCommit() throws Exception {
-        BatchPool batchPool = new BatchPool(new TSOServerConfig());
+        ObjectPool<Batch> batchPool = new BatchPoolModule(new TSOServerConfig()).getBatchPool();
 
         // The element to test
         RetryProcessor retryProc = new RetryProcessorImpl(metrics, commitTable, replyProc, panicker, batchPool);
@@ -119,7 +120,7 @@ public class TestRetryProcessor {
         Assert.assertTrue(invalidTxMarker.isPresent());
         Assert.assertEquals(invalidTxMarker.get().getValue(), InMemoryCommitTable.INVALID_TRANSACTION_MARKER);
 
-        BatchPool batchPool = new BatchPool(new TSOServerConfig());
+        ObjectPool<Batch> batchPool = new BatchPoolModule(new TSOServerConfig()).getBatchPool();
 
         // The element to test
         RetryProcessor retryProc = new RetryProcessorImpl(metrics, commitTable, replyProc, panicker, batchPool);

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/472c8283/tso-server/src/test/resources/test-omid.yml
----------------------------------------------------------------------
diff --git a/tso-server/src/test/resources/test-omid.yml b/tso-server/src/test/resources/test-omid.yml
index efba4cc..2d4fee2 100644
--- a/tso-server/src/test/resources/test-omid.yml
+++ b/tso-server/src/test/resources/test-omid.yml
@@ -5,6 +5,7 @@ keytab: /home/sieve_omid0/sieve_omid0.prod.headless.keytab
 
 port: 54758
 maxItems: 100000000
+numConcurrentCTWriters: 2
 batchSizePerCTWriter: 500
 batchPersistTimeoutInMs: 100
 networkIfaceName: eth1


[41/50] [abbrv] incubator-omid git commit: [ci skip]prepare for next development iteration

Posted by fp...@apache.org.
[ci skip]prepare for next development iteration


Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/231bde2a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/231bde2a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/231bde2a

Branch: refs/heads/master
Commit: 231bde2adfb652689bc89c3451b0dbf4a8f31535
Parents: 0b88b0b
Author: Omid CI <om...@yahoo-inc.com>
Authored: Fri May 6 17:27:03 2016 +0000
Committer: Omid CI <om...@yahoo-inc.com>
Committed: Fri May 6 17:27:03 2016 +0000

----------------------------------------------------------------------
 benchmarks/pom.xml          | 2 +-
 codahale-metrics/pom.xml    | 2 +-
 commit-table/pom.xml        | 2 +-
 common/pom.xml              | 2 +-
 examples/pom.xml            | 2 +-
 hbase-client/pom.xml        | 2 +-
 hbase-commit-table/pom.xml  | 2 +-
 hbase-common/pom.xml        | 2 +-
 hbase-coprocessor/pom.xml   | 2 +-
 hbase-shims/hbase-0/pom.xml | 2 +-
 hbase-shims/hbase-1/pom.xml | 2 +-
 hbase-shims/pom.xml         | 2 +-
 hbase-tools/pom.xml         | 2 +-
 metrics/pom.xml             | 2 +-
 pom.xml                     | 4 ++--
 statemachine/pom.xml        | 2 +-
 timestamp-storage/pom.xml   | 2 +-
 transaction-client/pom.xml  | 2 +-
 tso-server/pom.xml          | 2 +-
 19 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/231bde2a/benchmarks/pom.xml
----------------------------------------------------------------------
diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml
index 364623e..07bba68 100644
--- a/benchmarks/pom.xml
+++ b/benchmarks/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.48</version>
+        <version>0.8.1.49-SNAPSHOT</version>
     </parent>
 
     <artifactId>benchmarks</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/231bde2a/codahale-metrics/pom.xml
----------------------------------------------------------------------
diff --git a/codahale-metrics/pom.xml b/codahale-metrics/pom.xml
index c598e80..98a84ba 100644
--- a/codahale-metrics/pom.xml
+++ b/codahale-metrics/pom.xml
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.48</version>
+        <version>0.8.1.49-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/231bde2a/commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/commit-table/pom.xml b/commit-table/pom.xml
index e86936b..1ba2a97 100644
--- a/commit-table/pom.xml
+++ b/commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.48</version>
+        <version>0.8.1.49-SNAPSHOT</version>
     </parent>
 
     <artifactId>commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/231bde2a/common/pom.xml
----------------------------------------------------------------------
diff --git a/common/pom.xml b/common/pom.xml
index bf1b1b1..52f3233 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.48</version>
+        <version>0.8.1.49-SNAPSHOT</version>
     </parent>
 
     <artifactId>common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/231bde2a/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index e76e647..c44d33f 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.48</version>
+        <version>0.8.1.49-SNAPSHOT</version>
     </parent>
 
     <artifactId>examples</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/231bde2a/hbase-client/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml
index 1fb296c..8dd1ca2 100644
--- a/hbase-client/pom.xml
+++ b/hbase-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.48</version>
+        <version>0.8.1.49-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/231bde2a/hbase-commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-commit-table/pom.xml b/hbase-commit-table/pom.xml
index 8809051..74ed26b 100644
--- a/hbase-commit-table/pom.xml
+++ b/hbase-commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.48</version>
+        <version>0.8.1.49-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/231bde2a/hbase-common/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml
index 2362db2..51cd197 100644
--- a/hbase-common/pom.xml
+++ b/hbase-common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.48</version>
+        <version>0.8.1.49-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/231bde2a/hbase-coprocessor/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-coprocessor/pom.xml b/hbase-coprocessor/pom.xml
index 41b0fc3..375df65 100644
--- a/hbase-coprocessor/pom.xml
+++ b/hbase-coprocessor/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.48</version>
+        <version>0.8.1.49-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-coprocessor</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/231bde2a/hbase-shims/hbase-0/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-0/pom.xml b/hbase-shims/hbase-0/pom.xml
index 0a52505..146f574 100644
--- a/hbase-shims/hbase-0/pom.xml
+++ b/hbase-shims/hbase-0/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.48</version>
+        <version>0.8.1.49-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase0-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/231bde2a/hbase-shims/hbase-1/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-1/pom.xml b/hbase-shims/hbase-1/pom.xml
index 8f3b570..e957db0 100644
--- a/hbase-shims/hbase-1/pom.xml
+++ b/hbase-shims/hbase-1/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.48</version>
+        <version>0.8.1.49-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase1-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/231bde2a/hbase-shims/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/pom.xml b/hbase-shims/pom.xml
index e28bfbb..214168a 100644
--- a/hbase-shims/pom.xml
+++ b/hbase-shims/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.48</version>
+        <version>0.8.1.49-SNAPSHOT</version>
     </parent>
 
     <artifactId>omid-shims-aggregator</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/231bde2a/hbase-tools/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-tools/pom.xml b/hbase-tools/pom.xml
index a997bf1..27dfdba 100644
--- a/hbase-tools/pom.xml
+++ b/hbase-tools/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.48</version>
+        <version>0.8.1.49-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-tools</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/231bde2a/metrics/pom.xml
----------------------------------------------------------------------
diff --git a/metrics/pom.xml b/metrics/pom.xml
index 5b7d151..7c133cf 100644
--- a/metrics/pom.xml
+++ b/metrics/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.48</version>
+        <version>0.8.1.49-SNAPSHOT</version>
     </parent>
 
     <artifactId>metrics</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/231bde2a/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index a6b1b6f..6eb839d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
     <artifactId>omid</artifactId>
     <packaging>pom</packaging>
     <!-- WARNING: do not update version manually, use mvn versions:set -->
-    <version>0.8.1.48</version>
+    <version>0.8.1.49-SNAPSHOT</version>
 
     <organization>
         <name>Apache Software Foundation</name>
@@ -105,7 +105,7 @@
         <connection>scm:git:git://github.com/yahoo/omid.git</connection>
         <developerConnection>scm:git:https://${GH_TOKEN}@github.com/yahoo/omid.git</developerConnection>
         <url>https://github.com/yahoo/omid</url>
-        <tag>omid-0.8.1.48</tag>
+        <tag>master</tag>
     </scm>
 
     <distributionManagement>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/231bde2a/statemachine/pom.xml
----------------------------------------------------------------------
diff --git a/statemachine/pom.xml b/statemachine/pom.xml
index 84ac019..6c50c2c 100644
--- a/statemachine/pom.xml
+++ b/statemachine/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.48</version>
+        <version>0.8.1.49-SNAPSHOT</version>
     </parent>
 
     <name>State Machine</name>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/231bde2a/timestamp-storage/pom.xml
----------------------------------------------------------------------
diff --git a/timestamp-storage/pom.xml b/timestamp-storage/pom.xml
index 87ea156..c12e886 100644
--- a/timestamp-storage/pom.xml
+++ b/timestamp-storage/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.48</version>
+        <version>0.8.1.49-SNAPSHOT</version>
     </parent>
 
     <artifactId>timestamp-storage</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/231bde2a/transaction-client/pom.xml
----------------------------------------------------------------------
diff --git a/transaction-client/pom.xml b/transaction-client/pom.xml
index 578b358..d102326 100644
--- a/transaction-client/pom.xml
+++ b/transaction-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.48</version>
+        <version>0.8.1.49-SNAPSHOT</version>
     </parent>
 
     <artifactId>transaction-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/231bde2a/tso-server/pom.xml
----------------------------------------------------------------------
diff --git a/tso-server/pom.xml b/tso-server/pom.xml
index aef2fe1..ae0936a 100644
--- a/tso-server/pom.xml
+++ b/tso-server/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.48</version>
+        <version>0.8.1.49-SNAPSHOT</version>
     </parent>
 
     <artifactId>tso-server</artifactId>


[48/50] [abbrv] incubator-omid git commit: Merge pull request #89 from yahoo/concurrentCTwrite

Posted by fp...@apache.org.
Merge pull request #89 from yahoo/concurrentCTwrite

Concurrent CT write

Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/6ab0725d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/6ab0725d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/6ab0725d

Branch: refs/heads/master
Commit: 6ab0725deb80a409dc5b9d8a26c8cbe3c3a4b904
Parents: 9ea3473 5b27a07
Author: ikatkov <ik...@gmail.com>
Authored: Wed May 11 10:45:26 2016 -0700
Committer: ikatkov <ik...@gmail.com>
Committed: Wed May 11 10:45:26 2016 -0700

----------------------------------------------------------------------
 .../apache/omid/benchmarks/utils/Generator.java |   2 +-
 .../utils/ScrambledZipfianGenerator.java        |   2 +-
 .../org/apache/omid/transaction/TTable.java     |  38 +-
 .../apache/omid/transaction/TestTSOModule.java  |  18 +
 .../TSOForHBaseCompactorTestModule.java         |  14 +
 .../omid/tools/hbase/OmidTableManager.java      |  12 +-
 pom.xml                                         |   1 +
 tso-server/pom.xml                              |   5 +
 .../main/java/org/apache/omid/tso/Batch.java    | 152 ++++++
 .../org/apache/omid/tso/BatchPoolModule.java    |  71 +++
 .../apache/omid/tso/FatalExceptionHandler.java  |   4 +-
 .../org/apache/omid/tso/LeaseManagement.java    |  10 +-
 .../java/org/apache/omid/tso/PersistEvent.java  | 121 +++++
 .../apache/omid/tso/PersistenceProcessor.java   |  15 +-
 .../omid/tso/PersistenceProcessorHandler.java   | 146 ++++++
 .../omid/tso/PersistenceProcessorImpl.java      | 441 ++++------------
 .../org/apache/omid/tso/ReplyProcessor.java     |  44 +-
 .../org/apache/omid/tso/ReplyProcessorImpl.java | 251 ++++-----
 .../apache/omid/tso/RequestProcessorImpl.java   |  91 +++-
 .../org/apache/omid/tso/RetryProcessorImpl.java |  62 +--
 .../java/org/apache/omid/tso/TSOModule.java     |  19 +-
 .../org/apache/omid/tso/TSOServerConfig.java    |  48 +-
 .../org/apache/omid/tso/TSOStateManager.java    |   6 +-
 .../apache/omid/tso/TSOStateManagerImpl.java    |   3 +-
 .../org/apache/omid/tso/VoidLeaseManager.java   |   4 +-
 tso-server/src/main/resources/default-omid.yml  |  11 +-
 .../java/org/apache/omid/tso/TSOMockModule.java |  13 +
 .../java/org/apache/omid/tso/TestBatch.java     | 151 +++---
 .../java/org/apache/omid/tso/TestPanicker.java  |  71 ++-
 .../omid/tso/TestPersistenceProcessor.java      | 510 +++++++++++++------
 .../apache/omid/tso/TestRequestProcessor.java   |  39 +-
 .../org/apache/omid/tso/TestRetryProcessor.java |  58 ++-
 ...stTSOClientRequestAndResponseBehaviours.java |  25 +-
 tso-server/src/test/resources/test-omid.yml     |   3 +-
 34 files changed, 1601 insertions(+), 860 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6ab0725d/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/6ab0725d/tso-server/pom.xml
----------------------------------------------------------------------


[44/50] [abbrv] incubator-omid git commit: Merge pull request #102 from yahoo/secure-hbase-benchmarks

Posted by fp...@apache.org.
Merge pull request #102 from yahoo/secure-hbase-benchmarks

Fix benchmark configs to let them run on secure Hbase

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

Branch: refs/heads/master
Commit: ccd2249b48b9649c06da1ee71a44fd483993c4af
Parents: 231bde2 4c19497
Author: Francisco P�rez-Sorrosal <fp...@gmail.com>
Authored: Tue May 10 18:07:13 2016 -0700
Committer: Francisco P�rez-Sorrosal <fp...@gmail.com>
Committed: Tue May 10 18:07:13 2016 -0700

----------------------------------------------------------------------
 benchmarks/bin/benchmarks.sh                                  | 2 +-
 benchmarks/bin/omid-env.sh                                    | 7 +++++++
 .../apache/omid/benchmarks/tso/TSOServerBenchmarkConfig.java  | 6 +++---
 .../main/resources/default-tso-server-benchmark-config.yml    | 2 ++
 4 files changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------



[19/50] [abbrv] incubator-omid git commit: [ci skip]prepare for next development iteration

Posted by fp...@apache.org.
[ci skip]prepare for next development iteration


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

Branch: refs/heads/master
Commit: bcdd3d1f28e77d1ba113f436d9b4fd86472243b2
Parents: c2e767b
Author: Omid CI <om...@yahoo-inc.com>
Authored: Wed Apr 27 01:44:05 2016 +0000
Committer: Omid CI <om...@yahoo-inc.com>
Committed: Wed Apr 27 01:44:05 2016 +0000

----------------------------------------------------------------------
 benchmarks/pom.xml          | 2 +-
 codahale-metrics/pom.xml    | 2 +-
 commit-table/pom.xml        | 2 +-
 common/pom.xml              | 2 +-
 examples/pom.xml            | 2 +-
 hbase-client/pom.xml        | 2 +-
 hbase-commit-table/pom.xml  | 2 +-
 hbase-common/pom.xml        | 2 +-
 hbase-coprocessor/pom.xml   | 2 +-
 hbase-shims/hbase-0/pom.xml | 2 +-
 hbase-shims/hbase-1/pom.xml | 2 +-
 hbase-shims/pom.xml         | 2 +-
 hbase-tools/pom.xml         | 2 +-
 metrics/pom.xml             | 2 +-
 pom.xml                     | 4 ++--
 statemachine/pom.xml        | 2 +-
 timestamp-storage/pom.xml   | 2 +-
 transaction-client/pom.xml  | 2 +-
 tso-server/pom.xml          | 2 +-
 19 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/bcdd3d1f/benchmarks/pom.xml
----------------------------------------------------------------------
diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml
index d17f9dd..c33de3c 100644
--- a/benchmarks/pom.xml
+++ b/benchmarks/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.45</version>
+        <version>0.8.1.46-SNAPSHOT</version>
     </parent>
 
     <artifactId>benchmarks</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/bcdd3d1f/codahale-metrics/pom.xml
----------------------------------------------------------------------
diff --git a/codahale-metrics/pom.xml b/codahale-metrics/pom.xml
index 76985e4..97b139e 100644
--- a/codahale-metrics/pom.xml
+++ b/codahale-metrics/pom.xml
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.45</version>
+        <version>0.8.1.46-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/bcdd3d1f/commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/commit-table/pom.xml b/commit-table/pom.xml
index 4e72442..9c49143 100644
--- a/commit-table/pom.xml
+++ b/commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.45</version>
+        <version>0.8.1.46-SNAPSHOT</version>
     </parent>
 
     <artifactId>commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/bcdd3d1f/common/pom.xml
----------------------------------------------------------------------
diff --git a/common/pom.xml b/common/pom.xml
index 938420a..c28e3da 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.45</version>
+        <version>0.8.1.46-SNAPSHOT</version>
     </parent>
 
     <artifactId>common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/bcdd3d1f/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index ff43d7c..1ed519e 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.45</version>
+        <version>0.8.1.46-SNAPSHOT</version>
     </parent>
 
     <artifactId>examples</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/bcdd3d1f/hbase-client/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml
index 3372358..577d065 100644
--- a/hbase-client/pom.xml
+++ b/hbase-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.45</version>
+        <version>0.8.1.46-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/bcdd3d1f/hbase-commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-commit-table/pom.xml b/hbase-commit-table/pom.xml
index 8e9f7d9..8bd684e 100644
--- a/hbase-commit-table/pom.xml
+++ b/hbase-commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.45</version>
+        <version>0.8.1.46-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/bcdd3d1f/hbase-common/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml
index f91ee9a..4ed0424 100644
--- a/hbase-common/pom.xml
+++ b/hbase-common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.45</version>
+        <version>0.8.1.46-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/bcdd3d1f/hbase-coprocessor/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-coprocessor/pom.xml b/hbase-coprocessor/pom.xml
index e9c36d8..9fbdc56 100644
--- a/hbase-coprocessor/pom.xml
+++ b/hbase-coprocessor/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.45</version>
+        <version>0.8.1.46-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-coprocessor</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/bcdd3d1f/hbase-shims/hbase-0/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-0/pom.xml b/hbase-shims/hbase-0/pom.xml
index 3b399eb..76ba833 100644
--- a/hbase-shims/hbase-0/pom.xml
+++ b/hbase-shims/hbase-0/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.45</version>
+        <version>0.8.1.46-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase0-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/bcdd3d1f/hbase-shims/hbase-1/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-1/pom.xml b/hbase-shims/hbase-1/pom.xml
index 225e8c6..2a6b45e 100644
--- a/hbase-shims/hbase-1/pom.xml
+++ b/hbase-shims/hbase-1/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.45</version>
+        <version>0.8.1.46-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase1-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/bcdd3d1f/hbase-shims/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/pom.xml b/hbase-shims/pom.xml
index 5782141..f8e8594 100644
--- a/hbase-shims/pom.xml
+++ b/hbase-shims/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.45</version>
+        <version>0.8.1.46-SNAPSHOT</version>
     </parent>
 
     <artifactId>omid-shims-aggregator</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/bcdd3d1f/hbase-tools/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-tools/pom.xml b/hbase-tools/pom.xml
index 48209da..51a5dbe 100644
--- a/hbase-tools/pom.xml
+++ b/hbase-tools/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.45</version>
+        <version>0.8.1.46-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-tools</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/bcdd3d1f/metrics/pom.xml
----------------------------------------------------------------------
diff --git a/metrics/pom.xml b/metrics/pom.xml
index 2c57b70..5426f46 100644
--- a/metrics/pom.xml
+++ b/metrics/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.45</version>
+        <version>0.8.1.46-SNAPSHOT</version>
     </parent>
 
     <artifactId>metrics</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/bcdd3d1f/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 354f305..8d24ce1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
     <artifactId>omid</artifactId>
     <packaging>pom</packaging>
     <!-- WARNING: do not update version manually, use mvn versions:set -->
-    <version>0.8.1.45</version>
+    <version>0.8.1.46-SNAPSHOT</version>
 
     <organization>
         <name>Apache Software Foundation</name>
@@ -105,7 +105,7 @@
         <connection>scm:git:git://github.com/yahoo/omid.git</connection>
         <developerConnection>scm:git:https://${GH_TOKEN}@github.com/yahoo/omid.git</developerConnection>
         <url>https://github.com/yahoo/omid</url>
-        <tag>omid-0.8.1.45</tag>
+        <tag>master</tag>
     </scm>
 
     <distributionManagement>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/bcdd3d1f/statemachine/pom.xml
----------------------------------------------------------------------
diff --git a/statemachine/pom.xml b/statemachine/pom.xml
index 24a060e..806d888 100644
--- a/statemachine/pom.xml
+++ b/statemachine/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.45</version>
+        <version>0.8.1.46-SNAPSHOT</version>
     </parent>
 
     <name>State Machine</name>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/bcdd3d1f/timestamp-storage/pom.xml
----------------------------------------------------------------------
diff --git a/timestamp-storage/pom.xml b/timestamp-storage/pom.xml
index 88a0e8e..1f5409b 100644
--- a/timestamp-storage/pom.xml
+++ b/timestamp-storage/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.45</version>
+        <version>0.8.1.46-SNAPSHOT</version>
     </parent>
 
     <artifactId>timestamp-storage</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/bcdd3d1f/transaction-client/pom.xml
----------------------------------------------------------------------
diff --git a/transaction-client/pom.xml b/transaction-client/pom.xml
index 6ef6a03..7f1db0b 100644
--- a/transaction-client/pom.xml
+++ b/transaction-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.45</version>
+        <version>0.8.1.46-SNAPSHOT</version>
     </parent>
 
     <artifactId>transaction-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/bcdd3d1f/tso-server/pom.xml
----------------------------------------------------------------------
diff --git a/tso-server/pom.xml b/tso-server/pom.xml
index 0baaee2..b3f317e 100644
--- a/tso-server/pom.xml
+++ b/tso-server/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.45</version>
+        <version>0.8.1.46-SNAPSHOT</version>
     </parent>
 
     <artifactId>tso-server</artifactId>


[07/50] [abbrv] incubator-omid git commit: [ci skip]prepare release omid-0.8.1.43

Posted by fp...@apache.org.
[ci skip]prepare release omid-0.8.1.43


Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/06e1dcde
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/06e1dcde
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/06e1dcde

Branch: refs/heads/master
Commit: 06e1dcde9f0ad764d882d85dcb183737837a8b25
Parents: 768a307
Author: Omid CI <om...@yahoo-inc.com>
Authored: Mon Apr 25 19:11:39 2016 +0000
Committer: Omid CI <om...@yahoo-inc.com>
Committed: Mon Apr 25 19:11:39 2016 +0000

----------------------------------------------------------------------
 benchmarks/pom.xml          | 2 +-
 codahale-metrics/pom.xml    | 2 +-
 commit-table/pom.xml        | 2 +-
 common/pom.xml              | 2 +-
 examples/pom.xml            | 2 +-
 hbase-client/pom.xml        | 2 +-
 hbase-commit-table/pom.xml  | 2 +-
 hbase-common/pom.xml        | 2 +-
 hbase-coprocessor/pom.xml   | 2 +-
 hbase-shims/hbase-0/pom.xml | 2 +-
 hbase-shims/hbase-1/pom.xml | 2 +-
 hbase-shims/pom.xml         | 2 +-
 hbase-tools/pom.xml         | 2 +-
 metrics/pom.xml             | 2 +-
 pom.xml                     | 4 ++--
 statemachine/pom.xml        | 2 +-
 timestamp-storage/pom.xml   | 2 +-
 transaction-client/pom.xml  | 2 +-
 tso-server/pom.xml          | 2 +-
 19 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06e1dcde/benchmarks/pom.xml
----------------------------------------------------------------------
diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml
index fd329bc..b24af5b 100644
--- a/benchmarks/pom.xml
+++ b/benchmarks/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.43-SNAPSHOT</version>
+        <version>0.8.1.43</version>
     </parent>
 
     <artifactId>benchmarks</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06e1dcde/codahale-metrics/pom.xml
----------------------------------------------------------------------
diff --git a/codahale-metrics/pom.xml b/codahale-metrics/pom.xml
index 3e051d5..0c28fc6 100644
--- a/codahale-metrics/pom.xml
+++ b/codahale-metrics/pom.xml
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.43-SNAPSHOT</version>
+        <version>0.8.1.43</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06e1dcde/commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/commit-table/pom.xml b/commit-table/pom.xml
index 8fd85be..09003d6 100644
--- a/commit-table/pom.xml
+++ b/commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.43-SNAPSHOT</version>
+        <version>0.8.1.43</version>
     </parent>
 
     <artifactId>commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06e1dcde/common/pom.xml
----------------------------------------------------------------------
diff --git a/common/pom.xml b/common/pom.xml
index a7d948f..99e8c9d 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.43-SNAPSHOT</version>
+        <version>0.8.1.43</version>
     </parent>
 
     <artifactId>common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06e1dcde/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 55c429f..f50b467 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.43-SNAPSHOT</version>
+        <version>0.8.1.43</version>
     </parent>
 
     <artifactId>examples</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06e1dcde/hbase-client/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml
index c1a022c..4a0f84c 100644
--- a/hbase-client/pom.xml
+++ b/hbase-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.43-SNAPSHOT</version>
+        <version>0.8.1.43</version>
     </parent>
 
     <artifactId>hbase-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06e1dcde/hbase-commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-commit-table/pom.xml b/hbase-commit-table/pom.xml
index c20656d..c58e559 100644
--- a/hbase-commit-table/pom.xml
+++ b/hbase-commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.43-SNAPSHOT</version>
+        <version>0.8.1.43</version>
     </parent>
 
     <artifactId>hbase-commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06e1dcde/hbase-common/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml
index 6dc89a5..5df849c 100644
--- a/hbase-common/pom.xml
+++ b/hbase-common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.43-SNAPSHOT</version>
+        <version>0.8.1.43</version>
     </parent>
 
     <artifactId>hbase-common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06e1dcde/hbase-coprocessor/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-coprocessor/pom.xml b/hbase-coprocessor/pom.xml
index d289c3e..e18659f 100644
--- a/hbase-coprocessor/pom.xml
+++ b/hbase-coprocessor/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.43-SNAPSHOT</version>
+        <version>0.8.1.43</version>
     </parent>
 
     <artifactId>hbase-coprocessor</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06e1dcde/hbase-shims/hbase-0/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-0/pom.xml b/hbase-shims/hbase-0/pom.xml
index b933a4c..e5438f9 100644
--- a/hbase-shims/hbase-0/pom.xml
+++ b/hbase-shims/hbase-0/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.43-SNAPSHOT</version>
+        <version>0.8.1.43</version>
     </parent>
 
     <artifactId>hbase0-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06e1dcde/hbase-shims/hbase-1/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-1/pom.xml b/hbase-shims/hbase-1/pom.xml
index 52933e1..48d1aee 100644
--- a/hbase-shims/hbase-1/pom.xml
+++ b/hbase-shims/hbase-1/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.43-SNAPSHOT</version>
+        <version>0.8.1.43</version>
     </parent>
 
     <artifactId>hbase1-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06e1dcde/hbase-shims/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/pom.xml b/hbase-shims/pom.xml
index 6751e1a..cbf5d4c 100644
--- a/hbase-shims/pom.xml
+++ b/hbase-shims/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.43-SNAPSHOT</version>
+        <version>0.8.1.43</version>
     </parent>
 
     <artifactId>omid-shims-aggregator</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06e1dcde/hbase-tools/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-tools/pom.xml b/hbase-tools/pom.xml
index 1f8f708..066606c 100644
--- a/hbase-tools/pom.xml
+++ b/hbase-tools/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.43-SNAPSHOT</version>
+        <version>0.8.1.43</version>
     </parent>
 
     <artifactId>hbase-tools</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06e1dcde/metrics/pom.xml
----------------------------------------------------------------------
diff --git a/metrics/pom.xml b/metrics/pom.xml
index 00a0e0b..e0205b9 100644
--- a/metrics/pom.xml
+++ b/metrics/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.43-SNAPSHOT</version>
+        <version>0.8.1.43</version>
     </parent>
 
     <artifactId>metrics</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06e1dcde/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index ac77137..a7eda12 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
     <artifactId>omid</artifactId>
     <packaging>pom</packaging>
     <!-- WARNING: do not update version manually, use mvn versions:set -->
-    <version>0.8.1.43-SNAPSHOT</version>
+    <version>0.8.1.43</version>
 
     <organization>
         <name>Apache Software Foundation</name>
@@ -105,7 +105,7 @@
         <connection>scm:git:git://github.com/yahoo/omid.git</connection>
         <developerConnection>scm:git:https://${GH_TOKEN}@github.com/yahoo/omid.git</developerConnection>
         <url>https://github.com/yahoo/omid</url>
-        <tag>master</tag>
+        <tag>omid-0.8.1.43</tag>
     </scm>
 
     <distributionManagement>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06e1dcde/statemachine/pom.xml
----------------------------------------------------------------------
diff --git a/statemachine/pom.xml b/statemachine/pom.xml
index 9d2246a..3ce4de2 100644
--- a/statemachine/pom.xml
+++ b/statemachine/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.43-SNAPSHOT</version>
+        <version>0.8.1.43</version>
     </parent>
 
     <name>State Machine</name>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06e1dcde/timestamp-storage/pom.xml
----------------------------------------------------------------------
diff --git a/timestamp-storage/pom.xml b/timestamp-storage/pom.xml
index 6bc3ba2..71b452b 100644
--- a/timestamp-storage/pom.xml
+++ b/timestamp-storage/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.43-SNAPSHOT</version>
+        <version>0.8.1.43</version>
     </parent>
 
     <artifactId>timestamp-storage</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06e1dcde/transaction-client/pom.xml
----------------------------------------------------------------------
diff --git a/transaction-client/pom.xml b/transaction-client/pom.xml
index 53348cc..e1a2e70 100644
--- a/transaction-client/pom.xml
+++ b/transaction-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.43-SNAPSHOT</version>
+        <version>0.8.1.43</version>
     </parent>
 
     <artifactId>transaction-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/06e1dcde/tso-server/pom.xml
----------------------------------------------------------------------
diff --git a/tso-server/pom.xml b/tso-server/pom.xml
index d2c8f51..e239c11 100644
--- a/tso-server/pom.xml
+++ b/tso-server/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.43-SNAPSHOT</version>
+        <version>0.8.1.43</version>
     </parent>
 
     <artifactId>tso-server</artifactId>


[17/50] [abbrv] incubator-omid git commit: Merge pull request #98 from yahoo/remove-junit-asserts

Posted by fp...@apache.org.
Merge pull request #98 from yahoo/remove-junit-asserts

Remove JUnit asserts

Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/2c6e18b0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/2c6e18b0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/2c6e18b0

Branch: refs/heads/master
Commit: 2c6e18b0ee27d29c54926dd46b0a3048251af72b
Parents: a5c2c2f 4323560
Author: ikatkov <ik...@gmail.com>
Authored: Tue Apr 26 18:25:09 2016 -0700
Committer: ikatkov <ik...@gmail.com>
Committed: Tue Apr 26 18:25:09 2016 -0700

----------------------------------------------------------------------
 .../apache/omid/transaction/TestAutoFlush.java  |   7 +-
 .../apache/omid/transaction/TestCellUtils.java  |  48 +-
 .../omid/transaction/TestColumnIterator.java    |  10 +-
 .../apache/omid/transaction/TestDeletion.java   |  38 +-
 .../apache/omid/transaction/TestFilters.java    |  34 +-
 .../transaction/TestHBaseTransactionClient.java |  49 +-
 .../apache/omid/transaction/TestReadPath.java   |  12 +-
 .../transaction/TestSingleColumnFamily.java     |  17 +-
 .../transaction/TestTransactionCleanup.java     |  15 +-
 .../transaction/TestTransactionConflict.java    | 161 +++---
 .../apache/omid/transaction/TestUpdateScan.java |  20 +-
 .../committable/hbase/TestHBaseCommitTable.java |  64 +--
 .../apache/omid/transaction/TestCompaction.java | 495 ++++++++-----------
 .../omid/transaction/TestCompactorScanner.java  |  16 +-
 .../storage/TestHBaseTimestampStorage.java      |  12 +-
 .../omid/tso/client/TestMockTSOClient.java      |  12 +-
 .../java/org/apache/omid/tso/TestBatch.java     |  21 +-
 .../org/apache/omid/tso/TestLeaseManager.java   |   4 +-
 .../apache/omid/tso/TestRequestProcessor.java   |   4 +-
 .../org/apache/omid/tso/TestRetryProcessor.java |   9 +-
 .../apache/omid/tso/TestTSOStateManager.java    |  10 +-
 ...tionOfTSOClientServerBasicFunctionality.java |   4 +-
 22 files changed, 469 insertions(+), 593 deletions(-)
----------------------------------------------------------------------



[06/50] [abbrv] incubator-omid git commit: Merge pull request #96 from yahoo/improve-exceptions

Posted by fp...@apache.org.
Merge pull request #96 from yahoo/improve-exceptions

Use IOException in TransactionException and ZKUtils.initZKClient()

Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/768a307e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/768a307e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/768a307e

Branch: refs/heads/master
Commit: 768a307e1ef13bf427d1e9d1d2967c3f3c6edfb3
Parents: 3072f32 83c252b
Author: ikatkov <ik...@gmail.com>
Authored: Mon Apr 25 11:52:33 2016 -0700
Committer: ikatkov <ik...@gmail.com>
Committed: Mon Apr 25 11:52:33 2016 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/omid/zk/ZKUtils.java  | 17 ++++++++++++-----
 .../apache/omid/examples/ConfigurationExample.java |  3 +--
 .../transaction/TestEndToEndScenariosWithHA.java   |  2 +-
 .../apache/omid/transaction/TestTxMgrFailover.java |  2 +-
 .../apache/omid/timestamp/storage/ZKModule.java    |  2 +-
 .../omid/transaction/TransactionException.java     |  5 ++++-
 .../java/org/apache/omid/tso/client/TSOClient.java |  5 ++---
 7 files changed, 22 insertions(+), 14 deletions(-)
----------------------------------------------------------------------



[05/50] [abbrv] incubator-omid git commit: Use IOException in TransactionException and ZKUtils.initZKClient()

Posted by fp...@apache.org.
Use IOException in TransactionException and ZKUtils.initZKClient()

Change-Id: I309f03ccc003fc42203f5581641fc0b69c46a4f9


Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/83c252b4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/83c252b4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/83c252b4

Branch: refs/heads/master
Commit: 83c252b463128847c4f3b93a655f979fec0ce490
Parents: 3072f32
Author: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Authored: Thu Apr 21 16:02:36 2016 -0700
Committer: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Committed: Thu Apr 21 16:02:36 2016 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/omid/zk/ZKUtils.java  | 17 ++++++++++++-----
 .../apache/omid/examples/ConfigurationExample.java |  3 +--
 .../transaction/TestEndToEndScenariosWithHA.java   |  2 +-
 .../apache/omid/transaction/TestTxMgrFailover.java |  2 +-
 .../apache/omid/timestamp/storage/ZKModule.java    |  2 +-
 .../omid/transaction/TransactionException.java     |  5 ++++-
 .../java/org/apache/omid/tso/client/TSOClient.java |  5 ++---
 7 files changed, 22 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/83c252b4/common/src/main/java/org/apache/omid/zk/ZKUtils.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/omid/zk/ZKUtils.java b/common/src/main/java/org/apache/omid/zk/ZKUtils.java
index 275e3b7..9e3d3b4 100644
--- a/common/src/main/java/org/apache/omid/zk/ZKUtils.java
+++ b/common/src/main/java/org/apache/omid/zk/ZKUtils.java
@@ -32,7 +32,7 @@ public class ZKUtils {
     private static final Logger LOG = LoggerFactory.getLogger(ZKUtils.class);
 
     public static CuratorFramework initZKClient(String zkCluster, String namespace, int zkConnectionTimeoutInSec)
-            throws IOException, InterruptedException {
+            throws IOException {
 
         LOG.info("Creating Zookeeper Client connecting to {}", zkCluster);
 
@@ -44,10 +44,17 @@ public class ZKUtils {
                 .build();
 
         zkClient.start();
-        if (zkClient.blockUntilConnected(zkConnectionTimeoutInSec, TimeUnit.SECONDS)) {
-            LOG.info("Connected to ZK cluster '{}', client in state: [{}]", zkCluster, zkClient.getState());
-        } else {
-            throw new IOException(String.format("Can't contact ZK cluster '%s' after 10 seconds", zkCluster));
+
+        try {
+            if (zkClient.blockUntilConnected(zkConnectionTimeoutInSec, TimeUnit.SECONDS)) {
+                LOG.info("Connected to ZK cluster '{}', client in state: [{}]", zkCluster, zkClient.getState());
+            } else {
+                String errorMsg = String.format("Can't contact ZK cluster '%s' after %d seconds",
+                                                zkCluster, zkConnectionTimeoutInSec);
+                throw new IOException(errorMsg);
+            }
+        } catch (InterruptedException ex) {
+            throw new IOException(String.format("Interrupted whilst connecting to ZK cluster '%s'", zkCluster));
         }
 
         return zkClient;

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/83c252b4/examples/src/main/java/org/apache/omid/examples/ConfigurationExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/omid/examples/ConfigurationExample.java b/examples/src/main/java/org/apache/omid/examples/ConfigurationExample.java
index 17457c6..aa59245 100644
--- a/examples/src/main/java/org/apache/omid/examples/ConfigurationExample.java
+++ b/examples/src/main/java/org/apache/omid/examples/ConfigurationExample.java
@@ -22,7 +22,6 @@ import org.apache.omid.transaction.HBaseTransactionManager;
 import org.apache.omid.transaction.RollbackException;
 import org.apache.omid.transaction.TTable;
 import org.apache.omid.transaction.Transaction;
-import org.apache.omid.transaction.TransactionException;
 import org.apache.omid.transaction.TransactionManager;
 import org.apache.commons.lang.StringUtils;
 import org.apache.hadoop.hbase.client.Put;
@@ -91,7 +90,7 @@ public class ConfigurationExample {
     }
 
     private void doWork(String userTableName, byte[] family, HBaseOmidClientConfiguration configuration)
-            throws IOException, TransactionException, RollbackException, InterruptedException {
+            throws IOException, RollbackException, InterruptedException {
 
         byte[] exampleRow1 = Bytes.toBytes("EXAMPLE_ROW1");
         byte[] exampleRow2 = Bytes.toBytes("EXAMPLE_ROW2");

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/83c252b4/hbase-client/src/test/java/org/apache/omid/transaction/TestEndToEndScenariosWithHA.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/test/java/org/apache/omid/transaction/TestEndToEndScenariosWithHA.java b/hbase-client/src/test/java/org/apache/omid/transaction/TestEndToEndScenariosWithHA.java
index ce69bf5..dba54f5 100644
--- a/hbase-client/src/test/java/org/apache/omid/transaction/TestEndToEndScenariosWithHA.java
+++ b/hbase-client/src/test/java/org/apache/omid/transaction/TestEndToEndScenariosWithHA.java
@@ -369,7 +369,7 @@ public class TestEndToEndScenariosWithHA extends OmidTestBase {
     }
 
     private void checkRowValues(TTable txTable, byte[] expectedDataR1Q1, byte[] expectedDataR2Q2)
-            throws TransactionException, IOException, RollbackException {
+            throws IOException, RollbackException {
         Transaction readTx = tm.begin();
         LOG.info("Starting Read Tx {} for checking cell values", readTx.getTransactionId());
         Get getRow1 = new Get(row1).setMaxVersions(1);

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/83c252b4/hbase-client/src/test/java/org/apache/omid/transaction/TestTxMgrFailover.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/test/java/org/apache/omid/transaction/TestTxMgrFailover.java b/hbase-client/src/test/java/org/apache/omid/transaction/TestTxMgrFailover.java
index 5c64874..f37808d 100644
--- a/hbase-client/src/test/java/org/apache/omid/transaction/TestTxMgrFailover.java
+++ b/hbase-client/src/test/java/org/apache/omid/transaction/TestTxMgrFailover.java
@@ -204,7 +204,7 @@ public class TestTxMgrFailover extends OmidTestBase {
 
     }
 
-    private void executeTxAndCheckRollback() throws IOException, TransactionException, InterruptedException, java.util.concurrent.ExecutionException {
+    private void executeTxAndCheckRollback() throws IOException, InterruptedException, java.util.concurrent.ExecutionException {
         try (TTable txTable = new TTable(hbaseConf, TEST_TABLE)) {
             HBaseTransaction tx1 = (HBaseTransaction) tm.begin();
             assertEquals(tx1.getStartTimestamp(), TX1_ST);

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/83c252b4/timestamp-storage/src/main/java/org/apache/omid/timestamp/storage/ZKModule.java
----------------------------------------------------------------------
diff --git a/timestamp-storage/src/main/java/org/apache/omid/timestamp/storage/ZKModule.java b/timestamp-storage/src/main/java/org/apache/omid/timestamp/storage/ZKModule.java
index a6d959f..468511e 100644
--- a/timestamp-storage/src/main/java/org/apache/omid/timestamp/storage/ZKModule.java
+++ b/timestamp-storage/src/main/java/org/apache/omid/timestamp/storage/ZKModule.java
@@ -42,7 +42,7 @@ public class ZKModule extends AbstractModule {
 
     @Provides
     @Singleton
-    CuratorFramework provideInitializedZookeeperClient() throws IOException, InterruptedException {
+    CuratorFramework provideInitializedZookeeperClient() throws IOException {
         return ZKUtils.initZKClient(zkCluster, namespace, 10);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/83c252b4/transaction-client/src/main/java/org/apache/omid/transaction/TransactionException.java
----------------------------------------------------------------------
diff --git a/transaction-client/src/main/java/org/apache/omid/transaction/TransactionException.java b/transaction-client/src/main/java/org/apache/omid/transaction/TransactionException.java
index d843327..e549989 100644
--- a/transaction-client/src/main/java/org/apache/omid/transaction/TransactionException.java
+++ b/transaction-client/src/main/java/org/apache/omid/transaction/TransactionException.java
@@ -17,7 +17,9 @@
  */
 package org.apache.omid.transaction;
 
-public class TransactionException extends Exception {
+import java.io.IOException;
+
+public class TransactionException extends IOException {
 
     private static final long serialVersionUID = 7273525983622126275L;
 
@@ -28,4 +30,5 @@ public class TransactionException extends Exception {
     public TransactionException(String reason, Throwable e) {
         super(reason, e);
     }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/83c252b4/transaction-client/src/main/java/org/apache/omid/tso/client/TSOClient.java
----------------------------------------------------------------------
diff --git a/transaction-client/src/main/java/org/apache/omid/tso/client/TSOClient.java b/transaction-client/src/main/java/org/apache/omid/tso/client/TSOClient.java
index def591a..260df53 100644
--- a/transaction-client/src/main/java/org/apache/omid/tso/client/TSOClient.java
+++ b/transaction-client/src/main/java/org/apache/omid/tso/client/TSOClient.java
@@ -96,13 +96,12 @@ public class TSOClient implements TSOProtocol, NodeCacheListener {
     // Construction
     // ----------------------------------------------------------------------------------------------------------------
 
-    public static TSOClient newInstance(OmidClientConfiguration tsoClientConf)
-            throws IOException, InterruptedException {
+    public static TSOClient newInstance(OmidClientConfiguration tsoClientConf) throws IOException {
         return new TSOClient(tsoClientConf);
     }
 
     // Avoid instantiation
-    private TSOClient(OmidClientConfiguration omidConf) throws IOException, InterruptedException {
+    private TSOClient(OmidClientConfiguration omidConf) throws IOException {
 
         // Start client with Nb of active threads = 3 as maximum.
         int tsoExecutorThreads = omidConf.getExecutorThreads();


[13/50] [abbrv] incubator-omid git commit: [ci skip]prepare release omid-0.8.1.44

Posted by fp...@apache.org.
[ci skip]prepare release omid-0.8.1.44


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

Branch: refs/heads/master
Commit: eb8d63650202edb74edd15a5b8f32e4c72074eab
Parents: 36e3573
Author: Omid CI <om...@yahoo-inc.com>
Authored: Wed Apr 27 00:55:19 2016 +0000
Committer: Omid CI <om...@yahoo-inc.com>
Committed: Wed Apr 27 00:55:19 2016 +0000

----------------------------------------------------------------------
 benchmarks/pom.xml          | 2 +-
 codahale-metrics/pom.xml    | 2 +-
 commit-table/pom.xml        | 2 +-
 common/pom.xml              | 2 +-
 examples/pom.xml            | 2 +-
 hbase-client/pom.xml        | 2 +-
 hbase-commit-table/pom.xml  | 2 +-
 hbase-common/pom.xml        | 2 +-
 hbase-coprocessor/pom.xml   | 2 +-
 hbase-shims/hbase-0/pom.xml | 2 +-
 hbase-shims/hbase-1/pom.xml | 2 +-
 hbase-shims/pom.xml         | 2 +-
 hbase-tools/pom.xml         | 2 +-
 metrics/pom.xml             | 2 +-
 pom.xml                     | 4 ++--
 statemachine/pom.xml        | 2 +-
 timestamp-storage/pom.xml   | 2 +-
 transaction-client/pom.xml  | 2 +-
 tso-server/pom.xml          | 2 +-
 19 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/eb8d6365/benchmarks/pom.xml
----------------------------------------------------------------------
diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml
index dd4859e..ae74716 100644
--- a/benchmarks/pom.xml
+++ b/benchmarks/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.44-SNAPSHOT</version>
+        <version>0.8.1.44</version>
     </parent>
 
     <artifactId>benchmarks</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/eb8d6365/codahale-metrics/pom.xml
----------------------------------------------------------------------
diff --git a/codahale-metrics/pom.xml b/codahale-metrics/pom.xml
index 348ab6c..f318a39 100644
--- a/codahale-metrics/pom.xml
+++ b/codahale-metrics/pom.xml
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.44-SNAPSHOT</version>
+        <version>0.8.1.44</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/eb8d6365/commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/commit-table/pom.xml b/commit-table/pom.xml
index 9e6c74b..ede83b6 100644
--- a/commit-table/pom.xml
+++ b/commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.44-SNAPSHOT</version>
+        <version>0.8.1.44</version>
     </parent>
 
     <artifactId>commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/eb8d6365/common/pom.xml
----------------------------------------------------------------------
diff --git a/common/pom.xml b/common/pom.xml
index 32a1cd5..2ee78ce 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.44-SNAPSHOT</version>
+        <version>0.8.1.44</version>
     </parent>
 
     <artifactId>common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/eb8d6365/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 6586d59..273a0ac 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.44-SNAPSHOT</version>
+        <version>0.8.1.44</version>
     </parent>
 
     <artifactId>examples</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/eb8d6365/hbase-client/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml
index 69a9abd..d344d0b 100644
--- a/hbase-client/pom.xml
+++ b/hbase-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.44-SNAPSHOT</version>
+        <version>0.8.1.44</version>
     </parent>
 
     <artifactId>hbase-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/eb8d6365/hbase-commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-commit-table/pom.xml b/hbase-commit-table/pom.xml
index 94ba5f9..5b1250a 100644
--- a/hbase-commit-table/pom.xml
+++ b/hbase-commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.44-SNAPSHOT</version>
+        <version>0.8.1.44</version>
     </parent>
 
     <artifactId>hbase-commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/eb8d6365/hbase-common/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml
index faed30c..ecbb5d1 100644
--- a/hbase-common/pom.xml
+++ b/hbase-common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.44-SNAPSHOT</version>
+        <version>0.8.1.44</version>
     </parent>
 
     <artifactId>hbase-common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/eb8d6365/hbase-coprocessor/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-coprocessor/pom.xml b/hbase-coprocessor/pom.xml
index 3182229..0690ad2 100644
--- a/hbase-coprocessor/pom.xml
+++ b/hbase-coprocessor/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.44-SNAPSHOT</version>
+        <version>0.8.1.44</version>
     </parent>
 
     <artifactId>hbase-coprocessor</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/eb8d6365/hbase-shims/hbase-0/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-0/pom.xml b/hbase-shims/hbase-0/pom.xml
index c389516..878c51f 100644
--- a/hbase-shims/hbase-0/pom.xml
+++ b/hbase-shims/hbase-0/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.44-SNAPSHOT</version>
+        <version>0.8.1.44</version>
     </parent>
 
     <artifactId>hbase0-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/eb8d6365/hbase-shims/hbase-1/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-1/pom.xml b/hbase-shims/hbase-1/pom.xml
index ad92212..1e16622 100644
--- a/hbase-shims/hbase-1/pom.xml
+++ b/hbase-shims/hbase-1/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.44-SNAPSHOT</version>
+        <version>0.8.1.44</version>
     </parent>
 
     <artifactId>hbase1-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/eb8d6365/hbase-shims/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/pom.xml b/hbase-shims/pom.xml
index 8f847a3..c4572b1 100644
--- a/hbase-shims/pom.xml
+++ b/hbase-shims/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.44-SNAPSHOT</version>
+        <version>0.8.1.44</version>
     </parent>
 
     <artifactId>omid-shims-aggregator</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/eb8d6365/hbase-tools/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-tools/pom.xml b/hbase-tools/pom.xml
index 4a52974..6332a82 100644
--- a/hbase-tools/pom.xml
+++ b/hbase-tools/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.44-SNAPSHOT</version>
+        <version>0.8.1.44</version>
     </parent>
 
     <artifactId>hbase-tools</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/eb8d6365/metrics/pom.xml
----------------------------------------------------------------------
diff --git a/metrics/pom.xml b/metrics/pom.xml
index 4453fed..d5ef5d7 100644
--- a/metrics/pom.xml
+++ b/metrics/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.44-SNAPSHOT</version>
+        <version>0.8.1.44</version>
     </parent>
 
     <artifactId>metrics</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/eb8d6365/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index dafba98..cfb8091 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
     <artifactId>omid</artifactId>
     <packaging>pom</packaging>
     <!-- WARNING: do not update version manually, use mvn versions:set -->
-    <version>0.8.1.44-SNAPSHOT</version>
+    <version>0.8.1.44</version>
 
     <organization>
         <name>Apache Software Foundation</name>
@@ -105,7 +105,7 @@
         <connection>scm:git:git://github.com/yahoo/omid.git</connection>
         <developerConnection>scm:git:https://${GH_TOKEN}@github.com/yahoo/omid.git</developerConnection>
         <url>https://github.com/yahoo/omid</url>
-        <tag>master</tag>
+        <tag>omid-0.8.1.44</tag>
     </scm>
 
     <distributionManagement>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/eb8d6365/statemachine/pom.xml
----------------------------------------------------------------------
diff --git a/statemachine/pom.xml b/statemachine/pom.xml
index 45fdf7c..0bef5ab 100644
--- a/statemachine/pom.xml
+++ b/statemachine/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.44-SNAPSHOT</version>
+        <version>0.8.1.44</version>
     </parent>
 
     <name>State Machine</name>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/eb8d6365/timestamp-storage/pom.xml
----------------------------------------------------------------------
diff --git a/timestamp-storage/pom.xml b/timestamp-storage/pom.xml
index 56b29fc..a8ebe0b 100644
--- a/timestamp-storage/pom.xml
+++ b/timestamp-storage/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.44-SNAPSHOT</version>
+        <version>0.8.1.44</version>
     </parent>
 
     <artifactId>timestamp-storage</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/eb8d6365/transaction-client/pom.xml
----------------------------------------------------------------------
diff --git a/transaction-client/pom.xml b/transaction-client/pom.xml
index 606ec74..58b15ca 100644
--- a/transaction-client/pom.xml
+++ b/transaction-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.44-SNAPSHOT</version>
+        <version>0.8.1.44</version>
     </parent>
 
     <artifactId>transaction-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/eb8d6365/tso-server/pom.xml
----------------------------------------------------------------------
diff --git a/tso-server/pom.xml b/tso-server/pom.xml
index c6497ab..201759d 100644
--- a/tso-server/pom.xml
+++ b/tso-server/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.44-SNAPSHOT</version>
+        <version>0.8.1.44</version>
     </parent>
 
     <artifactId>tso-server</artifactId>


[10/50] [abbrv] incubator-omid git commit: Remove heuristic decission

Posted by fp...@apache.org.
Remove heuristic decission

When in HA mode and the TSO loses the mastership, the instance commit suicice

Change-Id: I63b550da440986f76a9c6243df3778a71f1459e6


Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/55e6644f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/55e6644f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/55e6644f

Branch: refs/heads/master
Commit: 55e6644fe2f102465c5e69751c9f72aac6fc8e9d
Parents: 811ec48
Author: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Authored: Mon Apr 25 13:49:05 2016 -0700
Committer: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Committed: Tue Apr 26 17:08:45 2016 -0700

----------------------------------------------------------------------
 common/src/main/proto/TSOProto.proto            |   1 -
 .../apache/omid/transaction/TestTSOModule.java  |   4 +-
 .../omid/transaction/TestTxMgrFailover.java     | 189 +------------------
 .../transaction/AbstractTransactionManager.java |   7 +-
 .../apache/omid/tso/client/NewTSOException.java |  27 ---
 .../org/apache/omid/tso/client/TSOClient.java   |   9 +-
 .../java/org/apache/omid/tso/MockPanicker.java  |   2 +-
 .../omid/tso/PersistenceProcessorImpl.java      |  48 ++---
 .../org/apache/omid/tso/ReplyProcessor.java     |   8 +-
 .../org/apache/omid/tso/ReplyProcessorImpl.java |  26 +--
 .../org/apache/omid/tso/RetryProcessorImpl.java |   2 +-
 .../omid/tso/RuntimeExceptionPanicker.java      |   2 +-
 .../apache/omid/tso/ProgrammableTSOServer.java  |  14 +-
 .../java/org/apache/omid/tso/TestBatch.java     |  39 +---
 .../org/apache/omid/tso/TestLeaseManager.java   |   5 +-
 .../omid/tso/TestPersistenceProcessor.java      | 112 ++++++++---
 .../org/apache/omid/tso/TestRetryProcessor.java |   2 +-
 ...stTSOClientRequestAndResponseBehaviours.java |   3 -
 .../client/TestTSOClientResponseHandling.java   |  17 +-
 19 files changed, 140 insertions(+), 377 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/55e6644f/common/src/main/proto/TSOProto.proto
----------------------------------------------------------------------
diff --git a/common/src/main/proto/TSOProto.proto b/common/src/main/proto/TSOProto.proto
index 43987d8..749beaa 100644
--- a/common/src/main/proto/TSOProto.proto
+++ b/common/src/main/proto/TSOProto.proto
@@ -49,7 +49,6 @@ message CommitResponse {
     optional bool aborted = 1;
     optional int64 startTimestamp = 2;
     optional int64 commitTimestamp = 3;
-    optional bool makeHeuristicDecision = 4 [default = false];
 }
 
 message Capabilities {

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/55e6644f/hbase-client/src/test/java/org/apache/omid/transaction/TestTSOModule.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/test/java/org/apache/omid/transaction/TestTSOModule.java b/hbase-client/src/test/java/org/apache/omid/transaction/TestTSOModule.java
index 4c38efa..2d4479a 100644
--- a/hbase-client/src/test/java/org/apache/omid/transaction/TestTSOModule.java
+++ b/hbase-client/src/test/java/org/apache/omid/transaction/TestTSOModule.java
@@ -26,7 +26,7 @@ import org.apache.omid.metrics.NullMetricsProvider;
 import org.apache.omid.timestamp.storage.HBaseTimestampStorage;
 import org.apache.omid.timestamp.storage.TimestampStorage;
 import org.apache.omid.tso.DisruptorModule;
-import org.apache.omid.tso.MockPanicker;
+import org.apache.omid.tso.RuntimeExceptionPanicker;
 import org.apache.omid.tso.NetworkInterfaceUtils;
 import org.apache.omid.tso.Panicker;
 import org.apache.omid.tso.PausableTimestampOracle;
@@ -64,7 +64,7 @@ class TestTSOModule extends AbstractModule {
         bind(CommitTable.class).to(HBaseCommitTable.class).in(Singleton.class);
         bind(TimestampStorage.class).to(HBaseTimestampStorage.class).in(Singleton.class);
         bind(TimestampOracle.class).to(PausableTimestampOracle.class).in(Singleton.class);
-        bind(Panicker.class).to(MockPanicker.class).in(Singleton.class);
+        bind(Panicker.class).to(RuntimeExceptionPanicker.class).in(Singleton.class);
 
         // Disruptor setup
         install(new DisruptorModule());

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/55e6644f/hbase-client/src/test/java/org/apache/omid/transaction/TestTxMgrFailover.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/test/java/org/apache/omid/transaction/TestTxMgrFailover.java b/hbase-client/src/test/java/org/apache/omid/transaction/TestTxMgrFailover.java
index f37808d..d507c24 100644
--- a/hbase-client/src/test/java/org/apache/omid/transaction/TestTxMgrFailover.java
+++ b/hbase-client/src/test/java/org/apache/omid/transaction/TestTxMgrFailover.java
@@ -17,15 +17,6 @@
  */
 package org.apache.omid.transaction;
 
-import com.google.common.base.Optional;
-import com.google.common.util.concurrent.SettableFuture;
-import org.apache.omid.TestUtils;
-import org.apache.omid.committable.CommitTable;
-import org.apache.omid.committable.CommitTable.CommitTimestamp;
-import org.apache.omid.committable.InMemoryCommitTable;
-import org.apache.omid.transaction.Transaction.Status;
-import org.apache.omid.tso.ProgrammableTSOServer;
-import org.apache.omid.tso.client.TSOClient;
 import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CellUtil;
 import org.apache.hadoop.hbase.KeyValue;
@@ -34,6 +25,12 @@ import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.omid.TestUtils;
+import org.apache.omid.committable.CommitTable;
+import org.apache.omid.committable.InMemoryCommitTable;
+import org.apache.omid.transaction.Transaction.Status;
+import org.apache.omid.tso.ProgrammableTSOServer;
+import org.apache.omid.tso.client.TSOClient;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.annotations.BeforeClass;
@@ -43,13 +40,9 @@ import org.testng.annotations.Test;
 import javax.annotation.Nullable;
 import java.io.IOException;
 
-import static org.apache.omid.committable.CommitTable.CommitTimestamp.Location.COMMIT_TABLE;
-import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.spy;
 import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertNull;
-import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.fail;
 
 @Test(groups = "sharedHBase")
@@ -71,7 +64,6 @@ public class TestTxMgrFailover extends OmidTestBase {
     private InMemoryCommitTable commitTable;
 
     private CommitTable.Client commitTableClient;
-    private CommitTable.Writer commitTableWriter;
 
     // Allows to prepare the required responses to client request operations
     private ProgrammableTSOServer tso;
@@ -93,7 +85,6 @@ public class TestTxMgrFailover extends OmidTestBase {
 
         commitTable = new InMemoryCommitTable(); // Use an in-memory commit table to speed up tests
         commitTableClient = spy(commitTable.getClient());
-        commitTableWriter = spy(commitTable.getWriter());
 
         HBaseOmidClientConfiguration hbaseOmidClientConf = new HBaseOmidClientConfiguration();
         hbaseOmidClientConf.setConnectionString(TSO_SERVER_HOST + ":" + TSO_SERVER_PORT);
@@ -140,174 +131,6 @@ public class TestTxMgrFailover extends OmidTestBase {
 
     }
 
-    @Test(timeOut = 30_000)
-    public void testClientReceivesSuccessfulCommitForNonInvalidatedTxCommittedByPreviousTSO() throws Exception {
-
-        // Program the TSO to return an ad-hoc Timestamp and an commit response with heuristic actions
-        tso.queueResponse(new ProgrammableTSOServer.TimestampResponse(TX1_ST));
-        tso.queueResponse(new ProgrammableTSOServer.CommitResponse(true, TX1_ST, TX1_CT));
-        // Simulate that tx1 was committed by writing to commit table
-        commitTableWriter.addCommittedTransaction(TX1_ST, TX1_CT);
-        commitTableWriter.flush();
-        assertEquals(commitTable.countElements(), 1, "Rows should be 1!");
-
-        try (TTable txTable = new TTable(hbaseConf, TEST_TABLE)) {
-            HBaseTransaction tx1 = (HBaseTransaction) tm.begin();
-            assertEquals(tx1.getStartTimestamp(), TX1_ST);
-            Put put = new Put(row1);
-            put.add(TEST_FAMILY.getBytes(), qualifier, data1);
-            txTable.put(tx1, put);
-            // Should succeed
-            tm.commit(tx1);
-
-            // Check transaction status
-            assertEquals(tx1.getStatus(), Status.COMMITTED);
-            assertEquals(tx1.getCommitTimestamp(), TX1_CT);
-            // Check the cleanup process did its job and the committed data is there
-            // Note that now we do not clean up the commit table when exercising the heuristic actions
-            assertEquals(commitTable.countElements(), 1,
-                    "Rows should be 1! We don't have to clean CT in this case");
-            Optional<CommitTimestamp>
-                    optionalCT =
-                    tm.commitTableClient.getCommitTimestamp(TX1_ST).get();
-            assertTrue(optionalCT.isPresent());
-            checkOperationSuccessOnCell(KeyValue.Type.Put, data1, TEST_TABLE.getBytes(), row1, TEST_FAMILY.getBytes(),
-                    qualifier);
-        }
-
-    }
-
-    @Test(timeOut = 30_000)
-    public void testClientReceivesRollbackExceptionForInvalidatedTxCommittedByPreviousTSO() throws Exception {
-
-        // Program the TSO to return an ad-hoc Timestamp and a commit response with heuristic actions
-        tso.queueResponse(new ProgrammableTSOServer.TimestampResponse(TX1_ST));
-        tso.queueResponse(new ProgrammableTSOServer.CommitResponse(true, TX1_ST, TX1_CT));
-        // Simulate that tx1 was committed by writing to commit table but was later invalidated
-        commitTableClient.tryInvalidateTransaction(TX1_ST);
-        assertEquals(commitTable.countElements(), 1, "Rows should be 1!");
-
-        executeTxAndCheckRollback();
-
-    }
-
-    @Test(timeOut = 30_000)
-    public void testClientReceivesNotificationOfANewTSOCanInvalidateTransaction() throws Exception {
-
-        // Program the TSO to return an ad-hoc Timestamp and a commit response with heuristic actions
-        tso.queueResponse(new ProgrammableTSOServer.TimestampResponse(TX1_ST));
-        tso.queueResponse(new ProgrammableTSOServer.CommitResponse(true, TX1_ST, TX1_CT));
-
-        assertEquals(commitTable.countElements(), 0, "Rows should be 0!");
-
-        executeTxAndCheckRollback();
-
-    }
-
-    private void executeTxAndCheckRollback() throws IOException, InterruptedException, java.util.concurrent.ExecutionException {
-        try (TTable txTable = new TTable(hbaseConf, TEST_TABLE)) {
-            HBaseTransaction tx1 = (HBaseTransaction) tm.begin();
-            assertEquals(tx1.getStartTimestamp(), TX1_ST);
-            Put put = new Put(row1);
-            put.add(TEST_FAMILY.getBytes(), qualifier, data1);
-            txTable.put(tx1, put);
-            try {
-                tm.commit(tx1);
-                fail();
-            } catch (RollbackException e) {
-                // Expected
-            }
-
-            // Check transaction status
-            assertEquals(tx1.getStatus(), Status.ROLLEDBACK);
-            assertEquals(tx1.getCommitTimestamp(), 0);
-            // Check the cleanup process did its job and the uncommitted data is NOT there
-            assertEquals(commitTable.countElements(), 1, "Rows should be 1! Dirty data should be there");
-            Optional<CommitTimestamp>
-                    optionalCT =
-                    tm.commitTableClient.getCommitTimestamp(TX1_ST).get();
-            assertTrue(optionalCT.isPresent());
-            assertFalse(optionalCT.get().isValid());
-            checkOperationSuccessOnCell(KeyValue.Type.Delete, null, TEST_TABLE.getBytes(), row1, TEST_FAMILY.getBytes(),
-                                        qualifier);
-        }
-    }
-
-    @Test(timeOut = 30_000)
-    public void testClientSuccessfullyCommitsWhenReceivingNotificationOfANewTSOAandCANTInvalidateTransaction()
-            throws Exception {
-
-        // Program the TSO to return an ad-hoc Timestamp and a commit response with heuristic actions
-        tso.queueResponse(new ProgrammableTSOServer.TimestampResponse(TX1_ST));
-        tso.queueResponse(new ProgrammableTSOServer.CommitResponse(true, TX1_ST, TX1_CT));
-
-        // Simulate that the original TSO was able to add the tx to commit table in the meantime
-        commitTableWriter.addCommittedTransaction(TX1_ST, TX1_CT);
-        commitTableWriter.flush();
-        assertEquals(commitTable.countElements(), 1, "Rows should be 1!");
-        SettableFuture<Optional<CommitTimestamp>> f1 = SettableFuture.create();
-        f1.set(Optional.<CommitTimestamp>absent());
-        SettableFuture<Optional<CommitTimestamp>> f2 = SettableFuture.create();
-        f2.set(Optional.of(new CommitTimestamp(COMMIT_TABLE, TX1_CT, true)));
-        doReturn(f1).doReturn(f2).when(commitTableClient).getCommitTimestamp(TX1_ST);
-
-        try (TTable txTable = new TTable(hbaseConf, TEST_TABLE)) {
-            HBaseTransaction tx1 = (HBaseTransaction) tm.begin();
-            assertEquals(tx1.getStartTimestamp(), TX1_ST);
-            Put put = new Put(row1);
-            put.add(TEST_FAMILY.getBytes(), qualifier, data1);
-            txTable.put(tx1, put);
-
-            tm.commit(tx1);
-
-            // Check transaction status
-            assertEquals(tx1.getStatus(), Status.COMMITTED);
-            assertEquals(tx1.getCommitTimestamp(), TX1_CT);
-            // Check the cleanup process did its job and the committed data is there
-            // Note that now we do not clean up the commit table when exercising the heuristic actions
-            assertEquals(commitTable.countElements(), 1,
-                    "Rows should be 1! We don't have to clean CT in this case");
-            checkOperationSuccessOnCell(KeyValue.Type.Put, data1, TEST_TABLE.getBytes(), row1, TEST_FAMILY.getBytes(),
-                    qualifier);
-        }
-
-    }
-
-    @Test(timeOut = 30_000)
-    public void testClientReceivesATransactionExceptionWhenReceivingNotificationOfANewTSOAndCANTInvalidateTransactionAndCTCheckIsUnsuccessful()
-            throws Exception {
-
-        // Program the TSO to return an ad-hoc Timestamp and a commit response with heuristic actions
-        tso.queueResponse(new ProgrammableTSOServer.TimestampResponse(TX1_ST));
-        tso.queueResponse(new ProgrammableTSOServer.CommitResponse(true, TX1_ST, TX1_CT));
-
-        // Simulate that the original TSO was able to add the tx to commit table in the meantime
-        SettableFuture<Boolean> f = SettableFuture.create();
-        f.set(false);
-        doReturn(f).when(commitTableClient).tryInvalidateTransaction(TX1_ST);
-
-        assertEquals(commitTable.countElements(), 0, "Rows should be 0!");
-
-        try (TTable txTable = new TTable(hbaseConf, TEST_TABLE)) {
-            HBaseTransaction tx1 = (HBaseTransaction) tm.begin();
-            assertEquals(tx1.getStartTimestamp(), TX1_ST);
-            Put put = new Put(row1);
-            put.add(TEST_FAMILY.getBytes(), qualifier, data1);
-            txTable.put(tx1, put);
-            try {
-                tm.commit(tx1);
-                fail();
-            } catch (TransactionException e) {
-                // Expected but is not good because we're not able to determine the tx outcome
-            }
-
-            // Check transaction status
-            assertEquals(tx1.getStatus(), Status.RUNNING);
-            assertEquals(tx1.getCommitTimestamp(), 0);
-        }
-
-    }
-
     // ----------------------------------------------------------------------------------------------------------------
     // Helper methods
     // ----------------------------------------------------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/55e6644f/transaction-client/src/main/java/org/apache/omid/transaction/AbstractTransactionManager.java
----------------------------------------------------------------------
diff --git a/transaction-client/src/main/java/org/apache/omid/transaction/AbstractTransactionManager.java b/transaction-client/src/main/java/org/apache/omid/transaction/AbstractTransactionManager.java
index 1157acb..4245917 100644
--- a/transaction-client/src/main/java/org/apache/omid/transaction/AbstractTransactionManager.java
+++ b/transaction-client/src/main/java/org/apache/omid/transaction/AbstractTransactionManager.java
@@ -29,7 +29,6 @@ import org.apache.omid.transaction.Transaction.Status;
 import org.apache.omid.tso.client.AbortException;
 import org.apache.omid.tso.client.CellId;
 import org.apache.omid.tso.client.ConnectionException;
-import org.apache.omid.tso.client.NewTSOException;
 import org.apache.omid.tso.client.ServiceUnavailableException;
 import org.apache.omid.tso.client.TSOClient;
 import org.slf4j.Logger;
@@ -417,11 +416,7 @@ public abstract class AbstractTransactionManager implements TransactionManager {
                 throw new RollbackException("Conflicts detected in tx writeset", e.getCause());
             }
 
-            if (e.getCause() instanceof ServiceUnavailableException
-                    ||
-                    e.getCause() instanceof NewTSOException
-                    ||
-                    e.getCause() instanceof ConnectionException) {
+            if (e.getCause() instanceof ServiceUnavailableException || e.getCause() instanceof ConnectionException) {
 
                 errorTxsCounter.inc();
                 try {

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/55e6644f/transaction-client/src/main/java/org/apache/omid/tso/client/NewTSOException.java
----------------------------------------------------------------------
diff --git a/transaction-client/src/main/java/org/apache/omid/tso/client/NewTSOException.java b/transaction-client/src/main/java/org/apache/omid/tso/client/NewTSOException.java
deleted file mode 100644
index 023257e..0000000
--- a/transaction-client/src/main/java/org/apache/omid/tso/client/NewTSOException.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.omid.tso.client;
-
-/**
- * Thrown when a new TSO has been detected
- */
-public class NewTSOException extends Exception {
-
-    private static final long serialVersionUID = -3250655858200759321L;
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/55e6644f/transaction-client/src/main/java/org/apache/omid/tso/client/TSOClient.java
----------------------------------------------------------------------
diff --git a/transaction-client/src/main/java/org/apache/omid/tso/client/TSOClient.java b/transaction-client/src/main/java/org/apache/omid/tso/client/TSOClient.java
index 260df53..67260fa 100644
--- a/transaction-client/src/main/java/org/apache/omid/tso/client/TSOClient.java
+++ b/transaction-client/src/main/java/org/apache/omid/tso/client/TSOClient.java
@@ -691,14 +691,7 @@ public class TSOClient implements TSOProtocol, NodeCacheListener {
                 if (resp.getCommitResponse().getAborted()) {
                     e.getRequest().error(new AbortException());
                 } else {
-                    // Check if the commit response received implies heuristic
-                    // actions during commit (because there's a new TSO master
-                    // replica) and inform the caller (e.g. the TxMgr) about it
-                    if (resp.getCommitResponse().getMakeHeuristicDecision()) {
-                        e.getRequest().error(new NewTSOException());
-                    } else {
-                        e.getRequest().success(resp.getCommitResponse().getCommitTimestamp());
-                    }
+                    e.getRequest().success(resp.getCommitResponse().getCommitTimestamp());
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/55e6644f/tso-server/src/main/java/org/apache/omid/tso/MockPanicker.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/MockPanicker.java b/tso-server/src/main/java/org/apache/omid/tso/MockPanicker.java
index fdf8476..c5278e8 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/MockPanicker.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/MockPanicker.java
@@ -26,7 +26,7 @@ public class MockPanicker implements Panicker {
 
     @Override
     public void panic(String reason) {
-        LOG.error("PANICKING: {}", reason);
+        panic(reason, new Throwable("Mock Panicker"));
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/55e6644f/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java
index ca0862f..bc1d43c 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/PersistenceProcessorImpl.java
@@ -202,36 +202,29 @@ class PersistenceProcessorImpl
     }
 
     synchronized private void flush() {
-        lastFlush.set(System.nanoTime());
 
-        boolean areWeStillMaster = true;
-        if (!leaseManager.stillInLeasePeriod()) {
-            // The master TSO replica has changed, so we must inform the
-            // clients about it when sending the replies and avoid flushing
-            // the current batch of TXs
-            areWeStillMaster = false;
-            // We need also to clear the data in the buffer
-            writer.clearWriteBuffer();
-            LOG.trace("Replica {} lost mastership before flushing data", tsoHostAndPort);
-        } else {
+        if (batch.getNumEvents() > 0) {
+            lastFlush.set(System.nanoTime());
+            commitSuicideIfNotMaster();
             try {
                 writer.flush();
+                batchSizeHistogram.update(batch.getNumEvents());
             } catch (IOException e) {
-                panicker.panic("Error persisting commit batch", e.getCause());
-            }
-            batchSizeHistogram.update(batch.getNumEvents());
-            if (!leaseManager.stillInLeasePeriod()) {
-                // If after flushing this TSO server is not the master
-                // replica we need inform the client about it
-                areWeStillMaster = false;
-                LOG.warn("Replica {} lost mastership after flushing data", tsoHostAndPort);
+                panicker.panic("Error persisting commit batch", e);
             }
+            commitSuicideIfNotMaster(); // TODO Here, we can return the client responses before committing suicide
+            flushTimer.update((System.nanoTime() - lastFlush.get()));
+            batch.sendRepliesAndReset(reply, retryProc);
         }
-        flushTimer.update((System.nanoTime() - lastFlush.get()));
-        batch.sendRepliesAndReset(reply, retryProc, areWeStillMaster);
 
     }
 
+    private void commitSuicideIfNotMaster() {
+        if (!leaseManager.stillInLeasePeriod()) {
+            panicker.panic("Replica " + tsoHostAndPort + " lost mastership whilst flushing data. Committing suicide");
+        }
+    }
+
     @Override
     public void persistCommit(long startTimestamp, long commitTimestamp, Channel c, MonitoringContext monCtx) {
         long seq = persistRing.next();
@@ -273,6 +266,7 @@ class PersistenceProcessorImpl
 
         Batch(int maxBatchSize) {
             assert (maxBatchSize > 0);
+            LOG.info("Creating the Batch with {} elements", maxBatchSize);
             this.maxBatchSize = maxBatchSize;
             events = new PersistEvent[maxBatchSize];
             numEvents = 0;
@@ -319,7 +313,7 @@ class PersistenceProcessorImpl
             PersistEvent.makePersistTimestamp(e, startTimestamp, c, monCtx);
         }
 
-        void sendRepliesAndReset(ReplyProcessor reply, RetryProcessor retryProc, boolean isTSOInstanceMaster) {
+        void sendRepliesAndReset(ReplyProcessor reply, RetryProcessor retryProc) {
             for (int i = 0; i < numEvents; i++) {
                 PersistEvent e = events[i];
                 switch (e.getType()) {
@@ -329,14 +323,8 @@ class PersistenceProcessorImpl
                         break;
                     case COMMIT:
                         e.getMonCtx().timerStop("commitPersistProcessor");
-                        if (isTSOInstanceMaster) {
-                            reply.commitResponse(false, e.getStartTimestamp(), e.getCommitTimestamp(), e.getChannel(),
-                                                 e.getMonCtx());
-                        } else {
-                            // The client will need to perform heuristic actions to determine the output
-                            reply.commitResponse(true, e.getStartTimestamp(), e.getCommitTimestamp(), e.getChannel(),
-                                                 e.getMonCtx());
-                        }
+
+                        reply.commitResponse(e.getStartTimestamp(), e.getCommitTimestamp(), e.getChannel(), e.getMonCtx());
                         break;
                     case ABORT:
                         if (e.isRetry()) {

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/55e6644f/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessor.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessor.java b/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessor.java
index c2de5f2..6aa6faa 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessor.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessor.java
@@ -21,12 +21,8 @@ import org.jboss.netty.channel.Channel;
 
 interface ReplyProcessor {
     /**
-     * Informs the client about the outcome of the Tx it was trying to
-     * commit. If the heuristic decision flat is enabled, the client
-     * will need to do additional actions for learning the final outcome.
+     * Informs the client about the outcome of the Tx it was trying to commit.
      *
-     * @param makeHeuristicDecision
-     *            informs about whether heuristic actions are needed or not
      * @param startTimestamp
      *            the start timestamp of the transaction (a.k.a. tx id)
      * @param commitTimestamp
@@ -34,7 +30,7 @@ interface ReplyProcessor {
      * @param channel
      *            the communication channed with the client
      */
-    void commitResponse(boolean makeHeuristicDecision, long startTimestamp, long commitTimestamp, Channel channel, MonitoringContext monCtx);
+    void commitResponse(long startTimestamp, long commitTimestamp, Channel channel, MonitoringContext monCtx);
 
     void abortResponse(long startTimestamp, Channel c, MonitoringContext monCtx);
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/55e6644f/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java b/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java
index e6899cc..d87f9a7 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/ReplyProcessorImpl.java
@@ -72,12 +72,7 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyEvent>,
                 case COMMIT:
                     name = "commitReplyProcessor";
                     event.getMonCtx().timerStart(name);
-                    handleCommitResponse(false, event.getStartTimestamp(), event.getCommitTimestamp(), event.getChannel());
-                    break;
-                case HEURISTIC_COMMIT:
-                    name = "commitReplyProcessor";
-                    event.getMonCtx().timerStart(name);
-                    handleCommitResponse(true, event.getStartTimestamp(), event.getCommitTimestamp(), event.getChannel());
+                    handleCommitResponse(event.getStartTimestamp(), event.getCommitTimestamp(), event.getChannel());
                     break;
                 case ABORT:
                     name = "abortReplyProcessor";
@@ -102,10 +97,10 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyEvent>,
     }
 
     @Override
-    public void commitResponse(boolean makeHeuristicDecision, long startTimestamp, long commitTimestamp, Channel c, MonitoringContext monCtx) {
+    public void commitResponse(long startTimestamp, long commitTimestamp, Channel c, MonitoringContext monCtx) {
         long seq = replyRing.next();
         ReplyEvent e = replyRing.get(seq);
-        ReplyEvent.makeCommitResponse(makeHeuristicDecision, e, startTimestamp, commitTimestamp, c, monCtx);
+        ReplyEvent.makeCommitResponse(e, startTimestamp, commitTimestamp, c, monCtx);
         replyRing.publish(seq);
     }
 
@@ -125,12 +120,9 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyEvent>,
         replyRing.publish(seq);
     }
 
-    void handleCommitResponse(boolean makeHeuristicDecision, long startTimestamp, long commitTimestamp, Channel c) {
+    void handleCommitResponse(long startTimestamp, long commitTimestamp, Channel c) {
         TSOProto.Response.Builder builder = TSOProto.Response.newBuilder();
         TSOProto.CommitResponse.Builder commitBuilder = TSOProto.CommitResponse.newBuilder();
-        if (makeHeuristicDecision) { // If the commit is ambiguous is due to a new master TSO
-            commitBuilder.setMakeHeuristicDecision(true);
-        }
         commitBuilder.setAborted(false)
                 .setStartTimestamp(startTimestamp)
                 .setCommitTimestamp(commitTimestamp);
@@ -164,7 +156,7 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyEvent>,
     public final static class ReplyEvent {
 
         enum Type {
-            TIMESTAMP, COMMIT, HEURISTIC_COMMIT, ABORT
+            TIMESTAMP, COMMIT, ABORT
         }
 
         private Type type = null;
@@ -201,14 +193,10 @@ class ReplyProcessorImpl implements EventHandler<ReplyProcessorImpl.ReplyEvent>,
             e.monCtx = monCtx;
         }
 
-        static void makeCommitResponse(boolean makeHeuristicDecision, ReplyEvent e, long startTimestamp,
+        static void makeCommitResponse(ReplyEvent e, long startTimestamp,
                                        long commitTimestamp, Channel c, MonitoringContext monCtx) {
 
-            if (makeHeuristicDecision) {
-                e.type = Type.HEURISTIC_COMMIT;
-            } else {
-                e.type = Type.COMMIT;
-            }
+            e.type = Type.COMMIT;
             e.startTimestamp = startTimestamp;
             e.commitTimestamp = commitTimestamp;
             e.channel = c;

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/55e6644f/tso-server/src/main/java/org/apache/omid/tso/RetryProcessorImpl.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/RetryProcessorImpl.java b/tso-server/src/main/java/org/apache/omid/tso/RetryProcessorImpl.java
index 96d6570..7503d8a 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/RetryProcessorImpl.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/RetryProcessorImpl.java
@@ -110,7 +110,7 @@ class RetryProcessorImpl implements EventHandler<RetryProcessorImpl.RetryEvent>,
             if (commitTimestamp.isPresent()) {
                 if (commitTimestamp.get().isValid()) {
                     LOG.trace("Valid commit TS found in Commit Table");
-                    replyProc.commitResponse(false, startTimestamp, commitTimestamp.get().getValue(),
+                    replyProc.commitResponse(startTimestamp, commitTimestamp.get().getValue(),
                             event.getChannel(), event.getMonCtx());
                 } else {
                     LOG.trace("Invalid commit TS found in Commit Table");

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/55e6644f/tso-server/src/main/java/org/apache/omid/tso/RuntimeExceptionPanicker.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/RuntimeExceptionPanicker.java b/tso-server/src/main/java/org/apache/omid/tso/RuntimeExceptionPanicker.java
index 657f0d2..9f4be88 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/RuntimeExceptionPanicker.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/RuntimeExceptionPanicker.java
@@ -17,7 +17,7 @@
  */
 package org.apache.omid.tso;
 
-class RuntimeExceptionPanicker implements Panicker {
+public class RuntimeExceptionPanicker implements Panicker {
 
     @Override
     public void panic(String reason) {

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/55e6644f/tso-server/src/test/java/org/apache/omid/tso/ProgrammableTSOServer.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/ProgrammableTSOServer.java b/tso-server/src/test/java/org/apache/omid/tso/ProgrammableTSOServer.java
index 47f0e3e..e973494 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/ProgrammableTSOServer.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/ProgrammableTSOServer.java
@@ -137,10 +137,7 @@ public class ProgrammableTSOServer extends SimpleChannelHandler {
                 switch (resp.type) {
                     case COMMIT:
                         CommitResponse commitResp = (CommitResponse) resp;
-                        sendCommitResponse(commitResp.heuristicDecissionRequired,
-                                commitResp.startTS,
-                                commitResp.commitTS,
-                                channel);
+                        sendCommitResponse(commitResp.startTS, commitResp.commitTS, channel);
                         break;
                     case ABORT:
                         AbortResponse abortResp = (AbortResponse) resp;
@@ -198,12 +195,9 @@ public class ProgrammableTSOServer extends SimpleChannelHandler {
         c.write(builder.build());
     }
 
-    private void sendCommitResponse(boolean makeHeuristicDecission, long startTimestamp, long commitTimestamp, Channel c) {
+    private void sendCommitResponse(long startTimestamp, long commitTimestamp, Channel c) {
         TSOProto.Response.Builder builder = TSOProto.Response.newBuilder();
         TSOProto.CommitResponse.Builder commitBuilder = TSOProto.CommitResponse.newBuilder();
-        if (makeHeuristicDecission) { // If the commit is ambiguous is due to a new master TSO
-            commitBuilder.setMakeHeuristicDecision(true);
-        }
         commitBuilder.setAborted(false).setStartTimestamp(startTimestamp).setCommitTimestamp(commitTimestamp);
         builder.setCommitResponse(commitBuilder.build());
         c.write(builder.build());
@@ -246,13 +240,11 @@ public class ProgrammableTSOServer extends SimpleChannelHandler {
 
     public static class CommitResponse extends Response {
 
-        final boolean heuristicDecissionRequired;
         final long startTS;
         final long commitTS;
 
-        public CommitResponse(boolean heuristicDecissionRequired, long startTS, long commitTS) {
+        public CommitResponse(long startTS, long commitTS) {
             super(ResponseType.COMMIT);
-            this.heuristicDecissionRequired = heuristicDecissionRequired;
             this.startTS = startTS;
             this.commitTS = commitTS;
         }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/55e6644f/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java b/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
index 4b012fe..0fe4a22 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
@@ -110,49 +110,14 @@ public class TestBatch {
         }
 
         // Test that sending replies empties the batch
-        final boolean MASTER_INSTANCE = true;
-        final boolean SHOULD_MAKE_HEURISTIC_DECISSION = true;
-        batch.sendRepliesAndReset(replyProcessor, retryProcessor, MASTER_INSTANCE);
+        batch.sendRepliesAndReset(replyProcessor, retryProcessor);
         verify(replyProcessor, timeout(100).times(BATCH_SIZE / 2))
                 .timestampResponse(anyLong(), any(Channel.class), any(MonitoringContext.class));
         verify(replyProcessor, timeout(100).times(BATCH_SIZE / 2))
-                .commitResponse(eq(!SHOULD_MAKE_HEURISTIC_DECISSION), anyLong(), anyLong(),
-                        any(Channel.class), any(MonitoringContext.class));
+                .commitResponse(anyLong(), anyLong(), any(Channel.class), any(MonitoringContext.class));
         AssertJUnit.assertFalse("Batch shouldn't be full", batch.isFull());
         AssertJUnit.assertEquals("Num events should be 0", 0, batch.getNumEvents());
 
     }
 
-    @Test
-    public void testBatchFunctionalityWhenMastershipIsLost() {
-        Channel channel = Mockito.mock(Channel.class);
-
-        // Fill the batch with events till full
-        for (int i = 0; i < BATCH_SIZE; i++) {
-            if (i % 2 == 0) {
-                MonitoringContext monCtx = new MonitoringContext(metrics);
-                monCtx.timerStart("timestampPersistProcessor");
-                batch.addTimestamp(i, channel, monCtx);
-            } else {
-                MonitoringContext monCtx = new MonitoringContext(metrics);
-                monCtx.timerStart("commitPersistProcessor");
-                batch.addCommit(i, i + 1, channel, monCtx);
-            }
-        }
-
-        // Test that sending replies empties the batch also when the replica
-        // is NOT master and calls the ambiguousCommitResponse() method on the
-        // reply processor
-        final boolean MASTER_INSTANCE = true;
-        final boolean SHOULD_MAKE_HEURISTIC_DECISSION = true;
-        batch.sendRepliesAndReset(replyProcessor, retryProcessor, !MASTER_INSTANCE);
-        verify(replyProcessor, timeout(100).times(BATCH_SIZE / 2))
-                .timestampResponse(anyLong(), any(Channel.class), any(MonitoringContext.class));
-        verify(replyProcessor, timeout(100).times(BATCH_SIZE / 2))
-                .commitResponse(eq(SHOULD_MAKE_HEURISTIC_DECISSION), anyLong(), anyLong(), any(Channel.class), any(
-                        MonitoringContext.class));
-        assertFalse(batch.isFull(), "Batch shouldn't be full");
-        assertEquals(batch.getNumEvents(), 0, "Num events should be 0");
-
-    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/55e6644f/tso-server/src/test/java/org/apache/omid/tso/TestLeaseManager.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestLeaseManager.java b/tso-server/src/test/java/org/apache/omid/tso/TestLeaseManager.java
index 60cefca..62c3435 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestLeaseManager.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestLeaseManager.java
@@ -40,6 +40,7 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.reset;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.timeout;
+import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 import static org.testng.Assert.assertEquals;
@@ -359,7 +360,7 @@ public class TestLeaseManager {
         Thread.sleep(TEST_LEASE_PERIOD_IN_MS * 2);
 
         ArgumentCaptor<IllegalArgumentException> trowableIAE = ArgumentCaptor.forClass(IllegalArgumentException.class);
-        verify(panicker).panic(anyString(), trowableIAE.capture());
+        verify(panicker, times(2)).panic(anyString(), trowableIAE.capture());
         assertTrue(trowableIAE.getValue() instanceof IllegalArgumentException);
         assertTrue(trowableIAE.getValue().getMessage().contains("Incorrect TSO Info found"));
 
@@ -378,7 +379,7 @@ public class TestLeaseManager {
 
         ArgumentCaptor<LeaseManagement.LeaseManagementException> trowableLME =
                 ArgumentCaptor.forClass(LeaseManagement.LeaseManagementException.class);
-        verify(panicker).panic(anyString(), trowableLME.capture());
+        verify(panicker, times(2)).panic(anyString(), trowableLME.capture());
         assertTrue(trowableLME.getValue() instanceof LeaseManagement.LeaseManagementException);
         assertTrue(trowableLME.getValue().getMessage().contains("Another TSO replica was found"));
     }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/55e6644f/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java b/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java
index 120d748..73d10dd 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java
@@ -18,9 +18,11 @@
 package org.apache.omid.tso;
 
 import org.apache.omid.committable.CommitTable;
+import org.apache.omid.committable.InMemoryCommitTable;
 import org.apache.omid.metrics.MetricsRegistry;
 import org.apache.omid.metrics.NullMetricsProvider;
 import org.apache.omid.tso.PersistenceProcessorImpl.Batch;
+import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
@@ -33,14 +35,17 @@ import java.io.IOException;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyLong;
 import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.eq;
+import static org.mockito.Matchers.isA;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.reset;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.timeout;
 import static org.mockito.Mockito.verify;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
 
 @SuppressWarnings({"UnusedDeclaration"})
 public class TestPersistenceProcessor {
@@ -100,6 +105,9 @@ public class TestPersistenceProcessor {
 
         TSOServerConfig tsoServerConfig = new TSOServerConfig();
         tsoServerConfig.setBatchPersistTimeoutInMs(100);
+
+        Batch batch = spy(new Batch(1));
+
         // Component under test
         PersistenceProcessor proc = new PersistenceProcessorImpl(tsoServerConfig,
                                                                  metrics,
@@ -114,58 +122,118 @@ public class TestPersistenceProcessor {
         // The non-ha lease manager always return true for
         // stillInLeasePeriod(), so verify the batch sends replies as master
         MonitoringContext monCtx = new MonitoringContext(metrics);
-        proc.persistCommit(1, 2, null, monCtx);
+        proc.persistCommit(0, 1, null, monCtx);
         verify(leaseManager, timeout(1000).times(2)).stillInLeasePeriod();
-        verify(batch, timeout(1000).times(2)).sendRepliesAndReset(any(ReplyProcessor.class),
-                                                                  any(RetryProcessor.class),
-                                                                  eq(true));
+        verify(batch, timeout(1000).times(1)).sendRepliesAndReset(any(ReplyProcessor.class),
+                                                                  any(RetryProcessor.class));
     }
 
     @Test
     public void testCommitPersistenceWithHALeaseManager() throws Exception {
 
-        // Init a HA lease manager
-        LeaseManager leaseManager = mock(LeaseManager.class);
-
         TSOServerConfig tsoServerConfig = new TSOServerConfig();
         tsoServerConfig.setBatchPersistTimeoutInMs(100);
+
+        MonitoringContext monCtx = new MonitoringContext(metrics);
+
+        // Test 1: Configure the lease manager to always return true for stillInLeasePeriod, so verify the batch sends
+        // replies as master
+
+        // Init stuff
+        ArgumentCaptor<String> msg = ArgumentCaptor.forClass(String.class);
+        Panicker panicker = spy(new RuntimeExceptionPanicker());
+        LeaseManager leaseManager = mock(LeaseManager.class);
+        Batch batch = spy(new Batch(1));
         // Component under test
         PersistenceProcessor proc = new PersistenceProcessorImpl(tsoServerConfig,
                                                                  metrics,
                                                                  "localhost:1234",
                                                                  batch,
                                                                  leaseManager,
-                                                                 commitTable,
+                                                                 new InMemoryCommitTable(),
                                                                  replyProcessor,
                                                                  retryProcessor,
                                                                  panicker);
 
-        // Configure the lease manager to always return true for
-        // stillInLeasePeriod, so verify the batch sends replies as master
         doReturn(true).when(leaseManager).stillInLeasePeriod();
-        MonitoringContext monCtx = new MonitoringContext(metrics);
         proc.persistCommit(1, 2, null, monCtx);
         verify(leaseManager, timeout(1000).times(2)).stillInLeasePeriod();
-        verify(batch).sendRepliesAndReset(any(ReplyProcessor.class), any(RetryProcessor.class), eq(true));
+        verify(batch).sendRepliesAndReset(any(ReplyProcessor.class), any(RetryProcessor.class));
+        verify(panicker, never()).panic(msg.capture(), any(Throwable.class));
 
-        // Configure the lease manager to always return true first and false
-        // later for stillInLeasePeriod, so verify the batch sends replies as
-        // non-master
+        // Test 2: Configure the lease manager to return true first and false later for stillInLeasePeriod, so verify
+        // the batch sends replies as non-master
+
+        // Reset stuff
         reset(leaseManager);
-        reset(batch);
+        batch = spy(new Batch(1));
+        msg = ArgumentCaptor.forClass(String.class);
+        panicker = spy(new RuntimeExceptionPanicker());
+        // Component under test
+        proc = new PersistenceProcessorImpl(tsoServerConfig,
+                                            metrics,
+                                            "localhost:1234",
+                                            batch,
+                                            leaseManager,
+                                            new InMemoryCommitTable(),
+                                            replyProcessor,
+                                            retryProcessor,
+                                            panicker);
         doReturn(true).doReturn(false).when(leaseManager).stillInLeasePeriod();
         proc.persistCommit(1, 2, null, monCtx);
         verify(leaseManager, timeout(1000).times(2)).stillInLeasePeriod();
-        verify(batch).sendRepliesAndReset(any(ReplyProcessor.class), any(RetryProcessor.class), eq(false));
+        verify(batch, never()).sendRepliesAndReset(any(ReplyProcessor.class), any(RetryProcessor.class));
+        verify(panicker).panic(msg.capture());
+        assertTrue(msg.getValue().contains("Committing suicide"));
+
+        // Test 3:  Configure the lease manager to always return false for stillInLeasePeriod, so verify the batch
+        // sends replies as non-master
 
-        // Configure the lease manager to always return false for
-        // stillInLeasePeriod, so verify the batch sends replies as non-master
+        // Reset stuff
         reset(leaseManager);
-        reset(batch);
+        batch = spy(new Batch(1));
+        msg = ArgumentCaptor.forClass(String.class);
+        panicker = spy(new RuntimeExceptionPanicker());
+        // Component under test
+        proc = new PersistenceProcessorImpl(tsoServerConfig,
+                                            metrics,
+                                            "localhost:1234",
+                                            batch,
+                                            leaseManager,
+                                            commitTable,
+                                            replyProcessor,
+                                            retryProcessor,
+                                            panicker);
         doReturn(false).when(leaseManager).stillInLeasePeriod();
         proc.persistCommit(1, 2, null, monCtx);
         verify(leaseManager, timeout(1000).times(1)).stillInLeasePeriod();
-        verify(batch).sendRepliesAndReset(any(ReplyProcessor.class), any(RetryProcessor.class), eq(false));
+        verify(batch, never()).sendRepliesAndReset(any(ReplyProcessor.class), any(RetryProcessor.class));
+        verify(panicker).panic(msg.capture());
+        assertTrue(msg.getValue().contains("Committing suicide"));
+
+        // Test 4: Test when flushing data fails to the database
+
+        // Reset stuff
+        reset(leaseManager);
+        batch = spy(new Batch(1));
+        msg = ArgumentCaptor.forClass(String.class);
+        panicker = spy(new RuntimeExceptionPanicker());
+        // Component under test
+        proc = new PersistenceProcessorImpl(tsoServerConfig,
+                                            metrics,
+                                            "localhost:1234",
+                                            batch,
+                                            leaseManager,
+                                            commitTable, // Commit table writer will fail and launch a panic
+                                            replyProcessor,
+                                            retryProcessor,
+                                            panicker);
+        doReturn(true).when(leaseManager).stillInLeasePeriod();
+        proc.persistCommit(1, 2, null, monCtx);
+        verify(leaseManager, timeout(1000).times(1)).stillInLeasePeriod();
+        verify(batch, never()).sendRepliesAndReset(any(ReplyProcessor.class), any(RetryProcessor.class));
+        verify(panicker).panic(msg.capture(), isA(IOException.class));
+        assertEquals(msg.getValue(), "Error persisting commit batch");
 
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/55e6644f/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java b/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java
index 5cc629e..d971e6c 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java
@@ -88,7 +88,7 @@ public class TestRetryProcessor {
         retryProc.disambiguateRetryRequestHeuristically(ST_TX_1, channel, new MonitoringContext(metrics));
         ArgumentCaptor<Long> secondTScapture = ArgumentCaptor.forClass(Long.class);
         verify(replyProc, timeout(100).times(1))
-                .commitResponse(eq(false), firstTScapture.capture(), secondTScapture.capture(), any(Channel.class), any(MonitoringContext.class));
+                .commitResponse(firstTScapture.capture(), secondTScapture.capture(), any(Channel.class), any(MonitoringContext.class));
 
         startTS = firstTScapture.getValue();
         long commitTS = secondTScapture.getValue();

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/55e6644f/tso-server/src/test/java/org/apache/omid/tso/client/TestTSOClientRequestAndResponseBehaviours.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/client/TestTSOClientRequestAndResponseBehaviours.java b/tso-server/src/test/java/org/apache/omid/tso/client/TestTSOClientRequestAndResponseBehaviours.java
index b80a0a3..2167fa7 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/client/TestTSOClientRequestAndResponseBehaviours.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/client/TestTSOClientRequestAndResponseBehaviours.java
@@ -357,7 +357,6 @@ public class TestTSOClientRequestAndResponseBehaviours {
         clientOneShot.makeRequest(createRetryCommitRequest(tx1ST));
         TSOProto.Response response = clientOneShot.makeRequest(createRetryCommitRequest(tx1ST));
         assertFalse(response.getCommitResponse().getAborted(), "Transaction should be committed");
-        assertFalse(response.getCommitResponse().getMakeHeuristicDecision());
         assertEquals(response.getCommitResponse().getCommitTimestamp(), tx1ST + 1);
     }
 
@@ -374,7 +373,6 @@ public class TestTSOClientRequestAndResponseBehaviours {
         clientOneShot.makeRequest(createRetryCommitRequest(tx1ST));
         TSOProto.Response response = clientOneShot.makeRequest(createRetryCommitRequest(tx1ST));
         assertTrue(response.getCommitResponse().getAborted(), "Transaction should be aborted");
-        assertFalse(response.getCommitResponse().getMakeHeuristicDecision());
         assertEquals(response.getCommitResponse().getCommitTimestamp(), 0);
     }
 
@@ -393,7 +391,6 @@ public class TestTSOClientRequestAndResponseBehaviours {
 
         TSOProto.Response response = clientOneShot.makeRequest(createRetryCommitRequest(tx1ST));
         assertTrue(response.getCommitResponse().getAborted(), "Transaction should abort");
-        assertFalse(response.getCommitResponse().getMakeHeuristicDecision());
         assertEquals(response.getCommitResponse().getCommitTimestamp(), 0);
     }
     // ----------------------------------------------------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/55e6644f/tso-server/src/test/java/org/apache/omid/tso/client/TestTSOClientResponseHandling.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/client/TestTSOClientResponseHandling.java b/tso-server/src/test/java/org/apache/omid/tso/client/TestTSOClientResponseHandling.java
index d485772..2f6463d 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/client/TestTSOClientResponseHandling.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/client/TestTSOClientResponseHandling.java
@@ -87,25 +87,10 @@ public class TestTSOClientResponseHandling {
         // side returns a commit timestamp
 
         // Program the TSO to return an Commit response (with no required heuristic actions)
-        tsoServer.queueResponse(new CommitResponse(false, START_TS, COMMIT_TS));
+        tsoServer.queueResponse(new CommitResponse(START_TS, COMMIT_TS));
 
         long commitTS = tsoClient.commit(START_TS, Collections.<CellId>emptySet()).get();
         assertEquals(commitTS, COMMIT_TS);
     }
 
-    @Test
-    public void testCommitRequestReceivingAHeuristicResponse() throws Exception {
-        // test commit request which needs heuristic actions from the client
-        // throws an execution exception with a NewTSOException as a cause
-
-        // Program the TSO to return an Commit response requiring heuristic actions
-        tsoServer.queueResponse(new CommitResponse(true, START_TS, COMMIT_TS));
-        try {
-            tsoClient.commit(START_TS, Collections.<CellId>emptySet()).get();
-        } catch (ExecutionException ee) {
-            assertEquals(ee.getCause().getClass(), NewTSOException.class);
-        }
-
-    }
-
 }


[30/50] [abbrv] incubator-omid git commit: Fix major error: Inject a single instance of BatchPool

Posted by fp...@apache.org.
Fix major error: Inject a single instance of BatchPool

Different object instances of BatchPool were created and passed to Persistence, Reply
and Retry Processors as no BatchPool was bind as a singleton in TSOModule.java

Change-Id: I50e435c19adaeac2444a7398c0cd26986e19c323


Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/3e5b6741
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/3e5b6741
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/3e5b6741

Branch: refs/heads/master
Commit: 3e5b6741a26d681f6696df36c64c8de1e762f49e
Parents: f6220a8
Author: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Authored: Tue May 3 14:57:28 2016 -0700
Committer: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Committed: Tue May 3 16:03:28 2016 -0700

----------------------------------------------------------------------
 .../src/test/java/org/apache/omid/transaction/TestTSOModule.java  | 3 +++
 tso-server/src/main/java/org/apache/omid/tso/BatchPool.java       | 2 +-
 tso-server/src/main/java/org/apache/omid/tso/TSOModule.java       | 1 +
 tso-server/src/test/java/org/apache/omid/tso/TSOMockModule.java   | 1 +
 4 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/3e5b6741/hbase-client/src/test/java/org/apache/omid/transaction/TestTSOModule.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/test/java/org/apache/omid/transaction/TestTSOModule.java b/hbase-client/src/test/java/org/apache/omid/transaction/TestTSOModule.java
index a8589bf..5d84b8b 100644
--- a/hbase-client/src/test/java/org/apache/omid/transaction/TestTSOModule.java
+++ b/hbase-client/src/test/java/org/apache/omid/transaction/TestTSOModule.java
@@ -26,6 +26,7 @@ import org.apache.omid.metrics.MetricsRegistry;
 import org.apache.omid.metrics.NullMetricsProvider;
 import org.apache.omid.timestamp.storage.HBaseTimestampStorage;
 import org.apache.omid.timestamp.storage.TimestampStorage;
+import org.apache.omid.tso.BatchPool;
 import org.apache.omid.tso.DisruptorModule;
 import org.apache.omid.tso.RuntimeExceptionPanicker;
 import org.apache.omid.tso.NetworkInterfaceUtils;
@@ -70,6 +71,8 @@ class TestTSOModule extends AbstractModule {
         bind(TimestampOracle.class).to(PausableTimestampOracle.class).in(Singleton.class);
         bind(Panicker.class).to(RuntimeExceptionPanicker.class).in(Singleton.class);
 
+        bind(BatchPool.class).in(Singleton.class);
+
         // Disruptor setup
         install(new DisruptorModule());
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/3e5b6741/tso-server/src/main/java/org/apache/omid/tso/BatchPool.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/BatchPool.java b/tso-server/src/main/java/org/apache/omid/tso/BatchPool.java
index 96bed25..6b5307e 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/BatchPool.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/BatchPool.java
@@ -20,7 +20,7 @@ package org.apache.omid.tso;
 import javax.inject.Inject;
 import java.util.Stack;
 
-class BatchPool {
+public class BatchPool {
 
     final private Batch[] batches;
     final private int poolSize;

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/3e5b6741/tso-server/src/main/java/org/apache/omid/tso/TSOModule.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/TSOModule.java b/tso-server/src/main/java/org/apache/omid/tso/TSOModule.java
index bd9e0f9..f195ebb 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/TSOModule.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/TSOModule.java
@@ -44,6 +44,7 @@ class TSOModule extends AbstractModule {
         bind(TSOStateManager.class).to(TSOStateManagerImpl.class).in(Singleton.class);
         bind(TimestampOracle.class).to(TimestampOracleImpl.class).in(Singleton.class);
         bind(Panicker.class).to(RuntimeExceptionPanicker.class).in(Singleton.class);
+        bind(BatchPool.class).in(Singleton.class);
 
         // Disruptor setup
         install(new DisruptorModule());

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/3e5b6741/tso-server/src/test/java/org/apache/omid/tso/TSOMockModule.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TSOMockModule.java b/tso-server/src/test/java/org/apache/omid/tso/TSOMockModule.java
index 29e06ed..c10df9d 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TSOMockModule.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TSOMockModule.java
@@ -52,6 +52,7 @@ public class TSOMockModule extends AbstractModule {
         bind(TimestampStorage.class).to(InMemoryTimestampStorage.class).in(Singleton.class);
         bind(TimestampOracle.class).to(PausableTimestampOracle.class).in(Singleton.class);
         bind(Panicker.class).to(MockPanicker.class).in(Singleton.class);
+        bind(BatchPool.class).in(Singleton.class);
 
         install(config.getLeaseModule());
         install(new DisruptorModule());


[14/50] [abbrv] incubator-omid git commit: [ci skip]prepare for next development iteration

Posted by fp...@apache.org.
[ci skip]prepare for next development iteration


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

Branch: refs/heads/master
Commit: a5c2c2f464094c713354baa6b151caa39bfc2f9c
Parents: eb8d636
Author: Omid CI <om...@yahoo-inc.com>
Authored: Wed Apr 27 00:55:21 2016 +0000
Committer: Omid CI <om...@yahoo-inc.com>
Committed: Wed Apr 27 00:55:21 2016 +0000

----------------------------------------------------------------------
 benchmarks/pom.xml          | 2 +-
 codahale-metrics/pom.xml    | 2 +-
 commit-table/pom.xml        | 2 +-
 common/pom.xml              | 2 +-
 examples/pom.xml            | 2 +-
 hbase-client/pom.xml        | 2 +-
 hbase-commit-table/pom.xml  | 2 +-
 hbase-common/pom.xml        | 2 +-
 hbase-coprocessor/pom.xml   | 2 +-
 hbase-shims/hbase-0/pom.xml | 2 +-
 hbase-shims/hbase-1/pom.xml | 2 +-
 hbase-shims/pom.xml         | 2 +-
 hbase-tools/pom.xml         | 2 +-
 metrics/pom.xml             | 2 +-
 pom.xml                     | 4 ++--
 statemachine/pom.xml        | 2 +-
 timestamp-storage/pom.xml   | 2 +-
 transaction-client/pom.xml  | 2 +-
 tso-server/pom.xml          | 2 +-
 19 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/a5c2c2f4/benchmarks/pom.xml
----------------------------------------------------------------------
diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml
index ae74716..4129cd3 100644
--- a/benchmarks/pom.xml
+++ b/benchmarks/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.44</version>
+        <version>0.8.1.45-SNAPSHOT</version>
     </parent>
 
     <artifactId>benchmarks</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/a5c2c2f4/codahale-metrics/pom.xml
----------------------------------------------------------------------
diff --git a/codahale-metrics/pom.xml b/codahale-metrics/pom.xml
index f318a39..82a03df 100644
--- a/codahale-metrics/pom.xml
+++ b/codahale-metrics/pom.xml
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.44</version>
+        <version>0.8.1.45-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/a5c2c2f4/commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/commit-table/pom.xml b/commit-table/pom.xml
index ede83b6..738f47e 100644
--- a/commit-table/pom.xml
+++ b/commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.44</version>
+        <version>0.8.1.45-SNAPSHOT</version>
     </parent>
 
     <artifactId>commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/a5c2c2f4/common/pom.xml
----------------------------------------------------------------------
diff --git a/common/pom.xml b/common/pom.xml
index 2ee78ce..08c3a4c 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.44</version>
+        <version>0.8.1.45-SNAPSHOT</version>
     </parent>
 
     <artifactId>common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/a5c2c2f4/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 273a0ac..c0a0531 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.44</version>
+        <version>0.8.1.45-SNAPSHOT</version>
     </parent>
 
     <artifactId>examples</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/a5c2c2f4/hbase-client/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml
index d344d0b..39cb1d6 100644
--- a/hbase-client/pom.xml
+++ b/hbase-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.44</version>
+        <version>0.8.1.45-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/a5c2c2f4/hbase-commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-commit-table/pom.xml b/hbase-commit-table/pom.xml
index 5b1250a..0d0d863 100644
--- a/hbase-commit-table/pom.xml
+++ b/hbase-commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.44</version>
+        <version>0.8.1.45-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/a5c2c2f4/hbase-common/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml
index ecbb5d1..e05b45e 100644
--- a/hbase-common/pom.xml
+++ b/hbase-common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.44</version>
+        <version>0.8.1.45-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/a5c2c2f4/hbase-coprocessor/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-coprocessor/pom.xml b/hbase-coprocessor/pom.xml
index 0690ad2..084c00f 100644
--- a/hbase-coprocessor/pom.xml
+++ b/hbase-coprocessor/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.44</version>
+        <version>0.8.1.45-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-coprocessor</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/a5c2c2f4/hbase-shims/hbase-0/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-0/pom.xml b/hbase-shims/hbase-0/pom.xml
index 878c51f..37dc00b 100644
--- a/hbase-shims/hbase-0/pom.xml
+++ b/hbase-shims/hbase-0/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.44</version>
+        <version>0.8.1.45-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase0-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/a5c2c2f4/hbase-shims/hbase-1/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-1/pom.xml b/hbase-shims/hbase-1/pom.xml
index 1e16622..d12dc07 100644
--- a/hbase-shims/hbase-1/pom.xml
+++ b/hbase-shims/hbase-1/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.44</version>
+        <version>0.8.1.45-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase1-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/a5c2c2f4/hbase-shims/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/pom.xml b/hbase-shims/pom.xml
index c4572b1..8a44881 100644
--- a/hbase-shims/pom.xml
+++ b/hbase-shims/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.44</version>
+        <version>0.8.1.45-SNAPSHOT</version>
     </parent>
 
     <artifactId>omid-shims-aggregator</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/a5c2c2f4/hbase-tools/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-tools/pom.xml b/hbase-tools/pom.xml
index 6332a82..8045439 100644
--- a/hbase-tools/pom.xml
+++ b/hbase-tools/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.44</version>
+        <version>0.8.1.45-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-tools</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/a5c2c2f4/metrics/pom.xml
----------------------------------------------------------------------
diff --git a/metrics/pom.xml b/metrics/pom.xml
index d5ef5d7..d462694 100644
--- a/metrics/pom.xml
+++ b/metrics/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.44</version>
+        <version>0.8.1.45-SNAPSHOT</version>
     </parent>
 
     <artifactId>metrics</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/a5c2c2f4/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index cfb8091..ad750da 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
     <artifactId>omid</artifactId>
     <packaging>pom</packaging>
     <!-- WARNING: do not update version manually, use mvn versions:set -->
-    <version>0.8.1.44</version>
+    <version>0.8.1.45-SNAPSHOT</version>
 
     <organization>
         <name>Apache Software Foundation</name>
@@ -105,7 +105,7 @@
         <connection>scm:git:git://github.com/yahoo/omid.git</connection>
         <developerConnection>scm:git:https://${GH_TOKEN}@github.com/yahoo/omid.git</developerConnection>
         <url>https://github.com/yahoo/omid</url>
-        <tag>omid-0.8.1.44</tag>
+        <tag>master</tag>
     </scm>
 
     <distributionManagement>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/a5c2c2f4/statemachine/pom.xml
----------------------------------------------------------------------
diff --git a/statemachine/pom.xml b/statemachine/pom.xml
index 0bef5ab..7b8dd79 100644
--- a/statemachine/pom.xml
+++ b/statemachine/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.44</version>
+        <version>0.8.1.45-SNAPSHOT</version>
     </parent>
 
     <name>State Machine</name>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/a5c2c2f4/timestamp-storage/pom.xml
----------------------------------------------------------------------
diff --git a/timestamp-storage/pom.xml b/timestamp-storage/pom.xml
index a8ebe0b..a7b51eb 100644
--- a/timestamp-storage/pom.xml
+++ b/timestamp-storage/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.44</version>
+        <version>0.8.1.45-SNAPSHOT</version>
     </parent>
 
     <artifactId>timestamp-storage</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/a5c2c2f4/transaction-client/pom.xml
----------------------------------------------------------------------
diff --git a/transaction-client/pom.xml b/transaction-client/pom.xml
index 58b15ca..14d07e9 100644
--- a/transaction-client/pom.xml
+++ b/transaction-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.44</version>
+        <version>0.8.1.45-SNAPSHOT</version>
     </parent>
 
     <artifactId>transaction-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/a5c2c2f4/tso-server/pom.xml
----------------------------------------------------------------------
diff --git a/tso-server/pom.xml b/tso-server/pom.xml
index 201759d..33789e2 100644
--- a/tso-server/pom.xml
+++ b/tso-server/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.44</version>
+        <version>0.8.1.45-SNAPSHOT</version>
     </parent>
 
     <artifactId>tso-server</artifactId>


[15/50] [abbrv] incubator-omid git commit: Remove JUnit asserts

Posted by fp...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/4323560f/hbase-coprocessor/src/test/java/org/apache/omid/transaction/TestCompaction.java
----------------------------------------------------------------------
diff --git a/hbase-coprocessor/src/test/java/org/apache/omid/transaction/TestCompaction.java b/hbase-coprocessor/src/test/java/org/apache/omid/transaction/TestCompaction.java
index c219b87..f7e791c 100644
--- a/hbase-coprocessor/src/test/java/org/apache/omid/transaction/TestCompaction.java
+++ b/hbase-coprocessor/src/test/java/org/apache/omid/transaction/TestCompaction.java
@@ -20,14 +20,6 @@ package org.apache.omid.transaction;
 import com.google.common.util.concurrent.SettableFuture;
 import com.google.inject.Guice;
 import com.google.inject.Injector;
-import org.apache.omid.HBaseShims;
-import org.apache.omid.TestUtils;
-import org.apache.omid.committable.CommitTable;
-import org.apache.omid.metrics.NullMetricsProvider;
-import org.apache.omid.committable.hbase.HBaseCommitTableConfig;
-import org.apache.omid.timestamp.storage.HBaseTimestampStorageConfig;
-import org.apache.omid.tso.TSOServer;
-import org.apache.omid.tso.TSOServerConfig;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CellUtil;
@@ -50,6 +42,14 @@ import org.apache.hadoop.hbase.client.Scan;
 import org.apache.hadoop.hbase.client.coprocessor.AggregationClient;
 import org.apache.hadoop.hbase.client.coprocessor.LongColumnInterpreter;
 import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.omid.HBaseShims;
+import org.apache.omid.TestUtils;
+import org.apache.omid.committable.CommitTable;
+import org.apache.omid.committable.hbase.HBaseCommitTableConfig;
+import org.apache.omid.metrics.NullMetricsProvider;
+import org.apache.omid.timestamp.storage.HBaseTimestampStorageConfig;
+import org.apache.omid.tso.TSOServer;
+import org.apache.omid.tso.TSOServerConfig;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 import org.slf4j.Logger;
@@ -72,11 +72,11 @@ import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.spy;
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertFalse;
-import static org.testng.AssertJUnit.assertNull;
-import static org.testng.AssertJUnit.assertTrue;
-import static org.testng.AssertJUnit.fail;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
 
 public class TestCompaction {
 
@@ -105,11 +105,7 @@ public class TestCompaction {
 
     private AggregationClient aggregationClient;
     private CommitTable commitTable;
-//<<<<<<< HEAD
-//    private TSOClient client;
     private PostCommitActions syncPostCommitter;
-//=======
-//>>>>>>> open-source-master
 
     @BeforeClass
     public void setupTestCompation() throws Exception {
@@ -132,18 +128,16 @@ public class TestCompaction {
         setupTSO();
 
         commitTable = injector.getInstance(CommitTable.class);
-
-//<<<<<<< HEAD
-//        client = TSOClient.newBuilder().withConfiguration(clientConf).build();
-//
-//=======
-//>>>>>>> open-source-master
     }
 
     private void setupHBase() throws Exception {
-        LOG.info("********** Setting up HBase **********");
+        LOG.info("--------------------------------------------------------------------------------------------------");
+        LOG.info("Setting up HBase");
+        LOG.info("--------------------------------------------------------------------------------------------------");
         hbaseTestUtil = new HBaseTestingUtility(hbaseConf);
-        LOG.info("********** Creating HBase MiniCluster **********");
+        LOG.info("--------------------------------------------------------------------------------------------------");
+        LOG.info("Creating HBase MiniCluster");
+        LOG.info("--------------------------------------------------------------------------------------------------");
         hbaseCluster = hbaseTestUtil.startMiniCluster(1);
     }
 
@@ -199,17 +193,6 @@ public class TestCompaction {
     }
 
     private TransactionManager newTransactionManager() throws Exception {
-//<<<<<<< HEAD
-//        CommitTable.Client commitTableClient =  commitTable.getClient();
-//        syncPostCommitter =
-//                spy(new HBaseSyncPostCommitter(new NullMetricsProvider(),commitTableClient));
-//
-//        return HBaseTransactionManager.newBuilder()
-//                .withConfiguration(hbaseConf)
-//                .withCommitTableClient(commitTableClient)
-//                .withTSOClient(client)
-//                .postCommitter(syncPostCommitter)
-//=======
         HBaseOmidClientConfiguration hbaseOmidClientConf = new HBaseOmidClientConfiguration();
         hbaseOmidClientConf.setConnectionString("localhost:1234");
         hbaseOmidClientConf.setHBaseConfiguration(hbaseConf);
@@ -219,7 +202,6 @@ public class TestCompaction {
         return HBaseTransactionManager.builder(hbaseOmidClientConf)
                 .postCommitter(syncPostCommitter)
                 .commitTableClient(commitTableClient)
-//>>>>>>> open-source-master
                 .build();
     }
 
@@ -266,7 +248,7 @@ public class TestCompaction {
         LOG.info("Waking up after 3 secs");
 
         // No rows should have been discarded after compacting
-        assertEquals("Rows in table after compacting should be " + ROWS_TO_ADD, ROWS_TO_ADD, rowCount(TEST_TABLE, fam));
+        assertEquals(rowCount(TEST_TABLE, fam), ROWS_TO_ADD, "Rows in table after compacting should be " + ROWS_TO_ADD);
     }
 
     @Test
@@ -292,18 +274,12 @@ public class TestCompaction {
             // Do nothing
         }
 
-        assertTrue("Cell should be there",
-                   CellUtils.hasCell(Bytes.toBytes(row),
-                                     fam,
-                                     qual,
-                                     problematicTx.getStartTimestamp(),
-                                     new TTableCellGetterAdapter(txTable)));
-        assertFalse("Shadow cell should not be there",
-                    CellUtils.hasShadowCell(Bytes.toBytes(row),
-                                            fam,
-                                            qual,
-                                            problematicTx.getStartTimestamp(),
-                                            new TTableCellGetterAdapter(txTable)));
+        assertTrue(CellUtils.hasCell(Bytes.toBytes(row), fam, qual, problematicTx.getStartTimestamp(),
+                                     new TTableCellGetterAdapter(txTable)),
+                   "Cell should be there");
+        assertFalse(CellUtils.hasShadowCell(Bytes.toBytes(row), fam, qual, problematicTx.getStartTimestamp(),
+                                            new TTableCellGetterAdapter(txTable)),
+                    "Shadow cell should not be there");
 
         // Return a LWM that triggers compaction and has all the possible start timestamps below it
         LOG.info("Regions in table {}: {}", TEST_TABLE, hbaseCluster.getRegions(Bytes.toBytes(TEST_TABLE)).size());
@@ -326,18 +302,12 @@ public class TestCompaction {
         Thread.sleep(3000);
         LOG.info("Waking up after 3 secs");
 
-        assertTrue("Cell should be there",
-                   CellUtils.hasCell(Bytes.toBytes(row),
-                                     fam,
-                                     qual,
-                                     problematicTx.getStartTimestamp(),
-                                     new TTableCellGetterAdapter(txTable)));
-        assertTrue("Shadow cell should not be there",
-                   CellUtils.hasShadowCell(Bytes.toBytes(row),
-                                           fam,
-                                           qual,
-                                           problematicTx.getStartTimestamp(),
-                                           new TTableCellGetterAdapter(txTable)));
+        assertTrue(CellUtils.hasCell(Bytes.toBytes(row), fam, qual, problematicTx.getStartTimestamp(),
+                                     new TTableCellGetterAdapter(txTable)),
+                   "Cell should be there");
+        assertTrue(CellUtils.hasShadowCell(Bytes.toBytes(row), fam, qual, problematicTx.getStartTimestamp(),
+                                           new TTableCellGetterAdapter(txTable)),
+                   "Shadow cell should not be there");
     }
 
     @Test
@@ -355,18 +325,12 @@ public class TestCompaction {
         Put put = new Put(Bytes.toBytes(rowId));
         put.add(fam, qual, data);
         txTable.put(neverendingTxBelowLowWatermark, put);
-        assertTrue("Cell should be there",
-                   CellUtils.hasCell(Bytes.toBytes(rowId),
-                                     fam,
-                                     qual,
-                                     neverendingTxBelowLowWatermark.getStartTimestamp(),
-                                     new TTableCellGetterAdapter(txTable)));
-        assertFalse("Shadow cell should not be there",
-                    CellUtils.hasShadowCell(Bytes.toBytes(rowId),
-                                            fam,
-                                            qual,
-                                            neverendingTxBelowLowWatermark.getStartTimestamp(),
-                                            new TTableCellGetterAdapter(txTable)));
+        assertTrue(CellUtils.hasCell(Bytes.toBytes(rowId), fam, qual, neverendingTxBelowLowWatermark.getStartTimestamp(),
+                                     new TTableCellGetterAdapter(txTable)),
+                   "Cell should be there");
+        assertFalse(CellUtils.hasShadowCell(Bytes.toBytes(rowId), fam, qual, neverendingTxBelowLowWatermark.getStartTimestamp(),
+                                            new TTableCellGetterAdapter(txTable)),
+                    "Shadow cell should not be there");
 
         // The KV in this transaction should be added without the shadow cells
         HBaseTransaction neverendingTxAboveLowWatermark = (HBaseTransaction) tm.begin();
@@ -374,23 +338,17 @@ public class TestCompaction {
         put = new Put(Bytes.toBytes(anotherRowId));
         put.add(fam, qual, data);
         txTable.put(neverendingTxAboveLowWatermark, put);
-        assertTrue("Cell should be there",
-                   CellUtils.hasCell(Bytes.toBytes(anotherRowId),
-                                     fam,
-                                     qual,
-                                     neverendingTxAboveLowWatermark.getStartTimestamp(),
-                                     new TTableCellGetterAdapter(txTable)));
-        assertFalse("Shadow cell should not be there",
-                    CellUtils.hasShadowCell(Bytes.toBytes(anotherRowId),
-                                            fam,
-                                            qual,
-                                            neverendingTxAboveLowWatermark.getStartTimestamp(),
-                                            new TTableCellGetterAdapter(txTable)));
-
-        assertEquals("Rows in table before flushing should be 2", 2, rowCount(TEST_TABLE, fam));
+        assertTrue(CellUtils.hasCell(Bytes.toBytes(anotherRowId), fam, qual, neverendingTxAboveLowWatermark.getStartTimestamp(),
+                                     new TTableCellGetterAdapter(txTable)),
+                   "Cell should be there");
+        assertFalse(CellUtils.hasShadowCell(Bytes.toBytes(anotherRowId), fam, qual, neverendingTxAboveLowWatermark.getStartTimestamp(),
+                                            new TTableCellGetterAdapter(txTable)),
+                    "Shadow cell should not be there");
+
+        assertEquals(rowCount(TEST_TABLE, fam), 2, "Rows in table before flushing should be 2");
         LOG.info("Flushing table {}", TEST_TABLE);
         admin.flush(TEST_TABLE);
-        assertEquals("Rows in table after flushing should be 2", 2, rowCount(TEST_TABLE, fam));
+        assertEquals(rowCount(TEST_TABLE, fam), 2, "Rows in table after flushing should be 2");
 
         // Return a LWM that triggers compaction and stays between both ST of TXs, so assign 1st TX's start timestamp
         LOG.info("Regions in table {}: {}", TEST_TABLE, hbaseCluster.getRegions(Bytes.toBytes(TEST_TABLE)).size());
@@ -410,33 +368,21 @@ public class TestCompaction {
         LOG.info("Waking up after 3 secs");
 
         // One row should have been discarded after compacting
-        assertEquals("There should be only one row in table after compacting", 1, rowCount(TEST_TABLE, fam));
+        assertEquals(rowCount(TEST_TABLE, fam), 1, "There should be only one row in table after compacting");
         // The row from the TX below the LWM should not be there (nor its Shadow Cell)
-        assertFalse("Cell should not be there",
-                    CellUtils.hasCell(Bytes.toBytes(rowId),
-                                      fam,
-                                      qual,
-                                      neverendingTxBelowLowWatermark.getStartTimestamp(),
-                                      new TTableCellGetterAdapter(txTable)));
-        assertFalse("Shadow cell should not be there",
-                    CellUtils.hasShadowCell(Bytes.toBytes(rowId),
-                                            fam,
-                                            qual,
-                                            neverendingTxBelowLowWatermark.getStartTimestamp(),
-                                            new TTableCellGetterAdapter(txTable)));
+        assertFalse(CellUtils.hasCell(Bytes.toBytes(rowId), fam, qual, neverendingTxBelowLowWatermark.getStartTimestamp(),
+                                      new TTableCellGetterAdapter(txTable)),
+                    "Cell should not be there");
+        assertFalse(CellUtils.hasShadowCell(Bytes.toBytes(rowId), fam, qual, neverendingTxBelowLowWatermark.getStartTimestamp(),
+                                            new TTableCellGetterAdapter(txTable)),
+                    "Shadow cell should not be there");
         // The row from the TX above the LWM should be there without the Shadow Cell
-        assertTrue("Cell should be there",
-                   CellUtils.hasCell(Bytes.toBytes(anotherRowId),
-                                     fam,
-                                     qual,
-                                     neverendingTxAboveLowWatermark.getStartTimestamp(),
-                                     new TTableCellGetterAdapter(txTable)));
-        assertFalse("Shadow cell should not be there",
-                    CellUtils.hasShadowCell(Bytes.toBytes(anotherRowId),
-                                            fam,
-                                            qual,
-                                            neverendingTxAboveLowWatermark.getStartTimestamp(),
-                                            new TTableCellGetterAdapter(txTable)));
+        assertTrue(CellUtils.hasCell(Bytes.toBytes(anotherRowId), fam, qual, neverendingTxAboveLowWatermark.getStartTimestamp(),
+                                     new TTableCellGetterAdapter(txTable)),
+                   "Cell should be there");
+        assertFalse(CellUtils.hasShadowCell(Bytes.toBytes(anotherRowId), fam, qual, neverendingTxAboveLowWatermark.getStartTimestamp(),
+                                            new TTableCellGetterAdapter(txTable)),
+                    "Shadow cell should not be there");
 
     }
 
@@ -453,23 +399,17 @@ public class TestCompaction {
         Put put = new Put(Bytes.toBytes(rowId));
         put.add(fam, qual, data);
         txTable.put(neverendingTx, put);
-        assertTrue("Cell should be there",
-                   CellUtils.hasCell(Bytes.toBytes(rowId),
-                                     fam,
-                                     qual,
-                                     neverendingTx.getStartTimestamp(),
-                                     new TTableCellGetterAdapter(txTable)));
-        assertFalse("Shadow cell should not be there",
-                    CellUtils.hasShadowCell(Bytes.toBytes(rowId),
-                                            fam,
-                                            qual,
-                                            neverendingTx.getStartTimestamp(),
-                                            new TTableCellGetterAdapter(txTable)));
-
-        assertEquals("There should be only one rows in table before flushing", 1, rowCount(TEST_TABLE, fam));
+        assertTrue(CellUtils.hasCell(Bytes.toBytes(rowId), fam, qual, neverendingTx.getStartTimestamp(),
+                                     new TTableCellGetterAdapter(txTable)),
+                   "Cell should be there");
+        assertFalse(CellUtils.hasShadowCell(Bytes.toBytes(rowId), fam, qual, neverendingTx.getStartTimestamp(),
+                                            new TTableCellGetterAdapter(txTable)),
+                    "Shadow cell should not be there");
+
+        assertEquals(rowCount(TEST_TABLE, fam), 1, "There should be only one rows in table before flushing");
         LOG.info("Flushing table {}", TEST_TABLE);
         admin.flush(TEST_TABLE);
-        assertEquals("There should be only one rows in table after flushing", 1, rowCount(TEST_TABLE, fam));
+        assertEquals(rowCount(TEST_TABLE, fam), 1, "There should be only one rows in table after flushing");
 
         // Break access to CommitTable functionality in Compactor
         LOG.info("Regions in table {}: {}", TEST_TABLE, hbaseCluster.getRegions(Bytes.toBytes(TEST_TABLE)).size());
@@ -490,19 +430,13 @@ public class TestCompaction {
         LOG.info("Waking up after 3 secs");
 
         // All rows should be there after the failed compaction
-        assertEquals("There should be only one row in table after compacting", 1, rowCount(TEST_TABLE, fam));
-        assertTrue("Cell should be there",
-                   CellUtils.hasCell(Bytes.toBytes(rowId),
-                                     fam,
-                                     qual,
-                                     neverendingTx.getStartTimestamp(),
-                                     new TTableCellGetterAdapter(txTable)));
-        assertFalse("Shadow cell should not be there",
-                    CellUtils.hasShadowCell(Bytes.toBytes(rowId),
-                                            fam,
-                                            qual,
-                                            neverendingTx.getStartTimestamp(),
-                                            new TTableCellGetterAdapter(txTable)));
+        assertEquals(rowCount(TEST_TABLE, fam), 1, "There should be only one row in table after compacting");
+        assertTrue(CellUtils.hasCell(Bytes.toBytes(rowId), fam, qual, neverendingTx.getStartTimestamp(),
+                                     new TTableCellGetterAdapter(txTable)),
+                   "Cell should be there");
+        assertFalse(CellUtils.hasShadowCell(Bytes.toBytes(rowId), fam, qual, neverendingTx.getStartTimestamp(),
+                                            new TTableCellGetterAdapter(txTable)),
+                    "Shadow cell should not be there");
     }
 
     @Test
@@ -523,36 +457,35 @@ public class TestCompaction {
         Transaction tx = tm.begin();
         Get get = new Get(Bytes.toBytes(rowId));
         get.setMaxVersions(2 * MAX_VERSIONS);
-        assertEquals("Max versions should be set to " + (2 * MAX_VERSIONS), (2 * MAX_VERSIONS), get.getMaxVersions());
+        assertEquals(get.getMaxVersions(), (2 * MAX_VERSIONS), "Max versions should be set to " + (2 * MAX_VERSIONS));
         get.addColumn(fam, qual);
         Result result = txTable.get(tx, get);
         tm.commit(tx);
         List<Cell> column = result.getColumnCells(fam, qual);
-        assertEquals("There should be only one version in the result", 1, column.size());
+        assertEquals(column.size(), 1, "There should be only one version in the result");
 
-        assertEquals("There should be only one row in table before flushing", 1, rowCount(TEST_TABLE, fam));
+        assertEquals(rowCount(TEST_TABLE, fam), 1, "There should be only one row in table before flushing");
         LOG.info("Flushing table {}", TEST_TABLE);
         admin.flush(TEST_TABLE);
-        assertEquals("There should be only one row in table after flushing", 1, rowCount(TEST_TABLE, fam));
+        assertEquals(rowCount(TEST_TABLE, fam), 1, "There should be only one row in table after flushing");
 
         // Return a LWM that triggers compaction
         compactEverything(TEST_TABLE);
 
         // One row should have been discarded after compacting
-        assertEquals("There should be only one row in table after compacting", 1, rowCount(TEST_TABLE, fam));
+        assertEquals(rowCount(TEST_TABLE, fam), 1, "There should be only one row in table after compacting");
 
         tx = tm.begin();
         get = new Get(Bytes.toBytes(rowId));
         get.setMaxVersions(2 * MAX_VERSIONS);
-        assertEquals("Max versions should be set to " + (2 * MAX_VERSIONS), (2 * MAX_VERSIONS), get.getMaxVersions());
+        assertEquals(get.getMaxVersions(), (2 * MAX_VERSIONS), "Max versions should be set to " + (2 * MAX_VERSIONS));
         get.addColumn(fam, qual);
         result = txTable.get(tx, get);
         tm.commit(tx);
         column = result.getColumnCells(fam, qual);
-        assertEquals("There should be only one version in the result", 1, column.size());
-        assertEquals("Values don't match",
-                     "testWrite-" + (2 * MAX_VERSIONS),
-                     Bytes.toString(CellUtil.cloneValue(column.get(0))));
+        assertEquals(column.size(), 1, "There should be only one version in the result");
+        assertEquals(Bytes.toString(CellUtil.cloneValue(column.get(0))), "testWrite-" + (2 * MAX_VERSIONS),
+                     "Values don't match");
     }
 
     // manually flush the regions on the region server.
@@ -594,36 +527,36 @@ public class TestCompaction {
 
         // Before compaction, the three timestamped values for the cell should be there
         TTableCellGetterAdapter getter = new TTableCellGetterAdapter(txTable);
-        assertTrue("Put cell of Tx1 should be there",
-                   CellUtils.hasCell(rowId, fam, qual, tx1.getStartTimestamp(), getter));
-        assertTrue("Put shadow cell of Tx1 should be there",
-                   CellUtils.hasShadowCell(rowId, fam, qual, tx1.getStartTimestamp(), getter));
-        assertTrue("Put cell of Tx2 cell should be there",
-                   CellUtils.hasCell(rowId, fam, qual, tx2.getStartTimestamp(), getter));
-        assertTrue("Put shadow cell of Tx2 should be there",
-                   CellUtils.hasShadowCell(rowId, fam, qual, tx2.getStartTimestamp(), getter));
-        assertTrue("Put cell of Tx3 cell should be there",
-                   CellUtils.hasCell(rowId, fam, qual, tx3.getStartTimestamp(), getter));
-        assertTrue("Put shadow cell of Tx3 should be there",
-                   CellUtils.hasShadowCell(rowId, fam, qual, tx3.getStartTimestamp(), getter));
+        assertTrue(CellUtils.hasCell(rowId, fam, qual, tx1.getStartTimestamp(), getter),
+                   "Put cell of Tx1 should be there");
+        assertTrue(CellUtils.hasShadowCell(rowId, fam, qual, tx1.getStartTimestamp(), getter),
+                   "Put shadow cell of Tx1 should be there");
+        assertTrue(CellUtils.hasCell(rowId, fam, qual, tx2.getStartTimestamp(), getter),
+                   "Put cell of Tx2 cell should be there");
+        assertTrue(CellUtils.hasShadowCell(rowId, fam, qual, tx2.getStartTimestamp(), getter),
+                   "Put shadow cell of Tx2 should be there");
+        assertTrue(CellUtils.hasCell(rowId, fam, qual, tx3.getStartTimestamp(), getter),
+                   "Put cell of Tx3 cell should be there");
+        assertTrue(CellUtils.hasShadowCell(rowId, fam, qual, tx3.getStartTimestamp(), getter),
+                   "Put shadow cell of Tx3 should be there");
 
         // Compact
         HBaseTransaction lwmTx = (HBaseTransaction) tm.begin();
         compactWithLWM(lwmTx.getStartTimestamp(), TEST_TABLE);
 
         // After compaction, only the last value for the cell should have survived
-        assertFalse("Put cell of Tx1 should not be there",
-                    CellUtils.hasCell(rowId, fam, qual, tx1.getStartTimestamp(), getter));
-        assertFalse("Put shadow cell of Tx1 should not be there",
-                    CellUtils.hasShadowCell(rowId, fam, qual, tx1.getStartTimestamp(), getter));
-        assertFalse("Put cell of Tx2 should not be there",
-                    CellUtils.hasCell(rowId, fam, qual, tx2.getStartTimestamp(), getter));
-        assertFalse("Put shadow cell of Tx2 should not be there",
-                    CellUtils.hasShadowCell(rowId, fam, qual, tx2.getStartTimestamp(), getter));
-        assertTrue("Put cell of Tx3 cell should be there",
-                   CellUtils.hasCell(rowId, fam, qual, tx3.getStartTimestamp(), getter));
-        assertTrue("Put shadow cell of Tx3 should be there",
-                   CellUtils.hasShadowCell(rowId, fam, qual, tx3.getStartTimestamp(), getter));
+        assertFalse(CellUtils.hasCell(rowId, fam, qual, tx1.getStartTimestamp(), getter),
+                    "Put cell of Tx1 should not be there");
+        assertFalse(CellUtils.hasShadowCell(rowId, fam, qual, tx1.getStartTimestamp(), getter),
+                    "Put shadow cell of Tx1 should not be there");
+        assertFalse(CellUtils.hasCell(rowId, fam, qual, tx2.getStartTimestamp(), getter),
+                    "Put cell of Tx2 should not be there");
+        assertFalse(CellUtils.hasShadowCell(rowId, fam, qual, tx2.getStartTimestamp(), getter),
+                    "Put shadow cell of Tx2 should not be there");
+        assertTrue(CellUtils.hasCell(rowId, fam, qual, tx3.getStartTimestamp(), getter),
+                   "Put cell of Tx3 cell should be there");
+        assertTrue(CellUtils.hasShadowCell(rowId, fam, qual, tx3.getStartTimestamp(), getter),
+                   "Put shadow cell of Tx3 should be there");
 
         // A new transaction after compaction should read the last value written
         HBaseTransaction newTx1 = (HBaseTransaction) tm.begin();
@@ -650,22 +583,22 @@ public class TestCompaction {
 
         // Only two values -the new written by newTx1 and the last value
         // for the cell after compaction- should have survived
-        assertFalse("Put cell of Tx1 should not be there",
-                    CellUtils.hasCell(rowId, fam, qual, tx1.getStartTimestamp(), getter));
-        assertFalse("Put shadow cell of Tx1 should not be there",
-                    CellUtils.hasShadowCell(rowId, fam, qual, tx1.getStartTimestamp(), getter));
-        assertFalse("Put cell of Tx2 should not be there",
-                    CellUtils.hasCell(rowId, fam, qual, tx2.getStartTimestamp(), getter));
-        assertFalse("Put shadow cell of Tx2 should not be there",
-                    CellUtils.hasShadowCell(rowId, fam, qual, tx2.getStartTimestamp(), getter));
-        assertTrue("Put cell of Tx3 cell should be there",
-                   CellUtils.hasCell(rowId, fam, qual, tx3.getStartTimestamp(), getter));
-        assertTrue("Put shadow cell of Tx3 should be there",
-                   CellUtils.hasShadowCell(rowId, fam, qual, tx3.getStartTimestamp(), getter));
-        assertTrue("Put cell of NewTx1 cell should be there",
-                   CellUtils.hasCell(rowId, fam, qual, newTx1.getStartTimestamp(), getter));
-        assertTrue("Put shadow cell of NewTx1 should be there",
-                   CellUtils.hasShadowCell(rowId, fam, qual, newTx1.getStartTimestamp(), getter));
+        assertFalse(CellUtils.hasCell(rowId, fam, qual, tx1.getStartTimestamp(), getter),
+                    "Put cell of Tx1 should not be there");
+        assertFalse(CellUtils.hasShadowCell(rowId, fam, qual, tx1.getStartTimestamp(), getter),
+                    "Put shadow cell of Tx1 should not be there");
+        assertFalse(CellUtils.hasCell(rowId, fam, qual, tx2.getStartTimestamp(), getter),
+                    "Put cell of Tx2 should not be there");
+        assertFalse(CellUtils.hasShadowCell(rowId, fam, qual, tx2.getStartTimestamp(), getter),
+                    "Put shadow cell of Tx2 should not be there");
+        assertTrue(CellUtils.hasCell(rowId, fam, qual, tx3.getStartTimestamp(), getter),
+                   "Put cell of Tx3 cell should be there");
+        assertTrue(CellUtils.hasShadowCell(rowId, fam, qual, tx3.getStartTimestamp(), getter),
+                   "Put shadow cell of Tx3 should be there");
+        assertTrue(CellUtils.hasCell(rowId, fam, qual, newTx1.getStartTimestamp(), getter),
+                   "Put cell of NewTx1 cell should be there");
+        assertTrue(CellUtils.hasShadowCell(rowId, fam, qual, newTx1.getStartTimestamp(), getter),
+                   "Put shadow cell of NewTx1 should be there");
     }
 
     /**
@@ -773,10 +706,9 @@ public class TestCompaction {
         Thread.sleep(3000);
 
         // check if the cell that should be compacted, is compacted
-        assertFalse("Cell should not be be there",
-                    CellUtils.hasCell(rowToBeCompactedAway, fam, qual,
-                                      tx1.getStartTimestamp(),
-                                      new TTableCellGetterAdapter(txTable)));
+        assertFalse(CellUtils.hasCell(rowToBeCompactedAway, fam, qual, tx1.getStartTimestamp(),
+                                      new TTableCellGetterAdapter(txTable)),
+                    "Cell should not be be there");
     }
 
     @Test(timeOut = 60000)
@@ -806,18 +738,14 @@ public class TestCompaction {
 
         Get g = new Get(rowId);
         Result result = txTable.getHTable().get(g);
-        assertEquals("Should be there, precompact",
-                     1, result.getColumnCells(nonOmidCF, nonOmidQual).size());
-        assertEquals("Should be there, precompact",
-                     1, result.getColumnCells(fam, qual).size());
+        assertEquals(result.getColumnCells(nonOmidCF, nonOmidQual).size(), 1, "Should be there, precompact");
+        assertEquals(result.getColumnCells(fam, qual).size(), 1, "Should be there, precompact");
 
         compactEverything(TEST_TABLE);
 
         result = txTable.getHTable().get(g);
-        assertEquals("Should be there, postcompact",
-                     1, result.getColumnCells(nonOmidCF, nonOmidQual).size());
-        assertEquals("Should not be there, postcompact",
-                     0, result.getColumnCells(fam, qual).size());
+        assertEquals(result.getColumnCells(nonOmidCF, nonOmidQual).size(), 1, "Should be there, postcompact");
+        assertEquals(result.getColumnCells(fam, qual).size(), 0, "Should not be there, postcompact");
     }
 
     // ----------------------------------------------------------------------------------------------------------------
@@ -858,7 +786,7 @@ public class TestCompaction {
         ResultScanner scannerResults = table.getScanner(scan);
 
         // ...and test the deleted cell is not there anymore
-        assertNull("There should be no results in scan results", scannerResults.next());
+        assertNull(scannerResults.next(), "There should be no results in scan results");
 
         table.close();
 
@@ -936,9 +864,8 @@ public class TestCompaction {
             listOfCellsScanned = scanResult.listCells(); // equivalent to rawCells()
             count++;
         }
-        assertEquals("There should be only one result in scan results", 1, count);
-        assertEquals("There should be three cell entries in the scan results (2 puts, 1 delete)", 3,
-                     listOfCellsScanned.size());
+        assertEquals(count, 1, "There should be only one result in scan results");
+        assertEquals(listOfCellsScanned.size(), 3, "There should be 3 cell entries in scan results (2 puts, 1 del)");
         boolean wasDeletedCellFound = false;
         int numberOfDeletedCellsFound = 0;
         for (Cell cell : listOfCellsScanned) {
@@ -947,8 +874,8 @@ public class TestCompaction {
                 numberOfDeletedCellsFound++;
             }
         }
-        assertTrue("We should have found a non-transactionally deleted cell", wasDeletedCellFound);
-        assertEquals("There should be only only one deleted cell", 1, numberOfDeletedCellsFound);
+        assertTrue(wasDeletedCellFound, "We should have found a non-transactionally deleted cell");
+        assertEquals(numberOfDeletedCellsFound, 1, "There should be only only one deleted cell");
 
         table.close();
     }
@@ -1007,30 +934,20 @@ public class TestCompaction {
 
         // Checks on results after compaction
         TTableCellGetterAdapter getter = new TTableCellGetterAdapter(txTable);
-        assertFalse("Put cell should be there",
-                    CellUtils.hasCell(rowId, fam, qual,
-                                      tx0.getStartTimestamp(), getter));
-        assertFalse("Put shadow cell should be there",
-                    CellUtils.hasShadowCell(rowId, fam, qual,
-                                            tx0.getStartTimestamp(), getter));
-        assertTrue("Put cell should be there",
-                   CellUtils.hasCell(rowId, fam, qual,
-                                     tx1.getStartTimestamp(), getter));
-        assertTrue("Put shadow cell should be there",
-                   CellUtils.hasShadowCell(rowId, fam, qual,
-                                           tx1.getStartTimestamp(), getter));
-        assertTrue("Delete cell should be there",
-                   CellUtils.hasCell(rowId, fam, qual,
-                                     deleteTx.getStartTimestamp(), getter));
-        assertTrue("Delete shadow cell should be there",
-                   CellUtils.hasShadowCell(rowId, fam, qual,
-                                           deleteTx.getStartTimestamp(), getter));
-        assertTrue("Put cell should be there",
-                   CellUtils.hasCell(rowId, fam, qual,
-                                     lastTx.getStartTimestamp(), getter));
-        assertTrue("Put shadow cell should be there",
-                   CellUtils.hasShadowCell(rowId, fam, qual,
-                                           lastTx.getStartTimestamp(), getter));
+        assertFalse(CellUtils.hasCell(rowId, fam, qual, tx0.getStartTimestamp(), getter), "Put cell should be there");
+        assertFalse(CellUtils.hasShadowCell(rowId, fam, qual, tx0.getStartTimestamp(), getter),
+                    "Put shadow cell should be there");
+        assertTrue(CellUtils.hasCell(rowId, fam, qual, tx1.getStartTimestamp(), getter), "Put cell should be there");
+        assertTrue(CellUtils.hasShadowCell(rowId, fam, qual, tx1.getStartTimestamp(), getter),
+                   "Put shadow cell should be there");
+        assertTrue(CellUtils.hasCell(rowId, fam, qual, deleteTx.getStartTimestamp(), getter),
+                   "Delete cell should be there");
+        assertTrue(CellUtils.hasShadowCell(rowId, fam, qual, deleteTx.getStartTimestamp(), getter),
+                   "Delete shadow cell should be there");
+        assertTrue(CellUtils.hasCell(rowId, fam, qual, lastTx.getStartTimestamp(), getter),
+                   "Put cell should be there");
+        assertTrue(CellUtils.hasShadowCell(rowId, fam, qual, lastTx.getStartTimestamp(), getter),
+                   "Put shadow cell should be there");
     }
 
 
@@ -1060,18 +977,14 @@ public class TestCompaction {
         tm.commit(tx2);
 
         TTableCellGetterAdapter getter = new TTableCellGetterAdapter(txTable);
-        assertTrue("Put cell should be there",
-                   CellUtils.hasCell(rowId, fam, qual,
-                                     tx1.getStartTimestamp(), getter));
-        assertTrue("Put shadow cell should be there",
-                   CellUtils.hasShadowCell(rowId, fam, qual,
-                                           tx1.getStartTimestamp(), getter));
-        assertTrue("Delete cell should be there",
-                   CellUtils.hasCell(rowId, fam, qual,
-                                     tx2.getStartTimestamp(), getter));
-        assertTrue("Delete shadow cell should be there",
-                   CellUtils.hasShadowCell(rowId, fam, qual,
-                                           tx2.getStartTimestamp(), getter));
+        assertTrue(CellUtils.hasCell(rowId, fam, qual, tx1.getStartTimestamp(), getter),
+                   "Put cell should be there");
+        assertTrue(CellUtils.hasShadowCell(rowId, fam, qual, tx1.getStartTimestamp(), getter),
+                   "Put shadow cell should be there");
+        assertTrue(CellUtils.hasCell(rowId, fam, qual, tx2.getStartTimestamp(), getter),
+                   "Delete cell should be there");
+        assertTrue(CellUtils.hasShadowCell(rowId, fam, qual, tx2.getStartTimestamp(), getter),
+                   "Delete shadow cell should be there");
     }
 
     /**
@@ -1100,18 +1013,14 @@ public class TestCompaction {
         compactWithLWM(lwmTx.getStartTimestamp(), TEST_TABLE);
 
         TTableCellGetterAdapter getter = new TTableCellGetterAdapter(txTable);
-        assertFalse("Put cell shouldn't be there",
-                    CellUtils.hasCell(rowId, fam, qual,
-                                      tx1.getStartTimestamp(), getter));
-        assertFalse("Put shadow cell shouldn't be there",
-                    CellUtils.hasShadowCell(rowId, fam, qual,
-                                            tx1.getStartTimestamp(), getter));
-        assertFalse("Delete cell shouldn't be there",
-                    CellUtils.hasCell(rowId, fam, qual,
-                                      tx2.getStartTimestamp(), getter));
-        assertFalse("Delete shadow cell shouldn't be there",
-                    CellUtils.hasShadowCell(rowId, fam, qual,
-                                            tx2.getStartTimestamp(), getter));
+        assertFalse(CellUtils.hasCell(rowId, fam, qual, tx1.getStartTimestamp(), getter),
+                    "Put cell shouldn't be there");
+        assertFalse(CellUtils.hasShadowCell(rowId, fam, qual, tx1.getStartTimestamp(), getter),
+                    "Put shadow cell shouldn't be there");
+        assertFalse(CellUtils.hasCell(rowId, fam, qual, tx2.getStartTimestamp(), getter),
+                    "Delete cell shouldn't be there");
+        assertFalse(CellUtils.hasShadowCell(rowId, fam, qual, tx2.getStartTimestamp(), getter),
+                    "Delete shadow cell shouldn't be there");
     }
 
     /**
@@ -1140,18 +1049,14 @@ public class TestCompaction {
         compactWithLWM(lwmTx.getStartTimestamp(), TEST_TABLE);
 
         TTableCellGetterAdapter getter = new TTableCellGetterAdapter(txTable);
-        assertTrue("Put cell should be there",
-                   CellUtils.hasCell(rowId, fam, qual,
-                                     tx1.getStartTimestamp(), getter));
-        assertTrue("Put shadow cell shouldn't be there",
-                   CellUtils.hasShadowCell(rowId, fam, qual,
-                                           tx1.getStartTimestamp(), getter));
-        assertFalse("Delete cell shouldn't be there",
-                    CellUtils.hasCell(rowId, fam, qual,
-                                      tx2.getStartTimestamp(), getter));
-        assertFalse("Delete shadow cell shouldn't be there",
-                    CellUtils.hasShadowCell(rowId, fam, qual,
-                                            tx2.getStartTimestamp(), getter));
+        assertTrue(CellUtils.hasCell(rowId, fam, qual, tx1.getStartTimestamp(), getter),
+                   "Put cell should be there");
+        assertTrue(CellUtils.hasShadowCell(rowId, fam, qual, tx1.getStartTimestamp(), getter),
+                   "Put shadow cell shouldn't be there");
+        assertFalse(CellUtils.hasCell(rowId, fam, qual, tx2.getStartTimestamp(), getter),
+                    "Delete cell shouldn't be there");
+        assertFalse(CellUtils.hasShadowCell(rowId, fam, qual, tx2.getStartTimestamp(), getter),
+                    "Delete shadow cell shouldn't be there");
     }
 
     /**
@@ -1180,18 +1085,14 @@ public class TestCompaction {
         compactWithLWM(lwmTx.getStartTimestamp(), TEST_TABLE);
 
         TTableCellGetterAdapter getter = new TTableCellGetterAdapter(txTable);
-        assertTrue("Put cell should be there",
-                   CellUtils.hasCell(rowId, fam, qual,
-                                     tx1.getStartTimestamp(), getter));
-        assertTrue("Put shadow cell shouldn't be there",
-                   CellUtils.hasShadowCell(rowId, fam, qual,
-                                           tx1.getStartTimestamp(), getter));
-        assertTrue("Delete cell should be there",
-                   CellUtils.hasCell(rowId, fam, qual,
-                                     tx2.getStartTimestamp(), getter));
-        assertFalse("Delete shadow cell shouldn't be there",
-                    CellUtils.hasShadowCell(rowId, fam, qual,
-                                            tx2.getStartTimestamp(), getter));
+        assertTrue(CellUtils.hasCell(rowId, fam, qual, tx1.getStartTimestamp(), getter),
+                   "Put cell should be there");
+        assertTrue(CellUtils.hasShadowCell(rowId, fam, qual, tx1.getStartTimestamp(), getter),
+                   "Put shadow cell shouldn't be there");
+        assertTrue(CellUtils.hasCell(rowId, fam, qual,tx2.getStartTimestamp(), getter),
+                   "Delete cell should be there");
+        assertFalse(CellUtils.hasShadowCell(rowId, fam, qual, tx2.getStartTimestamp(), getter),
+                    "Delete shadow cell shouldn't be there");
     }
 
     /**
@@ -1214,12 +1115,10 @@ public class TestCompaction {
         compactWithLWM(lwmTx.getStartTimestamp(), TEST_TABLE);
 
         TTableCellGetterAdapter getter = new TTableCellGetterAdapter(txTable);
-        assertFalse("Delete cell shouldn't be there",
-                    CellUtils.hasCell(rowId, fam, qual,
-                                      tx1.getStartTimestamp(), getter));
-        assertFalse("Delete shadow cell shouldn't be there",
-                    CellUtils.hasShadowCell(rowId, fam, qual,
-                                            tx1.getStartTimestamp(), getter));
+        assertFalse(CellUtils.hasCell(rowId, fam, qual, tx1.getStartTimestamp(), getter),
+                    "Delete cell shouldn't be there");
+        assertFalse(CellUtils.hasShadowCell(rowId, fam, qual, tx1.getStartTimestamp(), getter),
+                    "Delete shadow cell shouldn't be there");
     }
 
     /**
@@ -1248,18 +1147,14 @@ public class TestCompaction {
         compactWithLWM(lwmTx.getStartTimestamp(), TEST_TABLE);
 
         TTableCellGetterAdapter getter = new TTableCellGetterAdapter(txTable);
-        assertFalse("Delete cell shouldn't be there",
-                    CellUtils.hasCell(rowId, fam, qual,
-                                      tx1.getStartTimestamp(), getter));
-        assertFalse("Delete shadow cell shouldn't be there",
-                    CellUtils.hasShadowCell(rowId, fam, qual,
-                                            tx1.getStartTimestamp(), getter));
-        assertTrue("Put cell should be there",
-                   CellUtils.hasCell(rowId, fam, qual,
-                                     tx2.getStartTimestamp(), getter));
-        assertTrue("Put shadow cell shouldn't be there",
-                   CellUtils.hasShadowCell(rowId, fam, qual,
-                                           tx2.getStartTimestamp(), getter));
+        assertFalse(CellUtils.hasCell(rowId, fam, qual, tx1.getStartTimestamp(), getter),
+                    "Delete cell shouldn't be there");
+        assertFalse(CellUtils.hasShadowCell(rowId, fam, qual, tx1.getStartTimestamp(), getter),
+                    "Delete shadow cell shouldn't be there");
+        assertTrue(CellUtils.hasCell(rowId, fam, qual, tx2.getStartTimestamp(), getter),
+                   "Put cell should be there");
+        assertTrue(CellUtils.hasShadowCell(rowId, fam, qual, tx2.getStartTimestamp(), getter),
+                   "Put shadow cell shouldn't be there");
     }
 
     private void setCompactorLWM(long lwm, String tableName) throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/4323560f/hbase-coprocessor/src/test/java/org/apache/omid/transaction/TestCompactorScanner.java
----------------------------------------------------------------------
diff --git a/hbase-coprocessor/src/test/java/org/apache/omid/transaction/TestCompactorScanner.java b/hbase-coprocessor/src/test/java/org/apache/omid/transaction/TestCompactorScanner.java
index 4de3dc9..c2aca8a 100644
--- a/hbase-coprocessor/src/test/java/org/apache/omid/transaction/TestCompactorScanner.java
+++ b/hbase-coprocessor/src/test/java/org/apache/omid/transaction/TestCompactorScanner.java
@@ -18,8 +18,6 @@
 package org.apache.omid.transaction;
 
 import com.google.common.util.concurrent.SettableFuture;
-import org.apache.omid.committable.CommitTable;
-import org.apache.omid.committable.CommitTable.Client;
 import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.KeyValue.Type;
@@ -29,6 +27,8 @@ import org.apache.hadoop.hbase.regionserver.CompactorScanner;
 import org.apache.hadoop.hbase.regionserver.HRegion;
 import org.apache.hadoop.hbase.regionserver.InternalScanner;
 import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.omid.committable.CommitTable;
+import org.apache.omid.committable.CommitTable.Client;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.annotations.DataProvider;
@@ -39,8 +39,8 @@ import java.util.Queue;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.when;
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
 
 public class TestCompactorScanner {
 
@@ -94,10 +94,10 @@ public class TestCompactorScanner {
             KeyValue deleteFamilyVersionKV = new KeyValue(Bytes.toBytes("test-row"), TEST_TS, Type.DeleteFamilyVersion);
 
             assertFalse(scanner.shouldRetainNonTransactionallyDeletedCell(regularKV));
-            assertEquals(retainOption, scanner.shouldRetainNonTransactionallyDeletedCell(deleteKV));
-            assertEquals(retainOption, scanner.shouldRetainNonTransactionallyDeletedCell(deleteColumnKV));
-            assertEquals(retainOption, scanner.shouldRetainNonTransactionallyDeletedCell(deleteFamilyKV));
-            assertEquals(retainOption, scanner.shouldRetainNonTransactionallyDeletedCell(deleteFamilyVersionKV));
+            assertEquals(scanner.shouldRetainNonTransactionallyDeletedCell(deleteKV), retainOption);
+            assertEquals(scanner.shouldRetainNonTransactionallyDeletedCell(deleteColumnKV), retainOption);
+            assertEquals(scanner.shouldRetainNonTransactionallyDeletedCell(deleteFamilyKV), retainOption);
+            assertEquals(scanner.shouldRetainNonTransactionallyDeletedCell(deleteFamilyVersionKV), retainOption);
 
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/4323560f/timestamp-storage/src/test/java/org/apache/omid/timestamp/storage/TestHBaseTimestampStorage.java
----------------------------------------------------------------------
diff --git a/timestamp-storage/src/test/java/org/apache/omid/timestamp/storage/TestHBaseTimestampStorage.java b/timestamp-storage/src/test/java/org/apache/omid/timestamp/storage/TestHBaseTimestampStorage.java
index 0f3ba80..a69dfe9 100644
--- a/timestamp-storage/src/test/java/org/apache/omid/timestamp/storage/TestHBaseTimestampStorage.java
+++ b/timestamp-storage/src/test/java/org/apache/omid/timestamp/storage/TestHBaseTimestampStorage.java
@@ -36,8 +36,9 @@ import org.testng.annotations.Test;
 
 import java.io.IOException;
 
-import static org.apache.omid.timestamp.storage.HBaseTimestampStorageConfig.*;
-import static org.testng.AssertJUnit.assertEquals;
+import static org.apache.omid.timestamp.storage.HBaseTimestampStorageConfig.DEFAULT_TIMESTAMP_STORAGE_CF_NAME;
+import static org.apache.omid.timestamp.storage.HBaseTimestampStorageConfig.DEFAULT_TIMESTAMP_STORAGE_TABLE_NAME;
+import static org.testng.Assert.assertEquals;
 
 public class TestHBaseTimestampStorage {
 
@@ -111,7 +112,7 @@ public class TestHBaseTimestampStorage {
         HBaseTimestampStorage tsStorage = new HBaseTimestampStorage(hbaseConf, config);
 
         // Test that the first time we get the timestamp is the initial value
-        assertEquals("Initial value should be " + INITIAL_TS_VALUE, INITIAL_TS_VALUE, tsStorage.getMaxTimestamp());
+        assertEquals(tsStorage.getMaxTimestamp(), INITIAL_TS_VALUE, "Initial value should be " + INITIAL_TS_VALUE);
 
         // Test that updating the timestamp succeeds when passing the initial value as the previous one
         long newTimestamp = 1;
@@ -125,12 +126,13 @@ public class TestHBaseTimestampStorage {
         } catch (IOException e) {
             // Correct behavior
         }
-        assertEquals("Value should be still " + newTimestamp, newTimestamp, tsStorage.getMaxTimestamp());
+        assertEquals(tsStorage.getMaxTimestamp(), newTimestamp, "Value should be still " + newTimestamp);
 
         // Test we can set a new timestamp when passing the right previous max timestamp
         long veryNewTimestamp = 40;
         tsStorage.updateMaxTimestamp(newTimestamp, veryNewTimestamp);
-        assertEquals("Value should be " + veryNewTimestamp, veryNewTimestamp, tsStorage.getMaxTimestamp());
+        assertEquals(tsStorage.getMaxTimestamp(), veryNewTimestamp, "Value should be " + veryNewTimestamp);
+
     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/4323560f/transaction-client/src/test/java/org/apache/omid/tso/client/TestMockTSOClient.java
----------------------------------------------------------------------
diff --git a/transaction-client/src/test/java/org/apache/omid/tso/client/TestMockTSOClient.java b/transaction-client/src/test/java/org/apache/omid/tso/client/TestMockTSOClient.java
index 8e586db..1ad54e3 100644
--- a/transaction-client/src/test/java/org/apache/omid/tso/client/TestMockTSOClient.java
+++ b/transaction-client/src/test/java/org/apache/omid/tso/client/TestMockTSOClient.java
@@ -21,13 +21,13 @@ import com.google.common.collect.Sets;
 import org.apache.omid.committable.CommitTable;
 import org.apache.omid.committable.InMemoryCommitTable;
 import org.apache.omid.tso.util.DummyCellIdImpl;
-import org.testng.Assert;
-import org.testng.AssertJUnit;
 import org.testng.annotations.Test;
 
 import java.util.concurrent.ExecutionException;
 
-import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
 
 public class TestMockTSOClient {
 
@@ -46,9 +46,9 @@ public class TestMockTSOClient {
 
         try {
             client.commit(tr2, Sets.newHashSet(c1, c2)).get();
-            Assert.fail("Shouldn't have committed");
+            fail("Shouldn't have committed");
         } catch (ExecutionException ee) {
-            assertEquals("Should have aborted", ee.getCause().getClass(), AbortException.class);
+            assertEquals(ee.getCause().getClass(), AbortException.class, "Should have aborted");
         }
     }
 
@@ -67,6 +67,6 @@ public class TestMockTSOClient {
         client.commit(tr2, Sets.newHashSet(c1)).get();
 
         long newWatermark = commitTableClient.readLowWatermark().get();
-        AssertJUnit.assertTrue("new low watermark should be bigger", newWatermark > initWatermark);
+        assertTrue(newWatermark > initWatermark, "new low watermark should be bigger");
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/4323560f/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java b/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
index 0fe4a22..844a98d 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestBatch.java
@@ -26,17 +26,16 @@ import org.mockito.MockitoAnnotations;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.Assert;
-import org.testng.AssertJUnit;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyLong;
-import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.timeout;
 import static org.mockito.Mockito.verify;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
 
 public class TestBatch {
 
@@ -73,15 +72,15 @@ public class TestBatch {
         PersistenceProcessorImpl.Batch batch = new PersistenceProcessorImpl.Batch(BATCH_SIZE);
 
         // Test initial state is OK
-        AssertJUnit.assertFalse("Batch shouldn't be full", batch.isFull());
-        AssertJUnit.assertEquals("Num events should be 0", 0, batch.getNumEvents());
+        assertFalse(batch.isFull(), "Batch shouldn't be full");
+        assertEquals(batch.getNumEvents(), 0, "Num events should be 0");
 
         // Test adding a single commit event is OK
         MonitoringContext monCtx = new MonitoringContext(metrics);
         monCtx.timerStart("commitPersistProcessor");
         batch.addCommit(0, 1, channel, monCtx);
-        AssertJUnit.assertFalse("Batch shouldn't be full", batch.isFull());
-        AssertJUnit.assertEquals("Num events should be 1", 1, batch.getNumEvents());
+        assertFalse(batch.isFull(), "Batch shouldn't be full");
+        assertEquals(batch.getNumEvents(), 1, "Num events should be 1");
 
         // Test when filling the batch with events, batch is full
         for (int i = 0; i < (BATCH_SIZE - 1); i++) {
@@ -95,8 +94,8 @@ public class TestBatch {
                 batch.addCommit(i, i + 1, channel, monCtx);
             }
         }
-        AssertJUnit.assertTrue("Batch should be full", batch.isFull());
-        AssertJUnit.assertEquals("Num events should be " + BATCH_SIZE, BATCH_SIZE, batch.getNumEvents());
+        assertTrue(batch.isFull(), "Batch should be full");
+        assertEquals(batch.getNumEvents(), BATCH_SIZE, "Num events should be " + BATCH_SIZE);
 
         // Test an exception is thrown when batch is full and a new element is going to be added
         try {
@@ -105,7 +104,7 @@ public class TestBatch {
             batch.addCommit(0, 1, channel, new MonitoringContext(metrics));
             Assert.fail("Should throw an IllegalStateException");
         } catch (IllegalStateException e) {
-            AssertJUnit.assertEquals("message returned doesn't match", "batch full", e.getMessage());
+            assertEquals(e.getMessage(), "batch full", "message returned doesn't match");
             LOG.debug("IllegalStateException catched properly");
         }
 
@@ -115,8 +114,8 @@ public class TestBatch {
                 .timestampResponse(anyLong(), any(Channel.class), any(MonitoringContext.class));
         verify(replyProcessor, timeout(100).times(BATCH_SIZE / 2))
                 .commitResponse(anyLong(), anyLong(), any(Channel.class), any(MonitoringContext.class));
-        AssertJUnit.assertFalse("Batch shouldn't be full", batch.isFull());
-        AssertJUnit.assertEquals("Num events should be 0", 0, batch.getNumEvents());
+        assertFalse(batch.isFull(), "Batch shouldn't be full");
+        assertEquals(batch.getNumEvents(), 0, "Num events should be 0");
 
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/4323560f/tso-server/src/test/java/org/apache/omid/tso/TestLeaseManager.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestLeaseManager.java b/tso-server/src/test/java/org/apache/omid/tso/TestLeaseManager.java
index 62c3435..32a060c 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestLeaseManager.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestLeaseManager.java
@@ -44,8 +44,8 @@ import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 import static org.testng.Assert.assertEquals;
-import static org.testng.AssertJUnit.assertFalse;
-import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
 
 public class TestLeaseManager {
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/4323560f/tso-server/src/test/java/org/apache/omid/tso/TestRequestProcessor.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestRequestProcessor.java b/tso-server/src/test/java/org/apache/omid/tso/TestRequestProcessor.java
index d1272a7..8dd66d3 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestRequestProcessor.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestRequestProcessor.java
@@ -37,7 +37,7 @@ import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.timeout;
 import static org.mockito.Mockito.verify;
-import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.Assert.assertTrue;
 
 public class TestRequestProcessor {
 
@@ -113,7 +113,7 @@ public class TestRequestProcessor {
         ArgumentCaptor<Long> commitTScapture = ArgumentCaptor.forClass(Long.class);
 
         verify(persist, timeout(100).times(1)).persistCommit(eq(firstTS), commitTScapture.capture(), any(Channel.class), any(MonitoringContext.class));
-        assertTrue("Commit TS must be greater than start TS", commitTScapture.getValue() > firstTS);
+        assertTrue(commitTScapture.getValue() > firstTS, "Commit TS must be greater than start TS");
 
         // test conflict
         requestProc.timestampRequest(null, new MonitoringContext(metrics));

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/4323560f/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java b/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java
index d971e6c..7c4afac 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestRetryProcessor.java
@@ -34,10 +34,9 @@ import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
 import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.timeout;
 import static org.mockito.Mockito.verify;
-import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.Assert.assertEquals;
 
 public class TestRetryProcessor {
 
@@ -80,7 +79,7 @@ public class TestRetryProcessor {
         verify(replyProc, timeout(100).times(1)).abortResponse(firstTScapture.capture(), any(Channel.class), any(MonitoringContext.class));
 
         long startTS = firstTScapture.getValue();
-        assertEquals("Captured timestamp should be the same as NON_EXISTING_ST_TX", NON_EXISTING_ST_TX, startTS);
+        assertEquals(startTS, NON_EXISTING_ST_TX, "Captured timestamp should be the same as NON_EXISTING_ST_TX");
 
         // Test we'll reply with a commit for a retry request when the start timestamp IS in the commit table
         commitTable.getWriter().addCommittedTransaction(ST_TX_1, CT_TX_1); // Add a tx to commit table
@@ -92,8 +91,8 @@ public class TestRetryProcessor {
 
         startTS = firstTScapture.getValue();
         long commitTS = secondTScapture.getValue();
-        assertEquals("Captured timestamp should be the same as ST_TX_1", ST_TX_1, startTS);
-        assertEquals("Captured timestamp should be the same as CT_TX_1", CT_TX_1, commitTS);
+        assertEquals(startTS, ST_TX_1, "Captured timestamp should be the same as ST_TX_1");
+        assertEquals(commitTS, CT_TX_1, "Captured timestamp should be the same as CT_TX_1");
     }
 
     @Test(timeOut = 10_000)

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/4323560f/tso-server/src/test/java/org/apache/omid/tso/TestTSOStateManager.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestTSOStateManager.java b/tso-server/src/test/java/org/apache/omid/tso/TestTSOStateManager.java
index 2b4b250..b472d7f 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestTSOStateManager.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestTSOStateManager.java
@@ -31,7 +31,7 @@ import static org.mockito.Mockito.timeout;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 import static org.testng.Assert.assertEquals;
-import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.Assert.assertTrue;
 
 public class TestTSOStateManager {
 
@@ -57,8 +57,8 @@ public class TestTSOStateManager {
         TSOState initialState = stateManager.initialize();
         assertEquals(initialState.getLowWatermark(), INITIAL_STATE_VALUE);
         assertEquals(initialState.getEpoch(), INITIAL_STATE_VALUE);
-        assertTrue("In this implementation low watermark should be equal to epoch",
-                   initialState.getLowWatermark() == initialState.getEpoch());
+        assertTrue(initialState.getLowWatermark() == initialState.getEpoch(),
+                   "In this implementation low watermark should be equal to epoch");
 
         // Then, simulate a change in the state returned by the Timestamp Oracle...
         when(timestampOracle.getLast()).thenReturn(NEW_STATE_VALUE);
@@ -66,8 +66,8 @@ public class TestTSOStateManager {
         TSOState secondState = stateManager.initialize();
         assertEquals(secondState.getLowWatermark(), NEW_STATE_VALUE);
         assertEquals(secondState.getEpoch(), NEW_STATE_VALUE);
-        assertTrue("In this implementation low watermark should be equal to epoch",
-                   secondState.getLowWatermark() == secondState.getEpoch());
+        assertTrue(secondState.getLowWatermark() == secondState.getEpoch(),
+                   "In this implementation low watermark should be equal to epoch");
 
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/4323560f/tso-server/src/test/java/org/apache/omid/tso/client/TestIntegrationOfTSOClientServerBasicFunctionality.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/client/TestIntegrationOfTSOClientServerBasicFunctionality.java b/tso-server/src/test/java/org/apache/omid/tso/client/TestIntegrationOfTSOClientServerBasicFunctionality.java
index 7fbd77f..e997685 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/client/TestIntegrationOfTSOClientServerBasicFunctionality.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/client/TestIntegrationOfTSOClientServerBasicFunctionality.java
@@ -40,8 +40,8 @@ import java.util.concurrent.ExecutionException;
 
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNotNull;
 import static org.testng.Assert.assertTrue;
-import static org.testng.AssertJUnit.assertNotNull;
 
 public class TestIntegrationOfTSOClientServerBasicFunctionality {
 
@@ -186,7 +186,7 @@ public class TestIntegrationOfTSOClientServerBasicFunctionality {
         assertTrue(commitTsForTx1 > startTsForTx1, "Commit TS should be higher than Start TS for the same tx");
 
         Long commitTs1InCommitTable = commitTableClient.getCommitTimestamp(startTsForTx1).get().get().getValue();
-        assertNotNull("Tx is committed, should return as such from Commit Table", commitTs1InCommitTable);
+        assertNotNull(commitTs1InCommitTable, "Tx is committed, should return as such from Commit Table");
         assertEquals(commitTsForTx1, (long) commitTs1InCommitTable,
                 "getCommitTimestamp() & commit() should report same Commit TS value for same tx");
         assertTrue(commitTs1InCommitTable > startTsForTx2, "Commit TS should be higher than tx's Start TS");


[24/50] [abbrv] incubator-omid git commit: analyze the transactional anomalies described by P. Baillis et al.

Posted by fp...@apache.org.
analyze the transactional anomalies described by P. Baillis et al.

Change-Id: I584f3b5f0cab9a9867f8c47a52acc2fc6df07645


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

Branch: refs/heads/master
Commit: cad28cc9d4a1f9aaf03ec7584764dd385d02494a
Parents: bcdd3d1
Author: Igor Katkov <ka...@yahoo-inc.com>
Authored: Wed Apr 27 18:15:08 2016 -0700
Committer: Igor Katkov <ka...@yahoo-inc.com>
Committed: Thu Apr 28 17:07:23 2016 -0700

----------------------------------------------------------------------
 .../apache/omid/benchmarks/tso/RawTxRunner.java |   2 +-
 .../TestBaillisAnomaliesWithTXs.java            | 601 +++++++++++++++++++
 2 files changed, 602 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/cad28cc9/benchmarks/src/main/java/org/apache/omid/benchmarks/tso/RawTxRunner.java
----------------------------------------------------------------------
diff --git a/benchmarks/src/main/java/org/apache/omid/benchmarks/tso/RawTxRunner.java b/benchmarks/src/main/java/org/apache/omid/benchmarks/tso/RawTxRunner.java
index ef7bb06..f18fb56 100644
--- a/benchmarks/src/main/java/org/apache/omid/benchmarks/tso/RawTxRunner.java
+++ b/benchmarks/src/main/java/org/apache/omid/benchmarks/tso/RawTxRunner.java
@@ -163,7 +163,7 @@ class RawTxRunner implements Runnable {
 
     }
 
-    public void stop() {
+    void stop() {
         isRunning = false;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/cad28cc9/hbase-client/src/test/java/org/apache/omid/transaction/TestBaillisAnomaliesWithTXs.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/test/java/org/apache/omid/transaction/TestBaillisAnomaliesWithTXs.java b/hbase-client/src/test/java/org/apache/omid/transaction/TestBaillisAnomaliesWithTXs.java
new file mode 100644
index 0000000..5bfc8d5
--- /dev/null
+++ b/hbase-client/src/test/java/org/apache/omid/transaction/TestBaillisAnomaliesWithTXs.java
@@ -0,0 +1,601 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.omid.transaction;
+
+import org.apache.hadoop.hbase.client.Delete;
+import org.apache.hadoop.hbase.client.Put;
+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.filter.CompareFilter;
+import org.apache.hadoop.hbase.filter.Filter;
+import org.apache.hadoop.hbase.filter.SingleColumnValueFilter;
+import org.apache.hadoop.hbase.util.Bytes;
+import org.slf4j.Logger;
+import org.testng.ITestContext;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import java.io.IOException;
+import java.util.Arrays;
+
+import static org.slf4j.LoggerFactory.getLogger;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.fail;
+
+/**
+ * These tests try to analyze the transactional anomalies described by P. Baillis et al. in
+ * http://arxiv.org/pdf/1302.0309.pdf
+ *
+ * These tests try to model what project Hermitage is trying to do to compare the behavior of different DBMSs on these
+ * anomalies depending on the different isolation levels they offer. For more info on the Hermitage project, please
+ * refer to: https://github.com/ept/hermitage
+ *
+ * Transactional histories have been translated to HBase from the ones done for Postgresql in the Hermitage project:
+ * https://github.com/ept/hermitage/blob/master/postgres.md
+ *
+ * The "repeatable read" Postgresql isolation level is equivalent to "snapshot isolation", so we include the experiments
+ * for that isolation level
+ *
+ * With HBase 0.98 interfaces is not possible to execute updates/deletes based on predicates so the examples here are
+ * not exactly the same as in Postgres
+ */
+@Test(groups = "sharedHBase")
+public class TestBaillisAnomaliesWithTXs extends OmidTestBase {
+
+    private static final Logger LOG = getLogger(TestBaillisAnomaliesWithTXs.class);
+    private static final String TEST_COLUMN = "baillis-col";
+
+
+    // Data used in the tests
+    private byte[] famName = Bytes.toBytes(TEST_FAMILY);
+    private byte[] colName = Bytes.toBytes(TEST_COLUMN);
+
+    private byte[] rowId1 = Bytes.toBytes("row1");
+    private byte[] rowId2 = Bytes.toBytes("row2");
+    private byte[] rowId3 = Bytes.toBytes("row3");
+
+    private byte[] dataValue1 = Bytes.toBytes(10);
+    private byte[] dataValue2 = Bytes.toBytes(20);
+    private byte[] dataValue3 = Bytes.toBytes(30);
+
+
+    @Test
+    public void testSIPreventsPredicateManyPrecedersForReadPredicates(ITestContext context) throws Exception {
+        // TX History for PMP for Read Predicate:
+        // begin; set transaction isolation level repeatable read; -- T1
+        // begin; set transaction isolation level repeatable read; -- T2
+        // select * from test where value = 30; -- T1. Returns nothing
+        // insert into test (id, value) values(3, 30); -- T2
+        // commit; -- T2
+        // select * from test where value % 3 = 0; -- T1. Still returns nothing
+        // commit; -- T1
+
+        // 0) Start transactions
+        TransactionManager tm = newTransactionManager(context);
+        TTable txTable = new TTable(hbaseConf, TEST_TABLE);
+
+        Transaction tx1 = tm.begin();
+        Transaction tx2 = tm.begin();
+
+        // 1) select * from test where value = 30; -- T1. Returns nothing
+        Scan scan = new Scan();
+        Filter f = new SingleColumnValueFilter(famName, colName, CompareFilter.CompareOp.EQUAL, Bytes.toBytes(30));
+        scan.setFilter(f);
+        ResultScanner tx1Scanner = txTable.getScanner(tx1, scan);
+        assertNull(tx1Scanner.next());
+
+        // 2) insert into test (id, value) values(3, 30); -- T2
+        Put newRow = new Put(rowId3);
+        newRow.add(famName, colName, dataValue3);
+        txTable.put(tx2, newRow);
+
+        // 3) Commit TX 2
+        tm.commit(tx2);
+
+        // 4) select * from test where value % 3 = 0; -- T1. Still returns nothing
+        tx1Scanner = txTable.getScanner(tx1, scan);
+        assertNull(tx1Scanner.next());
+
+        // 5) Commit TX 1
+        tm.commit(tx1);
+    }
+
+    @Test
+    public void testSIPreventsPredicateManyPrecedersForWritePredicates(ITestContext context) throws Exception {
+        // TX History for PMP for Write Predicate:
+        // begin; set transaction isolation level repeatable read; -- T1
+        // begin; set transaction isolation level repeatable read; -- T2
+        // update test set value = value + 10; -- T1
+        // delete from test where value = 20; -- T2, BLOCKS
+        // commit; -- T1. T2 now prints out "ERROR: could not serialize access due to concurrent update"
+        // abort; -- T2. There's nothing else we can do, this transaction has failed
+
+        // 0) Start transactions
+        TransactionManager tm = newTransactionManager(context);
+        TTable txTable = new TTable(hbaseConf, TEST_TABLE);
+        Transaction tx1 = tm.begin();
+        Transaction tx2 = tm.begin();
+
+        // 1) update test set value = value + 10; -- T1
+        Scan updateScan = new Scan();
+        ResultScanner tx1Scanner = txTable.getScanner(tx2, updateScan);
+        Result updateRes = tx1Scanner.next();
+        int count = 0;
+        while (updateRes != null) {
+            LOG.info("RESSS {}", updateRes);
+            Put row = new Put(updateRes.getRow());
+            int val = Bytes.toInt(updateRes.getValue(famName, colName));
+            LOG.info("Updating row id {} with value {}", Bytes.toString(updateRes.getRow()), val);
+            row.add(famName, colName, Bytes.toBytes(val + 10));
+            txTable.put(tx1, row);
+            updateRes = tx1Scanner.next();
+            count++;
+        }
+        assertEquals(count, 2);
+
+        // 2) delete from test where value = 20; -- T2, BLOCKS
+        Scan scan = new Scan();
+        Filter f = new SingleColumnValueFilter(famName, colName, CompareFilter.CompareOp.EQUAL, Bytes.toBytes(20));
+        scan.setFilter(f);
+        ResultScanner tx2Scanner = txTable.getScanner(tx2, scan);
+        // assertEquals(tx2Scanner.next(100).length, 1);
+        Result res = tx2Scanner.next();
+        int count20 = 0;
+        while (res != null) {
+            LOG.info("RESSS {}", res);
+            LOG.info("Deleting row id {} with value {}", Bytes.toString(res.getRow()),
+                     Bytes.toInt(res.getValue(famName, colName)));
+            Delete delete20 = new Delete(res.getRow());
+            txTable.delete(tx2, delete20);
+            res = tx2Scanner.next();
+            count20++;
+        }
+        assertEquals(count20, 1);
+        // 3) commit TX 1
+        tm.commit(tx1);
+
+        tx2Scanner = txTable.getScanner(tx2, scan);
+        assertNull(tx2Scanner.next());
+
+        // 4) commit TX 2 -> Should be rolled-back
+        try {
+            tm.commit(tx2);
+            fail();
+        } catch (RollbackException e) {
+            // Expected
+        }
+
+    }
+
+    @Test
+    public void testSIPreventsLostUpdates(ITestContext context) throws Exception {
+        // TX History for P4:
+        // begin; set transaction isolation level repeatable read; -- T1
+        // begin; set transaction isolation level repeatable read; -- T2
+        // select * from test where id = 1; -- T1
+        // select * from test where id = 1; -- T2
+        // update test set value = 11 where id = 1; -- T1
+        // update test set value = 11 where id = 1; -- T2, BLOCKS
+        // commit; -- T1. T2 now prints out "ERROR: could not serialize access due to concurrent update"
+        // abort;  -- T2. There's nothing else we can do, this transaction has failed
+
+        // 0) Start transactions
+        TransactionManager tm = newTransactionManager(context);
+        TTable txTable = new TTable(hbaseConf, TEST_TABLE);
+        Transaction tx1 = tm.begin();
+        Transaction tx2 = tm.begin();
+
+        Scan scan = new Scan(rowId1, rowId1);
+        scan.addColumn(famName, colName);
+
+        // 1) select * from test where id = 1; -- T1
+        ResultScanner tx1Scanner = txTable.getScanner(tx1, scan);
+        Result res = tx1Scanner.next();
+        int count = 0;
+        while (res != null) {
+            LOG.info("RESSS {}", res);
+            LOG.info("Row id {} with value {}", Bytes.toString(res.getRow()),
+                     Bytes.toString(res.getValue(famName, colName)));
+            assertEquals(res.getRow(), rowId1);
+            assertEquals(res.getValue(famName, colName), dataValue1);
+            res = tx1Scanner.next();
+            count++;
+        }
+        assertEquals(count, 1);
+
+        // 2) select * from test where id = 1; -- T2
+        ResultScanner tx2Scanner = txTable.getScanner(tx2, scan);
+        res = tx2Scanner.next();
+        count = 0;
+        while (res != null) {
+            LOG.info("RESSS {}", res);
+            LOG.info("Row id {} with value {}", Bytes.toString(res.getRow()),
+                     Bytes.toString(res.getValue(famName, colName)));
+            assertEquals(res.getRow(), rowId1);
+            assertEquals(res.getValue(famName, colName), dataValue1);
+            res = tx2Scanner.next();
+            count++;
+        }
+        assertEquals(count, 1);
+
+        // 3) update test set value = 11 where id = 1; -- T1
+        Put updateRow1Tx1 = new Put(rowId1);
+        updateRow1Tx1.add(famName, colName, Bytes.toBytes("11"));
+        txTable.put(tx1, updateRow1Tx1);
+
+        // 4) update test set value = 11 where id = 1; -- T2
+        Put updateRow1Tx2 = new Put(rowId1);
+        updateRow1Tx2.add(famName, colName, Bytes.toBytes("11"));
+        txTable.put(tx2, updateRow1Tx2);
+
+        // 5) commit -- T1
+        tm.commit(tx1);
+
+        // 6) commit -- T2 --> should be rolled-back
+        try {
+            tm.commit(tx2);
+            fail();
+        } catch (RollbackException e) {
+            // Expected
+        }
+
+    }
+
+    @Test
+    public void testSIPreventsReadSkew(ITestContext context) throws Exception {
+        // TX History for G-single:
+        // begin; set transaction isolation level repeatable read; -- T1
+        // begin; set transaction isolation level repeatable read; -- T2
+        // select * from test where id = 1; -- T1. Shows 1 => 10
+        // select * from test where id = 1; -- T2
+        // select * from test where id = 2; -- T2
+        // update test set value = 12 where id = 1; -- T2
+        // update test set value = 18 where id = 2; -- T2
+        // commit; -- T2
+        // select * from test where id = 2; -- T1. Shows 2 => 20
+        // commit; -- T1
+
+        // 0) Start transactions
+        TransactionManager tm = newTransactionManager(context);
+        TTable txTable = new TTable(hbaseConf, TEST_TABLE);
+        Transaction tx1 = tm.begin();
+        Transaction tx2 = tm.begin();
+
+        Scan rowId1Scan = new Scan(rowId1, rowId1);
+        rowId1Scan.addColumn(famName, colName);
+
+        // 1) select * from test where id = 1; -- T1. Shows 1 => 10
+        ResultScanner tx1Scanner = txTable.getScanner(tx1, rowId1Scan);
+        Result res = tx1Scanner.next();
+        int count = 0;
+        while (res != null) {
+            LOG.info("RESSS {}", res);
+            LOG.info("Row id {} with value {}", Bytes.toString(res.getRow()),
+                     Bytes.toString(res.getValue(famName, colName)));
+            assertEquals(res.getRow(), rowId1);
+            assertEquals(res.getValue(famName, colName), dataValue1);
+            res = tx1Scanner.next();
+            count++;
+        }
+        assertEquals(count, 1);
+
+        // 2) select * from test where id = 1; -- T2
+        ResultScanner tx2Scanner = txTable.getScanner(tx2, rowId1Scan);
+        res = tx2Scanner.next();
+        count = 0;
+        while (res != null) {
+            LOG.info("RESSS {}", res);
+            LOG.info("Row id {} with value {}", Bytes.toString(res.getRow()),
+                     Bytes.toString(res.getValue(famName, colName)));
+            assertEquals(res.getRow(), rowId1);
+            assertEquals(res.getValue(famName, colName), dataValue1);
+            res = tx2Scanner.next();
+            count++;
+        }
+
+        Scan rowId2Scan = new Scan(rowId2, rowId2);
+        rowId2Scan.addColumn(famName, colName);
+
+        // 3) select * from test where id = 2; -- T2
+        tx2Scanner = txTable.getScanner(tx2, rowId2Scan);
+        res = tx2Scanner.next();
+        count = 0;
+        while (res != null) {
+            LOG.info("RESSS {}", res);
+            LOG.info("Row id {} with value {}", Bytes.toString(res.getRow()),
+                     Bytes.toString(res.getValue(famName, colName)));
+            assertEquals(res.getRow(), rowId2);
+            assertEquals(res.getValue(famName, colName), dataValue2);
+            res = tx2Scanner.next();
+            count++;
+        }
+
+        // 4) update test set value = 12 where id = 1; -- T2
+        Put updateRow1Tx2 = new Put(rowId1);
+        updateRow1Tx2.add(famName, colName, Bytes.toBytes("12"));
+        txTable.put(tx1, updateRow1Tx2);
+
+        // 5) update test set value = 18 where id = 1; -- T2
+        Put updateRow2Tx2 = new Put(rowId2);
+        updateRow2Tx2.add(famName, colName, Bytes.toBytes("18"));
+        txTable.put(tx2, updateRow2Tx2);
+
+        // 6) commit -- T2
+        tm.commit(tx2);
+
+        // 7) select * from test where id = 2; -- T1. Shows 2 => 20
+        tx1Scanner = txTable.getScanner(tx1, rowId2Scan);
+        res = tx1Scanner.next();
+        count = 0;
+        while (res != null) {
+            LOG.info("RESSS {}", res);
+            LOG.info("Row id {} with value {}", Bytes.toString(res.getRow()),
+                     Bytes.toString(res.getValue(famName, colName)));
+            assertEquals(res.getRow(), rowId2);
+            assertEquals(res.getValue(famName, colName), dataValue2);
+            res = tx1Scanner.next();
+            count++;
+        }
+
+        // 8) commit -- T1
+        tm.commit(tx1);
+
+    }
+
+    @Test
+    public void testSIPreventsReadSkewUsingWritePredicate(ITestContext context) throws Exception {
+        // TX History for G-single:
+        // begin; set transaction isolation level repeatable read; -- T1
+        // begin; set transaction isolation level repeatable read; -- T2
+        // select * from test where id = 1; -- T1. Shows 1 => 10
+        // select * from test; -- T2
+        // update test set value = 12 where id = 1; -- T2
+        // update test set value = 18 where id = 2; -- T2
+        // commit; -- T2
+        // delete from test where value = 20; -- T1. Prints "ERROR: could not serialize access due to concurrent update"
+        // abort; -- T1. There's nothing else we can do, this transaction has failed
+
+        // 0) Start transactions
+        TransactionManager tm = newTransactionManager(context);
+        TTable txTable = new TTable(hbaseConf, TEST_TABLE);
+        Transaction tx1 = tm.begin();
+        Transaction tx2 = tm.begin();
+
+        // 1) select * from test; -- T1
+        assertNumberOfRows(txTable, tx1, 2, new Scan());
+
+        // 2) select * from test; -- T2
+        assertNumberOfRows(txTable, tx2, 2, new Scan());
+
+        // 3) update test set value = 12 where id = 1; -- T2
+        // 4) update test set value = 18 where id = 2; -- T2
+        Put updateRow1Tx2 = new Put(rowId1);
+        updateRow1Tx2.add(famName, colName, Bytes.toBytes(12));
+        Put updateRow2Tx2 = new Put(rowId2);
+        updateRow2Tx2.add(famName, colName, Bytes.toBytes(18));
+        txTable.put(tx2, Arrays.asList(updateRow1Tx2, updateRow2Tx2));
+
+        // 5) commit; -- T2
+        tm.commit(tx2);
+
+        // 6) delete from test where value = 20; -- T1. Prints
+        // "ERROR: could not serialize access due to concurrent update"
+        Filter f = new SingleColumnValueFilter(famName, colName, CompareFilter.CompareOp.EQUAL, Bytes.toBytes(20));
+        Scan checkFor20 = new Scan();
+        checkFor20.setFilter(f);
+        ResultScanner checkFor20Scanner = txTable.getScanner(tx1, checkFor20);
+        Result res = checkFor20Scanner.next();
+        while (res != null) {
+            LOG.info("RESSS {}", res);
+            LOG.info("Deleting row id {} with value {}", Bytes.toString(res.getRow()), Bytes.toInt(res.getValue(famName, colName)));
+            Delete delete20 = new Delete(res.getRow());
+            txTable.delete(tx1, delete20);
+            res = checkFor20Scanner.next();
+        }
+
+        // 7) abort; -- T1
+        try {
+            tm.commit(tx1);
+            fail("Should be aborted");
+        } catch (RollbackException e) {
+            // Expected
+        }
+
+    }
+
+    // this test shows that Omid does not provide serilizable level of isolation other wise last commit would have failed
+    @Test
+    public void testSIDoesNotPreventWriteSkew(ITestContext context) throws Exception {
+        // TX History for G2-item:
+        // begin; set transaction isolation level repeatable read; -- T1
+        // begin; set transaction isolation level repeatable read; -- T2
+        // select * from test where id in (1,2); -- T1
+        // select * from test where id in (1,2); -- T2
+        // update test set value = 11 where id = 1; -- T1
+        // update test set value = 21 where id = 2; -- T2
+        // commit; -- T1
+        // commit; -- T2
+
+        // 0) Start transactions
+        TransactionManager tm = newTransactionManager(context);
+        TTable txTable = new TTable(hbaseConf, TEST_TABLE);
+        Transaction tx1 = tm.begin();
+        Transaction tx2 = tm.begin();
+
+        Scan rowId12Scan = new Scan(rowId1, rowId3);
+        rowId12Scan.addColumn(famName, colName);
+
+        // 1) select * from test where id in (1,2); -- T1
+        ResultScanner tx1Scanner = txTable.getScanner(tx1, rowId12Scan);
+        Result res = tx1Scanner.next();
+        int count = 0;
+        while (res != null) {
+            LOG.info("RESSS {}", res);
+            LOG.info("Row id {} with value {}", Bytes.toString(res.getRow()), Bytes.toInt(res.getValue(famName, colName)));
+            switch (count) {
+                case 0:
+                    assertEquals(res.getRow(), rowId1);
+                    assertEquals(res.getValue(famName, colName), dataValue1);
+                    break;
+                case 1:
+                    assertEquals(res.getRow(), rowId2);
+                    assertEquals(res.getValue(famName, colName), dataValue2);
+                    break;
+                default:
+                    fail();
+            }
+            res = tx1Scanner.next();
+            count++;
+        }
+        assertEquals(count, 2);
+
+        // 2) select * from test where id in (1,2); -- T2
+        ResultScanner tx2Scanner = txTable.getScanner(tx1, rowId12Scan);
+        res = tx2Scanner.next();
+        count = 0;
+        while (res != null) {
+            LOG.info("RESSS {}", res);
+            LOG.info("Row id {} with value {}", Bytes.toString(res.getRow()), Bytes.toInt(res.getValue(famName, colName)));
+            switch (count) {
+                case 0:
+                    assertEquals(res.getRow(), rowId1);
+                    assertEquals(res.getValue(famName, colName), dataValue1);
+                    break;
+                case 1:
+                    assertEquals(res.getRow(), rowId2);
+                    assertEquals(res.getValue(famName, colName), dataValue2);
+                    break;
+                default:
+                    fail();
+            }
+            res = tx2Scanner.next();
+            count++;
+        }
+        assertEquals(count, 2);
+
+        // 3) update test set value = 11 where id = 1; -- T1
+        Put updateRow1Tx1 = new Put(rowId1);
+        updateRow1Tx1.add(famName, colName, Bytes.toBytes("11"));
+        txTable.put(tx1, updateRow1Tx1);
+
+        // 4) update test set value = 21 where id = 2; -- T2
+        Put updateRow2Tx2 = new Put(rowId2);
+        updateRow2Tx2.add(famName, colName, Bytes.toBytes("21"));
+        txTable.put(tx2, updateRow2Tx2);
+
+        // 5) commit; -- T1
+        tm.commit(tx1);
+
+        // 6) commit; -- T2
+        tm.commit(tx2);
+    }
+
+    // this test shows that Omid does not provide serilizable level of isolation other wise last commit would have failed
+    @Test
+    public void testSIDoesNotPreventAntiDependencyCycles(ITestContext context) throws Exception {
+        // TX History for G2:
+        // begin; set transaction isolation level repeatable read; -- T1
+        // begin; set transaction isolation level repeatable read; -- T2
+        // select * from test where value % 3 = 0; -- T1
+        // select * from test where value % 3 = 0; -- T2
+        // insert into test (id, value) values(3, 30); -- T1
+        // insert into test (id, value) values(4, 42); -- T2
+        // commit; -- T1
+        // commit; -- T2
+        // select * from test where value % 3 = 0; -- Either. Returns 3 => 30, 4 => 42
+
+        // 0) Start transactions
+        TransactionManager tm = newTransactionManager(context);
+        TTable txTable = new TTable(hbaseConf, TEST_TABLE);
+        Transaction tx1 = tm.begin();
+        Transaction tx2 = tm.begin();
+
+        Filter f = new SingleColumnValueFilter(famName, colName, CompareFilter.CompareOp.EQUAL, Bytes.toBytes("30"));
+        Scan value30 = new Scan();
+        value30.setFilter(f);
+        value30.addColumn(famName, colName);
+
+        // 1) select * from test where value % 3 = 0; -- T1
+        assertNumberOfRows(txTable, tx1, 0, value30);
+
+
+        // 2) select * from test where value % 3 = 0; -- T2
+        assertNumberOfRows(txTable, tx2, 0, value30);
+
+
+        // 3) insert into test (id, value) values(3, 30); -- T1
+        Put insertRow3Tx1 = new Put(rowId1);
+        insertRow3Tx1.add(famName, colName, Bytes.toBytes("30"));
+        txTable.put(tx1, insertRow3Tx1);
+
+        // 4) insert into test (id, value) values(4, 42); -- T2
+        Put updateRow4Tx2 = new Put(rowId2);
+        updateRow4Tx2.add(famName, colName, Bytes.toBytes("42"));
+        txTable.put(tx2, updateRow4Tx2);
+
+        // 5) commit; -- T1
+        tm.commit(tx1);
+
+        // 6) commit; -- T2
+        tm.commit(tx2);
+
+        // 7) select * from test where value % 3 = 0; -- Either. Returns 3 => 30, 4 => 42
+    }
+
+    /**
+     * This translates the table initialization done in:
+     * https://github.com/ept/hermitage/blob/master/postgres.md
+     *
+     * create table test (id int primary key, value int);
+     * insert into test (id, value) values (1, 10), (2, 20);
+     */
+    @BeforeMethod(alwaysRun = true)
+    private void loadBaseDataOnTestTable(ITestContext context) throws Exception {
+
+        TransactionManager tm = newTransactionManager(context);
+        TTable txTable = new TTable(hbaseConf, TEST_TABLE);
+
+        Transaction initializationTx = tm.begin();
+        Put row1 = new Put(rowId1);
+        row1.add(famName, colName, dataValue1);
+        txTable.put(initializationTx, row1);
+        Put row2 = new Put(rowId2);
+        row2.add(famName, colName, dataValue2);
+        txTable.put(initializationTx, row2);
+
+        tm.commit(initializationTx);
+    }
+
+
+    private void assertNumberOfRows(TTable txTable, Transaction tx2, int maxCount, Scan scan) throws IOException {
+        int count = 0;
+        ResultScanner tx2Scanner = txTable.getScanner(tx2, scan);
+        Result res = tx2Scanner.next();
+        while (res != null) {
+            LOG.info("RESSS {}", res);
+            LOG.info("Row id {} with value {}", Bytes.toString(res.getRow()), Bytes.toInt(res.getValue(famName, colName)));
+            res = tx2Scanner.next();
+            count++;
+        }
+        assertEquals(count, maxCount);
+    }
+
+
+}


[27/50] [abbrv] incubator-omid git commit: [ci skip]prepare for next development iteration

Posted by fp...@apache.org.
[ci skip]prepare for next development iteration


Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/41d2e23f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/41d2e23f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/41d2e23f

Branch: refs/heads/master
Commit: 41d2e23fb47fe4d62d3ce363de7154423c8f1c03
Parents: 6422981
Author: Omid CI <om...@yahoo-inc.com>
Authored: Fri Apr 29 00:24:06 2016 +0000
Committer: Omid CI <om...@yahoo-inc.com>
Committed: Fri Apr 29 00:24:06 2016 +0000

----------------------------------------------------------------------
 benchmarks/pom.xml          | 2 +-
 codahale-metrics/pom.xml    | 2 +-
 commit-table/pom.xml        | 2 +-
 common/pom.xml              | 2 +-
 examples/pom.xml            | 2 +-
 hbase-client/pom.xml        | 2 +-
 hbase-commit-table/pom.xml  | 2 +-
 hbase-common/pom.xml        | 2 +-
 hbase-coprocessor/pom.xml   | 2 +-
 hbase-shims/hbase-0/pom.xml | 2 +-
 hbase-shims/hbase-1/pom.xml | 2 +-
 hbase-shims/pom.xml         | 2 +-
 hbase-tools/pom.xml         | 2 +-
 metrics/pom.xml             | 2 +-
 pom.xml                     | 4 ++--
 statemachine/pom.xml        | 2 +-
 timestamp-storage/pom.xml   | 2 +-
 transaction-client/pom.xml  | 2 +-
 tso-server/pom.xml          | 2 +-
 19 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/41d2e23f/benchmarks/pom.xml
----------------------------------------------------------------------
diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml
index fccea84..cd373df 100644
--- a/benchmarks/pom.xml
+++ b/benchmarks/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.47</version>
+        <version>0.8.1.48-SNAPSHOT</version>
     </parent>
 
     <artifactId>benchmarks</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/41d2e23f/codahale-metrics/pom.xml
----------------------------------------------------------------------
diff --git a/codahale-metrics/pom.xml b/codahale-metrics/pom.xml
index 4ad45e6..d8272c6 100644
--- a/codahale-metrics/pom.xml
+++ b/codahale-metrics/pom.xml
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.47</version>
+        <version>0.8.1.48-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/41d2e23f/commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/commit-table/pom.xml b/commit-table/pom.xml
index fa670d3..ad9a3cc 100644
--- a/commit-table/pom.xml
+++ b/commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.47</version>
+        <version>0.8.1.48-SNAPSHOT</version>
     </parent>
 
     <artifactId>commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/41d2e23f/common/pom.xml
----------------------------------------------------------------------
diff --git a/common/pom.xml b/common/pom.xml
index 095513b..c9cafdf 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.47</version>
+        <version>0.8.1.48-SNAPSHOT</version>
     </parent>
 
     <artifactId>common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/41d2e23f/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 8738e00..236e377 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.47</version>
+        <version>0.8.1.48-SNAPSHOT</version>
     </parent>
 
     <artifactId>examples</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/41d2e23f/hbase-client/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml
index 34acce4..39d9e42 100644
--- a/hbase-client/pom.xml
+++ b/hbase-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.47</version>
+        <version>0.8.1.48-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/41d2e23f/hbase-commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-commit-table/pom.xml b/hbase-commit-table/pom.xml
index b3184dc..f0c6b6c 100644
--- a/hbase-commit-table/pom.xml
+++ b/hbase-commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.47</version>
+        <version>0.8.1.48-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/41d2e23f/hbase-common/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml
index 2a75d5e..ac45421 100644
--- a/hbase-common/pom.xml
+++ b/hbase-common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.47</version>
+        <version>0.8.1.48-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/41d2e23f/hbase-coprocessor/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-coprocessor/pom.xml b/hbase-coprocessor/pom.xml
index 746a6bf..405fde1 100644
--- a/hbase-coprocessor/pom.xml
+++ b/hbase-coprocessor/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.47</version>
+        <version>0.8.1.48-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-coprocessor</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/41d2e23f/hbase-shims/hbase-0/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-0/pom.xml b/hbase-shims/hbase-0/pom.xml
index dccd50e..6dab82f 100644
--- a/hbase-shims/hbase-0/pom.xml
+++ b/hbase-shims/hbase-0/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.47</version>
+        <version>0.8.1.48-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase0-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/41d2e23f/hbase-shims/hbase-1/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-1/pom.xml b/hbase-shims/hbase-1/pom.xml
index 5be4045..4183e3a 100644
--- a/hbase-shims/hbase-1/pom.xml
+++ b/hbase-shims/hbase-1/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.47</version>
+        <version>0.8.1.48-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase1-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/41d2e23f/hbase-shims/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/pom.xml b/hbase-shims/pom.xml
index a4d2572..432fbe9 100644
--- a/hbase-shims/pom.xml
+++ b/hbase-shims/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.47</version>
+        <version>0.8.1.48-SNAPSHOT</version>
     </parent>
 
     <artifactId>omid-shims-aggregator</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/41d2e23f/hbase-tools/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-tools/pom.xml b/hbase-tools/pom.xml
index 0ae2841..312bec4 100644
--- a/hbase-tools/pom.xml
+++ b/hbase-tools/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.47</version>
+        <version>0.8.1.48-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-tools</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/41d2e23f/metrics/pom.xml
----------------------------------------------------------------------
diff --git a/metrics/pom.xml b/metrics/pom.xml
index 5896689..41b37b7 100644
--- a/metrics/pom.xml
+++ b/metrics/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.47</version>
+        <version>0.8.1.48-SNAPSHOT</version>
     </parent>
 
     <artifactId>metrics</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/41d2e23f/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index e61d15c..84881d5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
     <artifactId>omid</artifactId>
     <packaging>pom</packaging>
     <!-- WARNING: do not update version manually, use mvn versions:set -->
-    <version>0.8.1.47</version>
+    <version>0.8.1.48-SNAPSHOT</version>
 
     <organization>
         <name>Apache Software Foundation</name>
@@ -105,7 +105,7 @@
         <connection>scm:git:git://github.com/yahoo/omid.git</connection>
         <developerConnection>scm:git:https://${GH_TOKEN}@github.com/yahoo/omid.git</developerConnection>
         <url>https://github.com/yahoo/omid</url>
-        <tag>omid-0.8.1.47</tag>
+        <tag>master</tag>
     </scm>
 
     <distributionManagement>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/41d2e23f/statemachine/pom.xml
----------------------------------------------------------------------
diff --git a/statemachine/pom.xml b/statemachine/pom.xml
index b140eac..9db6e9b 100644
--- a/statemachine/pom.xml
+++ b/statemachine/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.47</version>
+        <version>0.8.1.48-SNAPSHOT</version>
     </parent>
 
     <name>State Machine</name>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/41d2e23f/timestamp-storage/pom.xml
----------------------------------------------------------------------
diff --git a/timestamp-storage/pom.xml b/timestamp-storage/pom.xml
index 4633585..5392e26 100644
--- a/timestamp-storage/pom.xml
+++ b/timestamp-storage/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.47</version>
+        <version>0.8.1.48-SNAPSHOT</version>
     </parent>
 
     <artifactId>timestamp-storage</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/41d2e23f/transaction-client/pom.xml
----------------------------------------------------------------------
diff --git a/transaction-client/pom.xml b/transaction-client/pom.xml
index 4e52a92..8b4efff 100644
--- a/transaction-client/pom.xml
+++ b/transaction-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.47</version>
+        <version>0.8.1.48-SNAPSHOT</version>
     </parent>
 
     <artifactId>transaction-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/41d2e23f/tso-server/pom.xml
----------------------------------------------------------------------
diff --git a/tso-server/pom.xml b/tso-server/pom.xml
index b328c26..3a520d8 100644
--- a/tso-server/pom.xml
+++ b/tso-server/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.47</version>
+        <version>0.8.1.48-SNAPSHOT</version>
     </parent>
 
     <artifactId>tso-server</artifactId>


[46/50] [abbrv] incubator-omid git commit: [ci skip]prepare for next development iteration

Posted by fp...@apache.org.
[ci skip]prepare for next development iteration


Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/9ea34730
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/9ea34730
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/9ea34730

Branch: refs/heads/master
Commit: 9ea34730df464a30df3084ad9ae19954576caab9
Parents: 06bd23c
Author: Omid CI <om...@yahoo-inc.com>
Authored: Wed May 11 01:22:23 2016 +0000
Committer: Omid CI <om...@yahoo-inc.com>
Committed: Wed May 11 01:22:23 2016 +0000

----------------------------------------------------------------------
 benchmarks/pom.xml          | 2 +-
 codahale-metrics/pom.xml    | 2 +-
 commit-table/pom.xml        | 2 +-
 common/pom.xml              | 2 +-
 examples/pom.xml            | 2 +-
 hbase-client/pom.xml        | 2 +-
 hbase-commit-table/pom.xml  | 2 +-
 hbase-common/pom.xml        | 2 +-
 hbase-coprocessor/pom.xml   | 2 +-
 hbase-shims/hbase-0/pom.xml | 2 +-
 hbase-shims/hbase-1/pom.xml | 2 +-
 hbase-shims/pom.xml         | 2 +-
 hbase-tools/pom.xml         | 2 +-
 metrics/pom.xml             | 2 +-
 pom.xml                     | 4 ++--
 statemachine/pom.xml        | 2 +-
 timestamp-storage/pom.xml   | 2 +-
 transaction-client/pom.xml  | 2 +-
 tso-server/pom.xml          | 2 +-
 19 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9ea34730/benchmarks/pom.xml
----------------------------------------------------------------------
diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml
index b4e9cf1..e48827e 100644
--- a/benchmarks/pom.xml
+++ b/benchmarks/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.49</version>
+        <version>0.8.1.50-SNAPSHOT</version>
     </parent>
 
     <artifactId>benchmarks</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9ea34730/codahale-metrics/pom.xml
----------------------------------------------------------------------
diff --git a/codahale-metrics/pom.xml b/codahale-metrics/pom.xml
index fad6b84..314d8aa 100644
--- a/codahale-metrics/pom.xml
+++ b/codahale-metrics/pom.xml
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.49</version>
+        <version>0.8.1.50-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9ea34730/commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/commit-table/pom.xml b/commit-table/pom.xml
index d2962c7..495d295 100644
--- a/commit-table/pom.xml
+++ b/commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.49</version>
+        <version>0.8.1.50-SNAPSHOT</version>
     </parent>
 
     <artifactId>commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9ea34730/common/pom.xml
----------------------------------------------------------------------
diff --git a/common/pom.xml b/common/pom.xml
index baeb35e..68f3e1a 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.49</version>
+        <version>0.8.1.50-SNAPSHOT</version>
     </parent>
 
     <artifactId>common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9ea34730/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 90af3cb..f1412c8 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.49</version>
+        <version>0.8.1.50-SNAPSHOT</version>
     </parent>
 
     <artifactId>examples</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9ea34730/hbase-client/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml
index f29066d..70bd821 100644
--- a/hbase-client/pom.xml
+++ b/hbase-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.49</version>
+        <version>0.8.1.50-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9ea34730/hbase-commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-commit-table/pom.xml b/hbase-commit-table/pom.xml
index 20c6291..e54c603 100644
--- a/hbase-commit-table/pom.xml
+++ b/hbase-commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.49</version>
+        <version>0.8.1.50-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9ea34730/hbase-common/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml
index 29d7f3a..439f010 100644
--- a/hbase-common/pom.xml
+++ b/hbase-common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.49</version>
+        <version>0.8.1.50-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9ea34730/hbase-coprocessor/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-coprocessor/pom.xml b/hbase-coprocessor/pom.xml
index 653a435..ad9c824 100644
--- a/hbase-coprocessor/pom.xml
+++ b/hbase-coprocessor/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.49</version>
+        <version>0.8.1.50-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-coprocessor</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9ea34730/hbase-shims/hbase-0/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-0/pom.xml b/hbase-shims/hbase-0/pom.xml
index 3c451eb..aa05aeb 100644
--- a/hbase-shims/hbase-0/pom.xml
+++ b/hbase-shims/hbase-0/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.49</version>
+        <version>0.8.1.50-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase0-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9ea34730/hbase-shims/hbase-1/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-1/pom.xml b/hbase-shims/hbase-1/pom.xml
index fc5721e..7e99fcf 100644
--- a/hbase-shims/hbase-1/pom.xml
+++ b/hbase-shims/hbase-1/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.49</version>
+        <version>0.8.1.50-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase1-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9ea34730/hbase-shims/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/pom.xml b/hbase-shims/pom.xml
index 6556289..4a7a59b 100644
--- a/hbase-shims/pom.xml
+++ b/hbase-shims/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.49</version>
+        <version>0.8.1.50-SNAPSHOT</version>
     </parent>
 
     <artifactId>omid-shims-aggregator</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9ea34730/hbase-tools/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-tools/pom.xml b/hbase-tools/pom.xml
index 5d479f1..3bb71a7 100644
--- a/hbase-tools/pom.xml
+++ b/hbase-tools/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.49</version>
+        <version>0.8.1.50-SNAPSHOT</version>
     </parent>
 
     <artifactId>hbase-tools</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9ea34730/metrics/pom.xml
----------------------------------------------------------------------
diff --git a/metrics/pom.xml b/metrics/pom.xml
index 514afbb..935a2d2 100644
--- a/metrics/pom.xml
+++ b/metrics/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.49</version>
+        <version>0.8.1.50-SNAPSHOT</version>
     </parent>
 
     <artifactId>metrics</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9ea34730/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index a572667..ee9d39f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
     <artifactId>omid</artifactId>
     <packaging>pom</packaging>
     <!-- WARNING: do not update version manually, use mvn versions:set -->
-    <version>0.8.1.49</version>
+    <version>0.8.1.50-SNAPSHOT</version>
 
     <organization>
         <name>Apache Software Foundation</name>
@@ -105,7 +105,7 @@
         <connection>scm:git:git://github.com/yahoo/omid.git</connection>
         <developerConnection>scm:git:https://${GH_TOKEN}@github.com/yahoo/omid.git</developerConnection>
         <url>https://github.com/yahoo/omid</url>
-        <tag>omid-0.8.1.49</tag>
+        <tag>master</tag>
     </scm>
 
     <distributionManagement>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9ea34730/statemachine/pom.xml
----------------------------------------------------------------------
diff --git a/statemachine/pom.xml b/statemachine/pom.xml
index 47c7be3..02255a2 100644
--- a/statemachine/pom.xml
+++ b/statemachine/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.49</version>
+        <version>0.8.1.50-SNAPSHOT</version>
     </parent>
 
     <name>State Machine</name>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9ea34730/timestamp-storage/pom.xml
----------------------------------------------------------------------
diff --git a/timestamp-storage/pom.xml b/timestamp-storage/pom.xml
index 5edd473..8707ae2 100644
--- a/timestamp-storage/pom.xml
+++ b/timestamp-storage/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.49</version>
+        <version>0.8.1.50-SNAPSHOT</version>
     </parent>
 
     <artifactId>timestamp-storage</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9ea34730/transaction-client/pom.xml
----------------------------------------------------------------------
diff --git a/transaction-client/pom.xml b/transaction-client/pom.xml
index 3d8e6a0..823fe13 100644
--- a/transaction-client/pom.xml
+++ b/transaction-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.49</version>
+        <version>0.8.1.50-SNAPSHOT</version>
     </parent>
 
     <artifactId>transaction-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9ea34730/tso-server/pom.xml
----------------------------------------------------------------------
diff --git a/tso-server/pom.xml b/tso-server/pom.xml
index 1ba655d..13420c9 100644
--- a/tso-server/pom.xml
+++ b/tso-server/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.49</version>
+        <version>0.8.1.50-SNAPSHOT</version>
     </parent>
 
     <artifactId>tso-server</artifactId>


[32/50] [abbrv] incubator-omid git commit: Simplify Batch(Pool) initialization and fix tests

Posted by fp...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/1d60f21d/tso-server/src/test/java/org/apache/omid/tso/client/TestTSOClientRequestAndResponseBehaviours.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/client/TestTSOClientRequestAndResponseBehaviours.java b/tso-server/src/test/java/org/apache/omid/tso/client/TestTSOClientRequestAndResponseBehaviours.java
index 2167fa7..203f46f 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/client/TestTSOClientRequestAndResponseBehaviours.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/client/TestTSOClientRequestAndResponseBehaviours.java
@@ -75,6 +75,7 @@ public class TestTSOClientRequestAndResponseBehaviours {
         TSOServerConfig tsoConfig = new TSOServerConfig();
         tsoConfig.setMaxItems(1000);
         tsoConfig.setPort(TSO_SERVER_PORT);
+        tsoConfig.setNumConcurrentCTWriters(2);
         Module tsoServerMockModule = new TSOMockModule(tsoConfig);
         Injector injector = Guice.createInjector(tsoServerMockModule);
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/1d60f21d/tso-server/src/test/resources/test-omid.yml
----------------------------------------------------------------------
diff --git a/tso-server/src/test/resources/test-omid.yml b/tso-server/src/test/resources/test-omid.yml
index 4729bb1..efba4cc 100644
--- a/tso-server/src/test/resources/test-omid.yml
+++ b/tso-server/src/test/resources/test-omid.yml
@@ -5,7 +5,7 @@ keytab: /home/sieve_omid0/sieve_omid0.prod.headless.keytab
 
 port: 54758
 maxItems: 100000000
-maxBatchSize: 500
+batchSizePerCTWriter: 500
 batchPersistTimeoutInMs: 100
 networkIfaceName: eth1
 


[12/50] [abbrv] incubator-omid git commit: Merge pull request #97 from yahoo/avoid-reseting-tso-state

Posted by fp...@apache.org.
Merge pull request #97 from yahoo/avoid-reseting-tso-state

Avoid reseting TSO state

Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/36e35733
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/36e35733
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/36e35733

Branch: refs/heads/master
Commit: 36e357335f31bc3719d82ec01ea6e5936a219b07
Parents: 10fea27 cf6beee
Author: ikatkov <ik...@gmail.com>
Authored: Tue Apr 26 17:37:02 2016 -0700
Committer: ikatkov <ik...@gmail.com>
Committed: Tue Apr 26 17:37:02 2016 -0700

----------------------------------------------------------------------
 common/src/main/proto/TSOProto.proto            |   1 -
 .../apache/omid/transaction/TestTSOModule.java  |   4 +-
 .../omid/transaction/TestTxMgrFailover.java     | 189 +------------------
 .../transaction/AbstractTransactionManager.java |   7 +-
 .../apache/omid/tso/client/NewTSOException.java |  27 ---
 .../org/apache/omid/tso/client/TSOClient.java   |   9 +-
 .../main/java/org/apache/omid/tso/Cache.java    |  32 ----
 .../org/apache/omid/tso/CacheEvaluation.java    |   2 +-
 .../java/org/apache/omid/tso/CommitHashMap.java |   7 +-
 .../java/org/apache/omid/tso/LeaseManager.java  |  20 +-
 .../java/org/apache/omid/tso/LongCache.java     |  19 +-
 .../java/org/apache/omid/tso/MockPanicker.java  |   7 +
 .../main/java/org/apache/omid/tso/Panicker.java |   4 +
 .../omid/tso/PersistenceProcessorImpl.java      |  48 ++---
 .../org/apache/omid/tso/ReplyProcessor.java     |   8 +-
 .../org/apache/omid/tso/ReplyProcessorImpl.java |  26 +--
 .../apache/omid/tso/RequestProcessorImpl.java   |  11 +-
 .../org/apache/omid/tso/RetryProcessorImpl.java |   2 +-
 .../omid/tso/RuntimeExceptionPanicker.java      |   8 +-
 .../java/org/apache/omid/tso/TSOServer.java     |   2 -
 .../org/apache/omid/tso/TSOStateManager.java    |   6 +-
 .../apache/omid/tso/TSOStateManagerImpl.java    |   8 +-
 .../org/apache/omid/tso/VoidLeaseManager.java   |   2 +-
 .../apache/omid/tso/ProgrammableTSOServer.java  |  14 +-
 .../java/org/apache/omid/tso/TestBatch.java     |  39 +---
 .../org/apache/omid/tso/TestLeaseManager.java   |  30 +--
 .../java/org/apache/omid/tso/TestLongCache.java |  25 +--
 .../omid/tso/TestPersistenceProcessor.java      | 112 ++++++++---
 .../apache/omid/tso/TestRequestProcessor.java   |   4 +-
 .../org/apache/omid/tso/TestRetryProcessor.java |   2 +-
 .../apache/omid/tso/TestTSOStateManager.java    |  22 +--
 ...stTSOClientRequestAndResponseBehaviours.java |   3 -
 .../client/TestTSOClientResponseHandling.java   |  17 +-
 33 files changed, 212 insertions(+), 505 deletions(-)
----------------------------------------------------------------------



[16/50] [abbrv] incubator-omid git commit: Remove JUnit asserts

Posted by fp...@apache.org.
Remove JUnit asserts

No changes in functionality have been done

Change-Id: I48a5409dacac0716191ce332f2d0bbe995ed5761


Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/4323560f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/4323560f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/4323560f

Branch: refs/heads/master
Commit: 4323560f3e8aa85795d601db76ee95c128ce188c
Parents: a5c2c2f
Author: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Authored: Tue Apr 26 13:09:22 2016 -0700
Committer: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Committed: Tue Apr 26 18:19:34 2016 -0700

----------------------------------------------------------------------
 .../apache/omid/transaction/TestAutoFlush.java  |   7 +-
 .../apache/omid/transaction/TestCellUtils.java  |  48 +-
 .../omid/transaction/TestColumnIterator.java    |  10 +-
 .../apache/omid/transaction/TestDeletion.java   |  38 +-
 .../apache/omid/transaction/TestFilters.java    |  34 +-
 .../transaction/TestHBaseTransactionClient.java |  49 +-
 .../apache/omid/transaction/TestReadPath.java   |  12 +-
 .../transaction/TestSingleColumnFamily.java     |  17 +-
 .../transaction/TestTransactionCleanup.java     |  15 +-
 .../transaction/TestTransactionConflict.java    | 161 +++---
 .../apache/omid/transaction/TestUpdateScan.java |  20 +-
 .../committable/hbase/TestHBaseCommitTable.java |  64 +--
 .../apache/omid/transaction/TestCompaction.java | 495 ++++++++-----------
 .../omid/transaction/TestCompactorScanner.java  |  16 +-
 .../storage/TestHBaseTimestampStorage.java      |  12 +-
 .../omid/tso/client/TestMockTSOClient.java      |  12 +-
 .../java/org/apache/omid/tso/TestBatch.java     |  21 +-
 .../org/apache/omid/tso/TestLeaseManager.java   |   4 +-
 .../apache/omid/tso/TestRequestProcessor.java   |   4 +-
 .../org/apache/omid/tso/TestRetryProcessor.java |   9 +-
 .../apache/omid/tso/TestTSOStateManager.java    |  10 +-
 ...tionOfTSOClientServerBasicFunctionality.java |   4 +-
 22 files changed, 469 insertions(+), 593 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/4323560f/hbase-client/src/test/java/org/apache/omid/transaction/TestAutoFlush.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/test/java/org/apache/omid/transaction/TestAutoFlush.java b/hbase-client/src/test/java/org/apache/omid/transaction/TestAutoFlush.java
index ac2052d..dca346b 100644
--- a/hbase-client/src/test/java/org/apache/omid/transaction/TestAutoFlush.java
+++ b/hbase-client/src/test/java/org/apache/omid/transaction/TestAutoFlush.java
@@ -24,13 +24,14 @@ import org.apache.hadoop.hbase.util.Bytes;
 import org.testng.ITestContext;
 import org.testng.annotations.Test;
 
-import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.Assert.assertEquals;
 
 @Test(groups = "sharedHBase")
 public class TestAutoFlush extends OmidTestBase {
 
     @Test
     public void testReadWithSeveralUncommitted(ITestContext context) throws Exception {
+
         byte[] family = Bytes.toBytes(TEST_FAMILY);
         byte[] row = Bytes.toBytes("row");
         byte[] col = Bytes.toBytes("col1");
@@ -49,14 +50,14 @@ public class TestAutoFlush extends OmidTestBase {
         // Data shouldn't be in DB yet
         Get get = new Get(row);
         Result result = table.getHTable().get(get);
-        assertEquals("Writes are already in DB", 0, result.size());
+        assertEquals(result.size(), 0, "Writes are already in DB");
 
         tm.commit(t);
 
         // After commit, both the cell and shadow cell should be there.
         // That's why we check for two elements in the test assertion
         result = table.getHTable().get(get);
-        assertEquals("Writes were not flushed to DB", 2, result.size());
+        assertEquals(result.size(), 2, "Writes were not flushed to DB");
     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/4323560f/hbase-client/src/test/java/org/apache/omid/transaction/TestCellUtils.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/test/java/org/apache/omid/transaction/TestCellUtils.java b/hbase-client/src/test/java/org/apache/omid/transaction/TestCellUtils.java
index 928b55b..351b57c 100644
--- a/hbase-client/src/test/java/org/apache/omid/transaction/TestCellUtils.java
+++ b/hbase-client/src/test/java/org/apache/omid/transaction/TestCellUtils.java
@@ -18,11 +18,11 @@
 package org.apache.omid.transaction;
 
 import com.google.common.base.Optional;
-import org.apache.omid.HBaseShims;
 import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.KeyValue.Type;
 import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.omid.HBaseShims;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
@@ -32,10 +32,10 @@ import java.util.List;
 import java.util.SortedMap;
 
 import static org.apache.omid.transaction.CellUtils.SHADOW_CELL_SUFFIX;
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertFalse;
-import static org.testng.AssertJUnit.assertTrue;
-import static org.testng.AssertJUnit.fail;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
 
 @Test(groups = "noHBase")
 public class TestCellUtils {
@@ -72,27 +72,27 @@ public class TestCellUtils {
         // and is placed at the end of the qualifier:
         // qual_nameSUFFIX
         KeyValue kv = new KeyValue(row, family, validShadowCellQualifier, value);
-        assertTrue("Should include a valid shadowCell identifier", CellUtils.isShadowCell(kv));
+        assertTrue(CellUtils.isShadowCell(kv), "Should include a valid shadowCell identifier");
 
         // We also accept this pattern in the qualifier:
         // SUFFIXqual_nameSUFFIX
         kv = new KeyValue(row, family, sandwichValidShadowCellQualifier, value);
-        assertTrue("Should include a valid shadowCell identifier", CellUtils.isShadowCell(kv));
+        assertTrue(CellUtils.isShadowCell(kv), "Should include a valid shadowCell identifier");
 
         // We also accept this pattern in the qualifier:
         // qual_nameSUFFIXSUFFIX
         kv = new KeyValue(row, family, doubleEndedValidShadowCellQualifier, value);
-        assertTrue("Should include a valid shadowCell identifier", CellUtils.isShadowCell(kv));
+        assertTrue(CellUtils.isShadowCell(kv), "Should include a valid shadowCell identifier");
 
         // We also accept this pattern in the qualifier:
         // qual_nameSUFFIXqual_nameSUFFIXqual_nameSUFFIX
         kv = new KeyValue(row, family, interleavedValidShadowCellQualifier, value);
-        assertTrue("Should include a valid shadowCell identifier", CellUtils.isShadowCell(kv));
+        assertTrue(CellUtils.isShadowCell(kv), "Should include a valid shadowCell identifier");
 
         // Test the qualifier passed is not a shadow cell
         // qualifier if there's nothing else apart from the suffix
         kv = new KeyValue(row, family, shadowCellSuffixToTest, value);
-        assertFalse("Should not include a valid shadowCell identifier", CellUtils.isShadowCell(kv));
+        assertFalse(CellUtils.isShadowCell(kv), "Should not include a valid shadowCell identifier");
 
     }
 
@@ -126,27 +126,27 @@ public class TestCellUtils {
 
         // Check dup shadow cell with same MVCC is ignored
         SortedMap<Cell, Optional<Cell>> cellsToShadowCells = CellUtils.mapCellsToShadowCells(badListWithDups);
-        assertEquals("There should be only 1 key-value maps", 1, cellsToShadowCells.size());
+        assertEquals(cellsToShadowCells.size(), 1, "There should be only 1 key-value maps");
         assertTrue(cellsToShadowCells.containsKey(cell1));
         KeyValue firstKey = (KeyValue) cellsToShadowCells.firstKey();
         KeyValue lastKey = (KeyValue) cellsToShadowCells.lastKey();
         assertTrue(firstKey.equals(lastKey));
-        assertTrue("Should be equal", 0 == Bytes.compareTo(
-                firstKey.getValueArray(), firstKey.getValueOffset(), firstKey.getValueLength(),
-                cell1.getValueArray(), cell1.getValueOffset(), cell1.getValueLength()));
+        assertTrue(0 == Bytes.compareTo(firstKey.getValueArray(), firstKey.getValueOffset(), firstKey.getValueLength(),
+                                        cell1.getValueArray(), cell1.getValueOffset(), cell1.getValueLength()),
+                   "Should be equal");
 
         // Modify dup shadow cell to have a greater MVCC and check that is replaced
         HBaseShims.setKeyValueSequenceId((KeyValue) dupCell1WithAnotherValue, 1);
         cellsToShadowCells = CellUtils.mapCellsToShadowCells(badListWithDups);
-        assertEquals("There should be only 1 key-value maps", 1, cellsToShadowCells.size());
+        assertEquals(cellsToShadowCells.size(), 1, "There should be only 1 key-value maps");
         assertTrue(cellsToShadowCells.containsKey(dupCell1WithAnotherValue));
         firstKey = (KeyValue) cellsToShadowCells.firstKey();
         lastKey = (KeyValue) cellsToShadowCells.lastKey();
         assertTrue(firstKey.equals(lastKey));
-        assertTrue("Should be equal", 0 == Bytes.compareTo(
-                firstKey.getValueArray(), firstKey.getValueOffset(), firstKey.getValueLength(),
-                dupCell1WithAnotherValue.getValueArray(), dupCell1WithAnotherValue.getValueOffset(),
-                dupCell1WithAnotherValue.getValueLength()));
+        assertTrue(0 == Bytes.compareTo(firstKey.getValueArray(), firstKey.getValueOffset(),
+                                        firstKey.getValueLength(), dupCell1WithAnotherValue.getValueArray(),
+                                        dupCell1WithAnotherValue.getValueOffset(), dupCell1WithAnotherValue.getValueLength()),
+                   "Should be equal");
         // Check a list of cells with duplicate values
         List<Cell> cellListWithDups = new ArrayList<>();
         cellListWithDups.add(cell1);
@@ -158,7 +158,7 @@ public class TestCellUtils {
         cellListWithDups.add(shadowCell2);
 
         cellsToShadowCells = CellUtils.mapCellsToShadowCells(cellListWithDups);
-        assertEquals("There should be only 3 key-value maps", 3, cellsToShadowCells.size());
+        assertEquals(cellsToShadowCells.size(), 3, "There should be only 3 key-value maps");
         assertTrue(cellsToShadowCells.get(cell1).get().equals(shadowCell1));
         assertTrue(cellsToShadowCells.get(dupCell1).get().equals(shadowCell1));
         assertFalse(cellsToShadowCells.containsKey(delCell1)); // TODO This is strange and needs to be solved.
@@ -177,7 +177,7 @@ public class TestCellUtils {
                 cell.getQualifierOffset(),
                 cell.getQualifierLength());
         byte[] expectedQualifier = com.google.common.primitives.Bytes.concat(qualifier, SHADOW_CELL_SUFFIX);
-        assertEquals(expectedQualifier, suffixedQualifier);
+        assertEquals(suffixedQualifier, expectedQualifier);
 
     }
 
@@ -191,7 +191,7 @@ public class TestCellUtils {
                 cell.getQualifierOffset(),
                 cell.getQualifierLength());
         byte[] expectedQualifier = qualifier;
-        assertEquals(expectedQualifier, resultedQualifier);
+        assertEquals(resultedQualifier, expectedQualifier);
 
         // Test removal from a badly suffixed qualifier
         byte[] badlySuffixedQualifier = com.google.common.primitives.Bytes.concat(qualifier, Bytes.toBytes("BAD"));
@@ -219,12 +219,12 @@ public class TestCellUtils {
         byte[] suffixedQualifier = com.google.common.primitives.Bytes.concat(qualifier, shadowCellSuffixToTest);
         int originalQualifierLength =
                 CellUtils.qualifierLengthFromShadowCellQualifier(suffixedQualifier, 0, suffixedQualifier.length);
-        assertEquals(qualifier.length, originalQualifierLength);
+        assertEquals(originalQualifierLength, qualifier.length);
 
         // Test passing qualifier without shadow cell suffix
         originalQualifierLength =
                 CellUtils.qualifierLengthFromShadowCellQualifier(qualifier, 0, qualifier.length);
-        assertEquals(qualifier.length, originalQualifierLength);
+        assertEquals(originalQualifierLength, qualifier.length);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/4323560f/hbase-client/src/test/java/org/apache/omid/transaction/TestColumnIterator.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/test/java/org/apache/omid/transaction/TestColumnIterator.java b/hbase-client/src/test/java/org/apache/omid/transaction/TestColumnIterator.java
index 3cc7185..f4df0b2 100644
--- a/hbase-client/src/test/java/org/apache/omid/transaction/TestColumnIterator.java
+++ b/hbase-client/src/test/java/org/apache/omid/transaction/TestColumnIterator.java
@@ -30,7 +30,7 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
 
-import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.Assert.assertEquals;
 
 @Test(groups = "noHBase")
 public class TestColumnIterator {
@@ -63,7 +63,7 @@ public class TestColumnIterator {
         ImmutableList<Collection<Cell>> groupedColumnsWithoutShadowCells =
                 TTable.groupCellsByColumnFilteringShadowCells(cells);
         Log.info("Column Groups " + groupedColumnsWithoutShadowCells);
-        assertEquals("Should be 3 column groups", 3, groupedColumnsWithoutShadowCells.size());
+        assertEquals(groupedColumnsWithoutShadowCells.size(), 3, "Should be 3 column groups");
         int group1Counter = 0;
         int group2Counter = 0;
         int group3Counter = 0;
@@ -89,8 +89,8 @@ public class TestColumnIterator {
             }
         }
 
-        assertEquals("Group 1 should have 2 elems", 2, group1Counter);
-        assertEquals("Group 2 should have 1 elems", 1, group2Counter);
-        assertEquals("Group 3 should have 1 elems", 1, group3Counter);
+        assertEquals(group1Counter, 2, "Group 1 should have 2 elems");
+        assertEquals(group2Counter, 1, "Group 2 should have 1 elems");
+        assertEquals(group3Counter, 1, "Group 3 should have 1 elems");
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/4323560f/hbase-client/src/test/java/org/apache/omid/transaction/TestDeletion.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/test/java/org/apache/omid/transaction/TestDeletion.java b/hbase-client/src/test/java/org/apache/omid/transaction/TestDeletion.java
index a03c685..6b7eaa5 100644
--- a/hbase-client/src/test/java/org/apache/omid/transaction/TestDeletion.java
+++ b/hbase-client/src/test/java/org/apache/omid/transaction/TestDeletion.java
@@ -27,7 +27,6 @@ import org.apache.hadoop.hbase.client.Scan;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.testng.AssertJUnit;
 import org.testng.ITestContext;
 import org.testng.annotations.Test;
 
@@ -35,6 +34,7 @@ import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 
+import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertTrue;
 
 @Test(groups = "sharedHBase")
@@ -85,17 +85,17 @@ public class TestDeletion extends OmidTestBase {
         ResultScanner rs = tt.getScanner(tscan, new Scan());
 
         Map<FamCol, Integer> count = countColsInRows(rs, famColA, famColB);
-        AssertJUnit.assertEquals("ColA count should be equal to rowsWritten", rowsWritten, (int) count.get(famColA));
-        AssertJUnit.assertEquals("ColB count should be equal to rowsWritten", rowsWritten, (int) count.get(famColB));
+        assertEquals((int) count.get(famColA), rowsWritten, "ColA count should be equal to rowsWritten");
+        assertEquals((int) count.get(famColB), rowsWritten, "ColB count should be equal to rowsWritten");
         tm.commit(t2);
 
         tscan = tm.begin();
         rs = tt.getScanner(tscan, new Scan());
 
         count = countColsInRows(rs, famColA, famColB);
-        AssertJUnit
-                .assertEquals("ColA count should be equal to rowsWritten - 1", (rowsWritten - 1), (int) count.get(famColA));
-        AssertJUnit.assertEquals("ColB count should be equal to rowsWritten", rowsWritten, (int) count.get(famColB));
+        assertEquals((int) count.get(famColA), (rowsWritten - 1), "ColA count should be equal to rowsWritten - 1");
+        assertEquals((int) count.get(famColB), rowsWritten, "ColB count should be equal to rowsWritten");
+
     }
 
     @Test
@@ -123,17 +123,17 @@ public class TestDeletion extends OmidTestBase {
         ResultScanner rs = tt.getScanner(tscan, new Scan());
 
         Map<FamCol, Integer> count = countColsInRows(rs, famColA, famColB);
-        AssertJUnit.assertEquals("ColA count should be equal to rowsWritten", rowsWritten, (int) count.get(famColA));
-        AssertJUnit.assertEquals("ColB count should be equal to rowsWritten", rowsWritten, (int) count.get(famColB));
+        assertEquals((int) count.get(famColA), rowsWritten, "ColA count should be equal to rowsWritten");
+        assertEquals((int) count.get(famColB), rowsWritten, "ColB count should be equal to rowsWritten");
         tm.commit(t2);
 
         tscan = tm.begin();
         rs = tt.getScanner(tscan, new Scan());
 
         count = countColsInRows(rs, famColA, famColB);
-        AssertJUnit
-                .assertEquals("ColA count should be equal to rowsWritten - 1", (rowsWritten - 1), (int) count.get(famColA));
-        AssertJUnit.assertEquals("ColB count should be equal to rowsWritten", rowsWritten, (int) count.get(famColB));
+        assertEquals((int) count.get(famColA), (rowsWritten - 1), "ColA count should be equal to rowsWritten - 1");
+        assertEquals((int) count.get(famColB), rowsWritten, "ColB count should be equal to rowsWritten");
+
     }
 
     /**
@@ -164,8 +164,8 @@ public class TestDeletion extends OmidTestBase {
         ResultScanner rs = tt.getScanner(tscan, new Scan());
 
         Map<FamCol, Integer> count = countColsInRows(rs, famColA, famColB);
-        AssertJUnit.assertEquals("ColA count should be equal to rowsWritten", rowsWritten, (int) count.get(famColA));
-        AssertJUnit.assertEquals("ColB count should be equal to rowsWritten", rowsWritten, (int) count.get(famColB));
+        assertEquals((int) count.get(famColA), rowsWritten, "ColA count should be equal to rowsWritten");
+        assertEquals((int) count.get(famColB), rowsWritten, "ColB count should be equal to rowsWritten");
         tm.commit(t2);
 
         tscan = tm.begin();
@@ -173,9 +173,9 @@ public class TestDeletion extends OmidTestBase {
 
         count = countColsInRows(rs, famColA, famColB);
 
-        AssertJUnit
-                .assertEquals("ColA count should be equal to rowsWritten - 1", (rowsWritten - 1), (int) count.get(famColA));
-        AssertJUnit.assertEquals("ColB count should be equal to rowsWritten", rowsWritten, (int) count.get(famColB));
+        assertEquals((int) count.get(famColA), (rowsWritten - 1), "ColA count should be equal to rowsWritten - 1");
+        assertEquals((int) count.get(famColB), rowsWritten, "ColB count should be equal to rowsWritten");
+
     }
 
     @Test
@@ -201,8 +201,7 @@ public class TestDeletion extends OmidTestBase {
         ResultScanner rs = tt.getScanner(tscan, new Scan());
 
         int rowsRead = countRows(rs);
-        AssertJUnit.assertTrue("Expected " + rowsWritten + " rows but " + rowsRead + " found",
-                rowsRead == rowsWritten);
+        assertTrue(rowsRead == rowsWritten, "Expected " + rowsWritten + " rows but " + rowsRead + " found");
 
         tm.commit(t2);
 
@@ -210,8 +209,7 @@ public class TestDeletion extends OmidTestBase {
         rs = tt.getScanner(tscan, new Scan());
 
         rowsRead = countRows(rs);
-        AssertJUnit.assertTrue("Expected " + (rowsWritten - 1) + " rows but " + rowsRead + " found",
-                rowsRead == (rowsWritten - 1));
+        assertTrue(rowsRead == (rowsWritten - 1), "Expected " + (rowsWritten - 1) + " rows but " + rowsRead + " found");
 
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/4323560f/hbase-client/src/test/java/org/apache/omid/transaction/TestFilters.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/test/java/org/apache/omid/transaction/TestFilters.java b/hbase-client/src/test/java/org/apache/omid/transaction/TestFilters.java
index 59853d2..32288b5 100644
--- a/hbase-client/src/test/java/org/apache/omid/transaction/TestFilters.java
+++ b/hbase-client/src/test/java/org/apache/omid/transaction/TestFilters.java
@@ -19,8 +19,6 @@ package org.apache.omid.transaction;
 
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.SettableFuture;
-import org.apache.omid.committable.CommitTable;
-import org.apache.omid.metrics.NullMetricsProvider;
 import org.apache.hadoop.hbase.client.Get;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Result;
@@ -32,6 +30,8 @@ import org.apache.hadoop.hbase.filter.CompareFilter;
 import org.apache.hadoop.hbase.filter.Filter;
 import org.apache.hadoop.hbase.filter.ValueFilter;
 import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.omid.committable.CommitTable;
+import org.apache.omid.metrics.NullMetricsProvider;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 import org.testng.ITestContext;
@@ -40,8 +40,8 @@ import org.testng.annotations.Test;
 import static org.mockito.Matchers.any;
 import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.spy;
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertNull;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNull;
 
 /**
  * Tests to verify that Get and Scan filters still work with transactions tables
@@ -68,6 +68,7 @@ public class TestFilters extends OmidTestBase {
     }
 
     private void testGet(ITestContext context, Filter f) throws Exception {
+
         CommitTable.Client commitTableClient = spy(getCommitTable(context).getClient());
 
         HBaseOmidClientConfiguration hbaseOmidClientConf = new HBaseOmidClientConfiguration();
@@ -89,19 +90,20 @@ public class TestFilters extends OmidTestBase {
         g.setFilter(f);
 
         Result r = table.get(t, g);
-        assertEquals("should exist in result", 1, r.getColumnCells(family, col1).size());
-        assertEquals("shouldn't exist in result", 0, r.getColumnCells(family, col2).size());
+        assertEquals(r.getColumnCells(family, col1).size(), 1, "should exist in result");
+        assertEquals(r.getColumnCells(family, col2).size(), 0 , "shouldn't exist in result");
 
         g = new Get(row2);
         g.setFilter(f);
         r = table.get(t, g);
-        assertEquals("should exist in result", 1, r.getColumnCells(family, col1).size());
-        assertEquals("shouldn't exist in result", 0, r.getColumnCells(family, col2).size());
+        assertEquals(r.getColumnCells(family, col1).size(), 1, "should exist in result");
+        assertEquals(r.getColumnCells(family, col2).size(), 0, "shouldn't exist in result");
 
         g = new Get(row3);
         g.setFilter(f);
         r = table.get(t, g);
-        assertEquals("shouldn't exist in result", 0, r.getColumnCells(family, col2).size());
+        assertEquals(r.getColumnCells(family, col2).size(), 0, "shouldn't exist in result");
+
     }
 
     @Test(timeOut = 60_000)
@@ -115,6 +117,7 @@ public class TestFilters extends OmidTestBase {
     }
 
     private void testScan(ITestContext context, Filter f) throws Exception {
+
         CommitTable.Client commitTableClient = spy(getCommitTable(context).getClient());
 
         HBaseOmidClientConfiguration hbaseOmidClientConf = new HBaseOmidClientConfiguration();
@@ -136,17 +139,17 @@ public class TestFilters extends OmidTestBase {
         ResultScanner rs = table.getScanner(t, s);
 
         Result r = rs.next();
-        assertEquals("should exist in result", 1, r.getColumnCells(family, col1).size());
-        assertEquals("shouldn't exist in result", 0, r.getColumnCells(family, col2).size());
+        assertEquals(r.getColumnCells(family, col1).size(), 1, "should exist in result");
+        assertEquals(r.getColumnCells(family, col2).size(), 0, "shouldn't exist in result");
 
         r = rs.next();
-        assertEquals("should exist in result", 1, r.getColumnCells(family, col1).size());
-        assertEquals("shouldn't exist in result", 0, r.getColumnCells(family, col2).size());
+        assertEquals(r.getColumnCells(family, col1).size(), 1, "should exist in result");
+        assertEquals(r.getColumnCells(family, col2).size(), 0, "shouldn't exist in result");
 
         r = rs.next();
-        assertNull("Last row shouldn't exist", r);
-    }
+        assertNull(r, "Last row shouldn't exist");
 
+    }
 
     private void writeRows(TTable table, TransactionManager tm, PostCommitActions postCommitter)
             throws Exception {
@@ -188,4 +191,5 @@ public class TestFilters extends OmidTestBase {
             // Expected, see comment above
         }
     }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/4323560f/hbase-client/src/test/java/org/apache/omid/transaction/TestHBaseTransactionClient.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/test/java/org/apache/omid/transaction/TestHBaseTransactionClient.java b/hbase-client/src/test/java/org/apache/omid/transaction/TestHBaseTransactionClient.java
index 87410bd..c349657 100644
--- a/hbase-client/src/test/java/org/apache/omid/transaction/TestHBaseTransactionClient.java
+++ b/hbase-client/src/test/java/org/apache/omid/transaction/TestHBaseTransactionClient.java
@@ -40,9 +40,9 @@ import static org.mockito.Matchers.any;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.spy;
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertFalse;
-import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
 
 @Test(groups = "sharedHBase")
 public class TestHBaseTransactionClient extends OmidTestBase {
@@ -83,9 +83,9 @@ public class TestHBaseTransactionClient extends OmidTestBase {
         HBaseCellId hBaseCellId3 = new HBaseCellId(htable, row2, family, qualifier, t3.getStartTimestamp());
 
         HBaseTransactionClient hbaseTm = (HBaseTransactionClient) newTransactionManager(context);
-        assertTrue("row1 should be committed", hbaseTm.isCommitted(hBaseCellId1));
-        assertFalse("row2 should not be committed for kv2", hbaseTm.isCommitted(hBaseCellId2));
-        assertTrue("row2 should be committed for kv3", hbaseTm.isCommitted(hBaseCellId3));
+        assertTrue(hbaseTm.isCommitted(hBaseCellId1), "row1 should be committed");
+        assertFalse(hbaseTm.isCommitted(hBaseCellId2), "row2 should not be committed for kv2");
+        assertTrue(hbaseTm.isCommitted(hBaseCellId3), "row2 should be committed for kv3");
     }
 
     @Test(timeOut = 30_000)
@@ -110,24 +110,16 @@ public class TestHBaseTransactionClient extends OmidTestBase {
             // Do nothing
         }
 
-        assertTrue("Cell should be there",
-                CellUtils.hasCell(row1,
-                        family,
-                        qualifier,
-                        t1.getStartTimestamp(),
-                        new TTableCellGetterAdapter(table)));
-        assertFalse("Shadow cell should not be there",
-                CellUtils.hasShadowCell(row1,
-                        family,
-                        qualifier,
-                        t1.getStartTimestamp(),
-                        new TTableCellGetterAdapter(table)));
+        assertTrue(CellUtils.hasCell(row1, family, qualifier, t1.getStartTimestamp(), new TTableCellGetterAdapter(table)),
+                   "Cell should be there");
+        assertFalse(CellUtils.hasShadowCell(row1, family, qualifier, t1.getStartTimestamp(), new TTableCellGetterAdapter(table)),
+                    "Shadow cell should not be there");
 
         HTable htable = new HTable(hbaseConf, TEST_TABLE);
         HBaseCellId hBaseCellId = new HBaseCellId(htable, row1, family, qualifier, t1.getStartTimestamp());
 
         HBaseTransactionClient hbaseTm = (HBaseTransactionClient) newTransactionManager(context);
-        assertTrue("row1 should be committed", hbaseTm.isCommitted(hBaseCellId));
+        assertTrue(hbaseTm.isCommitted(hBaseCellId), "row1 should be committed");
     }
 
     @Test(timeOut = 30_000)
@@ -159,7 +151,7 @@ public class TestHBaseTransactionClient extends OmidTestBase {
             assertTrue(optionalCT.isPresent());
             CommitTimestamp ct = optionalCT.get();
             assertFalse(ct.isValid());
-            assertEquals(CommitTable.INVALID_TRANSACTION_MARKER, ct.getValue());
+            assertEquals(ct.getValue(), CommitTable.INVALID_TRANSACTION_MARKER);
             assertTrue(ct.getLocation().compareTo(COMMIT_TABLE) == 0);
 
             // Finally test that we get the right commit timestamp for a committed tx
@@ -178,7 +170,7 @@ public class TestHBaseTransactionClient extends OmidTestBase {
             assertTrue(optionalCT.isPresent());
             ct = optionalCT.get();
             assertTrue(ct.isValid());
-            assertEquals(tx2.getCommitTimestamp(), ct.getValue());
+            assertEquals(ct.getValue(), tx2.getCommitTimestamp());
             assertTrue(ct.getLocation().compareTo(COMMIT_TABLE) == 0);
         }
     }
@@ -212,7 +204,7 @@ public class TestHBaseTransactionClient extends OmidTestBase {
             assertTrue(optionalCT.isPresent());
             CommitTimestamp ct = optionalCT.get();
             assertTrue(ct.isValid());
-            assertEquals(tx1.getCommitTimestamp(), ct.getValue());
+            assertEquals(ct.getValue(), tx1.getCommitTimestamp());
             assertTrue(ct.getLocation().compareTo(SHADOW_CELL) == 0);
 
         }
@@ -277,7 +269,7 @@ public class TestHBaseTransactionClient extends OmidTestBase {
                     ctLocator);
             assertTrue(ct.isValid());
             long expectedCommitTS = tx1.getStartTimestamp() + 1;
-            assertEquals(expectedCommitTS, ct.getValue());
+            assertEquals(ct.getValue(), expectedCommitTS);
             assertTrue(ct.getLocation().compareTo(COMMIT_TABLE) == 0);
         }
 
@@ -306,7 +298,7 @@ public class TestHBaseTransactionClient extends OmidTestBase {
             CommitTimestamp ct = tm.locateCellCommitTimestamp(tx1.getStartTimestamp(), tm.tsoClient.getEpoch(),
                     ctLocator);
             assertTrue(ct.isValid());
-            assertEquals(tx1.getCommitTimestamp(), ct.getValue());
+            assertEquals(ct.getValue(), tx1.getCommitTimestamp());
             assertTrue(ct.getLocation().compareTo(SHADOW_CELL) == 0);
         }
 
@@ -346,7 +338,7 @@ public class TestHBaseTransactionClient extends OmidTestBase {
             // Fake the current epoch to simulate a newer TSO
             CommitTimestamp ct = tm.locateCellCommitTimestamp(tx1.getStartTimestamp(), CURRENT_EPOCH_FAKE, ctLocator);
             assertFalse(ct.isValid());
-            assertEquals(CommitTable.INVALID_TRANSACTION_MARKER, ct.getValue());
+            assertEquals(ct.getValue(), CommitTable.INVALID_TRANSACTION_MARKER);
             assertTrue(ct.getLocation().compareTo(COMMIT_TABLE) == 0);
         }
     }
@@ -392,7 +384,7 @@ public class TestHBaseTransactionClient extends OmidTestBase {
             CommitTimestamp ct = tm.locateCellCommitTimestamp(tx1.getStartTimestamp(), tm.tsoClient.getEpoch(),
                     ctLocator);
             assertTrue(ct.isValid());
-            assertEquals(tx1.getCommitTimestamp(), ct.getValue());
+            assertEquals(ct.getValue(), tx1.getCommitTimestamp());
             assertTrue(ct.getLocation().compareTo(COMMIT_TABLE) == 0);
         }
 
@@ -430,7 +422,7 @@ public class TestHBaseTransactionClient extends OmidTestBase {
             CommitTimestamp ct = tm.locateCellCommitTimestamp(tx1.getStartTimestamp(), tm.tsoClient.getEpoch(),
                     ctLocator);
             assertTrue(ct.isValid());
-            assertEquals(tx1.getCommitTimestamp(), ct.getValue());
+            assertEquals(ct.getValue(), tx1.getCommitTimestamp());
             assertTrue(ct.getLocation().compareTo(SHADOW_CELL) == 0);
         }
 
@@ -457,9 +449,10 @@ public class TestHBaseTransactionClient extends OmidTestBase {
                     Maps.<Long, Long>newHashMap());
             CommitTimestamp ct = tm.locateCellCommitTimestamp(CELL_TS, tm.tsoClient.getEpoch(), ctLocator);
             assertTrue(ct.isValid());
-            assertEquals(-1L, ct.getValue());
+            assertEquals(ct.getValue(), -1L);
             assertTrue(ct.getLocation().compareTo(NOT_PRESENT) == 0);
         }
+
     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/4323560f/hbase-client/src/test/java/org/apache/omid/transaction/TestReadPath.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/test/java/org/apache/omid/transaction/TestReadPath.java b/hbase-client/src/test/java/org/apache/omid/transaction/TestReadPath.java
index 61cafba..2c48860 100644
--- a/hbase-client/src/test/java/org/apache/omid/transaction/TestReadPath.java
+++ b/hbase-client/src/test/java/org/apache/omid/transaction/TestReadPath.java
@@ -30,9 +30,9 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
-import static org.testng.AssertJUnit.assertFalse;
-import static org.testng.AssertJUnit.assertNotNull;
-import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertTrue;
 
 @Test(groups = "sharedHBase")
 public class TestReadPath extends OmidTestBase {
@@ -59,7 +59,7 @@ public class TestReadPath extends OmidTestBase {
 
         Get get = new Get(row);
         Result result = table.get(t2, get);
-        assertFalse("Should be unable to read column", result.containsColumn(family, col));
+        assertFalse(result.containsColumn(family, col), "Should be unable to read column");
     }
 
     @Test
@@ -89,9 +89,9 @@ public class TestReadPath extends OmidTestBase {
         Get get = new Get(row);
         Result result = table.get(t, get);
         Cell cell = result.getColumnLatestCell(family, col);
-        assertNotNull("KeyValue is null", cell);
+        assertNotNull(cell, "KeyValue is null");
         byte[] value = CellUtil.cloneValue(cell);
-        assertTrue("Read data doesn't match", Arrays.equals(data, value));
+        assertTrue(Arrays.equals(data, value), "Read data doesn't match");
         tm.commit(t);
 
         table.close();

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/4323560f/hbase-client/src/test/java/org/apache/omid/transaction/TestSingleColumnFamily.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/test/java/org/apache/omid/transaction/TestSingleColumnFamily.java b/hbase-client/src/test/java/org/apache/omid/transaction/TestSingleColumnFamily.java
index 3ac86a4..87ed23c 100644
--- a/hbase-client/src/test/java/org/apache/omid/transaction/TestSingleColumnFamily.java
+++ b/hbase-client/src/test/java/org/apache/omid/transaction/TestSingleColumnFamily.java
@@ -27,12 +27,12 @@ import org.slf4j.LoggerFactory;
 import org.testng.ITestContext;
 import org.testng.annotations.Test;
 
-import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.Assert.assertTrue;
 
 @Test(groups = "sharedHBase")
 public class TestSingleColumnFamily extends OmidTestBase {
-    private static final Logger LOG = LoggerFactory.getLogger(TestSingleColumnFamily.class);
 
+    private static final Logger LOG = LoggerFactory.getLogger(TestSingleColumnFamily.class);
 
     @Test
     public void testSingleColumnFamily(ITestContext context) throws Exception {
@@ -59,9 +59,7 @@ public class TestSingleColumnFamily extends OmidTestBase {
             LOG.info("RES:" + tmp1 + ";" + tmp2);
             count++;
         }
-        assertTrue("Can't see puts. I should see "
-                        + num + " but I see " + count
-                , num == count);
+        assertTrue(num == count, "Can't see puts. I should see " + num + " but I see " + count);
 
         tm.commit(t);
         t = tm.begin();
@@ -94,12 +92,9 @@ public class TestSingleColumnFamily extends OmidTestBase {
                 LOG.debug("stop");
             }
         }
-        assertTrue("Can't see puts. I should see "
-                        + num + " but I see " + count
-                , num == count);
-        assertTrue("Half of rows should equal row id, half not ("
-                        + modified + ", " + notmodified + ")"
-                , modified == notmodified && notmodified == (num / 2));
+        assertTrue(num == count, "Can't see puts. I should see " + num + " but I see " + count);
+        assertTrue(modified == notmodified && notmodified == (num / 2),
+                   "Half of rows should equal row id, half not (" + modified + ", " + notmodified + ")");
 
         tm.commit(t);
         LOG.info("End commiting");

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/4323560f/hbase-client/src/test/java/org/apache/omid/transaction/TestTransactionCleanup.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/test/java/org/apache/omid/transaction/TestTransactionCleanup.java b/hbase-client/src/test/java/org/apache/omid/transaction/TestTransactionCleanup.java
index 1d95c06..c3f85f2 100644
--- a/hbase-client/src/test/java/org/apache/omid/transaction/TestTransactionCleanup.java
+++ b/hbase-client/src/test/java/org/apache/omid/transaction/TestTransactionCleanup.java
@@ -18,15 +18,15 @@
 package org.apache.omid.transaction;
 
 import com.google.common.util.concurrent.SettableFuture;
-import org.apache.omid.tso.client.AbortException;
-import org.apache.omid.tso.client.ForwardingTSOFuture;
-import org.apache.omid.tso.client.TSOClient;
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.client.Put;
 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.util.Bytes;
+import org.apache.omid.tso.client.AbortException;
+import org.apache.omid.tso.client.ForwardingTSOFuture;
+import org.apache.omid.tso.client.TSOClient;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.ITestContext;
@@ -36,7 +36,7 @@ import static org.mockito.Matchers.anySetOf;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
-import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.Assert.assertEquals;
 
 @Test(groups = "sharedHBase")
 public class TestTransactionCleanup extends OmidTestBase {
@@ -104,15 +104,14 @@ public class TestTransactionCleanup extends OmidTestBase {
             ResultScanner resultScanner = txTable.getHTable().getScanner(scan);
             int resultCount = 0;
             for (Result result : resultScanner) {
-                assertEquals(2, result.size()); // Size == 2, including the put and delete from cleanup
+                assertEquals(result.size(), 2); // Size == 2, including the put and delete from cleanup
                 LOG.trace("Result {}", result);
                 // The last element of the qualifier should have the Delete marker
                 byte encodedType = result.getColumnLatestCell(family, qual).getTypeByte();
-                assertEquals(KeyValue.Type.Delete,
-                        KeyValue.Type.codeToType(encodedType));
+                assertEquals(KeyValue.Type.codeToType(encodedType), KeyValue.Type.Delete);
                 resultCount++;
             }
-            assertEquals(ROWS_MODIFIED, resultCount);
+            assertEquals(resultCount, ROWS_MODIFIED);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/4323560f/hbase-client/src/test/java/org/apache/omid/transaction/TestTransactionConflict.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/test/java/org/apache/omid/transaction/TestTransactionConflict.java b/hbase-client/src/test/java/org/apache/omid/transaction/TestTransactionConflict.java
index 4cf2d38..a776a71 100644
--- a/hbase-client/src/test/java/org/apache/omid/transaction/TestTransactionConflict.java
+++ b/hbase-client/src/test/java/org/apache/omid/transaction/TestTransactionConflict.java
@@ -30,19 +30,18 @@ import org.apache.hadoop.hbase.client.Scan;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.testng.Assert;
 import org.testng.ITestContext;
 import org.testng.annotations.Test;
 
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
 
 @Test(groups = "sharedHBase")
 public class TestTransactionConflict extends OmidTestBase {
 
     private static final Logger LOG = LoggerFactory.getLogger(TestTransactionConflict.class);
 
-
     @Test
     public void runTestWriteWriteConflict(ITestContext context) throws Exception {
         TransactionManager tm = newTransactionManager(context);
@@ -72,7 +71,7 @@ public class TestTransactionConflict extends OmidTestBase {
 
         try {
             tm.commit(t1);
-            Assert.fail("Transaction should not commit successfully");
+            fail("Transaction should not commit successfully");
         } catch (RollbackException e) {
         }
     }
@@ -132,11 +131,11 @@ public class TestTransactionConflict extends OmidTestBase {
         boolean aborted = false;
         try {
             tm.commit(t1);
-            assertTrue("Transaction commited successfully", false);
+            fail("Transaction commited successfully");
         } catch (RollbackException e) {
             aborted = true;
         }
-        assertTrue("Transaction didn't raise exception", aborted);
+        assertTrue(aborted, "Transaction didn't raise exception");
 
         ResultScanner rs = tt2.getHTable().getScanner(fam, col);
 
@@ -145,7 +144,7 @@ public class TestTransactionConflict extends OmidTestBase {
         while ((r = rs.next()) != null) {
             count += r.size();
         }
-        assertEquals("Should have cell", 1, count);
+        assertEquals(count, 1, "Should have cell");
     }
 
     @Test
@@ -172,111 +171,107 @@ public class TestTransactionConflict extends OmidTestBase {
         Get g = new Get(row).setMaxVersions();
         g.addColumn(fam, col);
         Result r = tt.getHTable().get(g);
-        assertEquals("Unexpected size for read.", 1, r.size());
-        assertTrue("Unexpected value for read: " + Bytes.toString(r.getValue(fam, col)),
-                Bytes.equals(data1, r.getValue(fam, col)));
+        assertEquals(r.size(), 1, "Unexpected size for read.");
+        assertTrue(Bytes.equals(data1, r.getValue(fam, col)),
+                   "Unexpected value for read: " + Bytes.toString(r.getValue(fam, col)));
 
         Put p2 = new Put(row);
         p2.add(fam, col, data2);
         tt.put(t2, p2);
 
         r = tt.getHTable().get(g);
-        assertEquals("Unexpected size for read.", 2, r.size());
+        assertEquals(r.size(), 2, "Unexpected size for read.");
         r = tt.get(t2, g);
-        assertEquals("Unexpected size for read.", 1, r.size());
-        assertTrue("Unexpected value for read: " + Bytes.toString(r.getValue(fam, col)),
-                Bytes.equals(data2, r.getValue(fam, col)));
+        assertEquals(r.size(),1, "Unexpected size for read.");
+        assertTrue(Bytes.equals(data2, r.getValue(fam, col)),
+                   "Unexpected value for read: " + Bytes.toString(r.getValue(fam, col)));
 
         tm.commit(t1);
 
         boolean aborted = false;
         try {
             tm.commit(t2);
-            assertTrue("Transaction commited successfully", false);
+            fail("Transaction commited successfully");
         } catch (RollbackException e) {
             aborted = true;
         }
-        assertTrue("Transaction didn't raise exception", aborted);
+        assertTrue(aborted, "Transaction didn't raise exception");
 
         r = tt.getHTable().get(g);
-        assertEquals("Unexpected size for read.", 1, r.size());
-        assertTrue("Unexpected value for read: " + Bytes.toString(r.getValue(fam, col)),
-                Bytes.equals(data1, r.getValue(fam, col)));
+        assertEquals(r.size(), 1, "Unexpected size for read.");
+        assertTrue(Bytes.equals(data1, r.getValue(fam, col)),
+                   "Unexpected value for read: " + Bytes.toString(r.getValue(fam, col)));
     }
 
     @Test
     public void testCleanupWithDeleteRow(ITestContext context) throws Exception {
-        try {
-            TransactionManager tm = newTransactionManager(context);
-            TTable tt = new TTable(hbaseConf, TEST_TABLE);
 
-            Transaction t1 = tm.begin();
-            LOG.info("Transaction created " + t1);
+        TransactionManager tm = newTransactionManager(context);
+        TTable tt = new TTable(hbaseConf, TEST_TABLE);
+
+        Transaction t1 = tm.begin();
+        LOG.info("Transaction created " + t1);
 
-            int rowcount = 10;
-            int count = 0;
+        int rowcount = 10;
+        int count = 0;
 
-            byte[] fam = Bytes.toBytes(TEST_FAMILY);
-            byte[] col = Bytes.toBytes("testdata");
-            byte[] data1 = Bytes.toBytes("testWrite-1");
-            byte[] data2 = Bytes.toBytes("testWrite-2");
+        byte[] fam = Bytes.toBytes(TEST_FAMILY);
+        byte[] col = Bytes.toBytes("testdata");
+        byte[] data1 = Bytes.toBytes("testWrite-1");
+        byte[] data2 = Bytes.toBytes("testWrite-2");
 
-            byte[] modrow = Bytes.toBytes("test-del" + 3);
-            for (int i = 0; i < rowcount; i++) {
-                byte[] row = Bytes.toBytes("test-del" + i);
+        byte[] modrow = Bytes.toBytes("test-del" + 3);
+        for (int i = 0; i < rowcount; i++) {
+            byte[] row = Bytes.toBytes("test-del" + i);
 
-                Put p = new Put(row);
-                p.add(fam, col, data1);
-                tt.put(t1, p);
-            }
-            tm.commit(t1);
+            Put p = new Put(row);
+            p.add(fam, col, data1);
+            tt.put(t1, p);
+        }
+        tm.commit(t1);
+
+        Transaction t2 = tm.begin();
+        LOG.info("Transaction created " + t2);
+        Delete d = new Delete(modrow);
+        tt.delete(t2, d);
+
+        ResultScanner rs = tt.getScanner(t2, new Scan());
+        Result r = rs.next();
+        count = 0;
+        while (r != null) {
+            count++;
+            LOG.trace("row: " + Bytes.toString(r.getRow()) + " count: " + count);
+            r = rs.next();
+        }
+        assertEquals(count, rowcount - 1, "Wrong count");
+
+        Transaction t3 = tm.begin();
+        LOG.info("Transaction created " + t3);
+        Put p = new Put(modrow);
+        p.add(fam, col, data2);
+        tt.put(t3, p);
+
+        tm.commit(t3);
 
-            Transaction t2 = tm.begin();
-            LOG.info("Transaction created " + t2);
-            Delete d = new Delete(modrow);
-            tt.delete(t2, d);
-
-            ResultScanner rs = tt.getScanner(t2, new Scan());
-            Result r = rs.next();
-            count = 0;
-            while (r != null) {
-                count++;
-                LOG.trace("row: " + Bytes.toString(r.getRow()) + " count: " + count);
-                r = rs.next();
-            }
-            assertEquals("Wrong count", rowcount - 1, count);
-
-            Transaction t3 = tm.begin();
-            LOG.info("Transaction created " + t3);
-            Put p = new Put(modrow);
-            p.add(fam, col, data2);
-            tt.put(t3, p);
-
-            tm.commit(t3);
-
-            boolean aborted = false;
-            try {
-                tm.commit(t2);
-                assertTrue("Didn't abort", false);
-            } catch (RollbackException e) {
-                aborted = true;
-            }
-            assertTrue("Didn't raise exception", aborted);
-
-            Transaction tscan = tm.begin();
-            rs = tt.getScanner(tscan, new Scan());
+        boolean aborted = false;
+        try {
+            tm.commit(t2);
+            fail("Didn't abort");
+        } catch (RollbackException e) {
+            aborted = true;
+        }
+        assertTrue(aborted, "Didn't raise exception");
+
+        Transaction tscan = tm.begin();
+        rs = tt.getScanner(tscan, new Scan());
+        r = rs.next();
+        count = 0;
+        while (r != null) {
+            count++;
             r = rs.next();
-            count = 0;
-            while (r != null) {
-                count++;
-                r = rs.next();
-            }
-            assertEquals("Wrong count", rowcount, count);
-
-        } catch (Exception e) {
-            LOG.error("Exception occurred", e);
-            throw e;
         }
+        assertEquals(count, rowcount, "Wrong count");
+
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/4323560f/hbase-client/src/test/java/org/apache/omid/transaction/TestUpdateScan.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/test/java/org/apache/omid/transaction/TestUpdateScan.java b/hbase-client/src/test/java/org/apache/omid/transaction/TestUpdateScan.java
index bfd8b70..16cbea4 100644
--- a/hbase-client/src/test/java/org/apache/omid/transaction/TestUpdateScan.java
+++ b/hbase-client/src/test/java/org/apache/omid/transaction/TestUpdateScan.java
@@ -34,8 +34,8 @@ import org.testng.Assert;
 import org.testng.ITestContext;
 import org.testng.annotations.Test;
 
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
 
 @Test(groups = "sharedHBase")
 public class TestUpdateScan extends OmidTestBase {
@@ -67,9 +67,7 @@ public class TestUpdateScan extends OmidTestBase {
                 int tmp = Bytes.toInt(r.getValue(Bytes.toBytes(TEST_FAMILY),
                         Bytes.toBytes(TEST_COL)));
                 LOG.info("Result:" + tmp);
-                assertTrue("Bad value, should be "
-                                + startKeyValue + " but is " + tmp
-                        , tmp == startKeyValue);
+                assertTrue(tmp == startKeyValue, "Bad value, should be " + startKeyValue + " but is " + tmp);
             } else {
                 Assert.fail("Bad result");
             }
@@ -98,7 +96,7 @@ public class TestUpdateScan extends OmidTestBase {
                 LOG.info("Result: " + iTmp);
                 count++;
             }
-            assertEquals("Count is wrong", 1, count);
+            assertEquals(count, 1, "Count is wrong");
             LOG.info("Rows found " + count);
             tm.commit(t);
             table.close();
@@ -136,8 +134,7 @@ public class TestUpdateScan extends OmidTestBase {
                 LOG.info("Result: " + iTmp);
                 count++;
             }
-            assertTrue("Count should be " + lInts.length + " but is " + count,
-                    count == lInts.length);
+            assertTrue(count == lInts.length, "Count should be " + lInts.length + " but is " + count);
             LOG.info("Rows found " + count);
 
             tm.commit(t);
@@ -151,8 +148,7 @@ public class TestUpdateScan extends OmidTestBase {
                 LOG.info("Result: " + iTmp);
                 count++;
             }
-            assertTrue("Count should be " + lInts.length + " but is " + count,
-                    count == lInts.length);
+            assertTrue(count == lInts.length, "Count should be " + lInts.length + " but is " + count);
             LOG.info("Rows found " + count);
             tm.commit(t);
         }
@@ -206,8 +202,8 @@ public class TestUpdateScan extends OmidTestBase {
                 LOG.info("Result: " + iTmp);
                 count++;
             }
-            assertTrue("Count should be " + (lIntsA.length * lIntsC.length) + " but is " + count,
-                    count == lIntsA.length + lIntsC.length);
+            assertTrue(count == lIntsA.length + lIntsC.length,
+                       "Count should be " + (lIntsA.length * lIntsC.length) + " but is " + count);
             LOG.info("Rows found " + count);
             tm.commit(t);
             table.close();

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/4323560f/hbase-commit-table/src/test/java/org/apache/omid/committable/hbase/TestHBaseCommitTable.java
----------------------------------------------------------------------
diff --git a/hbase-commit-table/src/test/java/org/apache/omid/committable/hbase/TestHBaseCommitTable.java b/hbase-commit-table/src/test/java/org/apache/omid/committable/hbase/TestHBaseCommitTable.java
index a7ba68c..9493a44 100644
--- a/hbase-commit-table/src/test/java/org/apache/omid/committable/hbase/TestHBaseCommitTable.java
+++ b/hbase-commit-table/src/test/java/org/apache/omid/committable/hbase/TestHBaseCommitTable.java
@@ -19,11 +19,6 @@ package org.apache.omid.committable.hbase;
 
 import com.google.common.base.Optional;
 import com.google.common.util.concurrent.ListenableFuture;
-import org.apache.omid.committable.CommitTable;
-import org.apache.omid.committable.CommitTable.Client;
-import org.apache.omid.committable.CommitTable.CommitTimestamp;
-import org.apache.omid.committable.CommitTable.Writer;
-import org.apache.omid.committable.hbase.HBaseCommitTable.HBaseClient;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
@@ -35,6 +30,11 @@ import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.Scan;
 import org.apache.hadoop.hbase.client.coprocessor.AggregationClient;
 import org.apache.hadoop.hbase.client.coprocessor.LongColumnInterpreter;
+import org.apache.omid.committable.CommitTable;
+import org.apache.omid.committable.CommitTable.Client;
+import org.apache.omid.committable.CommitTable.CommitTimestamp;
+import org.apache.omid.committable.CommitTable.Writer;
+import org.apache.omid.committable.hbase.HBaseCommitTable.HBaseClient;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.Assert;
@@ -47,9 +47,9 @@ import org.testng.annotations.Test;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertFalse;
-import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
 
 public class TestHBaseCommitTable {
 
@@ -139,14 +139,14 @@ public class TestHBaseCommitTable {
         Client client = commitTable.getClient();
 
         // Test that the first time the table is empty
-        assertEquals("Rows should be 0!", 0, rowCount(TABLE_NAME, commitTableFamily));
+        assertEquals(rowCount(TABLE_NAME, commitTableFamily), 0, "Rows should be 0!");
 
         // Test the successful creation of 1000 txs in the table
         for (int i = 0; i < 1000; i++) {
             writer.addCommittedTransaction(i, i + 1);
         }
         writer.flush();
-        assertEquals("Rows should be 1000!", 1000, rowCount(TABLE_NAME, commitTableFamily));
+        assertEquals(rowCount(TABLE_NAME, commitTableFamily), 1000, "Rows should be 1000!");
 
         // Test the we get the right commit timestamps for each previously inserted tx
         for (long i = 0; i < 1000; i++) {
@@ -154,9 +154,9 @@ public class TestHBaseCommitTable {
             assertTrue(commitTimestamp.isPresent());
             assertTrue(commitTimestamp.get().isValid());
             long ct = commitTimestamp.get().getValue();
-            assertEquals("Commit timestamp should be " + (i + 1), (i + 1), ct);
+            assertEquals(ct, (i + 1), "Commit timestamp should be " + (i + 1));
         }
-        assertEquals("Rows should be 1000!", 1000, rowCount(TABLE_NAME, commitTableFamily));
+        assertEquals(rowCount(TABLE_NAME, commitTableFamily), 1000, "Rows should be 1000!");
 
         // Test the successful deletion of the 1000 txs
         Future<Void> f;
@@ -164,31 +164,31 @@ public class TestHBaseCommitTable {
             f = client.completeTransaction(i);
             f.get();
         }
-        assertEquals("Rows should be 0!", 0, rowCount(TABLE_NAME, commitTableFamily));
+        assertEquals(rowCount(TABLE_NAME, commitTableFamily), 0, "Rows should be 0!");
 
         // Test we don't get a commit timestamp for a non-existent transaction id in the table
         Optional<CommitTimestamp> commitTimestamp = client.getCommitTimestamp(0).get();
-        assertFalse("Commit timestamp should not be present", commitTimestamp.isPresent());
+        assertFalse(commitTimestamp.isPresent(), "Commit timestamp should not be present");
 
         // Test that the first time, the low watermark family in table is empty
-        assertEquals("Rows should be 0!", 0, rowCount(TABLE_NAME, lowWatermarkFamily));
+        assertEquals(rowCount(TABLE_NAME, lowWatermarkFamily), 0, "Rows should be 0!");
 
         // Test the unsuccessful read of the low watermark the first time
         ListenableFuture<Long> lowWatermarkFuture = client.readLowWatermark();
-        assertEquals("Low watermark should be 0", Long.valueOf(0), lowWatermarkFuture.get());
+        assertEquals(lowWatermarkFuture.get(), Long.valueOf(0), "Low watermark should be 0");
 
         // Test the successful update of the low watermark
         for (int lowWatermark = 0; lowWatermark < 1000; lowWatermark++) {
             writer.updateLowWatermark(lowWatermark);
         }
         writer.flush();
-        assertEquals("Should there be only one row!", 1, rowCount(TABLE_NAME, lowWatermarkFamily));
+        assertEquals(rowCount(TABLE_NAME, lowWatermarkFamily), 1, "Should there be only one row!");
 
         // Test the successful read of the low watermark
         lowWatermarkFuture = client.readLowWatermark();
         long lowWatermark = lowWatermarkFuture.get();
-        assertEquals("Low watermark should be 999", 999, lowWatermark);
-        assertEquals("Should there be only one row!", 1, rowCount(TABLE_NAME, lowWatermarkFamily));
+        assertEquals(lowWatermark, 999, "Low watermark should be 999");
+        assertEquals(rowCount(TABLE_NAME, lowWatermarkFamily), 1, "Should there be only one row!");
 
     }
 
@@ -210,7 +210,7 @@ public class TestHBaseCommitTable {
         Client client = commitTable.getClient();
 
         // Test that initially the table is empty
-        assertEquals("Rows should be 0!", 0, rowCount(TABLE_NAME, commitTableFamily));
+        assertEquals(rowCount(TABLE_NAME, commitTableFamily), 0, "Rows should be 0!");
 
         // Test that a transaction can be added properly to the commit table
         writer.addCommittedTransaction(TX1_ST, TX1_CT);
@@ -219,28 +219,28 @@ public class TestHBaseCommitTable {
         assertTrue(commitTimestamp.isPresent());
         assertTrue(commitTimestamp.get().isValid());
         long ct = commitTimestamp.get().getValue();
-        assertEquals("Commit timestamp should be " + TX1_CT, TX1_CT, ct);
+        assertEquals(ct, TX1_CT, "Commit timestamp should be " + TX1_CT);
 
         // Test that a committed transaction cannot be invalidated and
         // preserves its commit timestamp after that
         boolean wasInvalidated = client.tryInvalidateTransaction(TX1_ST).get();
-        assertFalse("Transaction should not be invalidated", wasInvalidated);
+        assertFalse(wasInvalidated, "Transaction should not be invalidated");
 
         commitTimestamp = client.getCommitTimestamp(TX1_ST).get();
         assertTrue(commitTimestamp.isPresent());
         assertTrue(commitTimestamp.get().isValid());
         ct = commitTimestamp.get().getValue();
-        assertEquals("Commit timestamp should be " + TX1_CT, TX1_CT, ct);
+        assertEquals(ct, TX1_CT, "Commit timestamp should be " + TX1_CT);
 
         // Test that a non-committed transaction can be invalidated...
         wasInvalidated = client.tryInvalidateTransaction(TX2_ST).get();
-        assertTrue("Transaction should be invalidated", wasInvalidated);
+        assertTrue(wasInvalidated, "Transaction should be invalidated");
         commitTimestamp = client.getCommitTimestamp(TX2_ST).get();
         assertTrue(commitTimestamp.isPresent());
         assertFalse(commitTimestamp.get().isValid());
         ct = commitTimestamp.get().getValue();
-        assertEquals("Commit timestamp should be " + CommitTable.INVALID_TRANSACTION_MARKER,
-                     CommitTable.INVALID_TRANSACTION_MARKER, ct);
+        assertEquals(ct, CommitTable.INVALID_TRANSACTION_MARKER,
+                     "Commit timestamp should be " + CommitTable.INVALID_TRANSACTION_MARKER);
         // ...and that if it has been already invalidated, it remains
         // invalidated when someone tries to commit it
         writer.addCommittedTransaction(TX2_ST, TX2_CT);
@@ -249,12 +249,12 @@ public class TestHBaseCommitTable {
         assertTrue(commitTimestamp.isPresent());
         assertFalse(commitTimestamp.get().isValid());
         ct = commitTimestamp.get().getValue();
-        assertEquals("Commit timestamp should be " + CommitTable.INVALID_TRANSACTION_MARKER,
-                     CommitTable.INVALID_TRANSACTION_MARKER, ct);
+        assertEquals(ct, CommitTable.INVALID_TRANSACTION_MARKER,
+                     "Commit timestamp should be " + CommitTable.INVALID_TRANSACTION_MARKER);
 
         // Test that at the end of the test, the commit table contains 2
         // elements, which correspond to the two rows added in the test
-        assertEquals("Rows should be 2!", 2, rowCount(TABLE_NAME, commitTableFamily));
+        assertEquals(rowCount(TABLE_NAME, commitTableFamily), 2, "Rows should be 2!");
 
     }
 
@@ -274,7 +274,7 @@ public class TestHBaseCommitTable {
 
         // Completing first transaction should be fine
         client.completeTransaction(0).get();
-        assertEquals("Rows should be 999!", 999, rowCount(TABLE_NAME, commitTableFamily));
+        assertEquals(rowCount(TABLE_NAME, commitTableFamily), 999, "Rows should be 999!");
 
         // When closing, removing a transaction should throw an EE with an IOException
         client.close();
@@ -284,8 +284,8 @@ public class TestHBaseCommitTable {
         } catch (ExecutionException e) {
             // Expected
         }
-        assertEquals("Delete queue size should be 0!", 0, client.deleteQueue.size());
-        assertEquals("Rows should be 999!", 999, rowCount(TABLE_NAME, commitTableFamily));
+        assertEquals(client.deleteQueue.size(), 0, "Delete queue size should be 0!");
+        assertEquals(rowCount(TABLE_NAME, commitTableFamily), 999, "Rows should be 999!");
 
     }
 


[11/50] [abbrv] incubator-omid git commit: Remove Cache interface

Posted by fp...@apache.org.
Remove Cache interface

Change-Id: I5a3ca5e412f3fb7fa6bd679617507b098b9978f9


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

Branch: refs/heads/master
Commit: cf6beeea499cc2508337dcdb3ee1824c6cbb21be
Parents: 55e6644
Author: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Authored: Tue Apr 26 17:16:24 2016 -0700
Committer: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Committed: Tue Apr 26 17:16:24 2016 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/omid/tso/Cache.java    | 30 --------------------
 .../org/apache/omid/tso/CacheEvaluation.java    |  2 +-
 .../java/org/apache/omid/tso/CommitHashMap.java |  2 +-
 .../java/org/apache/omid/tso/LongCache.java     | 10 +------
 .../java/org/apache/omid/tso/TestLongCache.java |  4 +--
 5 files changed, 5 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/cf6beeea/tso-server/src/main/java/org/apache/omid/tso/Cache.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/Cache.java b/tso-server/src/main/java/org/apache/omid/tso/Cache.java
deleted file mode 100644
index 53abf3d..0000000
--- a/tso-server/src/main/java/org/apache/omid/tso/Cache.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.omid.tso;
-
-/**
- * This interface defines a container for long-long mappings, for instance for holding row -> last commit information
- *
- */
-public interface Cache {
-
-    long set(long key, long value);
-
-    long get(long key);
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/cf6beeea/tso-server/src/main/java/org/apache/omid/tso/CacheEvaluation.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/CacheEvaluation.java b/tso-server/src/main/java/org/apache/omid/tso/CacheEvaluation.java
index a0331fe..68ead7a 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/CacheEvaluation.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/CacheEvaluation.java
@@ -40,7 +40,7 @@ public class CacheEvaluation {
         writer.close();
     }
 
-    private void testEntriesAge(Cache cache, PrintWriter writer) {
+    private void testEntriesAge(LongCache cache, PrintWriter writer) {
         Random random = new Random();
 
         long seed = random.nextLong();

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/cf6beeea/tso-server/src/main/java/org/apache/omid/tso/CommitHashMap.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/CommitHashMap.java b/tso-server/src/main/java/org/apache/omid/tso/CommitHashMap.java
index df7544d..7f1268a 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/CommitHashMap.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/CommitHashMap.java
@@ -40,7 +40,7 @@ class CommitHashMap {
 
     private static final Logger LOG = LoggerFactory.getLogger(CommitHashMap.class);
 
-    private final Cache cellIdToCommitMap;
+    private final LongCache cellIdToCommitMap;
 
     /**
      * Constructs a new, empty hashtable with a default size of 1000

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/cf6beeea/tso-server/src/main/java/org/apache/omid/tso/LongCache.java
----------------------------------------------------------------------
diff --git a/tso-server/src/main/java/org/apache/omid/tso/LongCache.java b/tso-server/src/main/java/org/apache/omid/tso/LongCache.java
index ecd6cd1..f53b4bb 100644
--- a/tso-server/src/main/java/org/apache/omid/tso/LongCache.java
+++ b/tso-server/src/main/java/org/apache/omid/tso/LongCache.java
@@ -17,7 +17,7 @@
  */
 package org.apache.omid.tso;
 
-public class LongCache implements Cache {
+public class LongCache {
 
     private final long[] cache;
     private final int size;
@@ -29,10 +29,6 @@ public class LongCache implements Cache {
         this.associativity = associativity;
     }
 
-    /* (non-Javadoc)
-     * @see org.apache.omid.tso.Cache#set(long, long)
-     */
-    @Override
     public long set(long key, long value) {
         final int index = index(key);
         int oldestIndex = 0;
@@ -54,10 +50,6 @@ public class LongCache implements Cache {
         return oldestValue;
     }
 
-    /* (non-Javadoc)
-     * @see org.apache.omid.tso.Cache#get(long)
-     */
-    @Override
     public long get(long key) {
         final int index = index(key);
         for (int i = 0; i < associativity; ++i) {

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/cf6beeea/tso-server/src/test/java/org/apache/omid/tso/TestLongCache.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestLongCache.java b/tso-server/src/test/java/org/apache/omid/tso/TestLongCache.java
index c02ed85..0c0d02a 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestLongCache.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestLongCache.java
@@ -42,7 +42,7 @@ public class TestLongCache {
         // Cache configuration
         final int CACHE_SIZE = 10_000_000;
         final int CACHE_ASSOCIATIVITY = 32;
-        Cache cache = new LongCache(CACHE_SIZE, CACHE_ASSOCIATIVITY);
+        LongCache cache = new LongCache(CACHE_SIZE, CACHE_ASSOCIATIVITY);
 
         // After creation, cache values should be the default
         for (int i = 0; i < 1000; i++) {
@@ -70,7 +70,7 @@ public class TestLongCache {
 
         final int entries = 1000;
 
-        Cache cache = new LongCache(entries, 16);
+        LongCache cache = new LongCache(entries, 16);
 
         int removals = 0;
         long totalAge = 0;


[25/50] [abbrv] incubator-omid git commit: Merge pull request #99 from yahoo/baillis2

Posted by fp...@apache.org.
Merge pull request #99 from yahoo/baillis2

analyze the transactional anomalies described by P. Baillis et al.

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

Branch: refs/heads/master
Commit: dcd9db839c314c0ac4564839f332173a11613c07
Parents: 5d7dfad cad28cc
Author: Francisco P�rez-Sorrosal <fp...@gmail.com>
Authored: Thu Apr 28 17:09:14 2016 -0700
Committer: Francisco P�rez-Sorrosal <fp...@gmail.com>
Committed: Thu Apr 28 17:09:14 2016 -0700

----------------------------------------------------------------------
 .../apache/omid/benchmarks/tso/RawTxRunner.java |   2 +-
 .../TestBaillisAnomaliesWithTXs.java            | 601 +++++++++++++++++++
 2 files changed, 602 insertions(+), 1 deletion(-)
----------------------------------------------------------------------



[18/50] [abbrv] incubator-omid git commit: [ci skip]prepare release omid-0.8.1.45

Posted by fp...@apache.org.
[ci skip]prepare release omid-0.8.1.45


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

Branch: refs/heads/master
Commit: c2e767b76807e4245ae193556f5cabf9d40c3c13
Parents: 2c6e18b
Author: Omid CI <om...@yahoo-inc.com>
Authored: Wed Apr 27 01:44:01 2016 +0000
Committer: Omid CI <om...@yahoo-inc.com>
Committed: Wed Apr 27 01:44:01 2016 +0000

----------------------------------------------------------------------
 benchmarks/pom.xml          | 2 +-
 codahale-metrics/pom.xml    | 2 +-
 commit-table/pom.xml        | 2 +-
 common/pom.xml              | 2 +-
 examples/pom.xml            | 2 +-
 hbase-client/pom.xml        | 2 +-
 hbase-commit-table/pom.xml  | 2 +-
 hbase-common/pom.xml        | 2 +-
 hbase-coprocessor/pom.xml   | 2 +-
 hbase-shims/hbase-0/pom.xml | 2 +-
 hbase-shims/hbase-1/pom.xml | 2 +-
 hbase-shims/pom.xml         | 2 +-
 hbase-tools/pom.xml         | 2 +-
 metrics/pom.xml             | 2 +-
 pom.xml                     | 4 ++--
 statemachine/pom.xml        | 2 +-
 timestamp-storage/pom.xml   | 2 +-
 transaction-client/pom.xml  | 2 +-
 tso-server/pom.xml          | 2 +-
 19 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c2e767b7/benchmarks/pom.xml
----------------------------------------------------------------------
diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml
index 4129cd3..d17f9dd 100644
--- a/benchmarks/pom.xml
+++ b/benchmarks/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.45-SNAPSHOT</version>
+        <version>0.8.1.45</version>
     </parent>
 
     <artifactId>benchmarks</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c2e767b7/codahale-metrics/pom.xml
----------------------------------------------------------------------
diff --git a/codahale-metrics/pom.xml b/codahale-metrics/pom.xml
index 82a03df..76985e4 100644
--- a/codahale-metrics/pom.xml
+++ b/codahale-metrics/pom.xml
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.45-SNAPSHOT</version>
+        <version>0.8.1.45</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c2e767b7/commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/commit-table/pom.xml b/commit-table/pom.xml
index 738f47e..4e72442 100644
--- a/commit-table/pom.xml
+++ b/commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.45-SNAPSHOT</version>
+        <version>0.8.1.45</version>
     </parent>
 
     <artifactId>commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c2e767b7/common/pom.xml
----------------------------------------------------------------------
diff --git a/common/pom.xml b/common/pom.xml
index 08c3a4c..938420a 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.45-SNAPSHOT</version>
+        <version>0.8.1.45</version>
     </parent>
 
     <artifactId>common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c2e767b7/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index c0a0531..ff43d7c 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.45-SNAPSHOT</version>
+        <version>0.8.1.45</version>
     </parent>
 
     <artifactId>examples</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c2e767b7/hbase-client/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml
index 39cb1d6..3372358 100644
--- a/hbase-client/pom.xml
+++ b/hbase-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.45-SNAPSHOT</version>
+        <version>0.8.1.45</version>
     </parent>
 
     <artifactId>hbase-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c2e767b7/hbase-commit-table/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-commit-table/pom.xml b/hbase-commit-table/pom.xml
index 0d0d863..8e9f7d9 100644
--- a/hbase-commit-table/pom.xml
+++ b/hbase-commit-table/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.45-SNAPSHOT</version>
+        <version>0.8.1.45</version>
     </parent>
 
     <artifactId>hbase-commit-table</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c2e767b7/hbase-common/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml
index e05b45e..f91ee9a 100644
--- a/hbase-common/pom.xml
+++ b/hbase-common/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.45-SNAPSHOT</version>
+        <version>0.8.1.45</version>
     </parent>
 
     <artifactId>hbase-common</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c2e767b7/hbase-coprocessor/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-coprocessor/pom.xml b/hbase-coprocessor/pom.xml
index 084c00f..e9c36d8 100644
--- a/hbase-coprocessor/pom.xml
+++ b/hbase-coprocessor/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.45-SNAPSHOT</version>
+        <version>0.8.1.45</version>
     </parent>
 
     <artifactId>hbase-coprocessor</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c2e767b7/hbase-shims/hbase-0/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-0/pom.xml b/hbase-shims/hbase-0/pom.xml
index 37dc00b..3b399eb 100644
--- a/hbase-shims/hbase-0/pom.xml
+++ b/hbase-shims/hbase-0/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.45-SNAPSHOT</version>
+        <version>0.8.1.45</version>
     </parent>
 
     <artifactId>hbase0-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c2e767b7/hbase-shims/hbase-1/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/hbase-1/pom.xml b/hbase-shims/hbase-1/pom.xml
index d12dc07..225e8c6 100644
--- a/hbase-shims/hbase-1/pom.xml
+++ b/hbase-shims/hbase-1/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid-shims-aggregator</artifactId>
-        <version>0.8.1.45-SNAPSHOT</version>
+        <version>0.8.1.45</version>
     </parent>
 
     <artifactId>hbase1-shims</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c2e767b7/hbase-shims/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shims/pom.xml b/hbase-shims/pom.xml
index 8a44881..5782141 100644
--- a/hbase-shims/pom.xml
+++ b/hbase-shims/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.45-SNAPSHOT</version>
+        <version>0.8.1.45</version>
     </parent>
 
     <artifactId>omid-shims-aggregator</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c2e767b7/hbase-tools/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-tools/pom.xml b/hbase-tools/pom.xml
index 8045439..48209da 100644
--- a/hbase-tools/pom.xml
+++ b/hbase-tools/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.45-SNAPSHOT</version>
+        <version>0.8.1.45</version>
     </parent>
 
     <artifactId>hbase-tools</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c2e767b7/metrics/pom.xml
----------------------------------------------------------------------
diff --git a/metrics/pom.xml b/metrics/pom.xml
index d462694..2c57b70 100644
--- a/metrics/pom.xml
+++ b/metrics/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>omid</artifactId>
         <groupId>org.apache.omid</groupId>
-        <version>0.8.1.45-SNAPSHOT</version>
+        <version>0.8.1.45</version>
     </parent>
 
     <artifactId>metrics</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c2e767b7/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index ad750da..354f305 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
     <artifactId>omid</artifactId>
     <packaging>pom</packaging>
     <!-- WARNING: do not update version manually, use mvn versions:set -->
-    <version>0.8.1.45-SNAPSHOT</version>
+    <version>0.8.1.45</version>
 
     <organization>
         <name>Apache Software Foundation</name>
@@ -105,7 +105,7 @@
         <connection>scm:git:git://github.com/yahoo/omid.git</connection>
         <developerConnection>scm:git:https://${GH_TOKEN}@github.com/yahoo/omid.git</developerConnection>
         <url>https://github.com/yahoo/omid</url>
-        <tag>master</tag>
+        <tag>omid-0.8.1.45</tag>
     </scm>
 
     <distributionManagement>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c2e767b7/statemachine/pom.xml
----------------------------------------------------------------------
diff --git a/statemachine/pom.xml b/statemachine/pom.xml
index 7b8dd79..24a060e 100644
--- a/statemachine/pom.xml
+++ b/statemachine/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.45-SNAPSHOT</version>
+        <version>0.8.1.45</version>
     </parent>
 
     <name>State Machine</name>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c2e767b7/timestamp-storage/pom.xml
----------------------------------------------------------------------
diff --git a/timestamp-storage/pom.xml b/timestamp-storage/pom.xml
index a7b51eb..88a0e8e 100644
--- a/timestamp-storage/pom.xml
+++ b/timestamp-storage/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.45-SNAPSHOT</version>
+        <version>0.8.1.45</version>
     </parent>
 
     <artifactId>timestamp-storage</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c2e767b7/transaction-client/pom.xml
----------------------------------------------------------------------
diff --git a/transaction-client/pom.xml b/transaction-client/pom.xml
index 14d07e9..6ef6a03 100644
--- a/transaction-client/pom.xml
+++ b/transaction-client/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.45-SNAPSHOT</version>
+        <version>0.8.1.45</version>
     </parent>
 
     <artifactId>transaction-client</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/c2e767b7/tso-server/pom.xml
----------------------------------------------------------------------
diff --git a/tso-server/pom.xml b/tso-server/pom.xml
index 33789e2..0baaee2 100644
--- a/tso-server/pom.xml
+++ b/tso-server/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.apache.omid</groupId>
         <artifactId>omid</artifactId>
-        <version>0.8.1.45-SNAPSHOT</version>
+        <version>0.8.1.45</version>
     </parent>
 
     <artifactId>tso-server</artifactId>