[27/50] [abbrv] phoenix git commit: PHOENIX-4613 Thread clientVersion through to IndexCommitter implementors

2018-05-02 Thread tdsilva
PHOENIX-4613 Thread clientVersion through to IndexCommitter implementors


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

Branch: refs/heads/system-catalog
Commit: ccd41de7bfd5047511db3eb6c17121e92eebf1e6
Parents: b768900
Author: James Taylor 
Authored: Fri Apr 20 11:44:13 2018 -0700
Committer: Vincent Poon 
Committed: Fri Apr 20 11:45:06 2018 -0700

--
 .../org/apache/phoenix/hbase/index/Indexer.java | 14 +
 .../hbase/index/builder/IndexBuildManager.java  |  4 
 .../hbase/index/covered/IndexMetaData.java  | 12 ++-
 .../hbase/index/write/IndexCommitter.java   |  2 +-
 .../phoenix/hbase/index/write/IndexWriter.java  | 21 ++--
 .../write/ParallelWriterIndexCommitter.java |  2 +-
 .../hbase/index/write/RecoveryIndexWriter.java  |  4 ++--
 .../TrackingParallelWriterIndexCommitter.java   |  2 +-
 .../index/PhoenixTransactionalIndexer.java  |  9 +++--
 .../index/covered/LocalTableStateTest.java  | 18 -
 .../hbase/index/write/TestIndexWriter.java  |  7 +++
 .../index/write/TestParalleIndexWriter.java |  4 +++-
 .../write/TestParalleWriterIndexCommitter.java  |  3 ++-
 13 files changed, 73 insertions(+), 29 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/ccd41de7/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
index 7b9bc1f..7325cd8 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
@@ -92,6 +92,7 @@ import org.apache.phoenix.trace.TracingUtils;
 import org.apache.phoenix.trace.util.NullSpan;
 import org.apache.phoenix.util.EnvironmentEdgeManager;
 import org.apache.phoenix.util.PropertiesUtil;
+import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.ServerUtil;
 
 import com.google.common.collect.Lists;
