public static Cluster createCluster ( String clusterName , CassandraHostConfigurator cassandraHostConfigurator , Map < String , String > credentials ) { synchronized ( clusters ) { Cluster cluster = clusters . get ( clusterName ) ; if ( cluster == null ) { cluster = new ThriftCluster ( clusterName , cassandraHostConfigurator , credentials ) ; clusters . put ( clusterName , cluster ) ; cluster . onStartup ( ) ; } return cluster ; } }
Method looks in the cache for the cluster by name . If none exists a new ThriftCluster instance is created and added to the map of known clusters