Repository: GoogleCloudPlatform/cloud-bigtable-client
Pull request #1984 (2018-10-30 16:06:03)

AppendAdapter, IncrementAdapter and HBaseRequestAdapter changes
adapt methods in `AppendAdapter `and `IncrementAdapter `changed to accept `ReadModifyWriteRow `as parameter instead of `ReadModifyWriteRowRequest.Builder`.
`HBaseRequestAdapter `revised to match the above changes.
`TestAppendAdapter `and `TestIncrementAdapter `test files updated.


Patch:
diff --git a/README.md b/README.md
index 5292835f0..0b811c2d5 100644
--- a/README.md
+++ b/README.md
@@ -80,7 +80,7 @@ infrequent product and client library announcements.
    Use the following command to run the Cloud Bigtable integration tests for HBase 1:
 
    ```sh
-   mvn clean integration-test \
+   mvn clean verify \
        -PbigtableIntegrationTest \
        -Dgoogle.bigtable.project.id=[your cloud project id] \
        -Dgoogle.bigtable.instance.id=[your cloud bigtable instance id]
@@ -89,7 +89,7 @@ infrequent product and client library announcements.
    Use the following command to run the Cloud Bigtable integration tests for HBase 2:
 
    ```sh
-   mvn clean integration-test \
+   mvn clean verify \
        -PbigtableIntegrationTestH2 \
        -Dgoogle.bigtable.project.id=[your cloud project id] \
        -Dgoogle.bigtable.instance.id=[your cloud bigtable instance id]
@@ -97,10 +97,10 @@ infrequent product and client library announcements.
    
    There are also tests that perform compatibility tests against an HBase Minicluster, which can be invoked with the following commands for HBase 1 and HBase 2 respectively: 
    ```sh
-   mvn clean integration-test -PhbaseLocalMiniClusterTest
+   mvn clean verify -PhbaseLocalMiniClusterTest
    ```
    ```sh
-   mvn clean integration-test -PhbaseLocalMiniClusterTestH2
+   mvn clean verify -PhbaseLocalMiniClusterTestH2
    ```
 
 
diff --git a/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/async/RetryingMutateRowsOperation.java b/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/async/RetryingMutateRowsOperation.java
index 5cf4ab5bc..861c85094 100644
--- a/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/async/RetryingMutateRowsOperation.java
+++ b/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/async/RetryingMutateRowsOperation.java
@@ -84,8 +84,8 @@ public class RetryingMutateRowsOperation extends
     }
 
     // Perform a partial retry, if the backoff policy allows it.
