private static boolean checkIfCollectionExists ( CloudSolrClient server , String collection ) throws KeeperException , InterruptedException { ZkStateReader zkStateReader = server . getZkStateReader ( ) ; zkStateReader . updateClusterState ( true ) ; ClusterState clusterState = zkStateReader . getClusterState ( ) ; return clusterState . getCollectionOrNull ( collection ) != null ; }
Checks if the collection has already been created in Solr .