@@ -132,8 +133,13 @@ public class Indexer extends BaseRegionObserver {
   // Hack to get around not being able to save any state between
   // coprocessor calls. TODO: remove after HBASE-18127 when available
   private static class BatchMutateContext {
+  public final int clientVersion;
   public Collection> indexUpdates = 
Collections.emptyList();
   public List rowLocks = 
Lists.newArrayListWithExpectedSize(QueryServicesOptions.DEFAULT_MUTATE_BATCH_SIZE);
+
+  public BatchMutateContext(int clientVersion) {
+  this.clientVersion = clientVersion;
+  }
   }
   
   private ThreadLocal batchMutateContext =
@@ -396,7 +402,7 @@ public class Indexer extends BaseRegionObserver {
* Exclusively lock all rows so we get a consistent read
* while determining the index updates
*/
-  BatchMutateContext context = new BatchMutateContext();
+  BatchMutateContext context = new 
BatchMutateContext(this.builder.getIndexMetaData(miniBatchOp).getClientVersion());
   setBatchMutateContext(c, context);
   Durability durability = Durability.SKIP_WAL;
   boolean copyMutations = false;
@@ -624,7 +630,7 @@ public class Indexer extends BaseRegionObserver {
   long start = EnvironmentEdgeManager.currentTimeMillis();
   
   current.addTimelineAnnotation("Actually doing index update for first 
time");
-  writer.writeAndKillYourselfOnFailure(context.indexUpdates, false);
+  writer.writeAndKillYourselfOnFailure(context.indexUpdates, false, 
context.clientVersion);
 
   long duration = EnvironmentEdgeManager.currentTimeMillis() - start;
   if (duration >= slowIndexWriteThreshold) {
@@ -693,7 +699,7 @@ public class Indexer extends BaseRegionObserver {
 // do the usual writer stuff, killing the server again, if we can't 
manage to make the index
 // writes succeed again
 try {
-writer.writeAndKillYourselfOnFailure(updates, true);
+writer.writeAndKillYourselfOnFailure(updates, true, 
ScanUtil.UNKNOWN_CLIENT_VERSION);
 } catch (IOException e) {
 LOG.error("During WAL replay of outstanding index updates, "
 + "Exception is thrown instead of killing server 
during index writing", e);
@@ -731,7 +737,7 @@ public class Indexer extends BaseRegionObserver {
* hopes they come up before the primary table finishes.

[1/3] phoenix git commit: PHOENIX-4613 Thread clientVersion through to IndexCommitter implementors [Forced Update!]

2018-04-22 Thread pboado
Repository: phoenix
Updated Branches:
  refs/heads/4.x-cdh5.14 213a00161 -> b21867b83 (forced update)


PHOENIX-4613 Thread clientVersion through to IndexCommitter implementors


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

Branch: refs/heads/4.x-cdh5.14
Commit: 1bfe303f6a861feea0d23e64bb1ec93d5db69a1f
Parents: 9948036
Author: Vincent Poon 
Authored: Fri Apr 20 21:35:06 2018 +0100
Committer: Pedro Boado 
Committed: Sun Apr 22 11:07:09 2018 +0100

--
 .../org/apache/phoenix/hbase/index/Indexer.java | 16 ++-
 .../hbase/index/builder/IndexBuildManager.java  |  4 
 .../hbase/index/covered/IndexMetaData.java  | 12 ++-
 .../hbase/index/write/IndexCommitter.java   |  2 +-
 .../phoenix/hbase/index/write/IndexWriter.java  | 21 ++--
 .../write/ParallelWriterIndexCommitter.java |  2 +-
 .../hbase/index/write/RecoveryIndexWriter.java  |  4 ++--
 .../TrackingParallelWriterIndexCommitter.java   |  2 +-
 .../index/PhoenixTransactionalIndexer.java  |  9 +++--
 .../index/covered/LocalTableStateTest.java  | 18 -
 .../hbase/index/write/TestIndexWriter.java  |  7 +++
 .../index/write/TestParalleIndexWriter.java |  4 +++-
 .../write/TestParalleWriterIndexCommitter.java  |  3 ++-
 13 files changed, 74 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/1bfe303f/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
index c7dbff2..1ef09fe 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
@@ -91,6 +91,7 @@ import org.apache.phoenix.trace.TracingUtils;
 import org.apache.phoenix.trace.util.NullSpan;
 import org.apache.phoenix.util.EnvironmentEdgeManager;
 import org.apache.phoenix.util.PropertiesUtil;
+import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.ServerUtil;
 
 import com.google.common.collect.Lists;
@@ -132,8 +133,13 @@ public class Indexer extends BaseRegionObserver {
   // Hack to get around not being able to save any state between
   // coprocessor calls. TODO: remove after HBASE-18127 when available
   private static class BatchMutateContext {
+  public final int clientVersion;
   public Collection> indexUpdates = 
Collections.emptyList();
   public List rowLocks = 
Lists.newArrayListWithExpectedSize(QueryServicesOptions.DEFAULT_MUTATE_BATCH_SIZE);
+
+  public BatchMutateContext(int clientVersion) {
+  this.clientVersion = clientVersion;
+  }
   }
   
   private ThreadLocal batchMutateContext =
@@ -399,7 +405,7 @@ public class Indexer extends BaseRegionObserver {
* Exclusively lock all rows so we get a consistent read
* while determining the index updates
*/
-  BatchMutateContext context = new BatchMutateContext();
+  BatchMutateContext context = new 
BatchMutateContext(this.builder.getIndexMetaData(miniBatchOp).getClientVersion());
   setBatchMutateContext(c, context);
   Durability durability = Durability.SKIP_WAL;
   boolean copyMutations = false;
@@ -627,10 +633,10 @@ public class Indexer extends BaseRegionObserver {
  }
  }
   if(!remoteUpdates.isEmpty()) {
-  writer.writeAndKillYourselfOnFailure(remoteUpdates, false);
+  writer.writeAndKillYourselfOnFailure(remoteUpdates, false, 
context.clientVersion);
   }
   if(!localUpdates.isEmpty()) {
-  writer.writeAndKillYourselfOnFailure(localUpdates, true);
+  writer.writeAndKillYourselfOnFailure(localUpdates, true, 
context.clientVersion);
   }
 
   long duration = EnvironmentEdgeManager.currentTimeMillis() - start;
@@ -700,7 +706,7 @@ public class Indexer extends BaseRegionObserver {
 // do the usual writer stuff, killing the server again, if we can't 
manage to make the index
 // writes succeed again
 try {
-writer.writeAndKillYourselfOnFailure(updates, true);
+writer.writeAndKillYourselfOnFailure(updates, true, 
ScanUtil.UNKNOWN_CLIENT_VERSION);
 } catch (IOException e) {
 LOG.error("During WAL replay of outstanding index updates, "
 + "Exception is thrown 

[1/3] phoenix git commit: PHOENIX-4613 Thread clientVersion through to IndexCommitter implementors [Forced Update!]

2018-04-22 Thread pboado
Repository: phoenix
Updated Branches:
  refs/heads/4.x-cdh5.13 1dd0830ed -> d396e455a (forced update)


PHOENIX-4613 Thread clientVersion through to IndexCommitter implementors


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

Branch: refs/heads/4.x-cdh5.13
Commit: 1bfe303f6a861feea0d23e64bb1ec93d5db69a1f
Parents: 9948036
Author: Vincent Poon 
Authored: Fri Apr 20 21:35:06 2018 +0100
Committer: Pedro Boado 
Committed: Sun Apr 22 11:07:09 2018 +0100

--
 .../org/apache/phoenix/hbase/index/Indexer.java | 16 ++-
 .../hbase/index/builder/IndexBuildManager.java  |  4 
 .../hbase/index/covered/IndexMetaData.java  | 12 ++-
 .../hbase/index/write/IndexCommitter.java   |  2 +-
 .../phoenix/hbase/index/write/IndexWriter.java  | 21 ++--
 .../write/ParallelWriterIndexCommitter.java |  2 +-
 .../hbase/index/write/RecoveryIndexWriter.java  |  4 ++--
 .../TrackingParallelWriterIndexCommitter.java   |  2 +-
 .../index/PhoenixTransactionalIndexer.java  |  9 +++--
 .../index/covered/LocalTableStateTest.java  | 18 -
 .../hbase/index/write/TestIndexWriter.java  |  7 +++
 .../index/write/TestParalleIndexWriter.java |  4 +++-
 .../write/TestParalleWriterIndexCommitter.java  |  3 ++-
 13 files changed, 74 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/1bfe303f/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
index c7dbff2..1ef09fe 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
@@ -91,6 +91,7 @@ import org.apache.phoenix.trace.TracingUtils;
 import org.apache.phoenix.trace.util.NullSpan;
 import org.apache.phoenix.util.EnvironmentEdgeManager;
 import org.apache.phoenix.util.PropertiesUtil;
+import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.ServerUtil;
 
 import com.google.common.collect.Lists;
@@ -132,8 +133,13 @@ public class Indexer extends BaseRegionObserver {
   // Hack to get around not being able to save any state between
   // coprocessor calls. TODO: remove after HBASE-18127 when available
   private static class BatchMutateContext {
+  public final int clientVersion;
   public Collection> indexUpdates = 
Collections.emptyList();
   public List rowLocks = 
Lists.newArrayListWithExpectedSize(QueryServicesOptions.DEFAULT_MUTATE_BATCH_SIZE);
+
+  public BatchMutateContext(int clientVersion) {
+  this.clientVersion = clientVersion;
+  }
   }
   
   private ThreadLocal batchMutateContext =
@@ -399,7 +405,7 @@ public class Indexer extends BaseRegionObserver {
* Exclusively lock all rows so we get a consistent read
* while determining the index updates
*/
-  BatchMutateContext context = new BatchMutateContext();
+  BatchMutateContext context = new 
BatchMutateContext(this.builder.getIndexMetaData(miniBatchOp).getClientVersion());
   setBatchMutateContext(c, context);
   Durability durability = Durability.SKIP_WAL;
   boolean copyMutations = false;
@@ -627,10 +633,10 @@ public class Indexer extends BaseRegionObserver {
  }
  }
   if(!remoteUpdates.isEmpty()) {
-  writer.writeAndKillYourselfOnFailure(remoteUpdates, false);
+  writer.writeAndKillYourselfOnFailure(remoteUpdates, false, 
context.clientVersion);
   }
   if(!localUpdates.isEmpty()) {
-  writer.writeAndKillYourselfOnFailure(localUpdates, true);
+  writer.writeAndKillYourselfOnFailure(localUpdates, true, 
context.clientVersion);
   }
 
   long duration = EnvironmentEdgeManager.currentTimeMillis() - start;
@@ -700,7 +706,7 @@ public class Indexer extends BaseRegionObserver {
 // do the usual writer stuff, killing the server again, if we can't 
manage to make the index
 // writes succeed again
 try {
-writer.writeAndKillYourselfOnFailure(updates, true);
+writer.writeAndKillYourselfOnFailure(updates, true, 
ScanUtil.UNKNOWN_CLIENT_VERSION);
 } catch (IOException e) {
 LOG.error("During WAL replay of outstanding index updates, "
 + "Exception is thrown 

[1/3] phoenix git commit: PHOENIX-4613 Thread clientVersion through to IndexCommitter implementors [Forced Update!]

2018-04-22 Thread pboado
Repository: phoenix
Updated Branches:
  refs/heads/4.x-cdh5.12 3fc3c5f3f -> c402afa2f (forced update)


PHOENIX-4613 Thread clientVersion through to IndexCommitter implementors


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

Branch: refs/heads/4.x-cdh5.12
Commit: 1bfe303f6a861feea0d23e64bb1ec93d5db69a1f
Parents: 9948036
Author: Vincent Poon 
Authored: Fri Apr 20 21:35:06 2018 +0100
Committer: Pedro Boado 
Committed: Sun Apr 22 11:07:09 2018 +0100

--
 .../org/apache/phoenix/hbase/index/Indexer.java | 16 ++-
 .../hbase/index/builder/IndexBuildManager.java  |  4 
 .../hbase/index/covered/IndexMetaData.java  | 12 ++-
 .../hbase/index/write/IndexCommitter.java   |  2 +-
 .../phoenix/hbase/index/write/IndexWriter.java  | 21 ++--
 .../write/ParallelWriterIndexCommitter.java |  2 +-
 .../hbase/index/write/RecoveryIndexWriter.java  |  4 ++--
 .../TrackingParallelWriterIndexCommitter.java   |  2 +-
 .../index/PhoenixTransactionalIndexer.java  |  9 +++--
 .../index/covered/LocalTableStateTest.java  | 18 -
 .../hbase/index/write/TestIndexWriter.java  |  7 +++
 .../index/write/TestParalleIndexWriter.java |  4 +++-
 .../write/TestParalleWriterIndexCommitter.java  |  3 ++-
 13 files changed, 74 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/1bfe303f/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
index c7dbff2..1ef09fe 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
@@ -91,6 +91,7 @@ import org.apache.phoenix.trace.TracingUtils;
 import org.apache.phoenix.trace.util.NullSpan;
 import org.apache.phoenix.util.EnvironmentEdgeManager;
 import org.apache.phoenix.util.PropertiesUtil;
+import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.ServerUtil;
 
 import com.google.common.collect.Lists;
@@ -132,8 +133,13 @@ public class Indexer extends BaseRegionObserver {
   // Hack to get around not being able to save any state between
   // coprocessor calls. TODO: remove after HBASE-18127 when available
   private static class BatchMutateContext {
+  public final int clientVersion;
   public Collection> indexUpdates = 
Collections.emptyList();
   public List rowLocks = 
Lists.newArrayListWithExpectedSize(QueryServicesOptions.DEFAULT_MUTATE_BATCH_SIZE);
+
+  public BatchMutateContext(int clientVersion) {
+  this.clientVersion = clientVersion;
+  }
   }
   
   private ThreadLocal batchMutateContext =
@@ -399,7 +405,7 @@ public class Indexer extends BaseRegionObserver {
* Exclusively lock all rows so we get a consistent read
* while determining the index updates
*/
-  BatchMutateContext context = new BatchMutateContext();
+  BatchMutateContext context = new 
BatchMutateContext(this.builder.getIndexMetaData(miniBatchOp).getClientVersion());
   setBatchMutateContext(c, context);
   Durability durability = Durability.SKIP_WAL;
   boolean copyMutations = false;
@@ -627,10 +633,10 @@ public class Indexer extends BaseRegionObserver {
  }
  }
   if(!remoteUpdates.isEmpty()) {
-  writer.writeAndKillYourselfOnFailure(remoteUpdates, false);
+  writer.writeAndKillYourselfOnFailure(remoteUpdates, false, 
context.clientVersion);
   }
   if(!localUpdates.isEmpty()) {
-  writer.writeAndKillYourselfOnFailure(localUpdates, true);
+  writer.writeAndKillYourselfOnFailure(localUpdates, true, 
context.clientVersion);
   }
 
   long duration = EnvironmentEdgeManager.currentTimeMillis() - start;
@@ -700,7 +706,7 @@ public class Indexer extends BaseRegionObserver {
 // do the usual writer stuff, killing the server again, if we can't 
manage to make the index
 // writes succeed again
 try {
-writer.writeAndKillYourselfOnFailure(updates, true);
+writer.writeAndKillYourselfOnFailure(updates, true, 
ScanUtil.UNKNOWN_CLIENT_VERSION);
 } catch (IOException e) {
 LOG.error("During WAL replay of outstanding index updates, "
 + "Exception is thrown 

[1/2] phoenix git commit: PHOENIX-4613 Thread clientVersion through to IndexCommitter implementors

2018-04-22 Thread pboado
Repository: phoenix
Updated Branches:
  refs/heads/4.x-cdh5.11 9948036b6 -> 8bba23976


PHOENIX-4613 Thread clientVersion through to IndexCommitter implementors


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

Branch: refs/heads/4.x-cdh5.11
Commit: 1bfe303f6a861feea0d23e64bb1ec93d5db69a1f
Parents: 9948036
Author: Vincent Poon 
Authored: Fri Apr 20 21:35:06 2018 +0100
Committer: Pedro Boado 
Committed: Sun Apr 22 11:07:09 2018 +0100

--
 .../org/apache/phoenix/hbase/index/Indexer.java | 16 ++-
 .../hbase/index/builder/IndexBuildManager.java  |  4 
 .../hbase/index/covered/IndexMetaData.java  | 12 ++-
 .../hbase/index/write/IndexCommitter.java   |  2 +-
 .../phoenix/hbase/index/write/IndexWriter.java  | 21 ++--
 .../write/ParallelWriterIndexCommitter.java |  2 +-
 .../hbase/index/write/RecoveryIndexWriter.java  |  4 ++--
 .../TrackingParallelWriterIndexCommitter.java   |  2 +-
 .../index/PhoenixTransactionalIndexer.java  |  9 +++--
 .../index/covered/LocalTableStateTest.java  | 18 -
 .../hbase/index/write/TestIndexWriter.java  |  7 +++
 .../index/write/TestParalleIndexWriter.java |  4 +++-
 .../write/TestParalleWriterIndexCommitter.java  |  3 ++-
 13 files changed, 74 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/1bfe303f/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
index c7dbff2..1ef09fe 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
@@ -91,6 +91,7 @@ import org.apache.phoenix.trace.TracingUtils;
 import org.apache.phoenix.trace.util.NullSpan;
 import org.apache.phoenix.util.EnvironmentEdgeManager;
 import org.apache.phoenix.util.PropertiesUtil;
+import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.ServerUtil;
 
 import com.google.common.collect.Lists;
@@ -132,8 +133,13 @@ public class Indexer extends BaseRegionObserver {
   // Hack to get around not being able to save any state between
   // coprocessor calls. TODO: remove after HBASE-18127 when available
   private static class BatchMutateContext {
+  public final int clientVersion;
   public Collection> indexUpdates = 
Collections.emptyList();
   public List rowLocks = 
Lists.newArrayListWithExpectedSize(QueryServicesOptions.DEFAULT_MUTATE_BATCH_SIZE);
+
+  public BatchMutateContext(int clientVersion) {
+  this.clientVersion = clientVersion;
+  }
   }
   
   private ThreadLocal batchMutateContext =
@@ -399,7 +405,7 @@ public class Indexer extends BaseRegionObserver {
* Exclusively lock all rows so we get a consistent read
* while determining the index updates
*/
-  BatchMutateContext context = new BatchMutateContext();
+  BatchMutateContext context = new 
BatchMutateContext(this.builder.getIndexMetaData(miniBatchOp).getClientVersion());
   setBatchMutateContext(c, context);
   Durability durability = Durability.SKIP_WAL;
   boolean copyMutations = false;
@@ -627,10 +633,10 @@ public class Indexer extends BaseRegionObserver {
  }
  }
   if(!remoteUpdates.isEmpty()) {
-  writer.writeAndKillYourselfOnFailure(remoteUpdates, false);
+  writer.writeAndKillYourselfOnFailure(remoteUpdates, false, 
context.clientVersion);
   }
   if(!localUpdates.isEmpty()) {
-  writer.writeAndKillYourselfOnFailure(localUpdates, true);
+  writer.writeAndKillYourselfOnFailure(localUpdates, true, 
context.clientVersion);
   }
 
   long duration = EnvironmentEdgeManager.currentTimeMillis() - start;
@@ -700,7 +706,7 @@ public class Indexer extends BaseRegionObserver {
 // do the usual writer stuff, killing the server again, if we can't 
manage to make the index
 // writes succeed again
 try {
-writer.writeAndKillYourselfOnFailure(updates, true);
+writer.writeAndKillYourselfOnFailure(updates, true, 
ScanUtil.UNKNOWN_CLIENT_VERSION);
 } catch (IOException e) {
 LOG.error("During WAL replay of outstanding index updates, "
 + "Exception is thrown instead of killing 

phoenix git commit: PHOENIX-4613 Thread clientVersion through to IndexCommitter implementors

2018-04-20 Thread vincentpoon
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 751043d8f -> 64cc6d8c6


PHOENIX-4613 Thread clientVersion through to IndexCommitter implementors


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/64cc6d8c
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/64cc6d8c
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/64cc6d8c

Branch: refs/heads/4.x-HBase-0.98
Commit: 64cc6d8c607a32111a7a23ecd03eaa428399a12a
Parents: 751043d
Author: Vincent Poon 
Authored: Fri Apr 20 13:35:06 2018 -0700
Committer: Vincent Poon 
Committed: Fri Apr 20 13:48:34 2018 -0700

--
 .../org/apache/phoenix/hbase/index/Indexer.java | 16 ++-
 .../hbase/index/builder/IndexBuildManager.java  |  4 
 .../hbase/index/covered/IndexMetaData.java  | 12 ++-
 .../hbase/index/write/IndexCommitter.java   |  2 +-
 .../phoenix/hbase/index/write/IndexWriter.java  | 21 ++--
 .../write/ParallelWriterIndexCommitter.java |  2 +-
 .../hbase/index/write/RecoveryIndexWriter.java  |  4 ++--
 .../TrackingParallelWriterIndexCommitter.java   |  2 +-
 .../index/PhoenixTransactionalIndexer.java  |  9 +++--
 .../index/covered/LocalTableStateTest.java  | 18 -
 .../hbase/index/write/TestIndexWriter.java  |  7 ---
 .../index/write/TestParalleIndexWriter.java |  4 +++-
 .../write/TestParalleWriterIndexCommitter.java  |  3 ++-
 13 files changed, 75 insertions(+), 29 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/64cc6d8c/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
index 566c662..d6ecba6 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
@@ -88,6 +88,7 @@ import org.apache.phoenix.trace.TracingUtils;
 import org.apache.phoenix.trace.util.NullSpan;
 import org.apache.phoenix.util.EnvironmentEdgeManager;
 import org.apache.phoenix.util.PropertiesUtil;
+import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.ServerUtil;
 import org.cloudera.htrace.Span;
 import org.cloudera.htrace.Trace;
@@ -132,8 +133,13 @@ public class Indexer extends BaseRegionObserver {
   // Hack to get around not being able to save any state between
   // coprocessor calls. TODO: remove after HBASE-18127 when available
   private static class BatchMutateContext {
+  public final int clientVersion;
   public Collection> indexUpdates = 
Collections.emptyList();
   public List rowLocks = 
Lists.newArrayListWithExpectedSize(QueryServicesOptions.DEFAULT_MUTATE_BATCH_SIZE);
+
+  public BatchMutateContext(int clientVersion) {
+  this.clientVersion = clientVersion;
+  }
   }
   
   private ThreadLocal batchMutateContext =
@@ -399,7 +405,7 @@ public class Indexer extends BaseRegionObserver {
* Exclusively lock all rows so we get a consistent read
* while determining the index updates
*/
-  BatchMutateContext context = new BatchMutateContext();
+  BatchMutateContext context = new 
BatchMutateContext(this.builder.getIndexMetaData(miniBatchOp).getClientVersion());
   setBatchMutateContext(c, context);
   Durability durability = Durability.SKIP_WAL;
   boolean copyMutations = false;
@@ -627,10 +633,10 @@ public class Indexer extends BaseRegionObserver {
  }
  }
   if(!remoteUpdates.isEmpty()) {
-  writer.writeAndKillYourselfOnFailure(remoteUpdates, false);
+  writer.writeAndKillYourselfOnFailure(remoteUpdates, false, 
context.clientVersion);
   }
   if(!localUpdates.isEmpty()) {
-  writer.writeAndKillYourselfOnFailure(localUpdates, true);
+  writer.writeAndKillYourselfOnFailure(localUpdates, true, 
context.clientVersion);
   }
 
   long duration = EnvironmentEdgeManager.currentTimeMillis() - start;
@@ -700,7 +706,7 @@ public class Indexer extends BaseRegionObserver {
 // do the usual writer stuff, killing the server again, if we can't 
manage to make the index
 // writes succeed again
 try {
-writer.writeAndKillYourselfOnFailure(updates, true);
+writer.writeAndKillYourselfOnFailure(updates, true, 
ScanUtil.UNKNOWN_CLIENT_VERSION);
 } catch (IOException e) {
 LOG.error("During WAL replay of outstanding index updates, "
 + 

phoenix git commit: PHOENIX-4613 Thread clientVersion through to IndexCommitter implementors

2018-04-20 Thread vincentpoon
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.1 26ace0bff -> c795fd506


PHOENIX-4613 Thread clientVersion through to IndexCommitter implementors


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

Branch: refs/heads/4.x-HBase-1.1
Commit: c795fd506d4a2a79940ab8989e823748972e8188
Parents: 26ace0b
Author: Vincent Poon 
Authored: Fri Apr 20 13:35:06 2018 -0700
Committer: Vincent Poon 
Committed: Fri Apr 20 13:35:41 2018 -0700

--
 .../org/apache/phoenix/hbase/index/Indexer.java | 16 ++-
 .../hbase/index/builder/IndexBuildManager.java  |  4 
 .../hbase/index/covered/IndexMetaData.java  | 12 ++-
 .../hbase/index/write/IndexCommitter.java   |  2 +-
 .../phoenix/hbase/index/write/IndexWriter.java  | 21 ++--
 .../write/ParallelWriterIndexCommitter.java |  2 +-
 .../hbase/index/write/RecoveryIndexWriter.java  |  4 ++--
 .../TrackingParallelWriterIndexCommitter.java   |  2 +-
 .../index/PhoenixTransactionalIndexer.java  |  9 +++--
 .../index/covered/LocalTableStateTest.java  | 18 -
 .../hbase/index/write/TestIndexWriter.java  |  7 +++
 .../index/write/TestParalleIndexWriter.java |  4 +++-
 .../write/TestParalleWriterIndexCommitter.java  |  3 ++-
 13 files changed, 74 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/c795fd50/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
index c7dbff2..1ef09fe 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
@@ -91,6 +91,7 @@ import org.apache.phoenix.trace.TracingUtils;
 import org.apache.phoenix.trace.util.NullSpan;
 import org.apache.phoenix.util.EnvironmentEdgeManager;
 import org.apache.phoenix.util.PropertiesUtil;
+import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.ServerUtil;
 
 import com.google.common.collect.Lists;
@@ -132,8 +133,13 @@ public class Indexer extends BaseRegionObserver {
   // Hack to get around not being able to save any state between
   // coprocessor calls. TODO: remove after HBASE-18127 when available
   private static class BatchMutateContext {
+  public final int clientVersion;
   public Collection> indexUpdates = 
Collections.emptyList();
   public List rowLocks = 
Lists.newArrayListWithExpectedSize(QueryServicesOptions.DEFAULT_MUTATE_BATCH_SIZE);
+
+  public BatchMutateContext(int clientVersion) {
+  this.clientVersion = clientVersion;
+  }
   }
   
   private ThreadLocal batchMutateContext =
@@ -399,7 +405,7 @@ public class Indexer extends BaseRegionObserver {
* Exclusively lock all rows so we get a consistent read
* while determining the index updates
*/
-  BatchMutateContext context = new BatchMutateContext();
+  BatchMutateContext context = new 
BatchMutateContext(this.builder.getIndexMetaData(miniBatchOp).getClientVersion());
   setBatchMutateContext(c, context);
   Durability durability = Durability.SKIP_WAL;
   boolean copyMutations = false;
@@ -627,10 +633,10 @@ public class Indexer extends BaseRegionObserver {
  }
  }
   if(!remoteUpdates.isEmpty()) {
-  writer.writeAndKillYourselfOnFailure(remoteUpdates, false);
+  writer.writeAndKillYourselfOnFailure(remoteUpdates, false, 
context.clientVersion);
   }
   if(!localUpdates.isEmpty()) {
-  writer.writeAndKillYourselfOnFailure(localUpdates, true);
+  writer.writeAndKillYourselfOnFailure(localUpdates, true, 
context.clientVersion);
   }
 
   long duration = EnvironmentEdgeManager.currentTimeMillis() - start;
@@ -700,7 +706,7 @@ public class Indexer extends BaseRegionObserver {
 // do the usual writer stuff, killing the server again, if we can't 
manage to make the index
 // writes succeed again
 try {
-writer.writeAndKillYourselfOnFailure(updates, true);
+writer.writeAndKillYourselfOnFailure(updates, true, 
ScanUtil.UNKNOWN_CLIENT_VERSION);
 } catch (IOException e) {
 LOG.error("During WAL replay of outstanding index updates, "
 + "Exception is thrown instead of 

phoenix git commit: PHOENIX-4613 Thread clientVersion through to IndexCommitter implementors

2018-04-20 Thread vincentpoon
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.2 da66e473a -> 5bb75b311


PHOENIX-4613 Thread clientVersion through to IndexCommitter implementors


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

Branch: refs/heads/4.x-HBase-1.2
Commit: 5bb75b31110c1e58b0a301ccc9a652ee1a522deb
Parents: da66e47
Author: Vincent Poon 
Authored: Fri Apr 20 13:35:06 2018 -0700
Committer: Vincent Poon 
Committed: Fri Apr 20 13:35:06 2018 -0700

--
 .../org/apache/phoenix/hbase/index/Indexer.java | 16 ++-
 .../hbase/index/builder/IndexBuildManager.java  |  4 
 .../hbase/index/covered/IndexMetaData.java  | 12 ++-
 .../hbase/index/write/IndexCommitter.java   |  2 +-
 .../phoenix/hbase/index/write/IndexWriter.java  | 21 ++--
 .../write/ParallelWriterIndexCommitter.java |  2 +-
 .../hbase/index/write/RecoveryIndexWriter.java  |  4 ++--
 .../TrackingParallelWriterIndexCommitter.java   |  2 +-
 .../index/PhoenixTransactionalIndexer.java  |  9 +++--
 .../index/covered/LocalTableStateTest.java  | 18 -
 .../hbase/index/write/TestIndexWriter.java  |  7 +++
 .../index/write/TestParalleIndexWriter.java |  4 +++-
 .../write/TestParalleWriterIndexCommitter.java  |  3 ++-
 13 files changed, 74 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/5bb75b31/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
index c7dbff2..1ef09fe 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
@@ -91,6 +91,7 @@ import org.apache.phoenix.trace.TracingUtils;
 import org.apache.phoenix.trace.util.NullSpan;
 import org.apache.phoenix.util.EnvironmentEdgeManager;
 import org.apache.phoenix.util.PropertiesUtil;
+import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.ServerUtil;
 
 import com.google.common.collect.Lists;
@@ -132,8 +133,13 @@ public class Indexer extends BaseRegionObserver {
   // Hack to get around not being able to save any state between
   // coprocessor calls. TODO: remove after HBASE-18127 when available
   private static class BatchMutateContext {
+  public final int clientVersion;
   public Collection> indexUpdates = 
Collections.emptyList();
   public List rowLocks = 
Lists.newArrayListWithExpectedSize(QueryServicesOptions.DEFAULT_MUTATE_BATCH_SIZE);
+
+  public BatchMutateContext(int clientVersion) {
+  this.clientVersion = clientVersion;
+  }
   }
   
   private ThreadLocal batchMutateContext =
@@ -399,7 +405,7 @@ public class Indexer extends BaseRegionObserver {
* Exclusively lock all rows so we get a consistent read
* while determining the index updates
*/
-  BatchMutateContext context = new BatchMutateContext();
+  BatchMutateContext context = new 
BatchMutateContext(this.builder.getIndexMetaData(miniBatchOp).getClientVersion());
   setBatchMutateContext(c, context);
   Durability durability = Durability.SKIP_WAL;
   boolean copyMutations = false;
@@ -627,10 +633,10 @@ public class Indexer extends BaseRegionObserver {
  }
  }
   if(!remoteUpdates.isEmpty()) {
-  writer.writeAndKillYourselfOnFailure(remoteUpdates, false);
+  writer.writeAndKillYourselfOnFailure(remoteUpdates, false, 
context.clientVersion);
   }
   if(!localUpdates.isEmpty()) {
-  writer.writeAndKillYourselfOnFailure(localUpdates, true);
+  writer.writeAndKillYourselfOnFailure(localUpdates, true, 
context.clientVersion);
   }
 
   long duration = EnvironmentEdgeManager.currentTimeMillis() - start;
@@ -700,7 +706,7 @@ public class Indexer extends BaseRegionObserver {
 // do the usual writer stuff, killing the server again, if we can't 
manage to make the index
 // writes succeed again
 try {
-writer.writeAndKillYourselfOnFailure(updates, true);
+writer.writeAndKillYourselfOnFailure(updates, true, 
ScanUtil.UNKNOWN_CLIENT_VERSION);
 } catch (IOException e) {
 LOG.error("During WAL replay of outstanding index updates, "
 + "Exception is thrown instead of 

phoenix git commit: PHOENIX-4613 Thread clientVersion through to IndexCommitter implementors

2018-04-20 Thread vincentpoon
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.3 9a0e553b5 -> 62d20ec70


PHOENIX-4613 Thread clientVersion through to IndexCommitter implementors


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/62d20ec7
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/62d20ec7
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/62d20ec7

Branch: refs/heads/4.x-HBase-1.3
Commit: 62d20ec7022ccb3bee6d93ff581c562fe72d2955
Parents: 9a0e553
Author: James Taylor 
Authored: Fri Apr 20 11:44:13 2018 -0700
Committer: Vincent Poon 
Committed: Fri Apr 20 11:47:24 2018 -0700

--
 .../org/apache/phoenix/hbase/index/Indexer.java | 14 +
 .../hbase/index/builder/IndexBuildManager.java  |  4 
 .../hbase/index/covered/IndexMetaData.java  | 12 ++-
 .../hbase/index/write/IndexCommitter.java   |  2 +-
 .../phoenix/hbase/index/write/IndexWriter.java  | 21 ++--
 .../write/ParallelWriterIndexCommitter.java |  2 +-
 .../hbase/index/write/RecoveryIndexWriter.java  |  4 ++--
 .../TrackingParallelWriterIndexCommitter.java   |  2 +-
 .../index/PhoenixTransactionalIndexer.java  |  9 +++--
 .../index/covered/LocalTableStateTest.java  | 18 -
 .../hbase/index/write/TestIndexWriter.java  |  7 +++
 .../index/write/TestParalleIndexWriter.java |  4 +++-
 .../write/TestParalleWriterIndexCommitter.java  |  3 ++-
 13 files changed, 73 insertions(+), 29 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/62d20ec7/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
index 7b9bc1f..7325cd8 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
@@ -92,6 +92,7 @@ import org.apache.phoenix.trace.TracingUtils;
 import org.apache.phoenix.trace.util.NullSpan;
 import org.apache.phoenix.util.EnvironmentEdgeManager;
 import org.apache.phoenix.util.PropertiesUtil;
+import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.ServerUtil;
 
 import com.google.common.collect.Lists;
@@ -132,8 +133,13 @@ public class Indexer extends BaseRegionObserver {
   // Hack to get around not being able to save any state between
   // coprocessor calls. TODO: remove after HBASE-18127 when available
   private static class BatchMutateContext {
+  public final int clientVersion;
   public Collection> indexUpdates = 
Collections.emptyList();
   public List rowLocks = 
Lists.newArrayListWithExpectedSize(QueryServicesOptions.DEFAULT_MUTATE_BATCH_SIZE);
+
+  public BatchMutateContext(int clientVersion) {
+  this.clientVersion = clientVersion;
+  }
   }
   
   private ThreadLocal batchMutateContext =
@@ -396,7 +402,7 @@ public class Indexer extends BaseRegionObserver {
* Exclusively lock all rows so we get a consistent read
* while determining the index updates
*/
-  BatchMutateContext context = new BatchMutateContext();
+  BatchMutateContext context = new 
BatchMutateContext(this.builder.getIndexMetaData(miniBatchOp).getClientVersion());
   setBatchMutateContext(c, context);
   Durability durability = Durability.SKIP_WAL;
   boolean copyMutations = false;
@@ -624,7 +630,7 @@ public class Indexer extends BaseRegionObserver {
   long start = EnvironmentEdgeManager.currentTimeMillis();
   
   current.addTimelineAnnotation("Actually doing index update for first 
time");
-  writer.writeAndKillYourselfOnFailure(context.indexUpdates, false);
+  writer.writeAndKillYourselfOnFailure(context.indexUpdates, false, 
context.clientVersion);
 
   long duration = EnvironmentEdgeManager.currentTimeMillis() - start;
   if (duration >= slowIndexWriteThreshold) {
@@ -693,7 +699,7 @@ public class Indexer extends BaseRegionObserver {
 // do the usual writer stuff, killing the server again, if we can't 
manage to make the index
 // writes succeed again
 try {
-writer.writeAndKillYourselfOnFailure(updates, true);
+writer.writeAndKillYourselfOnFailure(updates, true, 
ScanUtil.UNKNOWN_CLIENT_VERSION);
 } catch (IOException e) {
 LOG.error("During WAL replay of outstanding index updates, "
 + "Exception is thrown instead of killing server 
during index writing", e);
@@ -731,7 +737,7 @@ public class Indexer extends 

phoenix git commit: PHOENIX-4613 Thread clientVersion through to IndexCommitter implementors

2018-04-20 Thread vincentpoon
Repository: phoenix
Updated Branches:
  refs/heads/master b768900d9 -> ccd41de7b


PHOENIX-4613 Thread clientVersion through to IndexCommitter implementors


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

Branch: refs/heads/master
Commit: ccd41de7bfd5047511db3eb6c17121e92eebf1e6
Parents: b768900
Author: James Taylor 
Authored: Fri Apr 20 11:44:13 2018 -0700
Committer: Vincent Poon 
Committed: Fri Apr 20 11:45:06 2018 -0700

--
 .../org/apache/phoenix/hbase/index/Indexer.java | 14 +
 .../hbase/index/builder/IndexBuildManager.java  |  4 
 .../hbase/index/covered/IndexMetaData.java  | 12 ++-
 .../hbase/index/write/IndexCommitter.java   |  2 +-
 .../phoenix/hbase/index/write/IndexWriter.java  | 21 ++--
 .../write/ParallelWriterIndexCommitter.java |  2 +-
 .../hbase/index/write/RecoveryIndexWriter.java  |  4 ++--
 .../TrackingParallelWriterIndexCommitter.java   |  2 +-
 .../index/PhoenixTransactionalIndexer.java  |  9 +++--
 .../index/covered/LocalTableStateTest.java  | 18 -
 .../hbase/index/write/TestIndexWriter.java  |  7 +++
 .../index/write/TestParalleIndexWriter.java |  4 +++-
 .../write/TestParalleWriterIndexCommitter.java  |  3 ++-
 13 files changed, 73 insertions(+), 29 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/ccd41de7/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
index 7b9bc1f..7325cd8 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
@@ -92,6 +92,7 @@ import org.apache.phoenix.trace.TracingUtils;
 import org.apache.phoenix.trace.util.NullSpan;
 import org.apache.phoenix.util.EnvironmentEdgeManager;
 import org.apache.phoenix.util.PropertiesUtil;
+import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.ServerUtil;
 
 import com.google.common.collect.Lists;
@@ -132,8 +133,13 @@ public class Indexer extends BaseRegionObserver {
   // Hack to get around not being able to save any state between
   // coprocessor calls. TODO: remove after HBASE-18127 when available
   private static class BatchMutateContext {
+  public final int clientVersion;
   public Collection> indexUpdates = 
Collections.emptyList();
   public List rowLocks = 
Lists.newArrayListWithExpectedSize(QueryServicesOptions.DEFAULT_MUTATE_BATCH_SIZE);
+
+  public BatchMutateContext(int clientVersion) {
+  this.clientVersion = clientVersion;
+  }
   }
   
   private ThreadLocal batchMutateContext =
@@ -396,7 +402,7 @@ public class Indexer extends BaseRegionObserver {
* Exclusively lock all rows so we get a consistent read
* while determining the index updates
*/
-  BatchMutateContext context = new BatchMutateContext();
+  BatchMutateContext context = new 
BatchMutateContext(this.builder.getIndexMetaData(miniBatchOp).getClientVersion());
   setBatchMutateContext(c, context);
   Durability durability = Durability.SKIP_WAL;
   boolean copyMutations = false;
@@ -624,7 +630,7 @@ public class Indexer extends BaseRegionObserver {
   long start = EnvironmentEdgeManager.currentTimeMillis();
   
   current.addTimelineAnnotation("Actually doing index update for first 
time");
-  writer.writeAndKillYourselfOnFailure(context.indexUpdates, false);
+  writer.writeAndKillYourselfOnFailure(context.indexUpdates, false, 
context.clientVersion);
 
   long duration = EnvironmentEdgeManager.currentTimeMillis() - start;
   if (duration >= slowIndexWriteThreshold) {
@@ -693,7 +699,7 @@ public class Indexer extends BaseRegionObserver {
 // do the usual writer stuff, killing the server again, if we can't 
manage to make the index
 // writes succeed again
 try {
-writer.writeAndKillYourselfOnFailure(updates, true);
+writer.writeAndKillYourselfOnFailure(updates, true, 
ScanUtil.UNKNOWN_CLIENT_VERSION);
 } catch (IOException e) {
 LOG.error("During WAL replay of outstanding index updates, "
 + "Exception is thrown instead of killing server 
during index writing", e);
@@ -731,7 +737,7 @@ public class Indexer extends BaseRegionObserver {