public void addCluster() {
    System.out.printf("%nAdding cluster: %s to instance: %s%n", CLUSTER, instanceId);
    // [START bigtable_create_cluster]
    try {
      adminClient.createCluster(
          CreateClusterRequest.of(instanceId, CLUSTER)
              .setZone("us-central1-c")
              .setServeNodes(3)
              .setStorageType(StorageType.SSD));
      System.out.printf("Cluster: %s created successfully%n", CLUSTER);
    } catch (AlreadyExistsException e) {
      System.err.println("Failed to add cluster, already exists: " + e.getMessage());
    }
    // [END bigtable_create_cluster]
  }
public void addCluster ( ) { System . out . printf ( "%nAdding cluster: %s to instance: %s%n" , CLUSTER , instanceId ) ; try { adminClient . createCluster ( CreateClusterRequest . of ( instanceId , CLUSTER ) . setZone ( "us-central1-c" ) . setServeNodes ( 3 ) . setStorageType ( StorageType . SSD ) ) ; System . out . printf ( "Cluster: %s created successfully%n" , CLUSTER ) ; } catch ( AlreadyExistsException e ) { System . err . println ( "Failed to add cluster, already exists: " + e . getMessage ( ) ) ; } }
Demonstrates how to add a cluster to an instance.