-    long nextBackOff = getNextBackoff();
-    if (nextBackOff == BackOff.STOP) {
+    Long nextBackOff = getNextBackoff();
+    if (nextBackOff == null) {
       // Return the response as is, and don't retry;
       rpc.getRpcMetrics().markRetriesExhasted();
       completionFuture.set(Arrays.asList(requestManager.buildResponse()));
diff --git a/bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/adapters/AppendAdapter.java b/bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/adapters/AppendAdapter.java
index 0c68e4f42..73627b721 100644
--- a/bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/adapters/AppendAdapter.java
+++ b/bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/adapters/AppendAdapter.java
@@ -15,8 +15,7 @@
  */
 package com.google.cloud.bigtable.hbase.adapters;
 
-import com.google.bigtable.v2.ReadModifyWriteRowRequest;
-import com.google.bigtable.v2.ReadModifyWriteRule;
+import com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow;
 import com.google.protobuf.ByteString;
 
 import org.apache.hadoop.hbase.Cell;
@@ -32,33 +31,29 @@ import java.util.Map;
  * @author sduskis
  * @version $Id: $Id
  */
-public class AppendAdapter implements OperationAdapter<Append, ReadModifyWriteRowRequest.Builder> {
+public class AppendAdapter implements OperationAdapter<Append, ReadModifyWriteRow> {
 
   /** {@inheritDoc} */
   @Override
-  public void adapt(Append operation, ReadModifyWriteRowRequest.Builder result) {
-    result.setRowKey(ByteString.copyFrom(operation.getRow()));
-
-    for (Map.Entry<byte[], List<Cell>> entry : operation.getFamilyCellMap().entrySet()){
+  public void adapt(Append operation, ReadModifyWriteRow readModifyWriteRow) {
+    for (Map.Entry<byte[], List<Cell>> entry : operation.getFamilyCellMap().entrySet()) {
       String familyName = Bytes.toString(entry.getKey());
       // Bigtable applies all appends present in a single RPC. HBase applies only the last
       // mutation present, if any. We remove all but the last mutation for each qualifier here:
       List<Cell> cells = CellDeduplicationHelper.deduplicateFamily(operation, entry.getKey());
 
       for (Cell cell : cells) {
-        ReadModifyWriteRule.Builder rule = ReadModifyWriteRule.newBuilder();
-        rule.setFamilyName(familyName);
-        rule.setColumnQualifier(
+        readModifyWriteRow.append(
+            familyName,
             ByteString.copyFrom(
                 cell.getQualifierArray(),
                 cell.getQualifierOffset(),
-                cell.getQualifierLength()));
-        rule.setAppendValue(
+                cell.getQualifierLength()),
             ByteString.copyFrom(
                 cell.getValueArray(),
                 cell.getValueOffset(),
-                cell.getValueLength()));
-        result.addRules(rule.build());
+                cell.getValueLength())
+        );
       }
     }
   }
diff --git a/bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/adapters/HBaseRequestAdapter.java b/bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/adapters/HBaseRequestAdapter.java
index 1c273791f..aa52cebdc 100644
--- a/bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/adapters/HBaseRequestAdapter.java
+++ b/bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/adapters/HBaseRequestAdapter.java
@@ -20,6 +20,7 @@ import com.google.cloud.bigtable.data.v2.internal.RequestContext;
 import com.google.cloud.bigtable.data.v2.models.InstanceName;
 import com.google.cloud.bigtable.data.v2.models.Mutation;
 import com.google.cloud.bigtable.data.v2.models.MutationApi;
+import com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow;
 import com.google.cloud.bigtable.data.v2.models.RowMutation;
 import com.google.common.annotations.VisibleForTesting;
 import com.google.protobuf.ByteString;
@@ -198,11 +199,10 @@ public class HBaseRequestAdapter {
    * @return a {@link com.google.bigtable.v2.ReadModifyWriteRowRequest} object.
    */
   public ReadModifyWriteRowRequest adapt(Append append) {
-    ReadModifyWriteRowRequest.Builder builder = ReadModifyWriteRowRequest.newBuilder();
-    //TODO: change APPEND_ADAPTER to adapt to {@link com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow} model
-    Adapters.APPEND_ADAPTER.adapt(append, builder);
-    builder.setTableName(getTableNameString());
-    return builder.build();
+    ReadModifyWriteRow readModifyWriteRow = ReadModifyWriteRow
+        .create(bigtableTableName.getTableId(), ByteString.copyFrom(append.getRow()));
+    Adapters.APPEND_ADAPTER.adapt(append, readModifyWriteRow);
+    return readModifyWriteRow.toProto(requestContext);
   }
 
   /**
@@ -212,11 +212,10 @@ public class HBaseRequestAdapter {
    * @return a {@link com.google.bigtable.v2.ReadModifyWriteRowRequest} object.
    */
   public ReadModifyWriteRowRequest adapt(Increment increment) {
-    ReadModifyWriteRowRequest.Builder builder = ReadModifyWriteRowRequest.newBuilder();
-    //TODO: change INCREMENT_ADAPTER to adapt to {@link com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow} model
-    Adapters.INCREMENT_ADAPTER.adapt(increment, builder);
-    builder.setTableName(getTableNameString());
-    return builder.build();
+    ReadModifyWriteRow readModifyWriteRow = ReadModifyWriteRow
+        .create(bigtableTableName.getTableId(), ByteString.copyFrom(increment.getRow()));
+    Adapters.INCREMENT_ADAPTER.adapt(increment, readModifyWriteRow);
+    return readModifyWriteRow.toProto(requestContext);
   }
 
   /**
diff --git a/bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/adapters/IncrementAdapter.java b/bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/adapters/IncrementAdapter.java
index 0ef6f2674..c83e62605 100644
--- a/bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/adapters/IncrementAdapter.java
+++ b/bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/adapters/IncrementAdapter.java
@@ -15,9 +15,7 @@
  */
 package com.google.cloud.bigtable.hbase.adapters;
 
-
-import com.google.bigtable.v2.ReadModifyWriteRowRequest;
-import com.google.bigtable.v2.ReadModifyWriteRule;
+import com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow;
 import com.google.protobuf.ByteString;
 
 import org.apache.hadoop.hbase.Cell;
@@ -36,18 +34,16 @@ import java.util.NavigableMap;
  * @version $Id: $Id
  */
 public class IncrementAdapter
-    implements OperationAdapter<Increment, ReadModifyWriteRowRequest.Builder>{
+    implements OperationAdapter<Increment, ReadModifyWriteRow>{
 
   /** {@inheritDoc} */
   @Override
-  public void adapt(Increment operation, ReadModifyWriteRowRequest.Builder result) {
+  public void adapt(Increment operation, ReadModifyWriteRow readModifyWriteRow) {
     if (!operation.getTimeRange().isAllTime()) {
       throw new UnsupportedOperationException(
           "Setting the time range in an Increment is not implemented");
     }
 
-    result.setRowKey(ByteString.copyFrom(operation.getRow()));
-
     for (Map.Entry<byte[], NavigableMap<byte[], Long>> familyEntry :
         operation.getFamilyMapOfLongs().entrySet()) {
       String familyName = Bytes.toString(familyEntry.getKey());
@@ -56,17 +52,15 @@ public class IncrementAdapter
       List<Cell> mutationCells =
           CellDeduplicationHelper.deduplicateFamily(operation, familyEntry.getKey());
 
-      for (Cell cell : mutationCells){
-        ReadModifyWriteRule.Builder rule = ReadModifyWriteRule.newBuilder();
-        rule.setIncrementAmount(
-            Bytes.toLong(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength()));
-        rule.setFamilyName(familyName);
-        rule.setColumnQualifier(
+      for (Cell cell : mutationCells) {
+        readModifyWriteRow.increment(
+            familyName,
             ByteString.copyFrom(
                 cell.getQualifierArray(),
                 cell.getQualifierOffset(),
-                cell.getQualifierLength()));
-        result.addRules(rule.build());
+                cell.getQualifierLength()),
+            Bytes.toLong(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength())
+        );
       }
     }
   }


Test patch:
diff --git a/bigtable-client-core-parent/bigtable-client-core/src/test/java/com/google/cloud/bigtable/grpc/async/OperationClock.java b/bigtable-client-core-parent/bigtable-client-core/src/test/java/com/google/cloud/bigtable/grpc/async/OperationClock.java
index fb153dde8..09bd8f0a6 100644
--- a/bigtable-client-core-parent/bigtable-client-core/src/test/java/com/google/cloud/bigtable/grpc/async/OperationClock.java
+++ b/bigtable-client-core-parent/bigtable-client-core/src/test/java/com/google/cloud/bigtable/grpc/async/OperationClock.java
@@ -15,10 +15,9 @@
  */
 package com.google.cloud.bigtable.grpc.async;
 
-import com.google.api.client.util.ExponentialBackOff;
 import com.google.api.client.util.NanoClock;
 import com.google.api.core.ApiClock;
-import com.google.cloud.bigtable.config.RetryOptions;
+import com.google.common.annotations.VisibleForTesting;
 import org.junit.Assert;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
@@ -44,6 +43,11 @@ public class OperationClock implements ApiClock {
     this.timeNs = System.nanoTime();
   }
 
+  @VisibleForTesting
+  void setTime(long time, TimeUnit timeUnit) {
+    this.timeNs = timeUnit.toNanos(time);
+  }
+
   @Override
   public synchronized long nanoTime() {
     return timeNs + totalSleepTimeNs;
diff --git a/bigtable-client-core-parent/bigtable-client-core/src/test/java/com/google/cloud/bigtable/grpc/async/TestRetryingMutateRowsOperation.java b/bigtable-client-core-parent/bigtable-client-core/src/test/java/com/google/cloud/bigtable/grpc/async/TestRetryingMutateRowsOperation.java
index 6a7ca9b79..d82629414 100644
--- a/bigtable-client-core-parent/bigtable-client-core/src/test/java/com/google/cloud/bigtable/grpc/async/TestRetryingMutateRowsOperation.java
+++ b/bigtable-client-core-parent/bigtable-client-core/src/test/java/com/google/cloud/bigtable/grpc/async/TestRetryingMutateRowsOperation.java
@@ -161,6 +161,27 @@ public class TestRetryingMutateRowsOperation {
     checkResponse(future, createResponse(OK, OK));
   }
 
+  @Test
+  public void testRetryExhausted() throws Exception {
+    MutateRowsRequest request = createRequest(2);
+    RetryingMutateRowsOperation underTest = createOperation(request);
+    ListenableFuture<?> future = underTest.getAsyncResult();
+    MutateRowsRequest retryRequest = createRequest(request.getEntries(1));
+
+    send(underTest, OK, DEADLINE_EXCEEDED);
+    checkExecutor(1);
+    Assert.assertEquals(retryRequest, underTest.getRetryRequest());
+
+    // Fast forward until retry limit has been reached
+    clock.setTime(clock.millisTime() + RETRY_OPTIONS.getMaxElapsedBackoffMillis() + 1, TimeUnit.MILLISECONDS);
+
+    send(underTest, DEADLINE_EXCEEDED);
+    checkExecutor(1);
+    Assert.assertEquals(retryRequest, underTest.getRetryRequest());
+
+    checkResponse(future, createResponse(OK, DEADLINE_EXCEEDED));
+  }
+
   @Test
   public void testCompleteFailure() throws InterruptedException, TimeoutException {
     MutateRowsRequest request = createRequest(2);
diff --git a/bigtable-client-core-parent/bigtable-hbase/src/test/java/com/google/cloud/bigtable/hbase/adapters/TestAppendAdapter.java b/bigtable-client-core-parent/bigtable-hbase/src/test/java/com/google/cloud/bigtable/hbase/adapters/TestAppendAdapter.java
index 3f4d2517c..b81bf110a 100644
--- a/bigtable-client-core-parent/bigtable-hbase/src/test/java/com/google/cloud/bigtable/hbase/adapters/TestAppendAdapter.java
+++ b/bigtable-client-core-parent/bigtable-hbase/src/test/java/com/google/cloud/bigtable/hbase/adapters/TestAppendAdapter.java
@@ -17,6 +17,9 @@ package com.google.cloud.bigtable.hbase.adapters;
 
 import com.google.bigtable.v2.ReadModifyWriteRowRequest;
 import com.google.bigtable.v2.ReadModifyWriteRule;
+import com.google.cloud.bigtable.data.v2.internal.RequestContext;
+import com.google.cloud.bigtable.data.v2.models.InstanceName;
+import com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow;
 import com.google.cloud.bigtable.hbase.DataGenerationHelper;
 import com.google.protobuf.ByteString;
 
@@ -31,6 +34,11 @@ import java.util.List;
 
 @RunWith(JUnit4.class)
 public class TestAppendAdapter {
+  private static final String PROJECT_ID = "test-project-id";
+  private static final String INSTANCE_ID = "test-instance-id";
+  private static final String TABLE_ID = "test-table-id";
+  private static final String APP_PROFILE_ID = "test-app-profile-id";
+  private RequestContext requestContext = RequestContext.create(InstanceName.of(PROJECT_ID, INSTANCE_ID), APP_PROFILE_ID);
   protected AppendAdapter appendAdapter = new AppendAdapter();
   protected DataGenerationHelper dataHelper = new DataGenerationHelper();
 
@@ -38,9 +46,10 @@ public class TestAppendAdapter {
   public void testBasicRowKeyAppend() {
     byte[] rowKey = dataHelper.randomData("rk1-");
     Append append = new Append(rowKey);
-    ReadModifyWriteRowRequest.Builder requestBuilder = ReadModifyWriteRowRequest.newBuilder();
-    appendAdapter.adapt(append, requestBuilder);
-    ReadModifyWriteRowRequest request = requestBuilder.build();
+    ReadModifyWriteRow readModifyWriteRow = ReadModifyWriteRow
+        .create(TABLE_ID, ByteString.copyFrom(rowKey));
+    appendAdapter.adapt(append, readModifyWriteRow);
+    ReadModifyWriteRowRequest request = readModifyWriteRow.toProto(requestContext);
     ByteString adaptedRowKey = request.getRowKey();
     Assert.assertArrayEquals(rowKey, adaptedRowKey.toByteArray());
   }
@@ -61,9 +70,10 @@ public class TestAppendAdapter {
     append.add(family1, qualifier1, value1);
     append.add(family2, qualifier2, value2);
 
-    ReadModifyWriteRowRequest.Builder requestBuilder = ReadModifyWriteRowRequest.newBuilder();
-    appendAdapter.adapt(append, requestBuilder);
-    ReadModifyWriteRowRequest request = requestBuilder.build();
+    ReadModifyWriteRow readModifyWriteRow = ReadModifyWriteRow
+        .create(TABLE_ID, ByteString.copyFrom(rowKey));
+    appendAdapter.adapt(append, readModifyWriteRow);
+    ReadModifyWriteRowRequest request = readModifyWriteRow.toProto(requestContext);
     List<ReadModifyWriteRule> rules = request.getRulesList();
     Assert.assertEquals(2, rules.size());
 
@@ -95,9 +105,10 @@ public class TestAppendAdapter {
     append.add(family2, qualifier2, value2);
     append.add(family2, qualifier2, value3);
 
-    ReadModifyWriteRowRequest.Builder requestBuilder = ReadModifyWriteRowRequest.newBuilder();
-    appendAdapter.adapt(append, requestBuilder);
-    ReadModifyWriteRowRequest request = requestBuilder.build();
+    ReadModifyWriteRow readModifyWriteRow = ReadModifyWriteRow
+        .create(TABLE_ID, ByteString.copyFrom(rowKey));
+    appendAdapter.adapt(append, readModifyWriteRow);
+    ReadModifyWriteRowRequest request = readModifyWriteRow.toProto(requestContext);
     List<ReadModifyWriteRule> rules = request.getRulesList();
     Assert.assertEquals(2, rules.size());
 
@@ -126,9 +137,10 @@ public class TestAppendAdapter {
     append.add(family1, qualifier1, value1);
     append.add(family2, qualifier1, value2);
 
-    ReadModifyWriteRowRequest.Builder requestBuilder = ReadModifyWriteRowRequest.newBuilder();
-    appendAdapter.adapt(append, requestBuilder);
-    ReadModifyWriteRowRequest request = requestBuilder.build();
+    ReadModifyWriteRow readModifyWriteRow = ReadModifyWriteRow
+        .create(TABLE_ID, ByteString.copyFrom(rowKey));
+    appendAdapter.adapt(append, readModifyWriteRow);
+    ReadModifyWriteRowRequest request = readModifyWriteRow.toProto(requestContext);
     List<ReadModifyWriteRule> rules = request.getRulesList();
     Assert.assertEquals(2, rules.size());
 
diff --git a/bigtable-client-core-parent/bigtable-hbase/src/test/java/com/google/cloud/bigtable/hbase/adapters/TestIncrementAdapter.java b/bigtable-client-core-parent/bigtable-hbase/src/test/java/com/google/cloud/bigtable/hbase/adapters/TestIncrementAdapter.java
index 882630152..58e6a8e01 100644
--- a/bigtable-client-core-parent/bigtable-hbase/src/test/java/com/google/cloud/bigtable/hbase/adapters/TestIncrementAdapter.java
+++ b/bigtable-client-core-parent/bigtable-hbase/src/test/java/com/google/cloud/bigtable/hbase/adapters/TestIncrementAdapter.java
@@ -17,6 +17,9 @@ package com.google.cloud.bigtable.hbase.adapters;
 
 import com.google.bigtable.v2.ReadModifyWriteRowRequest;
 import com.google.bigtable.v2.ReadModifyWriteRule;
+import com.google.cloud.bigtable.data.v2.internal.RequestContext;
+import com.google.cloud.bigtable.data.v2.models.InstanceName;
+import com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow;
 import com.google.cloud.bigtable.hbase.DataGenerationHelper;
 import com.google.protobuf.ByteString;
 
@@ -36,6 +39,11 @@ public class TestIncrementAdapter {
   @Rule
   public ExpectedException expectedException = ExpectedException.none();
 
+  private static final String PROJECT_ID = "test-project-id";
+  private static final String INSTANCE_ID = "test-instance-id";
+  private static final String TABLE_ID = "test-table-id";
+  private static final String APP_PROFILE_ID = "test-app-profile-id";
+  private RequestContext requestContext = RequestContext.create(InstanceName.of(PROJECT_ID, INSTANCE_ID), APP_PROFILE_ID);
   protected IncrementAdapter incrementAdapter = new IncrementAdapter();
   protected DataGenerationHelper dataHelper = new DataGenerationHelper();
 
@@ -43,8 +51,10 @@ public class TestIncrementAdapter {
   public void testBasicRowKeyIncrement() {
     byte[] rowKey = dataHelper.randomData("rk1-");
     Increment incr = new Increment(rowKey);
-    ReadModifyWriteRowRequest.Builder requestBuilder = ReadModifyWriteRowRequest.newBuilder();
-    incrementAdapter.adapt(incr, requestBuilder);
+    ReadModifyWriteRow readModifyWriteRow = ReadModifyWriteRow
+        .create(TABLE_ID, ByteString.copyFrom(rowKey));
+    incrementAdapter.adapt(incr, readModifyWriteRow);
+    ReadModifyWriteRowRequest requestBuilder = readModifyWriteRow.toProto(requestContext);
     ByteString adaptedRowKey = requestBuilder.getRowKey();
     Assert.assertArrayEquals(rowKey, adaptedRowKey.toByteArray());
   }
@@ -59,8 +69,10 @@ public class TestIncrementAdapter {
     Increment incr = new Increment(rowKey);
     incr.addColumn(family, qualifier, amount);
 
-    ReadModifyWriteRowRequest.Builder requestBuilder = ReadModifyWriteRowRequest.newBuilder();
-    incrementAdapter.adapt(incr, requestBuilder);
+    ReadModifyWriteRow readModifyWriteRow = ReadModifyWriteRow
+        .create(TABLE_ID, ByteString.copyFrom(rowKey));
+    incrementAdapter.adapt(incr, readModifyWriteRow);
+    ReadModifyWriteRowRequest requestBuilder = readModifyWriteRow.toProto(requestContext);
 
     Assert.assertEquals(1, requestBuilder.getRulesCount());
     ReadModifyWriteRule rule = requestBuilder.getRules(0);
@@ -86,8 +98,10 @@ public class TestIncrementAdapter {
     incr.addColumn(family1, qualifier1, amount1);
     incr.addColumn(family2, qualifier2, amount2);
 
-    ReadModifyWriteRowRequest.Builder requestBuilder = ReadModifyWriteRowRequest.newBuilder();
-    incrementAdapter.adapt(incr, requestBuilder);
+    ReadModifyWriteRow readModifyWriteRow = ReadModifyWriteRow
+        .create(TABLE_ID, ByteString.copyFrom(rowKey));
+    incrementAdapter.adapt(incr, readModifyWriteRow);
+    ReadModifyWriteRowRequest requestBuilder = readModifyWriteRow.toProto(requestContext);
     Assert.assertEquals(2, requestBuilder.getRulesCount());
 
     ReadModifyWriteRule rule = requestBuilder.getRules(0);
@@ -121,8 +135,10 @@ public class TestIncrementAdapter {
     incr.addColumn(family2, qualifier2, amount2);
     incr.addColumn(family2, qualifier2, amount3);
 
-    ReadModifyWriteRowRequest.Builder requestBuilder = ReadModifyWriteRowRequest.newBuilder();
-    incrementAdapter.adapt(incr, requestBuilder);
+    ReadModifyWriteRow readModifyWriteRow = ReadModifyWriteRow
+        .create(TABLE_ID, ByteString.copyFrom(rowKey));
+    incrementAdapter.adapt(incr, readModifyWriteRow);
+    ReadModifyWriteRowRequest requestBuilder = readModifyWriteRow.toProto(requestContext);
     Assert.assertEquals(2, requestBuilder.getRulesCount());
 
     ReadModifyWriteRule rule = requestBuilder.getRules(0);
@@ -146,6 +162,8 @@ public class TestIncrementAdapter {
     expectedException.expect(UnsupportedOperationException.class);
     expectedException.expectMessage("Setting the time range in an Increment is not implemented");
 
-    incrementAdapter.adapt(incr, ReadModifyWriteRowRequest.newBuilder());
+    ReadModifyWriteRow readModifyWriteRow = ReadModifyWriteRow
+        .create(TABLE_ID, ByteString.copyFrom(rowKey));
+    incrementAdapter.adapt(incr, readModifyWriteRow);
   }
 }
diff --git a/bigtable-hbase-1.x-parent/bigtable-hbase-1.x-integration-tests/pom.xml b/bigtable-hbase-1.x-parent/bigtable-hbase-1.x-integration-tests/pom.xml
index db5f6f4dc..addde9d63 100644
--- a/bigtable-hbase-1.x-parent/bigtable-hbase-1.x-integration-tests/pom.xml
+++ b/bigtable-hbase-1.x-parent/bigtable-hbase-1.x-integration-tests/pom.xml
@@ -70,6 +70,8 @@ limitations under the License.
                                     <forkedProcessTimeoutInSeconds>${test.timeout}</forkedProcessTimeoutInSeconds>
                                     <parallel>classesAndMethods</parallel>
                                     <threadCount>${thread.count}</threadCount>
+                                    <!-- Make sure to fail the build when the suite fails to initialize -->
+                                    <failIfNoTests>true</failIfNoTests>
                                 </configuration>
                             </execution>
                         </executions>
@@ -114,6 +116,8 @@ limitations under the License.
                                     <trimStackTrace>false</trimStackTrace>
                                     <parallel>classesAndMethods</parallel>
                                     <threadCount>${thread.count}</threadCount>
+                                    <!-- Make sure to fail the build when the suite fails to initialize -->
+                                    <failIfNoTests>true</failIfNoTests>
                                 </configuration>
                             </execution>
                         </executions>
@@ -152,6 +156,8 @@ limitations under the License.
                                     <trimStackTrace>false</trimStackTrace>
                                     <parallel>classesAndMethods</parallel>
                                     <threadCount>${thread.count}</threadCount>
+                                    <!-- Make sure to fail the build when the suite fails to initialize -->
+                                    <failIfNoTests>true</failIfNoTests>
                                 </configuration>
                             </execution>
                         </executions>
@@ -193,6 +199,8 @@ limitations under the License.
                                         <google.bigtable.connection.impl>${google.bigtable.connection.impl}</google.bigtable.connection.impl>
                                     </systemPropertyVariables>
                                     <trimStackTrace>false</trimStackTrace>
+                                    <!-- Make sure to fail the build when the suite fails to initialize -->
+                                    <failIfNoTests>true</failIfNoTests>
                                 </configuration>
                             </execution>
                         </executions>
@@ -247,6 +255,8 @@ limitations under the License.
                                     <trimStackTrace>false</trimStackTrace>
                                     <parallel>classesAndMethods</parallel>
                                     <threadCount>${thread.count}</threadCount>
+                                    <!-- Make sure to fail the build when the suite fails to initialize -->
+                                    <failIfNoTests>true</failIfNoTests>
                                 </configuration>
                             </execution>
                         </executions>
diff --git a/bigtable-hbase-2.x-parent/bigtable-hbase-2.x-integration-tests/pom.xml b/bigtable-hbase-2.x-parent/bigtable-hbase-2.x-integration-tests/pom.xml
index 02e8d6aea..4c5bf519a 100644
--- a/bigtable-hbase-2.x-parent/bigtable-hbase-2.x-integration-tests/pom.xml
+++ b/bigtable-hbase-2.x-parent/bigtable-hbase-2.x-integration-tests/pom.xml
@@ -75,6 +75,8 @@ limitations under the License.
                                     <forkedProcessTimeoutInSeconds>${test.timeout}</forkedProcessTimeoutInSeconds>
                                     <parallel>classesAndMethods</parallel>
                                     <threadCount>${thread.count}</threadCount>
+                                    <!-- Make sure to fail the build when the suite fails to initialize -->
+                                    <failIfNoTests>true</failIfNoTests>
                                 </configuration>
                             </execution>
                         </executions>
@@ -117,6 +119,8 @@ limitations under the License.
                                     <forkedProcessTimeoutInSeconds>${test.timeout}</forkedProcessTimeoutInSeconds>
                                     <parallel>classesAndMethods</parallel>
                                     <threadCount>${thread.count}</threadCount>
+                                    <!-- Make sure to fail the build when the suite fails to initialize -->
+                                    <failIfNoTests>true</failIfNoTests>
                                 </configuration>
                             </execution>
                         </executions>
@@ -168,6 +172,8 @@ limitations under the License.
                                     <forkedProcessTimeoutInSeconds>${test.timeout}</forkedProcessTimeoutInSeconds>
                                     <parallel>classesAndMethods</parallel>
                                     <threadCount>${thread.count}</threadCount>
+                                    <!-- Make sure to fail the build when the suite fails to initialize -->
+                                    <failIfNoTests>true</failIfNoTests>
                                 </configuration>
                             </execution>
                         </executions>
@@ -209,6 +215,8 @@ limitations under the License.
                                         <google.bigtable.connection.impl>${google.bigtable.connection.impl}</google.bigtable.connection.impl>
                                         <compileSource>1.8</compileSource>
                                     </systemPropertyVariables>
+                                    <!-- Make sure to fail the build when the suite fails to initialize -->
+                                    <failIfNoTests>true</failIfNoTests>
                                 </configuration>
                             </execution>
                         </executions>
@@ -233,6 +241,8 @@ limitations under the License.
                                 </goals>
                                 <configuration>
                                     <propertyName>bigtable.emulator.endpoint</propertyName>
+                                    <!-- Make sure to fail the build when the suite fails to initialize -->
+                                    <failIfNoTests>true</failIfNoTests>
                                 </configuration>
                             </execution>
                         </executions>