Apache Lucene open-source search software
SOLR-7130: formatting mistakes
Noble Paul925ad53f9742
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.javaindex ffda19233b4..ec8193f57f2 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java@@ -1109,30 +1109,30 @@ public class CloudSolrClient extends SolrClient {protected DocCollection getDocCollection(ClusterState clusterState, String collection, Integer expectedVersion) throws SolrException {- if(collection == null) return null;+ if (collection == null) return null;DocCollection col = getFromCache(collection);- if(col != null) {- if(expectedVersion == null) return col;- if(expectedVersion.intValue() == col.getZNodeVersion()) return col;+ if (col != null) {+ if (expectedVersion == null) return col;+ if (expectedVersion.intValue() == col.getZNodeVersion()) return col;}ClusterState.CollectionRef ref = clusterState.getCollectionRef(collection);- if(ref == null){+ if (ref == null) {//no such collection existsreturn null;}- if(!ref.isLazilyLoaded()) {+ if (!ref.isLazilyLoaded()) {//it is readily available just return itreturn ref.get();}List locks = this.locks;final Object lock = locks.get(Math.abs(Hash.murmurhash3_x86_32(collection, 0, collection.length(), 0) % locks.size()));- synchronized (lock){+ synchronized (lock) {//we have waited for sometime just check once againcol = getFromCache(collection);- if(col !=null) {- if(expectedVersion == null) return col;- if(expectedVersion.intValue() == col.getZNodeVersion()) {+ if (col != null) {+ if (expectedVersion == null) return col;+ if (expectedVersion.intValue() == col.getZNodeVersion()) {return col;} else {collectionStateCache.remove(collection);@@ -1140,8 +1140,8 @@ public class CloudSolrClient extends SolrClient {}col = ref.get();//this is a call to ZK}- if(col == null ) return null;- if(col.getStateFormat() >1) collectionStateCache.put(collection, new ExpiringCachedDocCollection(col));+ if (col == null) return null;+ if (col.getStateFormat() > 1) collectionStateCache.put(collection, new ExpiringCachedDocCollection(col));return col;}