Source:
<code>public void testConnection() throws Exception { String projectId = System.getProperty("google.bigtable.project.id"); String instanceId = System.getProperty("google.bigtable.instance.id"); String tableId = "myTable"; String family = "cf"; String instanceName = "projects/" + projectId + "/instances/" + instanceId; String tableName = instanceName + "/tables/" + tableId; BigtableOptions opts = new BigtableOptions.Builder() .setUserAgent("fake") .setCredentialOptions(CredentialOptions.nullCredential()) .setUsePlaintextNegotiation(true) .setPort(Integer.parseInt(System.getProperty("google.bigtable.endpoint.port"))) .setDataHost(System.getProperty("google.bigtable.endpoint.host")) .setInstanceAdminHost(System.getProperty("google.bigtable.instance.admin.endpoint.host")) .setTableAdminHost(System.getProperty("google.bigtable.admin.endpoint.host")) .setProjectId(projectId) .setInstanceId(instanceId) .build(); try (BigtableSession session = new BigtableSession(opts)) { BigtableTableAdminClient tableAdminClient = session.getTableAdminClient(); tableAdminClient.createTable( CreateTableRequest.newBuilder() .setParent(instanceName) .setTableId(tableId) .setTable( Table.newBuilder() .putColumnFamilies(family, ColumnFamily.getDefaultInstance()) ) .build() ); BigtableDataClient dataClient = session.getDataClient(); dataClient.mutateRow( MutateRowRequest.newBuilder() .setTableName(tableName) <START> .setRowKey(ByteString.copyFromUtf8("key")) <END> .addMutations( Mutation.newBuilder() .setSetCell( SetCell.newBuilder() .setFamilyName(family) .setValue(ByteString.copyFromUtf8("value")) ) ) .build() ); List<Row> results = dataClient.readRowsAsync(ReadRowsRequest.newBuilder() .setTableName(tableName) .setRows( RowSet.newBuilder() .addRowKeys(ByteString.copyFromUtf8("key")) ) .build() ).get(); Assert.assertEquals(ByteString.copyFromUtf8("value"), results.get(0).getFamilies(0).getColumns(0).getCells(0).getValue()); } }</code><technical_language>key constants</technical_language>

Target:
public void testConnection() throws Exception { String projectId = System.getProperty("google.bigtable.project.id"); String instanceId = System.getProperty("google.bigtable.instance.id"); String tableId = "myTable"; String family = "cf"; String key = "key"; String value = "value"; String instanceName = "projects/" + projectId + "/instances/" + instanceId; String tableName = instanceName + "/tables/" + tableId; BigtableOptions opts = new BigtableOptions.Builder() .setUserAgent("fake") .setCredentialOptions(CredentialOptions.nullCredential()) .setUsePlaintextNegotiation(true) .setPort(Integer.parseInt(System.getProperty("google.bigtable.endpoint.port"))) .setDataHost(System.getProperty("google.bigtable.endpoint.host")) .setInstanceAdminHost(System.getProperty("google.bigtable.instance.admin.endpoint.host")) .setTableAdminHost(System.getProperty("google.bigtable.admin.endpoint.host")) .setProjectId(projectId) .setInstanceId(instanceId) .build(); try (BigtableSession session = new BigtableSession(opts)) { BigtableTableAdminClient tableAdminClient = session.getTableAdminClient(); tableAdminClient.createTable( CreateTableRequest.newBuilder() .setParent(instanceName) .setTableId(tableId) .setTable( Table.newBuilder() .putColumnFamilies(family, ColumnFamily.getDefaultInstance()) ) .build() ); BigtableDataClient dataClient = session.getDataClient(); dataClient.mutateRow( MutateRowRequest.newBuilder() .setTableName(tableName) .setRowKey(ByteString.copyFromUtf8(key)) .addMutations( Mutation.newBuilder() .setSetCell( SetCell.newBuilder() .setFamilyName(family) .setValue(ByteString.copyFromUtf8(value)) ) ) .build() ); List<Row> results = dataClient.readRowsAsync(ReadRowsRequest.newBuilder() .setTableName(tableName) .setRows( RowSet.newBuilder() .addRowKeys(ByteString.copyFromUtf8(key)) ) .build() ).get(); Assert.assertEquals(ByteString.copyFromUtf8(value), results.get(0).getFamilies(0).getColumns(0).getCells(0).getValue()); } }