From d1892a95c7e57029f1ecc91edf3513ae99e35e32 Mon Sep 17 00:00:00 2001 From: Igor Bernstein Date: Wed, 26 Dec 2018 16:52:57 -0500 Subject: [PATCH 1/3] Bigtable: deprecate the use of typesafe names Unfortunately typesafe names create more issues for bigtable than they solve. A lot of the time users need to use both bigtable data & admin apis. Unfortunately, those apis define the same names in different namespaces. This forces users to use fully qualified names which is ugly. Also, absolute names don't benefit the bigtable client because the client is anchored at the instance and all names end up being relative --- .kokoro/continuous/bigtable-it.cfg | 2 +- .kokoro/nightly/bigtable-it.cfg | 2 +- .kokoro/presubmit/bigtable-it.cfg | 2 +- TESTING.md | 7 +- .../bigtable/data/v2/BigtableDataClient.java | 103 +++++++++--------- .../data/v2/BigtableDataSettings.java | 73 +++++++++++-- .../bigtable/data/v2/internal/NameUtil.java | 35 ++++++ .../data/v2/internal/RequestContext.java | 39 ++++++- .../bigtable/data/v2/models/BulkMutation.java | 12 +- .../v2/models/ConditionalRowMutation.java | 10 +- .../bigtable/data/v2/models/InstanceName.java | 7 +- .../cloud/bigtable/data/v2/models/Query.java | 12 +- .../data/v2/models/ReadModifyWriteRow.java | 13 ++- .../bigtable/data/v2/models/RowMutation.java | 22 ++-- .../data/v2/stub/EnhancedBigtableStub.java | 2 +- .../v2/stub/EnhancedBigtableStubSettings.java | 95 +++++++++++++--- .../data/v2/stub/SampleRowKeysCallable.java | 12 +- .../data/v2/BaseBigtableDataClientTest.java | 43 ++++---- .../data/v2/BigtableDataClientTest.java | 9 +- .../data/v2/internal/RowSetUtilTest.java | 3 +- .../data/v2/it/BulkMutationBatcherIT.java | 2 +- .../bigtable/data/v2/it/CheckAndMutateIT.java | 2 +- .../bigtable/data/v2/it/MutateRowIT.java | 6 +- .../cloud/bigtable/data/v2/it/ReadIT.java | 10 +- .../data/v2/it/ReadModifyWriteIT.java | 2 +- .../bigtable/data/v2/it/SampleRowsIT.java | 4 +- .../bigtable/data/v2/it/env/Emulator.java | 12 +- .../bigtable/data/v2/it/env/EmulatorEnv.java | 23 ++-- .../bigtable/data/v2/it/env/ProdEnv.java | 46 +++++--- .../bigtable/data/v2/it/env/TestEnv.java | 7 +- .../data/v2/models/BulkMutationTest.java | 11 +- .../v2/models/ConditionalRowMutationTest.java | 14 +-- .../bigtable/data/v2/models/QueryTest.java | 37 +++---- .../v2/models/ReadModifyWriteRowTest.java | 21 ++-- .../data/v2/models/RowMutationTest.java | 17 ++- .../stub/CheckAndMutateRowCallableTest.java | 11 +- .../EnhancedBigtableStubSettingsTest.java | 80 +++++++++----- .../data/v2/stub/MutateRowCallableTest.java | 5 +- .../stub/ReadModifyWriteRowCallableTest.java | 7 +- .../data/v2/stub/ResourceHeaderTest.java | 25 +++-- .../v2/stub/SampleRowKeysCallableTest.java | 11 +- .../mutaterows/BulkMutateRowsRetryTest.java | 13 +-- .../MutateRowsBatchingDescriptorTest.java | 18 +-- .../readrows/ReadRowsFirstCallableTest.java | 3 +- .../v2/stub/readrows/ReadRowsRetryTest.java | 39 +++---- .../readrows/ReadRowsUserCallableTest.java | 3 +- 46 files changed, 582 insertions(+), 350 deletions(-) create mode 100644 google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/NameUtil.java diff --git a/.kokoro/continuous/bigtable-it.cfg b/.kokoro/continuous/bigtable-it.cfg index 1e92e040f690..b5129e51121e 100644 --- a/.kokoro/continuous/bigtable-it.cfg +++ b/.kokoro/continuous/bigtable-it.cfg @@ -8,7 +8,7 @@ env_vars: { env_vars: { key: "INTEGRATION_TEST_ARGS" - value: "google-cloud-clients/google-cloud-bigtable -Dbigtable.env=prod -Dbigtable.table=projects/gcloud-devel/instances/google-cloud-bigtable/tables/integration-tests" + value: "google-cloud-clients/google-cloud-bigtable -Dbigtable.env=prod -Dbigtable.project=gcloud-devel -Dbigtable.instance=google-cloud-bigtable -Dbigtable.table=integration-tests" } env_vars: { diff --git a/.kokoro/nightly/bigtable-it.cfg b/.kokoro/nightly/bigtable-it.cfg index 1e92e040f690..b5129e51121e 100644 --- a/.kokoro/nightly/bigtable-it.cfg +++ b/.kokoro/nightly/bigtable-it.cfg @@ -8,7 +8,7 @@ env_vars: { env_vars: { key: "INTEGRATION_TEST_ARGS" - value: "google-cloud-clients/google-cloud-bigtable -Dbigtable.env=prod -Dbigtable.table=projects/gcloud-devel/instances/google-cloud-bigtable/tables/integration-tests" + value: "google-cloud-clients/google-cloud-bigtable -Dbigtable.env=prod -Dbigtable.project=gcloud-devel -Dbigtable.instance=google-cloud-bigtable -Dbigtable.table=integration-tests" } env_vars: { diff --git a/.kokoro/presubmit/bigtable-it.cfg b/.kokoro/presubmit/bigtable-it.cfg index 1e92e040f690..b5129e51121e 100644 --- a/.kokoro/presubmit/bigtable-it.cfg +++ b/.kokoro/presubmit/bigtable-it.cfg @@ -8,7 +8,7 @@ env_vars: { env_vars: { key: "INTEGRATION_TEST_ARGS" - value: "google-cloud-clients/google-cloud-bigtable -Dbigtable.env=prod -Dbigtable.table=projects/gcloud-devel/instances/google-cloud-bigtable/tables/integration-tests" + value: "google-cloud-clients/google-cloud-bigtable -Dbigtable.env=prod -Dbigtable.project=gcloud-devel -Dbigtable.instance=google-cloud-bigtable -Dbigtable.table=integration-tests" } env_vars: { diff --git a/TESTING.md b/TESTING.md index 44689ace5dec..3c2cb1fc9cf8 100644 --- a/TESTING.md +++ b/TESTING.md @@ -73,11 +73,12 @@ To run the tests: 2. Download the [JSON service account credentials file][create-service-account] from the Google Developer's Console. 3. Set the environment variable `GOOGLE_APPLICATION_CREDENTIALS` to the path of the credentials file -4. Set the system property `bigtable.instance` to the full instance name you - created earlier. Example: +4. Set the system properties `bigtable.project` and `bigtable.instance` to the project and instance + id of the instance you created earlier. Example: ```shell mvn verify -am -pl google-cloud-bigtable-admin \ - -Dbigtable.instance=projects/my-project/instances/my-instance + -Dbigtable.project=my-project + -Dbigtable.instance=my-instance ``` ### Testing code that uses Compute diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java index 6e9d085178b7..d1313db38b98 100644 --- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java +++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java @@ -26,7 +26,6 @@ import com.google.cloud.bigtable.data.v2.models.BulkMutation; import com.google.cloud.bigtable.data.v2.models.BulkMutationBatcher; import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation; -import com.google.cloud.bigtable.data.v2.models.InstanceName; import com.google.cloud.bigtable.data.v2.models.KeyOffset; import com.google.cloud.bigtable.data.v2.models.Query; import com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow; @@ -45,8 +44,7 @@ * get started: * *
{@code
- * InstanceName instanceName = InstanceName.of("[PROJECT]", "[INSTANCE]");
- * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create(instanceName)) {
+ * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
  *   for(Row row : bigtableDataClient.readRows(Query.create("[TABLE]")) {
  *     // Do something with row
  *   }
@@ -87,7 +85,8 @@
  * 
{@code
  * BigtableDataSettings bigtableDataSettings =
  *     BigtableDataSettings.newBuilder()
- *         .setInstanceName(InstanceName.of("[PROJECT]", "[INSTANCE]"))
+ *         .setProjectId("[PROJECT]")
+ *         .setInstanceId("[INSTANCE]")
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
  * try(BigtableDataClient bigtableDataClient = BigtableDataClient.create(bigtableDataSettings)) {
@@ -100,7 +99,8 @@
  * 
{@code
  * BigtableDataSettings bigtableDataSettings =
  *     BigtableDataSettings.newBuilder()
- *       .setInstanceName(InstanceName.of("[PROJECT]", "[INSTANCE]"))
+ *       .setProjectId("[PROJECT]")
+ *       .setInstanceId("[INSTANCE]")
  *       .setEndpoint(myEndpoint).build();
  * try(BigtableDataClient bigtableDataClient = BigtableDataClient.create(bigtableDataSettings)) {
  *   // ..
@@ -110,14 +110,33 @@
 public class BigtableDataClient implements AutoCloseable {
   private final EnhancedBigtableStub stub;
 
+  /**
+   * Constructs an instance of BigtableDataClient with default settings.
+   *
+   * @param projectId The project id of the instance to connect to.
+   * @param instanceId The id of the instance to connect to.
+   * @return A new client.
+   * @throws IOException If any.
+   */
+  public static BigtableDataClient create(String projectId, String instanceId) throws IOException {
+    BigtableDataSettings settings = BigtableDataSettings.newBuilder()
+        .setProjectId(projectId)
+        .setInstanceId(instanceId)
+        .build();
+    return create(settings);
+  }
+
   /**
    * Constructs an instance of BigtableDataClient with default settings.
    *
    * @param instanceName The instance to connect to.
    * @return A new client.
    * @throws IOException If any.
+   *
+   * @deprecated Please use {@link #create(String, String)}.
    */
-  public static BigtableDataClient create(InstanceName instanceName) throws IOException {
+  @Deprecated
+  public static BigtableDataClient create(com.google.cloud.bigtable.data.v2.models.InstanceName instanceName) throws IOException {
     BigtableDataSettings settings =
         BigtableDataSettings.newBuilder().setInstanceName(instanceName).build();
     return create(settings);
@@ -144,8 +163,7 @@ public static BigtableDataClient create(BigtableDataSettings settings) throws IO
    * 

Sample code: * *

{code
-   * InstanceName instanceName = InstanceName.of("[PROJECT]", "[INSTANCE]");
-   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create(instanceName)) {
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
    *   String tableId = "[TABLE]";
    *
    *   Row row = bigtableDataClient.readRow(tableId, ByteString.copyFromUtf8("key"));
@@ -174,8 +192,7 @@ public Row readRow(String tableId, ByteString rowKey) {
    * 

Sample code: * *

{code
-   * InstanceName instanceName = InstanceName.of("[PROJECT]", "[INSTANCE]");
-   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create(instanceName)) {
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
    *   String tableId = "[TABLE]";
    *
    *   Row row = bigtableDataClient.readRow(tableId, "key");
@@ -204,8 +221,7 @@ public Row readRow(String tableId, String rowKey) {
    * 

Sample code: * *

{@code
-   * InstanceName instanceName = InstanceName.of("[PROJECT]", "[INSTANCE]");
-   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create(instanceName)) {
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
    *   String tableId = "[TABLE]";
    *
    *   ApiFuture futureResult = bigtableDataClient.readRowAsync(tableId,  "key");
@@ -238,8 +254,7 @@ public ApiFuture readRowAsync(String tableId, String rowKey) {
    * 

Sample code: * *

{@code
-   * InstanceName instanceName = InstanceName.of("[PROJECT]", "[INSTANCE]");
-   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create(instanceName)) {
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
    *   String tableId = "[TABLE]";
    *
    *   ApiFuture futureResult = bigtableDataClient.readRowAsync(tableId,  ByteString.copyFromUtf8("key"));
@@ -274,8 +289,7 @@ public ApiFuture readRowAsync(String tableId, ByteString rowKey) {
    * // Import the filter DSL
    * import static com.google.cloud.bigtable.data.v2.models.Filters.FILTERS;
    *
-   * InstanceName instanceName = InstanceName.of("[PROJECT]", "[INSTANCE]");
-   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create(instanceName)) {
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
    *   String tableId = "[TABLE]";
    *
    *   Query query = Query.create(tableId)
@@ -309,8 +323,7 @@ public ServerStream readRows(Query query) {
    * 

Sample code: * *

{@code
-   * InstanceName instanceName = InstanceName.of("[PROJECT]", "[INSTANCE]");
-   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create(instanceName)) {
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
    *   String tableId = "[TABLE]";
    *
    *   Query query = Query.create(tableId)
@@ -347,8 +360,7 @@ public void readRowsAsync(Query query, ResponseObserver observer) {
    * 

Sample code: * *

{@code
-   * InstanceName instanceName = InstanceName.of("[PROJECT]", "[INSTANCE]");
-   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create(instanceName)) {
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
    *   String tableId = "[TABLE]";
    *
    *   Query query = Query.create(tableId)
@@ -410,8 +422,7 @@ public ServerStreamingCallable readRowsCallable() {
    * 

Sample code: * *

{@code
-   * InstanceName instanceName = InstanceName.of("[PROJECT]", "[INSTANCE]");
-   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create(instanceName)) {
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
    *   String tableId = "[TABLE]";
    *
    *   Query query = Query.create(tableId)
@@ -447,8 +458,7 @@ public  ServerStreamingCallable readRowsCallable(RowAdapterSample code:
    *
    * 
{@code
-   * InstanceName instanceName = InstanceName.of("[PROJECT]", "[INSTANCE]");
-   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create(instanceName)) {
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
    *   String tableId = "[TABLE_ID]";
    *
    *   List keyOffsets = bigtableDataClient.sampleRowKeys(tableId);
@@ -474,8 +484,7 @@ public List sampleRowKeys(String tableId) {
    * 

Sample code: * *

{@code
-   * InstanceName instanceName = InstanceName.of("[PROJECT]", "[INSTANCE]");
-   * try (BigtableClient bigtableDataClient = BigtableClient.create(instanceName)) {
+   * try (BigtableClient bigtableDataClient = BigtableClient.create("[PROJECT]", "[INSTANCE]")) {
    *   ApiFuture> keyOffsetsFuture = bigtableClient.sampleRowKeysAsync("[TABLE]");
    *
    *   ApiFutures.addCallback(keyOffsetsFuture, new ApiFutureCallback>() {
@@ -506,8 +515,7 @@ public ApiFuture> sampleRowKeysAsync(String tableId) {
    * 

Sample code: * *

{@code
-   * InstanceName instanceName = InstanceName.of("[PROJECT]", "[INSTANCE]");
-   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create(instanceName)) {
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
    *   // Synchronous invocation
    *   try {
    *     List keyOffsets = bigtableDataClient.sampleRowKeysCallable().call("[TABLE]");
@@ -546,8 +554,7 @@ public UnaryCallable> sampleRowKeysCallable() {
    * 

Sample code: * *

{@code
-   * InstanceName instanceName = InstanceName.of("[PROJECT]", "[INSTANCE]");
-   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create(instanceName)) {
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
    *   RowMutation mutation = RowMutation.create("[TABLE]", "[ROW KEY]")
    *     .setCell("[FAMILY NAME]", "[QUALIFIER]", "[VALUE]");
    *
@@ -570,8 +577,7 @@ public void mutateRow(RowMutation rowMutation) {
    * 

Sample code: * *

{@code
-   * InstanceName instanceName = InstanceName.of("[PROJECT]", "[INSTANCE]");
-   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create(instanceName)) {
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
    *   RowMutation mutation = RowMutation.create("[TABLE]", "[ROW KEY]")
    *     .setCell("[FAMILY NAME]", "[QUALIFIER]", "[VALUE]");
    *
@@ -603,8 +609,7 @@ public ApiFuture mutateRowAsync(RowMutation rowMutation) {
    * 

Sample code: * *

{@code
-   * InstanceName instanceName = InstanceName.of("[PROJECT]", "[INSTANCE]");
-   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create(instanceName)) {
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
    *   RowMutation mutation = RowMutation.create("[TABLE]", "[ROW KEY]")
    *     .setCell("[FAMILY NAME]", "[QUALIFIER]", "[VALUE]");
    *
@@ -630,8 +635,7 @@ public UnaryCallable mutateRowCallable() {
    * 

Sample code: * *

{@code
-   * InstanceName instanceName = InstanceName.of("[PROJECT]", "[INSTANCE]");
-   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create(instanceName)) {
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
    *   try (BulkMutationBatcher batcher = bigtableDataClient.newBulkMutationBatcher()) {
    *     for (String someValue : someCollection) {
    *       RowMutation mutation = RowMutation.create("[TABLE]", "[ROW KEY]")
@@ -659,8 +663,7 @@ public BulkMutationBatcher newBulkMutationBatcher() {
    * 

Sample code: * *

{@code
-   * InstanceName instanceName = InstanceName.of("[PROJECT]", "[INSTANCE]");
-   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create(instanceName)) {
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
    *   BulkMutation batch = BulkMutation.create("[TABLE]");
    *   for (String someValue : someCollection) {
    *     batch.add("[ROW KEY]", Mutation.create().setCell("[FAMILY NAME]", "[QUALIFIER]", "[VALUE]"));
@@ -689,8 +692,7 @@ public void bulkMutateRows(BulkMutation mutation) {
    * 

Sample code: * *

{@code
-   * InstanceName instanceName = InstanceName.of("[PROJECT]", "[INSTANCE]");
-   * try (BigtableClient bigtableClient = BigtableClient.create(instanceName)) {
+   * try (BigtableClient bigtableClient = BigtableClient.create("[PROJECT]", "[INSTANCE]")) {
    *   BulkMutation batch = BulkMutation.create("[TABLE]");
    *   for (String someValue : someCollection) {
    *     ApiFuture entryFuture = batch.add("[ROW KEY]",
@@ -725,8 +727,7 @@ public ApiFuture bulkMutateRowsAsync(BulkMutation mutation) {
    * 

Sample code: * *

{@code
-   * InstanceName instanceName = InstanceName.of("[PROJECT]", "[INSTANCE]");
-   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create(instanceName)) {
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
    *   BulkMutation batch = BulkMutation.create("[TABLE]");
    *   for (String someValue : someCollection) {
    *     ApiFuture entryFuture = batch.add("[ROW KEY]",
@@ -746,8 +747,7 @@ public UnaryCallable bulkMutationCallable() {
    * 

Sample code: * *

{@code
-   * InstanceName instanceName = InstanceName.of("[PROJECT]", "[INSTANCE]");
-   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create(instanceName)) {
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
    *   ConditionalRowMutation mutation = ConditionalRowMutation.create("[TABLE]", "[KEY]")
    *     .condition(FILTERS.value().regex("old-value"))
    *     .then(
@@ -773,8 +773,7 @@ public Boolean checkAndMutateRow(ConditionalRowMutation mutation) {
    * 

Sample code: * *

{@code
-   * InstanceName instanceName = InstanceName.of("[PROJECT]", "[INSTANCE]");
-   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create(instanceName)) {
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
    *   ConditionalRowMutation mutation = ConditionalRowMutation.create("[TABLE]", "[KEY]")
    *     .condition(FILTERS.value().regex("old-value"))
    *     .then(
@@ -809,8 +808,7 @@ public ApiFuture checkAndMutateRowAsync(ConditionalRowMutation mutation
    * 

Sample code: * *

{@code
-   * InstanceName instanceName = InstanceName.of("[PROJECT]", "[INSTANCE]");
-   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create(instanceName)) {
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
    *   ConditionalRowMutation mutation = ConditionalRowMutation.create("[TABLE]", "[KEY]")
    *     .condition(FILTERS.value().regex("old-value"))
    *     .then(
@@ -845,8 +843,7 @@ public UnaryCallable checkAndMutateRowCallable(
    * 

Sample code: * *

{@code
-   * InstanceName instanceName = InstanceName.of("[PROJECT]", "[INSTANCE]");
-   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create(instanceName)) {
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
    *   ReadModifyWriteRow mutation = ReadModifyWriteRow.create("[TABLE]", "[KEY]")
    *     .increment("[FAMILY]", "[QUALIFIER]", 1)
    *     .append("[FAMILY2]", "[QUALIFIER2]", "suffix");
@@ -872,8 +869,7 @@ public Row readModifyWriteRow(ReadModifyWriteRow mutation) {
    * 

Sample code: * *

{@code
-   * InstanceName instanceName = InstanceName.of("[PROJECT]", "[INSTANCE]");
-   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create(instanceName)) {
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
    *   ReadModifyWriteRow mutation = ReadModifyWriteRow.create("[TABLE]", "[KEY]")
    *     .increment("[FAMILY]", "[QUALIFIER]", 1)
    *     .append("[FAMILY2]", "[QUALIFIER2]", "suffix");
@@ -908,8 +904,7 @@ public ApiFuture readModifyWriteRowAsync(ReadModifyWriteRow mutation) {
    * 

Sample code: * *

{@code
-   * InstanceName instanceName = InstanceName.of("[PROJECT]", "[INSTANCE]");
-   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create(instanceName)) {
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
    *   ReadModifyWriteRow mutation = ReadModifyWriteRow.create("[TABLE]", "[KEY]")
    *     .increment("[FAMILY]", "[QUALIFIER]", 1)
    *     .append("[FAMILY2]", "[QUALIFIER2]", "suffix");
diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java
index 037737488df9..53bf36f8180a 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java
@@ -20,7 +20,6 @@
 import com.google.api.gax.rpc.ServerStreamingCallSettings;
 import com.google.api.gax.rpc.UnaryCallSettings;
 import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation;
-import com.google.cloud.bigtable.data.v2.models.InstanceName;
 import com.google.cloud.bigtable.data.v2.models.KeyOffset;
 import com.google.cloud.bigtable.data.v2.models.Query;
 import com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow;
@@ -49,7 +48,8 @@
  *
  * 
{@code
  * BigtableDataSettings.Builder settingsBuilder = BigtableDataSettings.newBuilder()
- *   .setInstanceName(InstanceName.of("my-project", "my-instance-id"))
+ *   .setProjectId("my-project")
+ *   .setInstanceId("my-instance-id")
  *   .setAppProfileId("default");
  *
  * settingsBuilder.readRowsSettings().setRetryableCodes(Code.DEADLINE_EXCEEDED, Code.UNAVAILABLE);
@@ -67,12 +67,27 @@ public static Builder newBuilder() {
     return new Builder();
   }
 
-  /** Returns the target instance */
-  public InstanceName getInstanceName() {
+  /**
+   * Returns the target instance.
+   *
+   * @deprecated Please use {@link #getProjectId()} and {@link #getInstanceId()}.
+   */
+  @Deprecated()
+  public com.google.cloud.bigtable.data.v2.models.InstanceName getInstanceName() {
     return getTypedStubSettings().getInstanceName();
   }
 
-  /** Returns the configured AppProfile to use */
+  /** Returns the target project id. */
+  public String getProjectId() {
+    return getTypedStubSettings().getProjectId();
+  }
+
+  /** Returns the target instance id. */
+  public String getInstanceId() {
+    return getTypedStubSettings().getInstanceId();
+  }
+
+  /** Returns the configured AppProfile id to use.  */
   public String getAppProfileId() {
     return getTypedStubSettings().getAppProfileId();
   }
@@ -142,17 +157,59 @@ private Builder(BigtableDataSettings settings) {
     /**
      * Sets the target instance. This setting is required. All RPCs will be made in the context of
      * this setting.
+     *
+     * @deprecated Please use {@link #setProjectId(String)} and {@link #setInstanceId(String)}.
      */
-    public Builder setInstanceName(@Nonnull InstanceName instanceName) {
+    @Deprecated
+    public Builder setInstanceName(
+        @Nonnull com.google.cloud.bigtable.data.v2.models.InstanceName instanceName) {
       getTypedStubSettings().setInstanceName(instanceName);
       return this;
     }
 
-    /** Gets the {@link InstanceName} that was previously set on this Builder. */
-    public InstanceName getInstanceName() {
+    /**
+     * Gets the {@link com.google.cloud.bigtable.data.v2.models.InstanceName} that was previously
+     * set on this Builder.
+     *
+     * @deprecated Please use {@link #getProjectId()} and {@link #getInstanceId()}.
+     */
+    @Deprecated
+    public com.google.cloud.bigtable.data.v2.models.InstanceName getInstanceName() {
       return getTypedStubSettings().getInstanceName();
     }
 
+    /**
+     * Sets the target project. This setting is required. All RPCs will be made in the context of
+     * this setting.
+     */
+    public Builder setProjectId(@Nonnull String projectId) {
+      getTypedStubSettings().setProjectId(projectId);
+      return this;
+    }
+
+    /**
+     * Gets the project id that was previously set on this Builder.
+     */
+    public String getProjectId() {
+      return getTypedStubSettings().getProjectId();
+    }
+
+    /**
+     * Sets the target instance. This setting is required. All RPCs will be made in the context of
+     * this setting.
+     */
+    public Builder setInstanceId(@Nonnull String instanceId) {
+      getTypedStubSettings().setInstanceId(instanceId);
+      return this;
+    }
+
+    /**
+     * Gets the instance id that was previously set on this Builder.
+     */
+    public String getInstanceId() {
+      return getTypedStubSettings().getInstanceId();
+    }
+
     /**
      * Sets the AppProfile to use. An application profile (sometimes also shortened to "app
      * profile") is a group of configuration parameters for an individual use case. A client will
diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/NameUtil.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/NameUtil.java
new file mode 100644
index 000000000000..11b1ce3538cf
--- /dev/null
+++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/NameUtil.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed 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
+ *
+ *     https://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 com.google.cloud.bigtable.data.v2.internal;
+
+import com.google.api.core.InternalApi;
+import javax.annotation.Nonnull;
+
+/**
+ * Internal helper to compose full resource names.
+ *
+ * 

This class is considered an internal implementation detail and not meant to be used by + * applications. + */ +@InternalApi +public class NameUtil { + public static String formatInstanceName(@Nonnull String projectId, @Nonnull String instanceId) { + return "projects/" + projectId + "/instances/" + instanceId; + } + public static String formatTableName(@Nonnull String projectId, @Nonnull String instanceId, @Nonnull String tableId) { + return formatInstanceName(projectId, instanceId) + "/tables/" + tableId; + } +} diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RequestContext.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RequestContext.java index eabef9c766f8..3df9b54ac79a 100644 --- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RequestContext.java +++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RequestContext.java @@ -17,7 +17,6 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; -import com.google.cloud.bigtable.data.v2.models.InstanceName; /** * Contains information necessary to construct Bigtable protobuf requests from user facing models. @@ -32,12 +31,42 @@ @InternalApi @AutoValue public abstract class RequestContext { - public static RequestContext create(InstanceName instanceName, String appProfileId) { - return new AutoValue_RequestContext(instanceName, appProfileId); + + /** + * Creates a new instance of the {@link RequestContext}. + */ + public static RequestContext create(String projectId, String instanceId, String appProfileId) { + return new AutoValue_RequestContext(projectId, instanceId, appProfileId); + } + + /** + * @deprecated Please use {@link #create(String, String, String)}. + */ + @Deprecated + public static RequestContext create( + com.google.cloud.bigtable.data.v2.models.InstanceName instanceName, String appProfileId) { + return new AutoValue_RequestContext( + instanceName.getProject(), + instanceName.getInstance(), + appProfileId); } - /** The instance that the client is configured to target */ - public abstract InstanceName getInstanceName(); + /** The project id that the client is configured to target. */ + public abstract String getProjectId(); + + /** The instance id that the client is configured to target. */ + public abstract String getInstanceId(); + + /** + * The instance that the client is configured to target. + * + * @deprecated Please use {@link #getProjectId()} and {@link #getInstanceId()}. + */ + @Deprecated + public com.google.cloud.bigtable.data.v2.models.InstanceName getInstanceName() { + return com.google.cloud.bigtable.data.v2.models.InstanceName.of( + getProjectId(), getInstanceId()); + } /** The App Profile to use when processing the current request */ public abstract String getAppProfileId(); diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/BulkMutation.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/BulkMutation.java index 8ec8b3050388..d6040c11eae3 100644 --- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/BulkMutation.java +++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/BulkMutation.java @@ -17,7 +17,7 @@ import com.google.api.core.InternalApi; import com.google.bigtable.v2.MutateRowsRequest; -import com.google.bigtable.v2.TableName; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; import com.google.cloud.bigtable.data.v2.internal.RequestContext; import com.google.common.base.Preconditions; import com.google.protobuf.ByteString; @@ -91,14 +91,12 @@ public BulkMutation add(@Nonnull ByteString rowKey, @Nonnull Mutation mutation) @InternalApi public MutateRowsRequest toProto(RequestContext requestContext) { - TableName tableName = - TableName.of( - requestContext.getInstanceName().getProject(), - requestContext.getInstanceName().getInstance(), - tableId); + String tableName = NameUtil + .formatTableName(requestContext.getProjectId(), requestContext.getInstanceId(), tableId); + return builder - .setTableName(tableName.toString()) + .setTableName(tableName) .setAppProfileId(requestContext.getAppProfileId()) .build(); } diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ConditionalRowMutation.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ConditionalRowMutation.java index d44e148105cc..1b79216aba79 100644 --- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ConditionalRowMutation.java +++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ConditionalRowMutation.java @@ -17,7 +17,7 @@ import com.google.api.core.InternalApi; import com.google.bigtable.v2.CheckAndMutateRowRequest; -import com.google.bigtable.v2.TableName; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; import com.google.cloud.bigtable.data.v2.internal.RequestContext; import com.google.cloud.bigtable.data.v2.models.Filters.Filter; import com.google.common.base.Preconditions; @@ -128,10 +128,10 @@ public CheckAndMutateRowRequest toProto(RequestContext requestContext) { Preconditions.checkState( !builder.getTrueMutationsList().isEmpty() || !builder.getFalseMutationsList().isEmpty(), "ConditionalRowMutations must have `then` or `otherwise` mutations."); - TableName tableName = - TableName.of( - requestContext.getInstanceName().getProject(), - requestContext.getInstanceName().getInstance(), + String tableName = + NameUtil.formatTableName( + requestContext.getProjectId(), + requestContext.getInstanceId(), tableId); return builder .setTableName(tableName.toString()) diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/InstanceName.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/InstanceName.java index ed64f7375dd6..3616cd3d3b16 100644 --- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/InstanceName.java +++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/InstanceName.java @@ -24,8 +24,11 @@ import java.util.Map; // Copied from com.google.bigtable.admin.v2 -// TODO: figure out how to unify admin & data resource names -/** Typesafe representation of a fully qualified Bigtable instance name */ + +/** + * @deprecated Please use project id and instance id strings instead. + */ +@Deprecated public class InstanceName implements ResourceName { private static final PathTemplate PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("projects/{project}/instances/{instance}"); diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java index 41091c894bad..39744811b82a 100644 --- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java +++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java @@ -19,8 +19,8 @@ import com.google.bigtable.v2.ReadRowsRequest; import com.google.bigtable.v2.RowRange; import com.google.bigtable.v2.RowSet; -import com.google.bigtable.v2.TableName; import com.google.cloud.bigtable.data.v2.internal.ByteStringComparator; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; import com.google.cloud.bigtable.data.v2.internal.RequestContext; import com.google.cloud.bigtable.data.v2.internal.RowSetUtil; import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange; @@ -246,14 +246,14 @@ public ByteStringRange getBound() { */ @InternalApi public ReadRowsRequest toProto(RequestContext requestContext) { - TableName tableName = - TableName.of( - requestContext.getInstanceName().getProject(), - requestContext.getInstanceName().getInstance(), + String tableName = + NameUtil.formatTableName( + requestContext.getProjectId(), + requestContext.getInstanceId(), tableId); return builder - .setTableName(tableName.toString()) + .setTableName(tableName) .setAppProfileId(requestContext.getAppProfileId()) .build(); } diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRow.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRow.java index 9e04b14ad255..fdcad875bd67 100644 --- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRow.java +++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRow.java @@ -18,7 +18,7 @@ import com.google.api.core.InternalApi; import com.google.bigtable.v2.ReadModifyWriteRowRequest; import com.google.bigtable.v2.ReadModifyWriteRule; -import com.google.bigtable.v2.TableName; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; import com.google.cloud.bigtable.data.v2.internal.RequestContext; import com.google.common.base.Preconditions; import com.google.protobuf.ByteString; @@ -128,13 +128,14 @@ public ReadModifyWriteRow increment( @InternalApi public ReadModifyWriteRowRequest toProto(RequestContext requestContext) { - TableName tableName = - TableName.of( - requestContext.getInstanceName().getProject(), - requestContext.getInstanceName().getInstance(), + String tableName = + NameUtil.formatTableName( + requestContext.getProjectId(), + requestContext.getInstanceId(), tableId); + return builder - .setTableName(tableName.toString()) + .setTableName(tableName) .setAppProfileId(requestContext.getAppProfileId()) .build(); } diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowMutation.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowMutation.java index 87b5cee693cd..ecec5edc9e64 100644 --- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowMutation.java +++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowMutation.java @@ -19,7 +19,7 @@ import com.google.bigtable.v2.MutateRowRequest; import com.google.bigtable.v2.MutateRowsRequest; import com.google.bigtable.v2.MutateRowsRequest.Entry; -import com.google.bigtable.v2.TableName; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; import com.google.cloud.bigtable.data.v2.internal.RequestContext; import com.google.cloud.bigtable.data.v2.models.Range.TimestampRange; import com.google.protobuf.ByteString; @@ -158,15 +158,15 @@ public RowMutation deleteRow() { @InternalApi public MutateRowRequest toProto(RequestContext requestContext) { - TableName tableName = - TableName.of( - requestContext.getInstanceName().getProject(), - requestContext.getInstanceName().getInstance(), + String tableName = + NameUtil.formatTableName( + requestContext.getProjectId(), + requestContext.getInstanceId(), tableId); return MutateRowRequest.newBuilder() .setAppProfileId(requestContext.getAppProfileId()) - .setTableName(tableName.toString()) + .setTableName(tableName) .setRowKey(key) .addAllMutations(mutation.getMutations()) .build(); @@ -178,15 +178,15 @@ public MutateRowRequest toProto(RequestContext requestContext) { */ @InternalApi public MutateRowsRequest toBulkProto(RequestContext requestContext) { - TableName tableName = - TableName.of( - requestContext.getInstanceName().getProject(), - requestContext.getInstanceName().getInstance(), + String tableName = + NameUtil.formatTableName( + requestContext.getProjectId(), + requestContext.getInstanceId(), tableId); return MutateRowsRequest.newBuilder() .setAppProfileId(requestContext.getAppProfileId()) - .setTableName(tableName.toString()) + .setTableName(tableName) .addEntries( Entry.newBuilder().setRowKey(key).addAllMutations(mutation.getMutations()).build()) .build(); diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java index 5d3c733476cc..cf4e57fa99bc 100644 --- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java +++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java @@ -148,7 +148,7 @@ public static EnhancedBigtableStub create(EnhancedBigtableStubSettings settings) this.clientContext = clientContext; this.stub = stub; this.requestContext = - RequestContext.create(settings.getInstanceName(), settings.getAppProfileId()); + RequestContext.create(settings.getProjectId(), settings.getInstanceId(), settings.getAppProfileId()); readRowsCallable = createReadRowsCallable(new DefaultRowAdapter()); sampleRowKeysCallable = createSampleRowKeysCallable(); diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java index 63320cfdc3d0..337feca414f1 100644 --- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java +++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java @@ -29,7 +29,6 @@ import com.google.api.gax.rpc.UnaryCallSettings; import com.google.cloud.bigtable.data.v2.internal.DummyBatchingDescriptor; import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation; -import com.google.cloud.bigtable.data.v2.models.InstanceName; import com.google.cloud.bigtable.data.v2.models.KeyOffset; import com.google.cloud.bigtable.data.v2.models.Query; import com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow; @@ -61,7 +60,8 @@ * *

{@code
  * BigtableDataSettings.Builder settingsBuilder = BigtableDataSettings.newBuilder()
- *   .setInstanceName(InstanceName.of("my-project", "my-instance-id"))
+ *   .setProjectId("my-project-id")
+ *   .setInstanceId("my-instance-id")
  *   .setAppProfileId("default");
  *
  * settingsBuilder.readRowsSettings()
@@ -108,7 +108,8 @@ public class EnhancedBigtableStubSettings extends StubSettings readRowsSettings;
@@ -120,7 +121,8 @@ public class EnhancedBigtableStubSettings extends StubSettings {
-    private InstanceName instanceName;
+
+    private String projectId;
+    private String instanceId;
     private String appProfileId;
 
     private final ServerStreamingCallSettings.Builder readRowsSettings;
@@ -277,7 +296,8 @@ private Builder() {
 
     private Builder(EnhancedBigtableStubSettings settings) {
       super(settings);
-      instanceName = settings.instanceName;
+      projectId = settings.projectId;
+      instanceId = settings.instanceId;
       appProfileId = settings.appProfileId;
 
       // Per method settings.
@@ -305,16 +325,60 @@ private static void copyRetrySettings(
     /**
      * Sets the target instance. This setting is required. All RPCs will be made in the context of
      * this setting.
+     *
+     * @deprecated Please use {@link #setProjectId(String)} and {@link #setInstanceId(String)}.
      */
-    public Builder setInstanceName(@Nonnull InstanceName instanceName) {
+    @Deprecated
+    public Builder setInstanceName(
+        @Nonnull com.google.cloud.bigtable.data.v2.models.InstanceName instanceName) {
       Preconditions.checkNotNull(instanceName);
-      this.instanceName = instanceName;
+      this.projectId = instanceName.getProject();
+      this.instanceId = instanceName.getInstance();
+      return this;
+    }
+
+    /**
+     * Gets the {@link com.google.cloud.bigtable.data.v2.models.InstanceName} that was previously
+     * set on this Builder.
+     *
+     * @deprecated Please use {@link #getProjectId()} and {@link #getInstanceId()}.
+     */
+    @Deprecated
+    public com.google.cloud.bigtable.data.v2.models.InstanceName getInstanceName() {
+      if (projectId != null && instanceId != null) {
+        return com.google.cloud.bigtable.data.v2.models.InstanceName.of(projectId, instanceId);
+      }
+      return null;
+    }
+
+    /**
+     * Sets the project id of that target instance. This setting is required. All RPCs will be made
+     * in the context of this setting.
+     */
+    public Builder setProjectId(@Nonnull String projectId) {
+      Preconditions.checkNotNull(projectId);
+      this.projectId = projectId;
+      return this;
+    }
+
+    /** Gets the project id  of the target instance that was previously set on this Builder. */
+    public String getProjectId() {
+      return projectId;
+    }
+
+    /**
+     * Sets the target instance id. This setting is required. All RPCs will be made in the context
+     * of this setting.
+     */
+    public Builder setInstanceId(@Nonnull String instanceId) {
+      Preconditions.checkNotNull(instanceId);
+      this.instanceId = instanceId;
       return this;
     }
 
-    /** Gets the {@link InstanceName} that was previously set on this Builder. */
-    public InstanceName getInstanceName() {
-      return instanceName;
+    /** Gets the target instance id that was previously set on this Builder. */
+    public String getInstanceId() {
+      return instanceId;
     }
 
     /**
@@ -366,7 +430,8 @@ public UnaryCallSettings.Builder readModifyWriteRowSett
 
     @SuppressWarnings("unchecked")
     public EnhancedBigtableStubSettings build() {
-      Preconditions.checkState(instanceName != null, "InstanceName must be set");
+      Preconditions.checkState(projectId != null, "Project id must be set");
+      Preconditions.checkState(instanceId != null, "Instance id must be set");
 
       return new EnhancedBigtableStubSettings(this);
     }
diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallable.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallable.java
index 554bf2bb08a8..dbef3d475312 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallable.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallable.java
@@ -22,7 +22,7 @@
 import com.google.api.gax.rpc.UnaryCallable;
 import com.google.bigtable.v2.SampleRowKeysRequest;
 import com.google.bigtable.v2.SampleRowKeysResponse;
-import com.google.bigtable.v2.TableName;
+import com.google.cloud.bigtable.data.v2.internal.NameUtil;
 import com.google.cloud.bigtable.data.v2.internal.RequestContext;
 import com.google.cloud.bigtable.data.v2.models.KeyOffset;
 import com.google.common.collect.ImmutableList;
@@ -44,15 +44,15 @@ class SampleRowKeysCallable extends UnaryCallable> {
 
   @Override
   public ApiFuture> futureCall(String tableId, ApiCallContext context) {
-    TableName tableName =
-        TableName.of(
-            requestContext.getInstanceName().getProject(),
-            requestContext.getInstanceName().getInstance(),
+    String tableName =
+        NameUtil.formatTableName(
+            requestContext.getProjectId(),
+            requestContext.getInstanceId(),
             tableId);
 
     SampleRowKeysRequest request =
         SampleRowKeysRequest.newBuilder()
-            .setTableName(tableName.toString())
+            .setTableName(tableName)
             .setAppProfileId(requestContext.getAppProfileId())
             .build();
 
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BaseBigtableDataClientTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BaseBigtableDataClientTest.java
index 8fa5813be340..832d7523fd4f 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BaseBigtableDataClientTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BaseBigtableDataClientTest.java
@@ -41,6 +41,7 @@
 import com.google.bigtable.v2.SampleRowKeysRequest;
 import com.google.bigtable.v2.SampleRowKeysResponse;
 import com.google.bigtable.v2.TableName;
+import com.google.cloud.bigtable.data.v2.internal.NameUtil;
 import com.google.protobuf.ByteString;
 import com.google.protobuf.GeneratedMessageV3;
 import io.grpc.Status;
@@ -101,9 +102,9 @@ public void readRowsTest() throws Exception {
     ReadRowsResponse expectedResponse =
         ReadRowsResponse.newBuilder().setLastScannedRowKey(lastScannedRowKey).build();
     mockBigtable.addResponse(expectedResponse);
-    TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+    String tableName = NameUtil.formatTableName("[PROJECT]", "[INSTANCE]", "[TABLE]");
     ReadRowsRequest request =
-        ReadRowsRequest.newBuilder().setTableName(tableName.toString()).build();
+        ReadRowsRequest.newBuilder().setTableName(tableName).build();
 
     MockStreamObserver responseObserver = new MockStreamObserver<>();
 
@@ -120,9 +121,9 @@ public void readRowsTest() throws Exception {
   public void readRowsExceptionTest() throws Exception {
     StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
     mockBigtable.addException(exception);
-    TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+    String tableName = NameUtil.formatTableName("[PROJECT]", "[INSTANCE]", "[TABLE]");
     ReadRowsRequest request =
-        ReadRowsRequest.newBuilder().setTableName(tableName.toString()).build();
+        ReadRowsRequest.newBuilder().setTableName(tableName).build();
 
     MockStreamObserver responseObserver = new MockStreamObserver<>();
 
@@ -147,9 +148,9 @@ public void sampleRowKeysTest() throws Exception {
     SampleRowKeysResponse expectedResponse =
         SampleRowKeysResponse.newBuilder().setRowKey(rowKey).setOffsetBytes(offsetBytes).build();
     mockBigtable.addResponse(expectedResponse);
-    TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+    String tableName = NameUtil.formatTableName("[PROJECT]", "[INSTANCE]", "[TABLE]");
     SampleRowKeysRequest request =
-        SampleRowKeysRequest.newBuilder().setTableName(tableName.toString()).build();
+        SampleRowKeysRequest.newBuilder().setTableName(tableName).build();
 
     MockStreamObserver responseObserver = new MockStreamObserver<>();
 
@@ -167,9 +168,9 @@ public void sampleRowKeysTest() throws Exception {
   public void sampleRowKeysExceptionTest() throws Exception {
     StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
     mockBigtable.addException(exception);
-    TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+    String tableName = NameUtil.formatTableName("[PROJECT]", "[INSTANCE]", "[TABLE]");
     SampleRowKeysRequest request =
-        SampleRowKeysRequest.newBuilder().setTableName(tableName.toString()).build();
+        SampleRowKeysRequest.newBuilder().setTableName(tableName).build();
 
     MockStreamObserver responseObserver = new MockStreamObserver<>();
 
@@ -193,7 +194,7 @@ public void mutateRowTest() {
     MutateRowResponse expectedResponse = MutateRowResponse.newBuilder().build();
     mockBigtable.addResponse(expectedResponse);
 
-    TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+    String tableName = NameUtil.formatTableName("[PROJECT]", "[INSTANCE]", "[TABLE]");
     ByteString rowKey = ByteString.copyFromUtf8("122");
     List mutations = new ArrayList<>();
 
@@ -204,7 +205,7 @@ public void mutateRowTest() {
     Assert.assertEquals(1, actualRequests.size());
     MutateRowRequest actualRequest = (MutateRowRequest) actualRequests.get(0);
 
-    Assert.assertEquals(tableName, TableName.parse(actualRequest.getTableName()));
+    Assert.assertEquals(tableName, actualRequest.getTableName());
     Assert.assertEquals(rowKey, actualRequest.getRowKey());
     Assert.assertEquals(mutations, actualRequest.getMutationsList());
     Assert.assertTrue(
@@ -220,7 +221,7 @@ public void mutateRowExceptionTest() throws Exception {
     mockBigtable.addException(exception);
 
     try {
-      TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+      String tableName = NameUtil.formatTableName("[PROJECT]", "[INSTANCE]", "[TABLE]");
       ByteString rowKey = ByteString.copyFromUtf8("122");
       List mutations = new ArrayList<>();
 
@@ -236,11 +237,11 @@ public void mutateRowExceptionTest() throws Exception {
   public void mutateRowsTest() throws Exception {
     MutateRowsResponse expectedResponse = MutateRowsResponse.newBuilder().build();
     mockBigtable.addResponse(expectedResponse);
-    TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+    String tableName = NameUtil.formatTableName("[PROJECT]", "[INSTANCE]", "[TABLE]");
     List entries = new ArrayList<>();
     MutateRowsRequest request =
         MutateRowsRequest.newBuilder()
-            .setTableName(tableName.toString())
+            .setTableName(tableName)
             .addAllEntries(entries)
             .build();
 
@@ -260,11 +261,11 @@ public void mutateRowsTest() throws Exception {
   public void mutateRowsExceptionTest() throws Exception {
     StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
     mockBigtable.addException(exception);
-    TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+    String tableName = NameUtil.formatTableName("[PROJECT]", "[INSTANCE]", "[TABLE]");
     List entries = new ArrayList<>();
     MutateRowsRequest request =
         MutateRowsRequest.newBuilder()
-            .setTableName(tableName.toString())
+            .setTableName(tableName)
             .addAllEntries(entries)
             .build();
 
@@ -292,7 +293,7 @@ public void checkAndMutateRowTest() {
         CheckAndMutateRowResponse.newBuilder().setPredicateMatched(predicateMatched).build();
     mockBigtable.addResponse(expectedResponse);
 
-    TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+    String tableName = NameUtil.formatTableName("[PROJECT]", "[INSTANCE]", "[TABLE]");
     ByteString rowKey = ByteString.copyFromUtf8("122");
     RowFilter predicateFilter = RowFilter.newBuilder().build();
     List trueMutations = new ArrayList<>();
@@ -306,7 +307,7 @@ public void checkAndMutateRowTest() {
     Assert.assertEquals(1, actualRequests.size());
     CheckAndMutateRowRequest actualRequest = (CheckAndMutateRowRequest) actualRequests.get(0);
 
-    Assert.assertEquals(tableName, TableName.parse(actualRequest.getTableName()));
+    Assert.assertEquals(tableName, actualRequest.getTableName());
     Assert.assertEquals(rowKey, actualRequest.getRowKey());
     Assert.assertEquals(predicateFilter, actualRequest.getPredicateFilter());
     Assert.assertEquals(trueMutations, actualRequest.getTrueMutationsList());
@@ -324,7 +325,7 @@ public void checkAndMutateRowExceptionTest() throws Exception {
     mockBigtable.addException(exception);
 
     try {
-      TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+      String tableName = NameUtil.formatTableName("[PROJECT]", "[INSTANCE]", "[TABLE]");
       ByteString rowKey = ByteString.copyFromUtf8("122");
       RowFilter predicateFilter = RowFilter.newBuilder().build();
       List trueMutations = new ArrayList<>();
@@ -343,7 +344,7 @@ public void readModifyWriteRowTest() {
     ReadModifyWriteRowResponse expectedResponse = ReadModifyWriteRowResponse.newBuilder().build();
     mockBigtable.addResponse(expectedResponse);
 
-    TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+    String tableName = NameUtil.formatTableName("[PROJECT]", "[INSTANCE]", "[TABLE]");
     ByteString rowKey = ByteString.copyFromUtf8("122");
     List rules = new ArrayList<>();
 
@@ -354,7 +355,7 @@ public void readModifyWriteRowTest() {
     Assert.assertEquals(1, actualRequests.size());
     ReadModifyWriteRowRequest actualRequest = (ReadModifyWriteRowRequest) actualRequests.get(0);
 
-    Assert.assertEquals(tableName, TableName.parse(actualRequest.getTableName()));
+    Assert.assertEquals(tableName, actualRequest.getTableName());
     Assert.assertEquals(rowKey, actualRequest.getRowKey());
     Assert.assertEquals(rules, actualRequest.getRulesList());
     Assert.assertTrue(
@@ -370,7 +371,7 @@ public void readModifyWriteRowExceptionTest() throws Exception {
     mockBigtable.addException(exception);
 
     try {
-      TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+      String tableName = NameUtil.formatTableName("[PROJECT]", "[INSTANCE]", "[TABLE]");
       ByteString rowKey = ByteString.copyFromUtf8("122");
       List rules = new ArrayList<>();
 
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientTest.java
index 622c8f308263..14b03152b19b 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientTest.java
@@ -33,7 +33,6 @@
 import com.google.cloud.bigtable.data.v2.models.BulkMutationBatcher;
 import com.google.cloud.bigtable.data.v2.models.BulkMutationBatcher.BulkMutationFailure;
 import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation;
-import com.google.cloud.bigtable.data.v2.models.InstanceName;
 import com.google.cloud.bigtable.data.v2.models.KeyOffset;
 import com.google.cloud.bigtable.data.v2.models.Mutation;
 import com.google.cloud.bigtable.data.v2.models.Query;
@@ -108,7 +107,7 @@ public void proxyReadRowAsyncTest() {
     Mockito.verify(mockReadRowsCallable.first()).futureCall(requestCaptor.capture());
 
     RequestContext ctx =
-        RequestContext.create(InstanceName.of("fake-project", "fake-instance"), "fake-profile");
+        RequestContext.create("fake-project", "fake-instance", "fake-profile");
     // NOTE: limit(1) is added by the mocked first() call, so it's not tested here
     assertThat(requestCaptor.getValue().toProto(ctx))
         .isEqualTo(
@@ -126,7 +125,7 @@ public void proxyReadRowStrAsyncTest() {
     Mockito.verify(mockReadRowsCallable.first()).futureCall(requestCaptor.capture());
 
     RequestContext ctx =
-        RequestContext.create(InstanceName.of("fake-project", "fake-instance"), "fake-profile");
+        RequestContext.create("fake-project", "fake-instance", "fake-profile");
     // NOTE: limit(1) is added by the mocked first() call, so it's not tested here
     assertThat(requestCaptor.getValue().toProto(ctx))
         .isEqualTo(
@@ -150,7 +149,7 @@ public void readRowTest() {
     Mockito.verify(mockReadRowsCallable.first()).futureCall(requestCaptor.capture());
 
     RequestContext ctx =
-        RequestContext.create(InstanceName.of("fake-project", "fake-instance"), "fake-profile");
+        RequestContext.create("fake-project", "fake-instance", "fake-profile");
     // NOTE: limit(1) is added by the mocked first() call, so it's not tested here
     assertThat(requestCaptor.getValue().toProto(ctx))
         .isEqualTo(
@@ -174,7 +173,7 @@ public void readRowStrTest() {
     Mockito.verify(mockReadRowsCallable.first()).futureCall(requestCaptor.capture());
 
     RequestContext ctx =
-        RequestContext.create(InstanceName.of("fake-project", "fake-instance"), "fake-profile");
+        RequestContext.create("fake-project", "fake-instance", "fake-profile");
     // NOTE: limit(1) is added by the mocked first() call, so it's not tested here
     assertThat(requestCaptor.getValue().toProto(ctx))
         .isEqualTo(
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/RowSetUtilTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/RowSetUtilTest.java
index 21d1dd7b0c74..555676ffb1d1 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/RowSetUtilTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/RowSetUtilTest.java
@@ -23,6 +23,7 @@
 import com.google.common.collect.ImmutableSortedSet;
 import com.google.common.collect.Lists;
 import com.google.protobuf.ByteString;
+import java.util.Arrays;
 import java.util.List;
 import java.util.SortedSet;
 import org.junit.Test;
@@ -571,7 +572,7 @@ public void multipleRangeBoundTest() {
   // Helpers
   private static void verifySplit(RowSet input, SortedSet splits, RowSet... expected) {
     List actualWithNull = RowSetUtil.split(input, splits, true);
-    assertThat(actualWithNull).containsExactly(expected).inOrder();
+    assertThat(actualWithNull).containsExactlyElementsIn(Arrays.asList(expected)).inOrder();
 
     List actualNonnull = RowSetUtil.split(input, splits, false);
     List expectedNonnull = Lists.newArrayList();
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BulkMutationBatcherIT.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BulkMutationBatcherIT.java
index b0d82d8d9388..97d42978ed9d 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BulkMutationBatcherIT.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BulkMutationBatcherIT.java
@@ -39,7 +39,7 @@ public class BulkMutationBatcherIT {
   @Test
   public void test() throws Exception {
     BigtableDataClient client = testEnvRule.env().getDataClient();
-    String tableId = testEnvRule.env().getTableName().getTable();
+    String tableId = testEnvRule.env().getTableId();
     String family = testEnvRule.env().getFamilyId();
     String rowPrefix = testEnvRule.env().getRowPrefix();
 
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/CheckAndMutateIT.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/CheckAndMutateIT.java
index 2b65517f232d..53f1a8997dd1 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/CheckAndMutateIT.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/CheckAndMutateIT.java
@@ -37,7 +37,7 @@ public class CheckAndMutateIT {
 
   @Test
   public void test() throws Exception {
-    String tableId = testEnvRule.env().getTableName().getTable();
+    String tableId = testEnvRule.env().getTableId();
     String rowKey = testEnvRule.env().getRowPrefix();
     String familyId = testEnvRule.env().getFamilyId();
 
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/MutateRowIT.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/MutateRowIT.java
index 4fdfef18e665..3e5e0f9a2ce1 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/MutateRowIT.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/MutateRowIT.java
@@ -41,7 +41,7 @@ public void test() throws Exception {
         .env()
         .getDataClient()
         .mutateRowAsync(
-            RowMutation.create(testEnvRule.env().getTableName().getTable(), rowKey)
+            RowMutation.create(testEnvRule.env().getTableId(), rowKey)
                 .setCell(familyId, "q", "myVal")
                 .setCell(familyId, "q2", "myVal2")
                 .setCell(familyId, "q3", "myVal3"))
@@ -51,7 +51,7 @@ public void test() throws Exception {
         .env()
         .getDataClient()
         .mutateRowAsync(
-            RowMutation.create(testEnvRule.env().getTableName().getTable(), rowKey)
+            RowMutation.create(testEnvRule.env().getTableId(), rowKey)
                 .deleteCells(familyId, "q2"))
         .get(1, TimeUnit.MINUTES);
 
@@ -61,7 +61,7 @@ public void test() throws Exception {
             .getDataClient()
             .readRowsCallable()
             .first()
-            .call(Query.create(testEnvRule.env().getTableName().getTable()).rowKey(rowKey));
+            .call(Query.create(testEnvRule.env().getTableId()).rowKey(rowKey));
 
     assertThat(row.getCells()).hasSize(2);
     assertThat(row.getCells().get(0).getValue()).isEqualTo(ByteString.copyFromUtf8("myVal"));
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/ReadIT.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/ReadIT.java
index 76add465c838..93ed0db6e0aa 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/ReadIT.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/ReadIT.java
@@ -59,7 +59,7 @@ public void setUp() {
   public void readEmpty() throws Throwable {
     String uniqueKey = prefix + "-readEmpty";
 
-    Query query = Query.create(testEnvRule.env().getTableName().getTable()).rowKey(uniqueKey);
+    Query query = Query.create(testEnvRule.env().getTableId()).rowKey(uniqueKey);
 
     // Sync
     ArrayList rows = Lists.newArrayList(testEnvRule.env().getDataClient().readRows(query));
@@ -78,7 +78,7 @@ public void read() throws Throwable {
     List expectedRows = Lists.newArrayList();
     String uniqueKey = prefix + "-read";
 
-    long timestampMicros = System.nanoTime() * 1_000;
+    long timestampMicros = System.currentTimeMillis() * 1_000;
 
     for (int i = 0; i < numRows; i++) {
       testEnvRule
@@ -86,7 +86,7 @@ public void read() throws Throwable {
           .getDataClient()
           .mutateRowCallable()
           .call(
-              RowMutation.create(testEnvRule.env().getTableName().getTable(), uniqueKey + "-" + i)
+              RowMutation.create(testEnvRule.env().getTableId(), uniqueKey + "-" + i)
                   .setCell(testEnvRule.env().getFamilyId(), "q", timestampMicros, "my-value"));
 
       expectedRows.add(
@@ -103,7 +103,7 @@ public void read() throws Throwable {
 
     // Sync
     Query query =
-        Query.create(testEnvRule.env().getTableName().getTable())
+        Query.create(testEnvRule.env().getTableId())
             .range(uniqueKey + "-0", uniqueKey + "-" + numRows);
     ArrayList actualResults =
         Lists.newArrayList(testEnvRule.env().getDataClient().readRows(query));
@@ -123,7 +123,7 @@ public void readSingleNonexistentAsyncCallback() throws Exception {
         testEnvRule
             .env()
             .getDataClient()
-            .readRowAsync(testEnvRule.env().getTableName().getTable(), "somenonexistentkey");
+            .readRowAsync(testEnvRule.env().getTableId(), "somenonexistentkey");
 
     final AtomicBoolean found = new AtomicBoolean();
     final CountDownLatch latch = new CountDownLatch(1);
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/ReadModifyWriteIT.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/ReadModifyWriteIT.java
index 296f43e2ddbe..692027db5446 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/ReadModifyWriteIT.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/ReadModifyWriteIT.java
@@ -35,7 +35,7 @@ public class ReadModifyWriteIT {
 
   @Test
   public void test() throws InterruptedException, ExecutionException, TimeoutException {
-    String tableId = testEnvRule.env().getTableName().getTable();
+    String tableId = testEnvRule.env().getTableId();
     String family = testEnvRule.env().getFamilyId();
     String rowKey = testEnvRule.env().getRowPrefix();
 
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/SampleRowsIT.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/SampleRowsIT.java
index e77fcdd98a16..4a7b5341192a 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/SampleRowsIT.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/SampleRowsIT.java
@@ -47,7 +47,7 @@ public void test() throws InterruptedException, ExecutionException, TimeoutExcep
       ApiFuture future =
           client.mutateRowAsync(
               RowMutation.create(
-                      testEnvRule.env().getTableName().getTable(),
+                      testEnvRule.env().getTableId(),
                       testEnvRule.env().getRowPrefix() + "-" + i)
                   .setCell(testEnvRule.env().getFamilyId(), "", "value"));
       futures.add(future);
@@ -55,7 +55,7 @@ public void test() throws InterruptedException, ExecutionException, TimeoutExcep
     ApiFutures.allAsList(futures).get(1, TimeUnit.MINUTES);
 
     ApiFuture> future =
-        client.sampleRowKeysAsync(testEnvRule.env().getTableName().getTable());
+        client.sampleRowKeysAsync(testEnvRule.env().getTableId());
 
     List results = future.get(1, TimeUnit.MINUTES);
 
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/Emulator.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/Emulator.java
index 738b330007c9..258ed1e59bfe 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/Emulator.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/Emulator.java
@@ -23,7 +23,6 @@
 import com.google.bigtable.admin.v2.BigtableTableAdminGrpc.BigtableTableAdminBlockingStub;
 import com.google.cloud.bigtable.data.v2.BigtableDataClient;
 import com.google.cloud.bigtable.data.v2.BigtableDataSettings;
-import com.google.cloud.bigtable.data.v2.models.InstanceName;
 import com.google.common.io.CharStreams;
 import io.grpc.ManagedChannel;
 import io.grpc.ManagedChannelBuilder;
@@ -57,8 +56,8 @@ class Emulator {
   private BigtableTableAdminBlockingStub tableAdminClient;
   private BigtableDataClient dataClient;
 
-  private static final InstanceName INSTANCE_NAME =
-      InstanceName.of("fake-project", "fake-instance");
+  private static final String PROJECT_ID = "fake-project";
+  private static final String INSTANCE_ID = "fake-instance";
 
   // Use the gcloud installed emulator
   static Emulator createGCloud() {
@@ -101,8 +100,11 @@ void start() throws Exception {
 
     dataClient =
         BigtableDataClient.create(
-            configureClient(BigtableDataSettings.newBuilder().setInstanceName(INSTANCE_NAME))
-                .build());
+            configureClient(
+                BigtableDataSettings.newBuilder()
+                    .setProjectId(PROJECT_ID)
+                    .setInstanceId(INSTANCE_ID)
+            ).build());
 
     Runtime.getRuntime()
         .addShutdownHook(
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/EmulatorEnv.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/EmulatorEnv.java
index 3741246aabb2..c4ce28ee13e2 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/EmulatorEnv.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/EmulatorEnv.java
@@ -18,13 +18,12 @@
 import com.google.bigtable.admin.v2.ColumnFamily;
 import com.google.bigtable.admin.v2.CreateTableRequest;
 import com.google.bigtable.admin.v2.Table;
-import com.google.bigtable.v2.TableName;
 import com.google.cloud.bigtable.data.v2.BigtableDataClient;
-import com.google.cloud.bigtable.data.v2.models.InstanceName;
+import com.google.cloud.bigtable.data.v2.internal.NameUtil;
 
 public class EmulatorEnv implements TestEnv {
-  private static final InstanceName INSTANCE_NAME =
-      InstanceName.of("fake-project", "fake-instance");
+  private static final String PROJECT_ID = "fake-project";
+  private static final String INSTANCE_ID = "fake-instance";
   private static final String TABLE_ID = "default-table";
   private static final String FAMILY_ID = "cf";
 
@@ -39,7 +38,7 @@ public void start() throws Exception {
         .getTableAdminClient()
         .createTable(
             CreateTableRequest.newBuilder()
-                .setParent(INSTANCE_NAME.toString())
+                .setParent(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID))
                 .setTableId(TABLE_ID)
                 .setTable(
                     Table.newBuilder()
@@ -53,8 +52,18 @@ public void stop() throws Exception {
   }
 
   @Override
-  public TableName getTableName() {
-    return TableName.of(INSTANCE_NAME.getProject(), INSTANCE_NAME.getInstance(), TABLE_ID);
+  public String getProjectId() {
+    return PROJECT_ID;
+  }
+
+  @Override
+  public String getInstanceId() {
+    return INSTANCE_ID;
+  }
+
+  @Override
+  public String getTableId() {
+    return TABLE_ID;
   }
 
   @Override
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/ProdEnv.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/ProdEnv.java
index f418c3c2d9f7..c221fb380784 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/ProdEnv.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/ProdEnv.java
@@ -18,9 +18,7 @@
 import com.google.api.core.ApiFuture;
 import com.google.api.core.ApiFutures;
 import com.google.api.gax.rpc.ServerStream;
-import com.google.bigtable.v2.TableName;
 import com.google.cloud.bigtable.data.v2.BigtableDataClient;
-import com.google.cloud.bigtable.data.v2.models.InstanceName;
 import com.google.cloud.bigtable.data.v2.models.Query;
 import com.google.cloud.bigtable.data.v2.models.Row;
 import com.google.cloud.bigtable.data.v2.models.RowMutation;
@@ -43,30 +41,36 @@
  * 
  */
 public class ProdEnv implements TestEnv {
+  private static final String PROJECT_PROPERTY_NAME = "bigtable.project";
+  private static final String INSTANCE_PROPERTY_NAME = "bigtable.instance";
   private static final String TABLE_PROPERTY_NAME = "bigtable.table";
 
-  private TableName tableName;
+  private final String projectId;
+  private final String instanceId;
+  private final String tableId;
   private static final String FAMILY_ID = "cf";
   private String rowPrefix;
 
   private BigtableDataClient dataClient;
 
   static ProdEnv fromSystemProperties() {
-    String tableNameStr = getRequiredProperty(TABLE_PROPERTY_NAME);
-    TableName tableName = TableName.parse(tableNameStr);
-
-    return new ProdEnv(tableName);
+    return new ProdEnv(
+        getRequiredProperty(PROJECT_PROPERTY_NAME),
+        getRequiredProperty(INSTANCE_PROPERTY_NAME),
+        getRequiredProperty(TABLE_PROPERTY_NAME)
+    );
   }
 
-  ProdEnv(TableName tableName) {
-    this.tableName = tableName;
+  public ProdEnv(String projectId, String instanceId, String tableId) {
+    this.projectId = projectId;
+    this.instanceId = instanceId;
+    this.tableId = tableId;
+    this.rowPrefix = UUID.randomUUID() + "-";
   }
 
   @Override
   public void start() throws IOException {
-    rowPrefix = UUID.randomUUID() + "-";
-    dataClient =
-        BigtableDataClient.create(InstanceName.of(tableName.getProject(), tableName.getInstance()));
+    dataClient = BigtableDataClient.create(projectId, instanceId);
   }
 
   @Override
@@ -81,8 +85,18 @@ public BigtableDataClient getDataClient() {
   }
 
   @Override
-  public TableName getTableName() {
-    return tableName;
+  public String getProjectId() {
+    return projectId;
+  }
+
+  @Override
+  public String getInstanceId() {
+    return instanceId;
+  }
+
+  @Override
+  public String getTableId() {
+    return tableId;
   }
 
   @Override
@@ -96,14 +110,14 @@ public String getRowPrefix() {
   }
 
   private void deleteRows() throws InterruptedException, ExecutionException, TimeoutException {
-    Query query = Query.create(tableName.getTable()).prefix(rowPrefix);
+    Query query = Query.create(tableId).prefix(rowPrefix);
 
     List> futures = Lists.newArrayList();
     ServerStream rows = dataClient.readRows(query);
     for (Row row : rows) {
       ApiFuture future =
           dataClient.mutateRowAsync(
-              RowMutation.create(tableName.getTable(), row.getKey()).deleteRow());
+              RowMutation.create(tableId, row.getKey()).deleteRow());
       futures.add(future);
     }
 
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/TestEnv.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/TestEnv.java
index 00a81de596c2..69c70efc3189 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/TestEnv.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/TestEnv.java
@@ -15,7 +15,6 @@
  */
 package com.google.cloud.bigtable.data.v2.it.env;
 
-import com.google.bigtable.v2.TableName;
 import com.google.cloud.bigtable.data.v2.BigtableDataClient;
 
 /**
@@ -30,7 +29,11 @@ public interface TestEnv {
 
   BigtableDataClient getDataClient();
 
-  TableName getTableName();
+  String getProjectId();
+
+  String getInstanceId();
+
+  String getTableId();
 
   String getFamilyId();
 
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/BulkMutationTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/BulkMutationTest.java
index c6734c7b577c..ab203d25f269 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/BulkMutationTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/BulkMutationTest.java
@@ -18,7 +18,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 import com.google.bigtable.v2.MutateRowsRequest;
-import com.google.bigtable.v2.TableName;
+import com.google.cloud.bigtable.data.v2.internal.NameUtil;
 import com.google.cloud.bigtable.data.v2.internal.RequestContext;
 import com.google.protobuf.ByteString;
 import com.google.protobuf.TextFormat;
@@ -34,12 +34,12 @@
 
 @RunWith(JUnit4.class)
 public class BulkMutationTest {
-  private static final InstanceName INSTANCE_NAME =
-      InstanceName.of("fake-project", "fake-instance");
+  private static final String PROJECT_ID = "fake-project";
+  private static final String INSTANCE_ID = "fake-instance";
   private static final String TABLE_ID = "fake-table";
   private static final String APP_PROFILE = "fake-profile";
   private static final RequestContext REQUEST_CONTEXT =
-      RequestContext.create(INSTANCE_NAME, APP_PROFILE);
+      RequestContext.create(PROJECT_ID, INSTANCE_ID, APP_PROFILE);
 
   @Test
   public void test() throws ParseException {
@@ -58,8 +58,7 @@ public void test() throws ParseException {
 
     MutateRowsRequest.Builder expected =
         MutateRowsRequest.newBuilder()
-            .setTableName(
-                TableName.format(INSTANCE_NAME.getProject(), INSTANCE_NAME.getInstance(), TABLE_ID))
+            .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID))
             .setAppProfileId(APP_PROFILE);
     TextFormat.merge(
         "entries {"
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ConditionalRowMutationTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ConditionalRowMutationTest.java
index dfdad7548bf7..044e54f4ef3d 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ConditionalRowMutationTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ConditionalRowMutationTest.java
@@ -20,7 +20,7 @@
 import com.google.bigtable.v2.CheckAndMutateRowRequest;
 import com.google.bigtable.v2.Mutation.DeleteFromColumn;
 import com.google.bigtable.v2.RowFilter;
-import com.google.bigtable.v2.TableName;
+import com.google.cloud.bigtable.data.v2.internal.NameUtil;
 import com.google.cloud.bigtable.data.v2.internal.RequestContext;
 import com.google.protobuf.ByteString;
 import java.io.ByteArrayInputStream;
@@ -34,15 +34,13 @@
 
 @RunWith(JUnit4.class)
 public class ConditionalRowMutationTest {
-  private static final InstanceName INSTANCE_NAME =
-      InstanceName.of("fake-project", "fake-instance");
-  private static final TableName TABLE_NAME =
-      TableName.of(INSTANCE_NAME.getProject(), INSTANCE_NAME.getInstance(), "fake-table");
-  private static final String TABLE_ID = TABLE_NAME.getTable();
+  private static final String PROJECT_ID = "fake-project";
+  private static final String INSTANCE_ID = "fake-instance";
+  private static final String TABLE_ID = "fake-table";
 
   private static final String APP_PROFILE_ID = "fake-profile";
   private static final RequestContext REQUEST_CONTEXT =
-      RequestContext.create(INSTANCE_NAME, APP_PROFILE_ID);
+      RequestContext.create(PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID);
 
   private static final ByteString TEST_KEY = ByteString.copyFromUtf8("fake-key");
 
@@ -58,7 +56,7 @@ public void toProtoTest() {
     assertThat(actualProto)
         .isEqualTo(
             CheckAndMutateRowRequest.newBuilder()
-                .setTableName(TABLE_NAME.toString())
+                .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID))
                 .setAppProfileId(APP_PROFILE_ID)
                 .setRowKey(TEST_KEY)
                 .build());
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/QueryTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/QueryTest.java
index 85521bc2dbe9..780720fceea4 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/QueryTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/QueryTest.java
@@ -23,8 +23,8 @@
 import com.google.bigtable.v2.RowFilter;
 import com.google.bigtable.v2.RowRange;
 import com.google.bigtable.v2.RowSet;
-import com.google.bigtable.v2.TableName;
 import com.google.cloud.bigtable.data.v2.internal.ByteStringComparator;
+import com.google.cloud.bigtable.data.v2.internal.NameUtil;
 import com.google.cloud.bigtable.data.v2.internal.RequestContext;
 import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange;
 import com.google.common.collect.ImmutableList;
@@ -44,21 +44,20 @@
 
 @RunWith(JUnit4.class)
 public class QueryTest {
-  private static final InstanceName INSTANCE_NAME =
-      InstanceName.of("fake-project", "fake-instance");
-  private static final TableName TABLE_NAME =
-      TableName.of("fake-project", "fake-instance", "fake-table");
+  private static final String PROJECT_ID = "fake-project";
+  private static final String INSTANCE_ID = "fake-instance";
+  private static final String TABLE_ID = "fake-table";
   private static final String APP_PROFILE_ID = "fake-profile-id";
   private RequestContext requestContext;
 
   @Before
   public void setUp() {
-    requestContext = RequestContext.create(INSTANCE_NAME, APP_PROFILE_ID);
+    requestContext = RequestContext.create(PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID);
   }
 
   @Test
   public void requestContextTest() {
-    Query query = Query.create(TABLE_NAME.getTable());
+    Query query = Query.create(TABLE_ID);
 
     ReadRowsRequest proto = query.toProto(requestContext);
     assertThat(proto).isEqualTo(expectedProtoBuilder().build());
@@ -67,7 +66,7 @@ public void requestContextTest() {
   @Test
   public void rowKeysTest() {
     Query query =
-        Query.create(TABLE_NAME.getTable())
+        Query.create(TABLE_ID)
             .rowKey("simple-string")
             .rowKey(ByteString.copyFromUtf8("byte-string"));
 
@@ -84,7 +83,7 @@ public void rowKeysTest() {
   @Test
   public void rowRangeTest() {
     Query query =
-        Query.create(TABLE_NAME.getTable())
+        Query.create(TABLE_ID)
             .range("simple-begin", "simple-end")
             .range(ByteString.copyFromUtf8("byte-begin"), ByteString.copyFromUtf8("byte-end"))
             .range(ByteStringRange.create("range-begin", "range-end"));
@@ -111,7 +110,7 @@ public void rowRangeTest() {
 
   @Test
   public void filterTest() {
-    Query query = Query.create(TABLE_NAME.getTable()).filter(FILTERS.key().regex(".*"));
+    Query query = Query.create(TABLE_ID).filter(FILTERS.key().regex(".*"));
 
     Builder expectedProto =
         expectedProtoBuilder()
@@ -123,7 +122,7 @@ public void filterTest() {
 
   @Test
   public void limitTest() {
-    Query query = Query.create(TABLE_NAME.getTable()).limit(10);
+    Query query = Query.create(TABLE_ID).limit(10);
 
     Builder expectedProto = expectedProtoBuilder().setRowsLimit(10);
 
@@ -133,7 +132,7 @@ public void limitTest() {
 
   @Test
   public void serializationTest() throws IOException, ClassNotFoundException {
-    Query expected = Query.create(TABLE_NAME.getTable()).filter(FILTERS.key().regex(".*"));
+    Query expected = Query.create(TABLE_ID).filter(FILTERS.key().regex(".*"));
 
     ByteArrayOutputStream bos = new ByteArrayOutputStream();
     ObjectOutputStream oos = new ObjectOutputStream(bos);
@@ -148,7 +147,7 @@ public void serializationTest() throws IOException, ClassNotFoundException {
 
   @Test
   public void shardTestSplitPoints() {
-    Query query = Query.create(TABLE_NAME.getTable()).range("a", "z");
+    Query query = Query.create(TABLE_ID).range("a", "z");
 
     SortedSet splitPoints =
         ImmutableSortedSet.orderedBy(ByteStringComparator.INSTANCE)
@@ -161,7 +160,7 @@ public void shardTestSplitPoints() {
     assertThat(subQueries.get(0).toProto(requestContext))
         .isEqualTo(
             ReadRowsRequest.newBuilder()
-                .setTableName(TABLE_NAME.toString())
+                .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID))
                 .setAppProfileId(APP_PROFILE_ID)
                 .setRows(
                     RowSet.newBuilder()
@@ -173,7 +172,7 @@ public void shardTestSplitPoints() {
     assertThat(subQueries.get(1).toProto(requestContext))
         .isEqualTo(
             ReadRowsRequest.newBuilder()
-                .setTableName(TABLE_NAME.toString())
+                .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID))
                 .setAppProfileId(APP_PROFILE_ID)
                 .setRows(
                     RowSet.newBuilder()
@@ -186,7 +185,7 @@ public void shardTestSplitPoints() {
 
   @Test
   public void shardTestKeyOffsets() {
-    Query query = Query.create(TABLE_NAME.getTable()).range("a", "z");
+    Query query = Query.create(TABLE_ID).range("a", "z");
 
     List keyOffsets =
         ImmutableList.of(
@@ -199,7 +198,7 @@ public void shardTestKeyOffsets() {
     assertThat(subQueries.get(0).toProto(requestContext))
         .isEqualTo(
             ReadRowsRequest.newBuilder()
-                .setTableName(TABLE_NAME.toString())
+                .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID))
                 .setAppProfileId(APP_PROFILE_ID)
                 .setRows(
                     RowSet.newBuilder()
@@ -211,7 +210,7 @@ public void shardTestKeyOffsets() {
     assertThat(subQueries.get(1).toProto(requestContext))
         .isEqualTo(
             ReadRowsRequest.newBuilder()
-                .setTableName(TABLE_NAME.toString())
+                .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID))
                 .setAppProfileId(APP_PROFILE_ID)
                 .setRows(
                     RowSet.newBuilder()
@@ -224,7 +223,7 @@ public void shardTestKeyOffsets() {
 
   private static ReadRowsRequest.Builder expectedProtoBuilder() {
     return ReadRowsRequest.newBuilder()
-        .setTableName(TABLE_NAME.toString())
+        .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID))
         .setAppProfileId(APP_PROFILE_ID);
   }
 }
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRowTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRowTest.java
index 7d6d8563d093..a318a61f0ec9 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRowTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRowTest.java
@@ -19,7 +19,7 @@
 
 import com.google.bigtable.v2.ReadModifyWriteRowRequest;
 import com.google.bigtable.v2.ReadModifyWriteRule;
-import com.google.bigtable.v2.TableName;
+import com.google.cloud.bigtable.data.v2.internal.NameUtil;
 import com.google.cloud.bigtable.data.v2.internal.RequestContext;
 import com.google.protobuf.ByteString;
 import java.io.ByteArrayInputStream;
@@ -30,18 +30,17 @@
 import org.junit.Test;
 
 public class ReadModifyWriteRowTest {
-  private static final InstanceName INSTANCE_NAME =
-      InstanceName.of("fake-project", "fake-instance");
+  private static final String PROJECT_ID = "fake-project";
+  private static final String INSTANCE_ID = "fake-instance";
+  private static final String TABLE_ID = "fake-table";
   private static final String APP_PROFILE_ID = "fake-profile";
   private static final RequestContext REQUEST_CONTEXT =
-      RequestContext.create(INSTANCE_NAME, APP_PROFILE_ID);
-  private static final TableName TABLE_NAME =
-      TableName.of(INSTANCE_NAME.getProject(), INSTANCE_NAME.getInstance(), "fake-table");
+      RequestContext.create(PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID);
 
   @Test
   public void testAppend() {
     ReadModifyWriteRow mutation =
-        ReadModifyWriteRow.create(TABLE_NAME.getTable(), "fake-key")
+        ReadModifyWriteRow.create(TABLE_ID, "fake-key")
             .append(
                 "fake-family",
                 ByteString.copyFromUtf8("fake-qualifier"),
@@ -52,7 +51,7 @@ public void testAppend() {
 
     ReadModifyWriteRowRequest expected =
         ReadModifyWriteRowRequest.newBuilder()
-            .setTableName(TABLE_NAME.toString())
+            .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID))
             .setAppProfileId(APP_PROFILE_ID)
             .setRowKey(ByteString.copyFromUtf8("fake-key"))
             .addRules(
@@ -72,7 +71,7 @@ public void testAppend() {
   @Test
   public void testIncrement() {
     ReadModifyWriteRow mutation =
-        ReadModifyWriteRow.create(TABLE_NAME.getTable(), "fake-key")
+        ReadModifyWriteRow.create(TABLE_ID, "fake-key")
             .increment("fake-family", ByteString.copyFromUtf8("fake-qualifier"), 1)
             .increment("fake-family", "fake-qualifier-str", 2);
 
@@ -81,7 +80,7 @@ public void testIncrement() {
     assertThat(actualProto)
         .isEqualTo(
             ReadModifyWriteRowRequest.newBuilder()
-                .setTableName(TABLE_NAME.toString())
+                .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID))
                 .setAppProfileId(APP_PROFILE_ID)
                 .setRowKey(ByteString.copyFromUtf8("fake-key"))
                 .addRules(
@@ -100,7 +99,7 @@ public void testIncrement() {
   @Test
   public void serializationTest() throws IOException, ClassNotFoundException {
     ReadModifyWriteRow expected =
-        ReadModifyWriteRow.create(TABLE_NAME.getTable(), "fake-key")
+        ReadModifyWriteRow.create(TABLE_ID, "fake-key")
             .increment("fake-family", ByteString.copyFromUtf8("fake-qualifier"), 1)
             .append("fake-family", "a", "b");
 
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowMutationTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowMutationTest.java
index d38ef5bffe8b..1698449401b7 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowMutationTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowMutationTest.java
@@ -19,7 +19,7 @@
 
 import com.google.bigtable.v2.MutateRowRequest;
 import com.google.bigtable.v2.MutateRowsRequest;
-import com.google.bigtable.v2.TableName;
+import com.google.cloud.bigtable.data.v2.internal.NameUtil;
 import com.google.cloud.bigtable.data.v2.internal.RequestContext;
 import com.google.protobuf.ByteString;
 import java.io.ByteArrayInputStream;
@@ -33,11 +33,12 @@
 
 @RunWith(JUnit4.class)
 public class RowMutationTest {
-  private static final InstanceName INSTANCE_NAME =
-      InstanceName.of("fake-project", "fake-instance");
+  private static final String PROJECT_ID = "fake-project";
+  private static final String INSTANCE_ID = "fake-instance";
+  private static final String TABLE_ID = "fake-table";
   private static final String APP_PROFILE_ID = "fake-profile";
   private static final RequestContext REQUEST_CONTEXT =
-      RequestContext.create(INSTANCE_NAME, APP_PROFILE_ID);
+      RequestContext.create(PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID);
 
   @Test
   public void toProtoTest() {
@@ -52,9 +53,7 @@ public void toProtoTest() {
         com.google.common.collect.Range.closed(timestampMin, System.currentTimeMillis() * 1_000);
 
     assertThat(actualRowMutation.getTableName())
-        .isEqualTo(
-            TableName.of(INSTANCE_NAME.getProject(), INSTANCE_NAME.getInstance(), "fake-table")
-                .toString());
+        .isEqualTo(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, "fake-table"));
     assertThat(actualRowMutation.getAppProfileId()).isEqualTo(APP_PROFILE_ID);
     assertThat(actualRowMutation.getMutationsList()).hasSize(1);
     assertThat(actualRowMutation.getMutations(0).getSetCell().getValue())
@@ -77,9 +76,7 @@ public void toBulkProtoTest() {
         com.google.common.collect.Range.closed(timestampMin, System.currentTimeMillis() * 1_000);
 
     assertThat(actualRowMutation.getTableName())
-        .isEqualTo(
-            TableName.of(INSTANCE_NAME.getProject(), INSTANCE_NAME.getInstance(), "fake-table")
-                .toString());
+        .isEqualTo(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID));
     assertThat(actualRowMutation.getAppProfileId()).isEqualTo(APP_PROFILE_ID);
     assertThat(actualRowMutation.getEntriesList()).hasSize(1);
     assertThat(actualRowMutation.getEntries(0).getMutationsList()).hasSize(1);
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/CheckAndMutateRowCallableTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/CheckAndMutateRowCallableTest.java
index cb9cfb2bf96d..ceb7b8d90001 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/CheckAndMutateRowCallableTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/CheckAndMutateRowCallableTest.java
@@ -26,9 +26,9 @@
 import com.google.bigtable.v2.CheckAndMutateRowRequest;
 import com.google.bigtable.v2.CheckAndMutateRowResponse;
 import com.google.bigtable.v2.Mutation.DeleteFromRow;
+import com.google.cloud.bigtable.data.v2.internal.NameUtil;
 import com.google.cloud.bigtable.data.v2.internal.RequestContext;
 import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation;
-import com.google.cloud.bigtable.data.v2.models.InstanceName;
 import com.google.cloud.bigtable.data.v2.models.Mutation;
 import com.google.protobuf.ByteString;
 import io.grpc.Status.Code;
@@ -41,8 +41,9 @@
 
 @RunWith(JUnit4.class)
 public class CheckAndMutateRowCallableTest {
-  private final RequestContext requestContext =
-      RequestContext.create(InstanceName.of("my-project", "my-instance"), "my-app-profile");
+
+  private final RequestContext requestContext = RequestContext
+      .create("my-project", "my-instance", "my-app-profile");
   private FakeCallable inner;
   private CheckAndMutateRowCallable callable;
 
@@ -60,7 +61,9 @@ public void requestIsCorrect() {
     assertThat(inner.request)
         .isEqualTo(
             CheckAndMutateRowRequest.newBuilder()
-                .setTableName(requestContext.getInstanceName() + "/tables/my-table")
+                .setTableName(
+                    NameUtil.formatTableName(
+                        requestContext.getProjectId(), requestContext.getInstanceId(),"my-table"))
                 .setRowKey(ByteString.copyFromUtf8("row-key"))
                 .setAppProfileId(requestContext.getAppProfileId())
                 .addTrueMutations(
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettingsTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettingsTest.java
index 5e1698828ad2..d2709cdbbe88 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettingsTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettingsTest.java
@@ -27,7 +27,6 @@
 import com.google.api.gax.rpc.UnaryCallSettings;
 import com.google.api.gax.rpc.WatchdogProvider;
 import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation;
-import com.google.cloud.bigtable.data.v2.models.InstanceName;
 import com.google.cloud.bigtable.data.v2.models.KeyOffset;
 import com.google.cloud.bigtable.data.v2.models.Query;
 import com.google.cloud.bigtable.data.v2.models.Row;
@@ -59,7 +58,8 @@ public void instanceNameIsRequiredTest() {
 
   @Test
   public void settingsAreNotLostTest() {
-    InstanceName instanceName = InstanceName.of("my-project", "my-instance");
+    String projectId = "my-project";
+    String instanceId = "my-instance";
     String appProfileId = "my-app-profile-id";
     String endpoint = "some.other.host:123";
     CredentialsProvider credentialsProvider = Mockito.mock(CredentialsProvider.class);
@@ -68,7 +68,8 @@ public void settingsAreNotLostTest() {
 
     EnhancedBigtableStubSettings.Builder builder =
         EnhancedBigtableStubSettings.newBuilder()
-            .setInstanceName(instanceName)
+            .setProjectId(projectId)
+            .setInstanceId(instanceId)
             .setAppProfileId(appProfileId)
             .setEndpoint(endpoint)
             .setCredentialsProvider(credentialsProvider)
@@ -77,7 +78,8 @@ public void settingsAreNotLostTest() {
 
     verifyBuilder(
         builder,
-        instanceName,
+        projectId,
+        instanceId,
         appProfileId,
         endpoint,
         credentialsProvider,
@@ -85,7 +87,8 @@ public void settingsAreNotLostTest() {
         watchdogInterval);
     verifySettings(
         builder.build(),
-        instanceName,
+        projectId,
+        instanceId,
         appProfileId,
         endpoint,
         credentialsProvider,
@@ -93,7 +96,8 @@ public void settingsAreNotLostTest() {
         watchdogInterval);
     verifyBuilder(
         builder.build().toBuilder(),
-        instanceName,
+        projectId,
+        instanceId,
         appProfileId,
         endpoint,
         credentialsProvider,
@@ -103,13 +107,15 @@ public void settingsAreNotLostTest() {
 
   private void verifyBuilder(
       EnhancedBigtableStubSettings.Builder builder,
-      InstanceName instanceName,
+      String projectId,
+      String instanceId,
       String appProfileId,
       String endpoint,
       CredentialsProvider credentialsProvider,
       WatchdogProvider watchdogProvider,
       Duration watchdogInterval) {
-    assertThat(builder.getInstanceName()).isEqualTo(instanceName);
+    assertThat(builder.getProjectId()).isEqualTo(projectId);
+    assertThat(builder.getInstanceId()).isEqualTo(instanceId);
     assertThat(builder.getAppProfileId()).isEqualTo(appProfileId);
     assertThat(builder.getEndpoint()).isEqualTo(endpoint);
     assertThat(builder.getCredentialsProvider()).isEqualTo(credentialsProvider);
@@ -119,13 +125,15 @@ private void verifyBuilder(
 
   private void verifySettings(
       EnhancedBigtableStubSettings settings,
-      InstanceName instanceName,
+      String projectId,
+      String instanceId,
       String appProfileId,
       String endpoint,
       CredentialsProvider credentialsProvider,
       WatchdogProvider watchdogProvider,
       Duration watchdogInterval) {
-    assertThat(settings.getInstanceName()).isEqualTo(instanceName);
+    assertThat(settings.getProjectId()).isEqualTo(projectId);
+    assertThat(settings.getInstanceId()).isEqualTo(instanceId);
     assertThat(settings.getAppProfileId()).isEqualTo(appProfileId);
     assertThat(settings.getEndpoint()).isEqualTo(endpoint);
     assertThat(settings.getCredentialsProvider()).isEqualTo(credentialsProvider);
@@ -135,10 +143,12 @@ private void verifySettings(
 
   @Test
   public void multipleChannelsByDefaultTest() {
-    InstanceName dummyInstanceName = InstanceName.of("my-project", "my-instance");
+    String dummyProjectId = "my-project";
+    String dummyInstanceId = "my-instance";
 
-    EnhancedBigtableStubSettings.Builder builder =
-        EnhancedBigtableStubSettings.newBuilder().setInstanceName(dummyInstanceName);
+    EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder()
+        .setProjectId(dummyProjectId)
+        .setInstanceId(dummyInstanceId);
 
     InstantiatingGrpcChannelProvider provider =
         (InstantiatingGrpcChannelProvider) builder.getTransportChannelProvider();
@@ -148,10 +158,12 @@ public void multipleChannelsByDefaultTest() {
 
   @Test
   public void readRowsIsNotLostTest() {
-    InstanceName dummyInstanceName = InstanceName.of("my-project", "my-instance");
+    String dummyProjectId = "my-project";
+    String dummyInstanceId = "my-instance";
 
-    EnhancedBigtableStubSettings.Builder builder =
-        EnhancedBigtableStubSettings.newBuilder().setInstanceName(dummyInstanceName);
+    EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder()
+        .setProjectId(dummyProjectId)
+        .setInstanceId(dummyInstanceId);
 
     RetrySettings retrySettings =
         RetrySettings.newBuilder()
@@ -199,10 +211,12 @@ public void readRowsHasSaneDefaultsTest() {
 
   @Test
   public void sampleRowKeysSettingsAreNotLostTest() {
-    InstanceName dummyInstanceName = InstanceName.of("my-project", "my-instance");
+    String dummyProjectId = "my-project";
+    String dummyInstanceId = "my-instance";
 
-    EnhancedBigtableStubSettings.Builder builder =
-        EnhancedBigtableStubSettings.newBuilder().setInstanceName(dummyInstanceName);
+    EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder()
+        .setProjectId(dummyProjectId)
+        .setInstanceId(dummyInstanceId);
 
     RetrySettings retrySettings =
         RetrySettings.newBuilder()
@@ -243,10 +257,12 @@ public void sampleRowKeysHasSaneDefaultsTest() {
 
   @Test
   public void mutateRowSettingsAreNotLostTest() {
-    InstanceName dummyInstanceName = InstanceName.of("my-project", "my-instance");
+    String dummyProjectId = "my-project";
+    String dummyInstanceId = "my-instance";
 
-    EnhancedBigtableStubSettings.Builder builder =
-        EnhancedBigtableStubSettings.newBuilder().setInstanceName(dummyInstanceName);
+    EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder()
+        .setProjectId(dummyProjectId)
+        .setInstanceId(dummyInstanceId);
 
     RetrySettings retrySettings =
         RetrySettings.newBuilder()
@@ -287,10 +303,12 @@ public void mutateRowHasSaneDefaultsTest() {
 
   @Test
   public void bulkMutateRowsSettingsAreNotLostTest() {
-    InstanceName dummyInstanceName = InstanceName.of("my-project", "my-instance");
+    String dummyProjectId = "my-project";
+    String dummyInstanceId = "my-instance";
 
-    EnhancedBigtableStubSettings.Builder builder =
-        EnhancedBigtableStubSettings.newBuilder().setInstanceName(dummyInstanceName);
+    EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder()
+        .setProjectId(dummyProjectId)
+        .setInstanceId(dummyInstanceId);
 
     RetrySettings retrySettings =
         RetrySettings.newBuilder()
@@ -346,19 +364,21 @@ public void mutateRowsHasSaneDefaultsTest() {
     assertThat(builder.getBatchingSettings().getRequestByteThreshold())
         .isLessThan(256L * 1024 * 1024);
     assertThat(
-            builder.getBatchingSettings().getFlowControlSettings().getMaxOutstandingElementCount())
+        builder.getBatchingSettings().getFlowControlSettings().getMaxOutstandingElementCount())
         .isLessThan(10_000L);
     assertThat(
-            builder.getBatchingSettings().getFlowControlSettings().getMaxOutstandingRequestBytes())
+        builder.getBatchingSettings().getFlowControlSettings().getMaxOutstandingRequestBytes())
         .isLessThan(512L * 1024 * 1024);
   }
 
   @Test
   public void checkAndMutateRowSettingsAreNotLostTest() {
-    InstanceName dummyInstanceName = InstanceName.of("my-project", "my-instance");
+    String dummyProjectId = "my-project";
+    String dummyInstanceId = "my-instance";
 
-    EnhancedBigtableStubSettings.Builder builder =
-        EnhancedBigtableStubSettings.newBuilder().setInstanceName(dummyInstanceName);
+    EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder()
+        .setProjectId(dummyProjectId)
+        .setInstanceId(dummyInstanceId);
 
     RetrySettings retrySettings = RetrySettings.newBuilder().build();
     builder
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/MutateRowCallableTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/MutateRowCallableTest.java
index aac06f077486..eb83c30b68ef 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/MutateRowCallableTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/MutateRowCallableTest.java
@@ -21,7 +21,6 @@
 import com.google.bigtable.v2.MutateRowRequest;
 import com.google.bigtable.v2.MutateRowResponse;
 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.RowMutation;
 import com.google.common.truth.Truth;
 import org.junit.Before;
@@ -35,7 +34,7 @@
 public class MutateRowCallableTest {
 
   private static final RequestContext REQUEST_CONTEXT =
-      RequestContext.create(InstanceName.of("fake-project", "fake-instance"), "fake-profile");
+      RequestContext.create("fake-project", "fake-instance", "fake-profile");
   private UnaryCallable innerCallable;
   private ArgumentCaptor innerMutation;
   private SettableApiFuture innerResult;
@@ -47,7 +46,7 @@ public void setUp() {
     innerMutation = ArgumentCaptor.forClass(MutateRowRequest.class);
     innerResult = SettableApiFuture.create();
     Mockito.when(
-            innerCallable.futureCall(innerMutation.capture(), Mockito.any(ApiCallContext.class)))
+        innerCallable.futureCall(innerMutation.capture(), Mockito.any(ApiCallContext.class)))
         .thenReturn(innerResult);
   }
 
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/ReadModifyWriteRowCallableTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/ReadModifyWriteRowCallableTest.java
index a91325de3237..96fc5401619c 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/ReadModifyWriteRowCallableTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/ReadModifyWriteRowCallableTest.java
@@ -29,8 +29,8 @@
 import com.google.bigtable.v2.ReadModifyWriteRowRequest;
 import com.google.bigtable.v2.ReadModifyWriteRowResponse;
 import com.google.bigtable.v2.ReadModifyWriteRule;
+import com.google.cloud.bigtable.data.v2.internal.NameUtil;
 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.data.v2.models.Row;
 import com.google.cloud.bigtable.data.v2.models.RowCell;
@@ -47,7 +47,7 @@
 @RunWith(JUnit4.class)
 public class ReadModifyWriteRowCallableTest {
   private final RequestContext requestContext =
-      RequestContext.create(InstanceName.of("my-project", "my-instance"), "my-app-profile");
+      RequestContext.create("fake-project", "fake-instance", "fake-profile");
   private FakeCallable inner;
   private ReadModifyWriteRowCallable callable;
 
@@ -65,7 +65,8 @@ public void requestIsCorrect() {
     assertThat(inner.request)
         .isEqualTo(
             ReadModifyWriteRowRequest.newBuilder()
-                .setTableName(requestContext.getInstanceName() + "/tables/my-table")
+                .setTableName(NameUtil.formatTableName(
+                    requestContext.getProjectId(), requestContext.getInstanceId(), "my-table"))
                 .setAppProfileId(requestContext.getAppProfileId())
                 .setRowKey(ByteString.copyFromUtf8("my-key"))
                 .addRules(
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/ResourceHeaderTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/ResourceHeaderTest.java
index 275e801e4e5f..3561deb08b80 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/ResourceHeaderTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/ResourceHeaderTest.java
@@ -21,13 +21,12 @@
 import com.google.api.gax.grpc.testing.InProcessServer;
 import com.google.api.gax.grpc.testing.LocalChannelProvider;
 import com.google.bigtable.v2.BigtableGrpc;
-import com.google.bigtable.v2.TableName;
 import com.google.cloud.bigtable.data.v2.BigtableDataClient;
 import com.google.cloud.bigtable.data.v2.BigtableDataSettings;
+import com.google.cloud.bigtable.data.v2.internal.NameUtil;
 import com.google.cloud.bigtable.data.v2.models.BulkMutationBatcher;
 import com.google.cloud.bigtable.data.v2.models.BulkMutationBatcher.BulkMutationFailure;
 import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation;
-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.Query;
 import com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow;
@@ -42,11 +41,12 @@
 
 @RunWith(JUnit4.class)
 public class ResourceHeaderTest {
+  private static final String PROJECT_ID = "fake-project";
+  private static final String INSTANCE_ID = "fake-instance";
+  private static final String TABLE_ID = "fake-table";
   private static final String NAME = "resource-header-test:123";
-  private static final TableName TABLE_NAME =
-      TableName.of("fake-project", "fake-instance", "fake-table");
   private static final Pattern EXPECTED_HEADER_PATTERN =
-      Pattern.compile(".*" + TABLE_NAME.toString() + ".*");
+      Pattern.compile(".*" + NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID) + ".*");
   private static final String HEADER_NAME = "x-goog-request-params";
 
   private InProcessServer server;
@@ -61,7 +61,8 @@ public void setUp() throws Exception {
 
     BigtableDataSettings.Builder settings =
         BigtableDataSettings.newBuilder()
-            .setInstanceName(InstanceName.of(TABLE_NAME.getProject(), TABLE_NAME.getInstance()))
+            .setProjectId(PROJECT_ID)
+            .setInstanceId(INSTANCE_ID)
             .setTransportChannelProvider(channelProvider)
             .setCredentialsProvider(NoCredentialsProvider.create());
 
@@ -88,26 +89,26 @@ public void tearDown() throws Exception {
 
   @Test
   public void readRowsTest() {
-    client.readRows(Query.create(TABLE_NAME.getTable()));
+    client.readRows(Query.create(TABLE_ID));
     verifyHeaderSent();
   }
 
   @Test
   public void sampleRowKeysTest() {
-    client.sampleRowKeysAsync(TABLE_NAME.getTable());
+    client.sampleRowKeysAsync(TABLE_ID);
     verifyHeaderSent();
   }
 
   @Test
   public void mutateRowTest() {
-    client.mutateRowAsync(RowMutation.create(TABLE_NAME.getTable(), "fake-key").deleteRow());
+    client.mutateRowAsync(RowMutation.create(TABLE_ID, "fake-key").deleteRow());
     verifyHeaderSent();
   }
 
   @Test
   public void mutateRowsTest() throws TimeoutException, InterruptedException {
     try (BulkMutationBatcher batcher = client.newBulkMutationBatcher()) {
-      batcher.add(RowMutation.create(TABLE_NAME.getTable(), "fake-key").deleteRow());
+      batcher.add(RowMutation.create(TABLE_ID, "fake-key").deleteRow());
     } catch (BulkMutationFailure e) {
       // Ignore the errors: none of the methods are actually implemented
     }
@@ -117,7 +118,7 @@ public void mutateRowsTest() throws TimeoutException, InterruptedException {
   @Test
   public void checkAndMutateRowTest() {
     client.checkAndMutateRowAsync(
-        ConditionalRowMutation.create(TABLE_NAME.getTable(), "fake-key")
+        ConditionalRowMutation.create(TABLE_ID, "fake-key")
             .then(Mutation.create().deleteRow()));
     verifyHeaderSent();
   }
@@ -125,7 +126,7 @@ public void checkAndMutateRowTest() {
   @Test
   public void readModifyWriteTest() {
     client.readModifyWriteRowAsync(
-        ReadModifyWriteRow.create(TABLE_NAME.getTable(), "fake-key").increment("cf", "q", 1));
+        ReadModifyWriteRow.create(TABLE_ID, "fake-key").increment("cf", "q", 1));
     verifyHeaderSent();
   }
 
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallableTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallableTest.java
index 1482eee96fff..f363679c772d 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallableTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallableTest.java
@@ -25,8 +25,8 @@
 import com.google.api.gax.rpc.UnaryCallable;
 import com.google.bigtable.v2.SampleRowKeysRequest;
 import com.google.bigtable.v2.SampleRowKeysResponse;
+import com.google.cloud.bigtable.data.v2.internal.NameUtil;
 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.KeyOffset;
 import com.google.common.collect.ImmutableList;
 import com.google.protobuf.ByteString;
@@ -41,8 +41,9 @@
 
 @RunWith(JUnit4.class)
 public class SampleRowKeysCallableTest {
+
   private final RequestContext requestContext =
-      RequestContext.create(InstanceName.of("my-project", "my-instance"), "my-app-profile");
+      RequestContext.create("my-project", "my-instance", "my-profile");
   private FakeCallable inner;
   private SampleRowKeysCallable callable;
 
@@ -59,7 +60,11 @@ public void requestIsCorrect() {
     assertThat(inner.request)
         .isEqualTo(
             SampleRowKeysRequest.newBuilder()
-                .setTableName(requestContext.getInstanceName() + "/tables/my-table")
+                .setTableName(NameUtil
+                    .formatTableName(
+                        requestContext.getProjectId(),
+                        requestContext.getInstanceId(),
+                        "my-table"))
                 .setAppProfileId(requestContext.getAppProfileId())
                 .build());
   }
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/BulkMutateRowsRetryTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/BulkMutateRowsRetryTest.java
index ea3aae3ba214..10528d333d27 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/BulkMutateRowsRetryTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/BulkMutateRowsRetryTest.java
@@ -30,11 +30,9 @@
 import com.google.bigtable.v2.MutateRowsRequest;
 import com.google.bigtable.v2.MutateRowsRequest.Entry;
 import com.google.bigtable.v2.MutateRowsResponse;
-import com.google.bigtable.v2.TableName;
 import com.google.cloud.bigtable.data.v2.BigtableDataClient;
 import com.google.cloud.bigtable.data.v2.BigtableDataSettings;
 import com.google.cloud.bigtable.data.v2.models.BulkMutationBatcher;
-import com.google.cloud.bigtable.data.v2.models.InstanceName;
 import com.google.cloud.bigtable.data.v2.models.RowMutation;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Queues;
@@ -56,11 +54,9 @@
 
 @RunWith(MockitoJUnitRunner.class)
 public class BulkMutateRowsRetryTest {
-  private static final InstanceName INSTANCE_NAME =
-      InstanceName.of("fake-project", "fake-instance");
-  private static final TableName TABLE_NAME =
-      TableName.of(INSTANCE_NAME.getProject(), INSTANCE_NAME.getInstance(), "fake-table");
-  private static final String TABLE_ID = TABLE_NAME.getTable();
+  private static final String PROJECT_ID = "fake-project";
+  private static final String INSTANCE_ID = "fake-instance";
+  private static final String TABLE_ID = "fake-table";
 
   private static final int MAX_ATTEMPTS = 5;
   private static final long FLUSH_COUNT = 10;
@@ -78,7 +74,8 @@ public void setUp() throws Exception {
 
     BigtableDataSettings.Builder settings =
         BigtableDataSettings.newBuilder()
-            .setInstanceName(INSTANCE_NAME)
+            .setProjectId(PROJECT_ID)
+            .setInstanceId(INSTANCE_ID)
             .setCredentialsProvider(NoCredentialsProvider.create())
             .setTransportChannelProvider(
                 FixedTransportChannelProvider.create(
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsBatchingDescriptorTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsBatchingDescriptorTest.java
index 67d4ebf0a0a6..07cd2ad375c3 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsBatchingDescriptorTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsBatchingDescriptorTest.java
@@ -30,7 +30,7 @@
 import com.google.bigtable.v2.MutateRowsRequest.Entry.Builder;
 import com.google.bigtable.v2.Mutation;
 import com.google.bigtable.v2.Mutation.SetCell;
-import com.google.bigtable.v2.TableName;
+import com.google.cloud.bigtable.data.v2.internal.NameUtil;
 import com.google.cloud.bigtable.data.v2.models.MutateRowsException;
 import com.google.cloud.bigtable.data.v2.models.MutateRowsException.FailedMutation;
 import com.google.common.collect.ImmutableList;
@@ -48,8 +48,9 @@
 
 @RunWith(JUnit4.class)
 public class MutateRowsBatchingDescriptorTest {
-  private static final TableName TABLE_NAME =
-      TableName.of("fake-project", "fake-instance", "fake-table");
+  private static final String PROJECT_ID = "fake-project";
+  private static final String INSTANCE_ID = "fake-instance";
+  private static final String TABLE_ID = "fake-table";
 
   private MutateRowsBatchingDescriptor descriptor;
 
@@ -74,13 +75,13 @@ public void countElementsTest() {
 
   @Test
   public void partitionKeyTest() {
-    TableName myTableName = TableName.of("my-project", "my-instance", "my-table");
+    String myTableName = NameUtil.formatTableName("my-project", "my-instance", "my-table");
 
     MutateRowsRequest request =
-        createRequest(2).toBuilder().setTableName(myTableName.toString()).build();
+        createRequest(2).toBuilder().setTableName(myTableName).build();
 
     PartitionKey actual = descriptor.getBatchPartitionKey(request);
-    assertThat(actual).isEqualTo(new PartitionKey(myTableName.toString()));
+    assertThat(actual).isEqualTo(new PartitionKey(myTableName));
   }
 
   @Test
@@ -92,7 +93,7 @@ public void requestBuilderTest() {
     for (Entry entry : expected.getEntriesList()) {
       MutateRowsRequest singleReq =
           MutateRowsRequest.newBuilder()
-              .setTableName(TABLE_NAME.toString())
+              .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID))
               .addEntries(entry)
               .build();
 
@@ -205,7 +206,8 @@ public void splitResponseOkTest()
 
   private static MutateRowsRequest createRequest(int count) {
     MutateRowsRequest.Builder request =
-        MutateRowsRequest.newBuilder().setTableName(TABLE_NAME.toString());
+        MutateRowsRequest.newBuilder().setTableName(
+            NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID));
 
     for (int i = 0; i < count; i++) {
       Builder entry =
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsFirstCallableTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsFirstCallableTest.java
index 17cdf380e701..e7fb90941ec0 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsFirstCallableTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsFirstCallableTest.java
@@ -19,7 +19,6 @@
 import com.google.api.gax.rpc.ApiCallContext;
 import com.google.api.gax.rpc.UnaryCallable;
 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.Query;
 import com.google.cloud.bigtable.data.v2.models.Row;
 import com.google.common.truth.Truth;
@@ -33,7 +32,7 @@
 @RunWith(JUnit4.class)
 public class ReadRowsFirstCallableTest {
   private static final RequestContext REQUEST_CONTEXT =
-      RequestContext.create(InstanceName.of("fake-project", "fake-instance"), "fake-profile");;
+      RequestContext.create("fake-project", "fake-instance", "fake-profile");
   private UnaryCallable innerCallable;
   private ArgumentCaptor innerQuery;
   private SettableApiFuture innerResult;
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryTest.java
index 5188405578ed..e0c3707d7ef3 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryTest.java
@@ -25,10 +25,9 @@
 import com.google.bigtable.v2.ReadRowsResponse;
 import com.google.bigtable.v2.ReadRowsResponse.CellChunk;
 import com.google.bigtable.v2.RowRange;
-import com.google.bigtable.v2.TableName;
 import com.google.cloud.bigtable.data.v2.BigtableDataClient;
 import com.google.cloud.bigtable.data.v2.BigtableDataSettings;
-import com.google.cloud.bigtable.data.v2.models.InstanceName;
+import com.google.cloud.bigtable.data.v2.internal.NameUtil;
 import com.google.cloud.bigtable.data.v2.models.Query;
 import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange;
 import com.google.cloud.bigtable.data.v2.models.Row;
@@ -54,10 +53,9 @@
 
 @RunWith(MockitoJUnitRunner.class)
 public class ReadRowsRetryTest {
-  private static final InstanceName instanceName = InstanceName.of("fake-project", "fake-instance");
-
-  private static final TableName tableName =
-      TableName.of(instanceName.getProject(), instanceName.getInstance(), "fake-table");
+  private static final String PROJECT_ID = "fake-project";
+  private static final String INSTANCE_ID = "fake-instance";
+  private static final String TABLE_ID = "fake-table";
 
   @Rule public GrpcServerRule serverRule = new GrpcServerRule();
   private TestBigtableService service;
@@ -70,7 +68,8 @@ public void setUp() throws IOException {
 
     BigtableDataSettings settings =
         BigtableDataSettings.newBuilder()
-            .setInstanceName(instanceName)
+            .setProjectId(PROJECT_ID)
+            .setInstanceId(INSTANCE_ID)
             .setCredentialsProvider(NoCredentialsProvider.create())
             .setTransportChannelProvider(
                 FixedTransportChannelProvider.create(
@@ -94,7 +93,7 @@ public void happyPathTest() {
             .respondWith("k1", "r1", "r2"));
 
     List actualResults =
-        getResults(Query.create(tableName.getTable()).rowKey("k1").range("r1", "r3"));
+        getResults(Query.create(TABLE_ID).rowKey("k1").range("r1", "r3"));
     Truth.assertThat(actualResults).containsExactly("k1", "r1", "r2").inOrder();
   }
 
@@ -112,7 +111,7 @@ public void immediateRetryTest() {
             .respondWith("k1", "r1", "r2"));
 
     List actualResults =
-        getResults(Query.create(tableName.getTable()).rowKey("k1").range("r1", "r3"));
+        getResults(Query.create(TABLE_ID).rowKey("k1").range("r1", "r3"));
     Truth.assertThat(actualResults).containsExactly("k1", "r1", "r2").inOrder();
   }
 
@@ -135,7 +134,7 @@ public void multipleRetryTest() {
     service.expectations.add(
         RpcExpectation.create().expectRequest(Range.open("r7", "r9")).respondWith("r8"));
 
-    List actualResults = getResults(Query.create(tableName.getTable()).range("r1", "r9"));
+    List actualResults = getResults(Query.create(TABLE_ID).range("r1", "r9"));
     Truth.assertThat(actualResults)
         .containsExactly("r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8")
         .inOrder();
@@ -156,7 +155,7 @@ public void rowLimitTest() {
             .respondWith("r2"));
 
     List actualResults =
-        getResults(Query.create(tableName.getTable()).range("r1", "r3").limit(2));
+        getResults(Query.create(TABLE_ID).range("r1", "r3").limit(2));
     Truth.assertThat(actualResults).containsExactly("r1", "r2").inOrder();
   }
 
@@ -172,7 +171,7 @@ public void errorAfterRowLimitMetTest() {
     // Second retry request is handled locally in ReadRowsRetryCompletedCallable
 
     List actualResults =
-        getResults(Query.create(tableName.getTable()).range("r1", "r3").limit(2));
+        getResults(Query.create(TABLE_ID).range("r1", "r3").limit(2));
 
     Truth.assertThat(actualResults).containsExactly("r1", "r2");
   }
@@ -189,7 +188,7 @@ public void errorAfterRequestCompleteTest() {
     // Second retry request is handled locally in ReadRowsRetryCompletedCallable
 
     List actualResults =
-        getResults(Query.create(tableName.getTable()).range("r1", "r3").rowKey("r4"));
+        getResults(Query.create(TABLE_ID).range("r1", "r3").rowKey("r4"));
 
     Truth.assertThat(actualResults).containsExactly("r2", "r4");
   }
@@ -204,7 +203,7 @@ public void pointTest() {
     service.expectations.add(RpcExpectation.create().expectRequest("r2").respondWith("r2"));
 
     List actualResults =
-        getResults(Query.create(tableName.getTable()).rowKey("r1").rowKey("r2"));
+        getResults(Query.create(TABLE_ID).rowKey("r1").rowKey("r2"));
     Truth.assertThat(actualResults).containsExactly("r1", "r2").inOrder();
   }
 
@@ -214,7 +213,7 @@ public void fullTableScanTest() {
         RpcExpectation.create().respondWith("r1").respondWithStatus(Code.UNAVAILABLE));
     service.expectations.add(
         RpcExpectation.create().expectRequest(Range.greaterThan("r1")).respondWith("r2"));
-    List actualResults = getResults(Query.create(tableName.getTable()));
+    List actualResults = getResults(Query.create(TABLE_ID));
     Truth.assertThat(actualResults).containsExactly("r1", "r2").inOrder();
   }
 
@@ -230,7 +229,7 @@ public void retryUnboundedStartTest() {
 
     List actualResults =
         getResults(
-            Query.create(tableName.getTable()).range(ByteStringRange.unbounded().endOpen("r9")));
+            Query.create(TABLE_ID).range(ByteStringRange.unbounded().endOpen("r9")));
     Truth.assertThat(actualResults).containsExactly("r1", "r2").inOrder();
   }
 
@@ -246,7 +245,7 @@ public void retryUnboundedEndTest() {
 
     List actualResults =
         getResults(
-            Query.create(tableName.getTable())
+            Query.create(TABLE_ID)
                 .range(ByteStringRange.unbounded().startClosed("r1")));
     Truth.assertThat(actualResults).containsExactly("r1", "r2").inOrder();
   }
@@ -261,7 +260,7 @@ public void retryWithLastScannedKeyTest() {
     service.expectations.add(
         RpcExpectation.create().expectRequest(Range.open("r5", "r9")).respondWith("r7"));
     List actualResults =
-        getResults(Query.create(tableName.getTable()).range(ByteStringRange.create("r1", "r9")));
+        getResults(Query.create(TABLE_ID).range(ByteStringRange.create("r1", "r9")));
     Truth.assertThat(actualResults).containsExactly("r7").inOrder();
   }
 
@@ -309,7 +308,9 @@ private static class RpcExpectation {
     List responses;
 
     private RpcExpectation() {
-      this.requestBuilder = ReadRowsRequest.newBuilder().setTableName(tableName.toString());
+      this.requestBuilder = ReadRowsRequest.newBuilder().setTableName(
+          NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)
+      );
       this.statusCode = Status.Code.OK;
       this.responses = Lists.newArrayList();
     }
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsUserCallableTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsUserCallableTest.java
index 8a0e2de9990c..d1e03df2c660 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsUserCallableTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsUserCallableTest.java
@@ -17,7 +17,6 @@
 
 import com.google.bigtable.v2.ReadRowsRequest;
 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.Query;
 import com.google.cloud.bigtable.data.v2.models.Row;
 import com.google.cloud.bigtable.gaxx.testing.FakeStreamingApi.ServerStreamingStashCallable;
@@ -29,7 +28,7 @@
 @RunWith(JUnit4.class)
 public class ReadRowsUserCallableTest {
   private static final RequestContext REQUEST_CONTEXT =
-      RequestContext.create(InstanceName.of("fake-project", "fake-instance"), "fake-profile");
+      RequestContext.create("fake-project", "fake-instance", "fake-profile");
 
   @Test
   public void testRequestConverted() {

From bc92d6d7834d32f3bb1a807afa08c3481108f0a6 Mon Sep 17 00:00:00 2001
From: Igor Bernstein 
Date: Wed, 26 Dec 2018 17:26:16 -0500
Subject: [PATCH 2/3] fix docs

---
 TESTING.md | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/TESTING.md b/TESTING.md
index 3c2cb1fc9cf8..a3375d13e45c 100644
--- a/TESTING.md
+++ b/TESTING.md
@@ -61,7 +61,9 @@ To use the `prod` environment:
     ```shell
     mvn verify -am -pl google-cloud-bigtable \
       -Dbigtable.env=prod \
-      -Dbigtable.table=projects/my-project/instances/my-instance/tables/my-table
+      -Dbigtable.project=my-project
+      -Dbigtable.instance=my-instance
+      -Dbigtable.table=my-table
     ```
 
 ### Testing code that uses Bigtable Admin
@@ -73,12 +75,11 @@ To run the tests:
 2. Download the [JSON service account credentials file][create-service-account] from the Google
    Developer's Console.
 3. Set the environment variable `GOOGLE_APPLICATION_CREDENTIALS` to the path of the credentials file
-4. Set the system properties `bigtable.project` and `bigtable.instance` to the project and instance
-   id of the instance you created earlier. Example:
+4. Set the system property `bigtable.instance` to the full instance name you
+    created earlier. Example:
     ```shell
     mvn verify -am -pl google-cloud-bigtable-admin \
-      -Dbigtable.project=my-project
-      -Dbigtable.instance=my-instance
+      -Dbigtable.instance=projects/my-project/instances/my-instance
     ```
 
 ### Testing code that uses Compute

From 7dbde8517f2d8c78ca9afb7002d9e95bfb2d47cf Mon Sep 17 00:00:00 2001
From: Igor Bernstein 
Date: Wed, 26 Dec 2018 20:33:02 -0500
Subject: [PATCH 3/3] format code

---
 .../bigtable/data/v2/BigtableDataClient.java  | 10 ++--
 .../data/v2/BigtableDataSettings.java         | 10 ++--
 .../bigtable/data/v2/internal/NameUtil.java   |  4 +-
 .../data/v2/internal/RequestContext.java      | 12 ++---
 .../bigtable/data/v2/models/BulkMutation.java |  6 +--
 .../v2/models/ConditionalRowMutation.java     |  4 +-
 .../bigtable/data/v2/models/InstanceName.java |  4 +-
 .../cloud/bigtable/data/v2/models/Query.java  |  4 +-
 .../data/v2/models/ReadModifyWriteRow.java    |  4 +-
 .../bigtable/data/v2/models/RowMutation.java  |  8 +---
 .../data/v2/stub/EnhancedBigtableStub.java    |  3 +-
 .../v2/stub/EnhancedBigtableStubSettings.java |  2 +-
 .../data/v2/stub/SampleRowKeysCallable.java   |  4 +-
 .../data/v2/BaseBigtableDataClientTest.java   | 17 ++-----
 .../data/v2/BigtableDataClientTest.java       | 24 ++++------
 .../bigtable/data/v2/it/MutateRowIT.java      |  3 +-
 .../bigtable/data/v2/it/SampleRowsIT.java     |  6 +--
 .../bigtable/data/v2/it/env/Emulator.java     |  8 ++--
 .../bigtable/data/v2/it/env/ProdEnv.java      |  6 +--
 .../stub/CheckAndMutateRowCallableTest.java   |  6 +--
 .../EnhancedBigtableStubSettingsTest.java     | 46 +++++++++++--------
 .../data/v2/stub/MutateRowCallableTest.java   |  2 +-
 .../stub/ReadModifyWriteRowCallableTest.java  |  5 +-
 .../data/v2/stub/ResourceHeaderTest.java      |  3 +-
 .../v2/stub/SampleRowKeysCallableTest.java    |  8 ++--
 .../MutateRowsBatchingDescriptorTest.java     |  7 ++-
 .../v2/stub/readrows/ReadRowsRetryTest.java   | 31 +++++--------
 27 files changed, 98 insertions(+), 149 deletions(-)

diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java
index b9a88f3e6eaa..6a71031b27ff 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java
@@ -121,10 +121,8 @@ public class BigtableDataClient implements AutoCloseable {
    * @throws IOException If any.
    */
   public static BigtableDataClient create(String projectId, String instanceId) throws IOException {
-    BigtableDataSettings settings = BigtableDataSettings.newBuilder()
-        .setProjectId(projectId)
-        .setInstanceId(instanceId)
-        .build();
+    BigtableDataSettings settings =
+        BigtableDataSettings.newBuilder().setProjectId(projectId).setInstanceId(instanceId).build();
     return create(settings);
   }
 
@@ -134,11 +132,11 @@ public static BigtableDataClient create(String projectId, String instanceId) thr
    * @param instanceName The instance to connect to.
    * @return A new client.
    * @throws IOException If any.
-   *
    * @deprecated Please use {@link #create(String, String)}.
    */
   @Deprecated
-  public static BigtableDataClient create(com.google.cloud.bigtable.data.v2.models.InstanceName instanceName) throws IOException {
+  public static BigtableDataClient create(
+      com.google.cloud.bigtable.data.v2.models.InstanceName instanceName) throws IOException {
     BigtableDataSettings settings =
         BigtableDataSettings.newBuilder().setInstanceName(instanceName).build();
     return create(settings);
diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java
index 53bf36f8180a..58991620a52b 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java
@@ -87,7 +87,7 @@ public String getInstanceId() {
     return getTypedStubSettings().getInstanceId();
   }
 
-  /** Returns the configured AppProfile id to use.  */
+  /** Returns the configured AppProfile id to use. */
   public String getAppProfileId() {
     return getTypedStubSettings().getAppProfileId();
   }
@@ -187,9 +187,7 @@ public Builder setProjectId(@Nonnull String projectId) {
       return this;
     }
 
-    /**
-     * Gets the project id that was previously set on this Builder.
-     */
+    /** Gets the project id that was previously set on this Builder. */
     public String getProjectId() {
       return getTypedStubSettings().getProjectId();
     }
@@ -203,9 +201,7 @@ public Builder setInstanceId(@Nonnull String instanceId) {
       return this;
     }
 
-    /**
-     * Gets the instance id that was previously set on this Builder.
-     */
+    /** Gets the instance id that was previously set on this Builder. */
     public String getInstanceId() {
       return getTypedStubSettings().getInstanceId();
     }
diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/NameUtil.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/NameUtil.java
index 11b1ce3538cf..c1118ed181c7 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/NameUtil.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/NameUtil.java
@@ -29,7 +29,9 @@ public class NameUtil {
   public static String formatInstanceName(@Nonnull String projectId, @Nonnull String instanceId) {
     return "projects/" + projectId + "/instances/" + instanceId;
   }
-  public static String formatTableName(@Nonnull String projectId, @Nonnull String instanceId, @Nonnull String tableId) {
+
+  public static String formatTableName(
+      @Nonnull String projectId, @Nonnull String instanceId, @Nonnull String tableId) {
     return formatInstanceName(projectId, instanceId) + "/tables/" + tableId;
   }
 }
diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RequestContext.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RequestContext.java
index 3df9b54ac79a..dd90f5b35086 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RequestContext.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RequestContext.java
@@ -32,23 +32,17 @@
 @AutoValue
 public abstract class RequestContext {
 
-  /**
-   * Creates a new instance of the {@link RequestContext}.
-   */
+  /** Creates a new instance of the {@link RequestContext}. */
   public static RequestContext create(String projectId, String instanceId, String appProfileId) {
     return new AutoValue_RequestContext(projectId, instanceId, appProfileId);
   }
 
-  /**
-   * @deprecated Please use {@link #create(String, String, String)}.
-   */
+  /** @deprecated Please use {@link #create(String, String, String)}. */
   @Deprecated
   public static RequestContext create(
       com.google.cloud.bigtable.data.v2.models.InstanceName instanceName, String appProfileId) {
     return new AutoValue_RequestContext(
-        instanceName.getProject(),
-        instanceName.getInstance(),
-        appProfileId);
+        instanceName.getProject(), instanceName.getInstance(), appProfileId);
   }
 
   /** The project id that the client is configured to target. */
diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/BulkMutation.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/BulkMutation.java
index d6040c11eae3..e8951a74475c 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/BulkMutation.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/BulkMutation.java
@@ -91,9 +91,9 @@ public BulkMutation add(@Nonnull ByteString rowKey, @Nonnull Mutation mutation)
 
   @InternalApi
   public MutateRowsRequest toProto(RequestContext requestContext) {
-    String tableName = NameUtil
-        .formatTableName(requestContext.getProjectId(), requestContext.getInstanceId(), tableId);
-
+    String tableName =
+        NameUtil.formatTableName(
+            requestContext.getProjectId(), requestContext.getInstanceId(), tableId);
 
     return builder
         .setTableName(tableName)
diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ConditionalRowMutation.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ConditionalRowMutation.java
index 1b79216aba79..15cc2be1f411 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ConditionalRowMutation.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ConditionalRowMutation.java
@@ -130,9 +130,7 @@ public CheckAndMutateRowRequest toProto(RequestContext requestContext) {
         "ConditionalRowMutations must have `then` or `otherwise` mutations.");
     String tableName =
         NameUtil.formatTableName(
-            requestContext.getProjectId(),
-            requestContext.getInstanceId(),
-            tableId);
+            requestContext.getProjectId(), requestContext.getInstanceId(), tableId);
     return builder
         .setTableName(tableName.toString())
         .setAppProfileId(requestContext.getAppProfileId())
diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/InstanceName.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/InstanceName.java
index 3616cd3d3b16..fc63cdaf68e9 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/InstanceName.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/InstanceName.java
@@ -25,9 +25,7 @@
 
 // Copied from com.google.bigtable.admin.v2
 
-/**
- * @deprecated Please use project id and instance id strings instead.
- */
+/** @deprecated Please use project id and instance id strings instead. */
 @Deprecated
 public class InstanceName implements ResourceName {
   private static final PathTemplate PATH_TEMPLATE =
diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java
index 39744811b82a..a879df449459 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java
@@ -248,9 +248,7 @@ public ByteStringRange getBound() {
   public ReadRowsRequest toProto(RequestContext requestContext) {
     String tableName =
         NameUtil.formatTableName(
-            requestContext.getProjectId(),
-            requestContext.getInstanceId(),
-            tableId);
+            requestContext.getProjectId(), requestContext.getInstanceId(), tableId);
 
     return builder
         .setTableName(tableName)
diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRow.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRow.java
index fdcad875bd67..26253b9cbcc9 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRow.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRow.java
@@ -130,9 +130,7 @@ public ReadModifyWriteRow increment(
   public ReadModifyWriteRowRequest toProto(RequestContext requestContext) {
     String tableName =
         NameUtil.formatTableName(
-            requestContext.getProjectId(),
-            requestContext.getInstanceId(),
-            tableId);
+            requestContext.getProjectId(), requestContext.getInstanceId(), tableId);
 
     return builder
         .setTableName(tableName)
diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowMutation.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowMutation.java
index ecec5edc9e64..8e6885ea6918 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowMutation.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowMutation.java
@@ -160,9 +160,7 @@ public RowMutation deleteRow() {
   public MutateRowRequest toProto(RequestContext requestContext) {
     String tableName =
         NameUtil.formatTableName(
-            requestContext.getProjectId(),
-            requestContext.getInstanceId(),
-            tableId);
+            requestContext.getProjectId(), requestContext.getInstanceId(), tableId);
 
     return MutateRowRequest.newBuilder()
         .setAppProfileId(requestContext.getAppProfileId())
@@ -180,9 +178,7 @@ public MutateRowRequest toProto(RequestContext requestContext) {
   public MutateRowsRequest toBulkProto(RequestContext requestContext) {
     String tableName =
         NameUtil.formatTableName(
-            requestContext.getProjectId(),
-            requestContext.getInstanceId(),
-            tableId);
+            requestContext.getProjectId(), requestContext.getInstanceId(), tableId);
 
     return MutateRowsRequest.newBuilder()
         .setAppProfileId(requestContext.getAppProfileId())
diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java
index cf4e57fa99bc..894100c1f809 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java
@@ -148,7 +148,8 @@ public static EnhancedBigtableStub create(EnhancedBigtableStubSettings settings)
     this.clientContext = clientContext;
     this.stub = stub;
     this.requestContext =
-        RequestContext.create(settings.getProjectId(), settings.getInstanceId(), settings.getAppProfileId());
+        RequestContext.create(
+            settings.getProjectId(), settings.getInstanceId(), settings.getAppProfileId());
 
     readRowsCallable = createReadRowsCallable(new DefaultRowAdapter());
     sampleRowKeysCallable = createSampleRowKeysCallable();
diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java
index 337feca414f1..e3977e520fa6 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java
@@ -361,7 +361,7 @@ public Builder setProjectId(@Nonnull String projectId) {
       return this;
     }
 
-    /** Gets the project id  of the target instance that was previously set on this Builder. */
+    /** Gets the project id of the target instance that was previously set on this Builder. */
     public String getProjectId() {
       return projectId;
     }
diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallable.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallable.java
index dbef3d475312..7658e414922b 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallable.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallable.java
@@ -46,9 +46,7 @@ class SampleRowKeysCallable extends UnaryCallable> {
   public ApiFuture> futureCall(String tableId, ApiCallContext context) {
     String tableName =
         NameUtil.formatTableName(
-            requestContext.getProjectId(),
-            requestContext.getInstanceId(),
-            tableId);
+            requestContext.getProjectId(), requestContext.getInstanceId(), tableId);
 
     SampleRowKeysRequest request =
         SampleRowKeysRequest.newBuilder()
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BaseBigtableDataClientTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BaseBigtableDataClientTest.java
index 832d7523fd4f..0b55cb6ed4b0 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BaseBigtableDataClientTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BaseBigtableDataClientTest.java
@@ -40,7 +40,6 @@
 import com.google.bigtable.v2.RowFilter;
 import com.google.bigtable.v2.SampleRowKeysRequest;
 import com.google.bigtable.v2.SampleRowKeysResponse;
-import com.google.bigtable.v2.TableName;
 import com.google.cloud.bigtable.data.v2.internal.NameUtil;
 import com.google.protobuf.ByteString;
 import com.google.protobuf.GeneratedMessageV3;
@@ -103,8 +102,7 @@ public void readRowsTest() throws Exception {
         ReadRowsResponse.newBuilder().setLastScannedRowKey(lastScannedRowKey).build();
     mockBigtable.addResponse(expectedResponse);
     String tableName = NameUtil.formatTableName("[PROJECT]", "[INSTANCE]", "[TABLE]");
-    ReadRowsRequest request =
-        ReadRowsRequest.newBuilder().setTableName(tableName).build();
+    ReadRowsRequest request = ReadRowsRequest.newBuilder().setTableName(tableName).build();
 
     MockStreamObserver responseObserver = new MockStreamObserver<>();
 
@@ -122,8 +120,7 @@ public void readRowsExceptionTest() throws Exception {
     StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
     mockBigtable.addException(exception);
     String tableName = NameUtil.formatTableName("[PROJECT]", "[INSTANCE]", "[TABLE]");
-    ReadRowsRequest request =
-        ReadRowsRequest.newBuilder().setTableName(tableName).build();
+    ReadRowsRequest request = ReadRowsRequest.newBuilder().setTableName(tableName).build();
 
     MockStreamObserver responseObserver = new MockStreamObserver<>();
 
@@ -240,10 +237,7 @@ public void mutateRowsTest() throws Exception {
     String tableName = NameUtil.formatTableName("[PROJECT]", "[INSTANCE]", "[TABLE]");
     List entries = new ArrayList<>();
     MutateRowsRequest request =
-        MutateRowsRequest.newBuilder()
-            .setTableName(tableName)
-            .addAllEntries(entries)
-            .build();
+        MutateRowsRequest.newBuilder().setTableName(tableName).addAllEntries(entries).build();
 
     MockStreamObserver responseObserver = new MockStreamObserver<>();
 
@@ -264,10 +258,7 @@ public void mutateRowsExceptionTest() throws Exception {
     String tableName = NameUtil.formatTableName("[PROJECT]", "[INSTANCE]", "[TABLE]");
     List entries = new ArrayList<>();
     MutateRowsRequest request =
-        MutateRowsRequest.newBuilder()
-            .setTableName(tableName)
-            .addAllEntries(entries)
-            .build();
+        MutateRowsRequest.newBuilder().setTableName(tableName).addAllEntries(entries).build();
 
     MockStreamObserver responseObserver = new MockStreamObserver<>();
 
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientTest.java
index 34049e2ba94b..7122b2a40204 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientTest.java
@@ -108,8 +108,7 @@ public void proxyReadRowAsyncTest() {
     ArgumentCaptor requestCaptor = ArgumentCaptor.forClass(Query.class);
     Mockito.verify(mockReadRowsCallable.first()).futureCall(requestCaptor.capture());
 
-    RequestContext ctx =
-        RequestContext.create("fake-project", "fake-instance", "fake-profile");
+    RequestContext ctx = RequestContext.create("fake-project", "fake-instance", "fake-profile");
     // NOTE: limit(1) is added by the mocked first() call, so it's not tested here
     assertThat(requestCaptor.getValue().toProto(ctx))
         .isEqualTo(
@@ -126,8 +125,7 @@ public void proxyReadRowStrAsyncTest() {
     ArgumentCaptor requestCaptor = ArgumentCaptor.forClass(Query.class);
     Mockito.verify(mockReadRowsCallable.first()).futureCall(requestCaptor.capture());
 
-    RequestContext ctx =
-        RequestContext.create("fake-project", "fake-instance", "fake-profile");
+    RequestContext ctx = RequestContext.create("fake-project", "fake-instance", "fake-profile");
     // NOTE: limit(1) is added by the mocked first() call, so it's not tested here
     assertThat(requestCaptor.getValue().toProto(ctx))
         .isEqualTo(
@@ -150,8 +148,7 @@ public void readRowFilterAsyncTest() {
     ArgumentCaptor requestCaptor = ArgumentCaptor.forClass(Query.class);
     Mockito.verify(mockReadRowsCallable.first()).futureCall(requestCaptor.capture());
 
-    RequestContext ctx =
-        RequestContext.create("fake-project", "fake-instance", "fake-profile");
+    RequestContext ctx = RequestContext.create("fake-project", "fake-instance", "fake-profile");
     // NOTE: limit(1) is added by the mocked first() call, so it's not tested here
     assertThat(requestCaptor.getValue().toProto(ctx))
         .isEqualTo(
@@ -180,8 +177,7 @@ public void readRowFilterStrAsyncTest() {
     ArgumentCaptor requestCaptor = ArgumentCaptor.forClass(Query.class);
     Mockito.verify(mockReadRowsCallable.first()).futureCall(requestCaptor.capture());
 
-    RequestContext ctx =
-        RequestContext.create("fake-project", "fake-instance", "fake-profile");
+    RequestContext ctx = RequestContext.create("fake-project", "fake-instance", "fake-profile");
     // NOTE: limit(1) is added by the mocked first() call, so it's not tested here
     assertThat(requestCaptor.getValue().toProto(ctx))
         .isEqualTo(
@@ -210,8 +206,7 @@ public void readRowTest() {
     ArgumentCaptor requestCaptor = ArgumentCaptor.forClass(Query.class);
     Mockito.verify(mockReadRowsCallable.first()).futureCall(requestCaptor.capture());
 
-    RequestContext ctx =
-        RequestContext.create("fake-project", "fake-instance", "fake-profile");
+    RequestContext ctx = RequestContext.create("fake-project", "fake-instance", "fake-profile");
     // NOTE: limit(1) is added by the mocked first() call, so it's not tested here
     assertThat(requestCaptor.getValue().toProto(ctx))
         .isEqualTo(
@@ -234,8 +229,7 @@ public void readRowStrTest() {
     ArgumentCaptor requestCaptor = ArgumentCaptor.forClass(Query.class);
     Mockito.verify(mockReadRowsCallable.first()).futureCall(requestCaptor.capture());
 
-    RequestContext ctx =
-        RequestContext.create("fake-project", "fake-instance", "fake-profile");
+    RequestContext ctx = RequestContext.create("fake-project", "fake-instance", "fake-profile");
     // NOTE: limit(1) is added by the mocked first() call, so it's not tested here
     assertThat(requestCaptor.getValue().toProto(ctx))
         .isEqualTo(
@@ -264,8 +258,7 @@ public void readRowFilterTest() {
     ArgumentCaptor requestCaptor = ArgumentCaptor.forClass(Query.class);
     Mockito.verify(mockReadRowsCallable.first()).futureCall(requestCaptor.capture());
 
-    RequestContext ctx =
-        RequestContext.create("fake-project", "fake-instance", "fake-profile");
+    RequestContext ctx = RequestContext.create("fake-project", "fake-instance", "fake-profile");
     // NOTE: limit(1) is added by the mocked first() call, so it's not tested here
     assertThat(requestCaptor.getValue().toProto(ctx))
         .isEqualTo(
@@ -300,8 +293,7 @@ public void readRowStrFilterTest() {
     ArgumentCaptor requestCaptor = ArgumentCaptor.forClass(Query.class);
     Mockito.verify(mockReadRowsCallable.first()).futureCall(requestCaptor.capture());
 
-    RequestContext ctx =
-        RequestContext.create("fake-project", "fake-instance", "fake-profile");
+    RequestContext ctx = RequestContext.create("fake-project", "fake-instance", "fake-profile");
     // NOTE: limit(1) is added by the mocked first() call, so it's not tested here
     assertThat(requestCaptor.getValue().toProto(ctx))
         .isEqualTo(
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/MutateRowIT.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/MutateRowIT.java
index 3e5e0f9a2ce1..545028e14a58 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/MutateRowIT.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/MutateRowIT.java
@@ -51,8 +51,7 @@ public void test() throws Exception {
         .env()
         .getDataClient()
         .mutateRowAsync(
-            RowMutation.create(testEnvRule.env().getTableId(), rowKey)
-                .deleteCells(familyId, "q2"))
+            RowMutation.create(testEnvRule.env().getTableId(), rowKey).deleteCells(familyId, "q2"))
         .get(1, TimeUnit.MINUTES);
 
     Row row =
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/SampleRowsIT.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/SampleRowsIT.java
index 4a7b5341192a..20bba81ea4ae 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/SampleRowsIT.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/SampleRowsIT.java
@@ -47,15 +47,13 @@ public void test() throws InterruptedException, ExecutionException, TimeoutExcep
       ApiFuture future =
           client.mutateRowAsync(
               RowMutation.create(
-                      testEnvRule.env().getTableId(),
-                      testEnvRule.env().getRowPrefix() + "-" + i)
+                      testEnvRule.env().getTableId(), testEnvRule.env().getRowPrefix() + "-" + i)
                   .setCell(testEnvRule.env().getFamilyId(), "", "value"));
       futures.add(future);
     }
     ApiFutures.allAsList(futures).get(1, TimeUnit.MINUTES);
 
-    ApiFuture> future =
-        client.sampleRowKeysAsync(testEnvRule.env().getTableId());
+    ApiFuture> future = client.sampleRowKeysAsync(testEnvRule.env().getTableId());
 
     List results = future.get(1, TimeUnit.MINUTES);
 
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/Emulator.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/Emulator.java
index 258ed1e59bfe..d8e7b00b0c4f 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/Emulator.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/Emulator.java
@@ -101,10 +101,10 @@ void start() throws Exception {
     dataClient =
         BigtableDataClient.create(
             configureClient(
-                BigtableDataSettings.newBuilder()
-                    .setProjectId(PROJECT_ID)
-                    .setInstanceId(INSTANCE_ID)
-            ).build());
+                    BigtableDataSettings.newBuilder()
+                        .setProjectId(PROJECT_ID)
+                        .setInstanceId(INSTANCE_ID))
+                .build());
 
     Runtime.getRuntime()
         .addShutdownHook(
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/ProdEnv.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/ProdEnv.java
index c221fb380784..6f3f333350dd 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/ProdEnv.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/ProdEnv.java
@@ -57,8 +57,7 @@ static ProdEnv fromSystemProperties() {
     return new ProdEnv(
         getRequiredProperty(PROJECT_PROPERTY_NAME),
         getRequiredProperty(INSTANCE_PROPERTY_NAME),
-        getRequiredProperty(TABLE_PROPERTY_NAME)
-    );
+        getRequiredProperty(TABLE_PROPERTY_NAME));
   }
 
   public ProdEnv(String projectId, String instanceId, String tableId) {
@@ -116,8 +115,7 @@ private void deleteRows() throws InterruptedException, ExecutionException, Timeo
     ServerStream rows = dataClient.readRows(query);
     for (Row row : rows) {
       ApiFuture future =
-          dataClient.mutateRowAsync(
-              RowMutation.create(tableId, row.getKey()).deleteRow());
+          dataClient.mutateRowAsync(RowMutation.create(tableId, row.getKey()).deleteRow());
       futures.add(future);
     }
 
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/CheckAndMutateRowCallableTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/CheckAndMutateRowCallableTest.java
index ceb7b8d90001..5441f1d1f8ec 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/CheckAndMutateRowCallableTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/CheckAndMutateRowCallableTest.java
@@ -42,8 +42,8 @@
 @RunWith(JUnit4.class)
 public class CheckAndMutateRowCallableTest {
 
-  private final RequestContext requestContext = RequestContext
-      .create("my-project", "my-instance", "my-app-profile");
+  private final RequestContext requestContext =
+      RequestContext.create("my-project", "my-instance", "my-app-profile");
   private FakeCallable inner;
   private CheckAndMutateRowCallable callable;
 
@@ -63,7 +63,7 @@ public void requestIsCorrect() {
             CheckAndMutateRowRequest.newBuilder()
                 .setTableName(
                     NameUtil.formatTableName(
-                        requestContext.getProjectId(), requestContext.getInstanceId(),"my-table"))
+                        requestContext.getProjectId(), requestContext.getInstanceId(), "my-table"))
                 .setRowKey(ByteString.copyFromUtf8("row-key"))
                 .setAppProfileId(requestContext.getAppProfileId())
                 .addTrueMutations(
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettingsTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettingsTest.java
index d2709cdbbe88..718ee20f26c3 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettingsTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettingsTest.java
@@ -146,9 +146,10 @@ public void multipleChannelsByDefaultTest() {
     String dummyProjectId = "my-project";
     String dummyInstanceId = "my-instance";
 
-    EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder()
-        .setProjectId(dummyProjectId)
-        .setInstanceId(dummyInstanceId);
+    EnhancedBigtableStubSettings.Builder builder =
+        EnhancedBigtableStubSettings.newBuilder()
+            .setProjectId(dummyProjectId)
+            .setInstanceId(dummyInstanceId);
 
     InstantiatingGrpcChannelProvider provider =
         (InstantiatingGrpcChannelProvider) builder.getTransportChannelProvider();
@@ -161,9 +162,10 @@ public void readRowsIsNotLostTest() {
     String dummyProjectId = "my-project";
     String dummyInstanceId = "my-instance";
 
-    EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder()
-        .setProjectId(dummyProjectId)
-        .setInstanceId(dummyInstanceId);
+    EnhancedBigtableStubSettings.Builder builder =
+        EnhancedBigtableStubSettings.newBuilder()
+            .setProjectId(dummyProjectId)
+            .setInstanceId(dummyInstanceId);
 
     RetrySettings retrySettings =
         RetrySettings.newBuilder()
@@ -214,9 +216,10 @@ public void sampleRowKeysSettingsAreNotLostTest() {
     String dummyProjectId = "my-project";
     String dummyInstanceId = "my-instance";
 
-    EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder()
-        .setProjectId(dummyProjectId)
-        .setInstanceId(dummyInstanceId);
+    EnhancedBigtableStubSettings.Builder builder =
+        EnhancedBigtableStubSettings.newBuilder()
+            .setProjectId(dummyProjectId)
+            .setInstanceId(dummyInstanceId);
 
     RetrySettings retrySettings =
         RetrySettings.newBuilder()
@@ -260,9 +263,10 @@ public void mutateRowSettingsAreNotLostTest() {
     String dummyProjectId = "my-project";
     String dummyInstanceId = "my-instance";
 
-    EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder()
-        .setProjectId(dummyProjectId)
-        .setInstanceId(dummyInstanceId);
+    EnhancedBigtableStubSettings.Builder builder =
+        EnhancedBigtableStubSettings.newBuilder()
+            .setProjectId(dummyProjectId)
+            .setInstanceId(dummyInstanceId);
 
     RetrySettings retrySettings =
         RetrySettings.newBuilder()
@@ -306,9 +310,10 @@ public void bulkMutateRowsSettingsAreNotLostTest() {
     String dummyProjectId = "my-project";
     String dummyInstanceId = "my-instance";
 
-    EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder()
-        .setProjectId(dummyProjectId)
-        .setInstanceId(dummyInstanceId);
+    EnhancedBigtableStubSettings.Builder builder =
+        EnhancedBigtableStubSettings.newBuilder()
+            .setProjectId(dummyProjectId)
+            .setInstanceId(dummyInstanceId);
 
     RetrySettings retrySettings =
         RetrySettings.newBuilder()
@@ -364,10 +369,10 @@ public void mutateRowsHasSaneDefaultsTest() {
     assertThat(builder.getBatchingSettings().getRequestByteThreshold())
         .isLessThan(256L * 1024 * 1024);
     assertThat(
-        builder.getBatchingSettings().getFlowControlSettings().getMaxOutstandingElementCount())
+            builder.getBatchingSettings().getFlowControlSettings().getMaxOutstandingElementCount())
         .isLessThan(10_000L);
     assertThat(
-        builder.getBatchingSettings().getFlowControlSettings().getMaxOutstandingRequestBytes())
+            builder.getBatchingSettings().getFlowControlSettings().getMaxOutstandingRequestBytes())
         .isLessThan(512L * 1024 * 1024);
   }
 
@@ -376,9 +381,10 @@ public void checkAndMutateRowSettingsAreNotLostTest() {
     String dummyProjectId = "my-project";
     String dummyInstanceId = "my-instance";
 
-    EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder()
-        .setProjectId(dummyProjectId)
-        .setInstanceId(dummyInstanceId);
+    EnhancedBigtableStubSettings.Builder builder =
+        EnhancedBigtableStubSettings.newBuilder()
+            .setProjectId(dummyProjectId)
+            .setInstanceId(dummyInstanceId);
 
     RetrySettings retrySettings = RetrySettings.newBuilder().build();
     builder
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/MutateRowCallableTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/MutateRowCallableTest.java
index eb83c30b68ef..2b688292576b 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/MutateRowCallableTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/MutateRowCallableTest.java
@@ -46,7 +46,7 @@ public void setUp() {
     innerMutation = ArgumentCaptor.forClass(MutateRowRequest.class);
     innerResult = SettableApiFuture.create();
     Mockito.when(
-        innerCallable.futureCall(innerMutation.capture(), Mockito.any(ApiCallContext.class)))
+            innerCallable.futureCall(innerMutation.capture(), Mockito.any(ApiCallContext.class)))
         .thenReturn(innerResult);
   }
 
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/ReadModifyWriteRowCallableTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/ReadModifyWriteRowCallableTest.java
index 96fc5401619c..76dabd159303 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/ReadModifyWriteRowCallableTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/ReadModifyWriteRowCallableTest.java
@@ -65,8 +65,9 @@ public void requestIsCorrect() {
     assertThat(inner.request)
         .isEqualTo(
             ReadModifyWriteRowRequest.newBuilder()
-                .setTableName(NameUtil.formatTableName(
-                    requestContext.getProjectId(), requestContext.getInstanceId(), "my-table"))
+                .setTableName(
+                    NameUtil.formatTableName(
+                        requestContext.getProjectId(), requestContext.getInstanceId(), "my-table"))
                 .setAppProfileId(requestContext.getAppProfileId())
                 .setRowKey(ByteString.copyFromUtf8("my-key"))
                 .addRules(
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/ResourceHeaderTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/ResourceHeaderTest.java
index 3561deb08b80..8acb7cde9b17 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/ResourceHeaderTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/ResourceHeaderTest.java
@@ -118,8 +118,7 @@ public void mutateRowsTest() throws TimeoutException, InterruptedException {
   @Test
   public void checkAndMutateRowTest() {
     client.checkAndMutateRowAsync(
-        ConditionalRowMutation.create(TABLE_ID, "fake-key")
-            .then(Mutation.create().deleteRow()));
+        ConditionalRowMutation.create(TABLE_ID, "fake-key").then(Mutation.create().deleteRow()));
     verifyHeaderSent();
   }
 
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallableTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallableTest.java
index f363679c772d..40a30d326393 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallableTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallableTest.java
@@ -60,11 +60,9 @@ public void requestIsCorrect() {
     assertThat(inner.request)
         .isEqualTo(
             SampleRowKeysRequest.newBuilder()
-                .setTableName(NameUtil
-                    .formatTableName(
-                        requestContext.getProjectId(),
-                        requestContext.getInstanceId(),
-                        "my-table"))
+                .setTableName(
+                    NameUtil.formatTableName(
+                        requestContext.getProjectId(), requestContext.getInstanceId(), "my-table"))
                 .setAppProfileId(requestContext.getAppProfileId())
                 .build());
   }
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsBatchingDescriptorTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsBatchingDescriptorTest.java
index 07cd2ad375c3..3178e82894d1 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsBatchingDescriptorTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsBatchingDescriptorTest.java
@@ -77,8 +77,7 @@ public void countElementsTest() {
   public void partitionKeyTest() {
     String myTableName = NameUtil.formatTableName("my-project", "my-instance", "my-table");
 
-    MutateRowsRequest request =
-        createRequest(2).toBuilder().setTableName(myTableName).build();
+    MutateRowsRequest request = createRequest(2).toBuilder().setTableName(myTableName).build();
 
     PartitionKey actual = descriptor.getBatchPartitionKey(request);
     assertThat(actual).isEqualTo(new PartitionKey(myTableName));
@@ -206,8 +205,8 @@ public void splitResponseOkTest()
 
   private static MutateRowsRequest createRequest(int count) {
     MutateRowsRequest.Builder request =
-        MutateRowsRequest.newBuilder().setTableName(
-            NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID));
+        MutateRowsRequest.newBuilder()
+            .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID));
 
     for (int i = 0; i < count; i++) {
       Builder entry =
diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryTest.java
index e0c3707d7ef3..12c01275cfe1 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryTest.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryTest.java
@@ -92,8 +92,7 @@ public void happyPathTest() {
             .expectRequest(Range.closedOpen("r1", "r3"))
             .respondWith("k1", "r1", "r2"));
 
-    List actualResults =
-        getResults(Query.create(TABLE_ID).rowKey("k1").range("r1", "r3"));
+    List actualResults = getResults(Query.create(TABLE_ID).rowKey("k1").range("r1", "r3"));
     Truth.assertThat(actualResults).containsExactly("k1", "r1", "r2").inOrder();
   }
 
@@ -110,8 +109,7 @@ public void immediateRetryTest() {
             .expectRequest(Range.closedOpen("r1", "r3"))
             .respondWith("k1", "r1", "r2"));
 
-    List actualResults =
-        getResults(Query.create(TABLE_ID).rowKey("k1").range("r1", "r3"));
+    List actualResults = getResults(Query.create(TABLE_ID).rowKey("k1").range("r1", "r3"));
     Truth.assertThat(actualResults).containsExactly("k1", "r1", "r2").inOrder();
   }
 
@@ -154,8 +152,7 @@ public void rowLimitTest() {
             .expectRowLimit(1)
             .respondWith("r2"));
 
-    List actualResults =
-        getResults(Query.create(TABLE_ID).range("r1", "r3").limit(2));
+    List actualResults = getResults(Query.create(TABLE_ID).range("r1", "r3").limit(2));
     Truth.assertThat(actualResults).containsExactly("r1", "r2").inOrder();
   }
 
@@ -170,8 +167,7 @@ public void errorAfterRowLimitMetTest() {
 
     // Second retry request is handled locally in ReadRowsRetryCompletedCallable
 
-    List actualResults =
-        getResults(Query.create(TABLE_ID).range("r1", "r3").limit(2));
+    List actualResults = getResults(Query.create(TABLE_ID).range("r1", "r3").limit(2));
 
     Truth.assertThat(actualResults).containsExactly("r1", "r2");
   }
@@ -187,8 +183,7 @@ public void errorAfterRequestCompleteTest() {
 
     // Second retry request is handled locally in ReadRowsRetryCompletedCallable
 
-    List actualResults =
-        getResults(Query.create(TABLE_ID).range("r1", "r3").rowKey("r4"));
+    List actualResults = getResults(Query.create(TABLE_ID).range("r1", "r3").rowKey("r4"));
 
     Truth.assertThat(actualResults).containsExactly("r2", "r4");
   }
@@ -202,8 +197,7 @@ public void pointTest() {
             .respondWithStatus(Code.UNAVAILABLE));
     service.expectations.add(RpcExpectation.create().expectRequest("r2").respondWith("r2"));
 
-    List actualResults =
-        getResults(Query.create(TABLE_ID).rowKey("r1").rowKey("r2"));
+    List actualResults = getResults(Query.create(TABLE_ID).rowKey("r1").rowKey("r2"));
     Truth.assertThat(actualResults).containsExactly("r1", "r2").inOrder();
   }
 
@@ -228,8 +222,7 @@ public void retryUnboundedStartTest() {
         RpcExpectation.create().expectRequest(Range.open("r1", "r9")).respondWith("r2"));
 
     List actualResults =
-        getResults(
-            Query.create(TABLE_ID).range(ByteStringRange.unbounded().endOpen("r9")));
+        getResults(Query.create(TABLE_ID).range(ByteStringRange.unbounded().endOpen("r9")));
     Truth.assertThat(actualResults).containsExactly("r1", "r2").inOrder();
   }
 
@@ -244,9 +237,7 @@ public void retryUnboundedEndTest() {
         RpcExpectation.create().expectRequest(Range.greaterThan("r1")).respondWith("r2"));
 
     List actualResults =
-        getResults(
-            Query.create(TABLE_ID)
-                .range(ByteStringRange.unbounded().startClosed("r1")));
+        getResults(Query.create(TABLE_ID).range(ByteStringRange.unbounded().startClosed("r1")));
     Truth.assertThat(actualResults).containsExactly("r1", "r2").inOrder();
   }
 
@@ -308,9 +299,9 @@ private static class RpcExpectation {
     List responses;
 
     private RpcExpectation() {
-      this.requestBuilder = ReadRowsRequest.newBuilder().setTableName(
-          NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)
-      );
+      this.requestBuilder =
+          ReadRowsRequest.newBuilder()
+              .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID));
       this.statusCode = Status.Code.OK;
       this.responses = Lists.newArrayList();
     }