code: public static Map<String, Integer> getClusterSizes(
        final String projectId,
        final String instanceId
    ) throws IOException, GeneralSecurityException {
      try (BigtableClusterUtilities clusterUtil = BigtableClusterUtilities
          .forInstance(projectId, instanceId)) {
        return Collections.unmodifiableMap(
            clusterUtil.getClusters().getClustersList().stream()
                .collect(Collectors.toMap(
                        cn -> cn.getName().substring(cn.getName().indexOf("/clusters/") + 10),
                        Cluster::getServeNodes)));
      }
    }
docs: Get size of all clusters for specified Bigtable instance.
  
  @param projectId GCP projectId
  @param instanceId Bigtable instanceId
  
  @return map of clusterId to its number of nodes
  @throws IOException If setting up channel pool fails
  @throws GeneralSecurityException If security-related exceptions occurs