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 ) ) ) ; } }
Get size of all clusters for specified Bigtable instance .