SOLR-7130: formatting mistakes

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1662546 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Noble Paul 2015-02-26 19:42:13 +00:00
parent bd44478442
commit 925ad53f97
1 changed files with 12 additions and 12 deletions

View File

@ -1109,30 +1109,30 @@ public class CloudSolrClient extends SolrClient {
protected DocCollection getDocCollection(ClusterState clusterState, String collection, Integer expectedVersion) throws SolrException { 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); DocCollection col = getFromCache(collection);
if(col != null) { if (col != null) {
if(expectedVersion == null) return col; if (expectedVersion == null) return col;
if(expectedVersion.intValue() == col.getZNodeVersion()) return col; if (expectedVersion.intValue() == col.getZNodeVersion()) return col;
} }
ClusterState.CollectionRef ref = clusterState.getCollectionRef(collection); ClusterState.CollectionRef ref = clusterState.getCollectionRef(collection);
if(ref == null){ if (ref == null) {
//no such collection exists //no such collection exists
return null; return null;
} }
if(!ref.isLazilyLoaded()) { if (!ref.isLazilyLoaded()) {
//it is readily available just return it //it is readily available just return it
return ref.get(); return ref.get();
} }
List locks = this.locks; List locks = this.locks;
final Object lock = locks.get(Math.abs(Hash.murmurhash3_x86_32(collection, 0, collection.length(), 0) % locks.size())); 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 again //we have waited for sometime just check once again
col = getFromCache(collection); col = getFromCache(collection);
if(col !=null) { if (col != null) {
if(expectedVersion == null) return col; if (expectedVersion == null) return col;
if(expectedVersion.intValue() == col.getZNodeVersion()) { if (expectedVersion.intValue() == col.getZNodeVersion()) {
return col; return col;
} else { } else {
collectionStateCache.remove(collection); collectionStateCache.remove(collection);
@ -1140,8 +1140,8 @@ public class CloudSolrClient extends SolrClient {
} }
col = ref.get();//this is a call to ZK col = ref.get();//this is a call to ZK
} }
if(col == null ) return null; if (col == null) return null;
if(col.getStateFormat() >1) collectionStateCache.put(collection, new ExpiringCachedDocCollection(col)); if (col.getStateFormat() > 1) collectionStateCache.put(collection, new ExpiringCachedDocCollection(col));
return col; return col;
} }