You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2011/12/08 01:45:39 UTC

svn commit: r1211725 - in /lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/cloud: ZkCollectionLock.java ZkController.java

Author: markrmiller
Date: Thu Dec  8 00:45:39 2011
New Revision: 1211725

URL: http://svn.apache.org/viewvc?rev=1211725&view=rev
Log:
we dont use collection lock anymore

Removed:
    lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/cloud/ZkCollectionLock.java
Modified:
    lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/cloud/ZkController.java

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/cloud/ZkController.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/cloud/ZkController.java?rev=1211725&r1=1211724&r2=1211725&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/cloud/ZkController.java (original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/cloud/ZkController.java Thu Dec  8 00:45:39 2011
@@ -613,6 +613,9 @@ public final class ZkController {
    */
   public void uploadToZK(File dir, String zkPath) throws IOException, KeeperException, InterruptedException {
     File[] files = dir.listFiles();
+    if (files == null) {
+      throw new IllegalArgumentException("Illegal directory: " + dir);
+    }
     for(File file : files) {
       if (!file.getName().startsWith(".")) {
         if (!file.isDirectory()) {
@@ -773,18 +776,6 @@ public final class ZkController {
           collectionProps.put("num_shards", Integer.toString(numShards));
           ZkNodeProps zkProps = new ZkNodeProps(collectionProps);
           zkClient.makePath(collectionPath, ZkStateReader.toJSON(zkProps), CreateMode.PERSISTENT, null, true);
-          try {
-            // shards_lock node
-            if (!zkClient.exists(ZkStateReader.COLLECTIONS_ZKNODE + "/" + collection + "/shards_lock")) {
-              // makes shards_lock zkNode if it doesn't exist
-              zkClient.makePath(ZkStateReader.COLLECTIONS_ZKNODE + "/" + collection + "/shards_lock");
-            }
-          } catch (KeeperException e) {
-            // its okay if another beats us creating the node
-            if (e.code() != KeeperException.Code.NODEEXISTS) {
-              throw e;
-            }
-          }
          
           // ping that there is a new collection
           zkClient.setData(ZkStateReader.COLLECTIONS_ZKNODE, (byte[])null);