Repository: GoogleCloudPlatform/cloud-bigtable-client
Pull request #2044 (2019-01-08 17:29:45)

Fixing compilation problems in master
The problems were caused by #2043

rahulKQL: Thank you for the correction, I was working on the [same.](https://github.com/rahulKQL/cloud-bigtable-client/commit/8f8c2aec73dbc0c146b2bf86f7c9731025d18eab).

Patch:
diff --git a/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableTableAdminClientWrapper.java b/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableTableAdminClientWrapper.java
index 8d61273d6..923b0db64 100644
--- a/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableTableAdminClientWrapper.java
+++ b/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableTableAdminClientWrapper.java
@@ -50,15 +50,14 @@ public class BigtableTableAdminClientWrapper implements IBigtableTableAdminClien
     Preconditions.checkNotNull(adminClient);
     Preconditions.checkNotNull(options);
     this.adminClient = adminClient;
-    this.instanceName = new BigtableInstanceName(options.getProjectId(),
-        options.getInstanceId());
+    this.instanceName = options.getInstanceName();
   }
 
   /** {@inheritDoc} */
   @Override
   public Table createTable(CreateTableRequest request) {
     com.google.bigtable.admin.v2.CreateTableRequest requestProto =
-        request.toProto(instanceName.toAdminInstanceName());
+        request.toProto(instanceName.getProjectId(), instanceName.getInstanceId());
     adminClient.createTable(requestProto);
 
     return getTable(requestProto.getTableId());
@@ -68,7 +67,7 @@ public class BigtableTableAdminClientWrapper implements IBigtableTableAdminClien
   @Override
   public ListenableFuture<Table> createTableAsync(CreateTableRequest request) {
     com.google.bigtable.admin.v2.CreateTableRequest requestProto =
-        request.toProto(instanceName.toAdminInstanceName());
+        request.toProto(instanceName.getProjectId(), instanceName.getInstanceId());
 
     return Futures.transform(adminClient.createTableAsync(requestProto),
         new Function<com.google.bigtable.admin.v2.Table, Table>() {
@@ -174,7 +173,7 @@ public class BigtableTableAdminClientWrapper implements IBigtableTableAdminClien
   @Override
   public Table modifyFamilies(ModifyColumnFamiliesRequest request) {
     com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest modifyColumnRequestProto =
-        request.toProto(instanceName.toAdminInstanceName());
+        request.toProto(instanceName.getProjectId(), instanceName.getInstanceId());
 
     return Table.fromProto(adminClient.modifyColumnFamily(modifyColumnRequestProto));
   }
@@ -183,7 +182,7 @@ public class BigtableTableAdminClientWrapper implements IBigtableTableAdminClien
   @Override
   public ListenableFuture<Table> modifyFamiliesAsync(ModifyColumnFamiliesRequest request) {
     com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest modifyColumnRequestProto =
-        request.toProto(instanceName.toAdminInstanceName());
+        request.toProto(instanceName.getProjectId(), instanceName.getInstanceId());
 
     return Futures.transform(adminClient.modifyColumnFamilyAsync(modifyColumnRequestProto),
         new Function<com.google.bigtable.admin.v2.Table, Table>() {


Test patch:
diff --git a/bigtable-client-core-parent/bigtable-client-core/src/test/java/com/google/cloud/bigtable/grpc/TestBigtableTableAdminClientWrapper.java b/bigtable-client-core-parent/bigtable-client-core/src/test/java/com/google/cloud/bigtable/grpc/TestBigtableTableAdminClientWrapper.java
index f6a4d08fb..adc4a759c 100644
--- a/bigtable-client-core-parent/bigtable-client-core/src/test/java/com/google/cloud/bigtable/grpc/TestBigtableTableAdminClientWrapper.java
+++ b/bigtable-client-core-parent/bigtable-client-core/src/test/java/com/google/cloud/bigtable/grpc/TestBigtableTableAdminClientWrapper.java
@@ -82,12 +82,12 @@ public class TestBigtableTableAdminClientWrapper {
     CreateTableRequest request = CreateTableRequest.of(TABLE_ID);
     GetTableRequest getTableRequest = GetTableRequest.newBuilder().setName(TABLE_NAME).build();
 
-    doNothing().when(mockAdminClient).createTable(request.toProto(INSTANCE_NAME.toAdminInstanceName()));
+    doNothing().when(mockAdminClient).createTable(request.toProto(PROJECT_ID, INSTANCE_ID));
     when(mockAdminClient.getTable(getTableRequest)).thenReturn(createTableData());
     Table response = clientWrapper.createTable(request);
 
     assertEquals(Table.fromProto(createTableData()), response);
-    verify(mockAdminClient).createTable(request.toProto(INSTANCE_NAME.toAdminInstanceName()));
+    verify(mockAdminClient).createTable(request.toProto(PROJECT_ID, INSTANCE_ID));
     verify(mockAdminClient).getTable(getTableRequest);
   }
 
@@ -95,12 +95,12 @@ public class TestBigtableTableAdminClientWrapper {
   public void testCreateTableAsync() throws Exception{
     CreateTableRequest request = CreateTableRequest.of(TABLE_ID);
 
-    when(mockAdminClient.createTableAsync(request.toProto(INSTANCE_NAME.toAdminInstanceName())))
+    when(mockAdminClient.createTableAsync(request.toProto(PROJECT_ID, INSTANCE_ID)))
         .thenReturn(immediateFuture(createTableData()));
     ListenableFuture<Table> response = clientWrapper.createTableAsync(request);
 
     assertEquals(Table.fromProto(createTableData()), response.get());
-    verify(mockAdminClient).createTableAsync(request.toProto(INSTANCE_NAME.toAdminInstanceName()));
+    verify(mockAdminClient).createTableAsync(request.toProto(PROJECT_ID, INSTANCE_ID));
   }
 
   @Test
@@ -191,12 +191,12 @@ public class TestBigtableTableAdminClientWrapper {
             .addFamily(COLUMN_FAMILY, GCRULES.maxVersions(1))
             .updateFamily(UPDATE_FAMILY, GCRULES.defaultRule());
 
-    when(mockAdminClient.modifyColumnFamily(request.toProto(INSTANCE_NAME.toAdminInstanceName())))
+    when(mockAdminClient.modifyColumnFamily(request.toProto(PROJECT_ID, INSTANCE_ID)))
         .thenReturn(createTableData());
     Table response = clientWrapper.modifyFamilies(request);
 
     assertEquals(Table.fromProto(createTableData()), response);
-    verify(mockAdminClient).modifyColumnFamily(request.toProto(INSTANCE_NAME.toAdminInstanceName()));
+    verify(mockAdminClient).modifyColumnFamily(request.toProto(PROJECT_ID, INSTANCE_ID));
   }
 
   @Test
@@ -207,12 +207,12 @@ public class TestBigtableTableAdminClientWrapper {
             .addFamily(COLUMN_FAMILY, GCRULES.maxVersions(1))
             .updateFamily(UPDATE_FAMILY, GCRULES.defaultRule());
 
-    when(mockAdminClient.modifyColumnFamilyAsync(request.toProto(INSTANCE_NAME.toAdminInstanceName())))
+    when(mockAdminClient.modifyColumnFamilyAsync(request.toProto(PROJECT_ID, INSTANCE_ID)))
         .thenReturn(immediateFuture(createTableData()));
     ListenableFuture<Table> response = clientWrapper.modifyFamiliesAsync(request);
 
     assertEquals(Table.fromProto(createTableData()), response.get());
-    verify(mockAdminClient).modifyColumnFamilyAsync(request.toProto(INSTANCE_NAME.toAdminInstanceName()));
+    verify(mockAdminClient).modifyColumnFamilyAsync(request.toProto(PROJECT_ID, INSTANCE_ID));
   }
 
   @Test