lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1575397 [3/3] - in /lucene/dev/branches/lucene5487: ./ dev-tools/ dev-tools/idea/solr/contrib/dataimporthandler/ dev-tools/idea/solr/contrib/map-reduce/ dev-tools/scripts/ lucene/ lucene/analysis/ lucene/analysis/common/ lucene/analysis/co...
Date Fri, 07 Mar 2014 20:50:47 GMT
Modified: lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/BlockCacheKey.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/BlockCacheKey.java?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/BlockCacheKey.java (original)
+++ lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/BlockCacheKey.java Fri Mar  7 20:50:45 2014
@@ -16,12 +16,23 @@ package org.apache.solr.store.blockcache
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
+/**
+ * @lucene.experimental
+ */
 public class BlockCacheKey implements Cloneable {
   
   private long block;
   private int file;
+  private String path;
   
+  public String getPath() {
+    return path;
+  }
+
+  public void setPath(String path) {
+    this.path = path;
+  }
+
   public long getBlock() {
     return block;
   }
@@ -44,9 +55,10 @@ public class BlockCacheKey implements Cl
     int result = 1;
     result = prime * result + (int) (block ^ (block >>> 32));
     result = prime * result + file;
+    result = prime * result + ((path == null) ? 0 : path.hashCode());
     return result;
   }
-  
+
   @Override
   public boolean equals(Object obj) {
     if (this == obj) return true;
@@ -55,9 +67,12 @@ public class BlockCacheKey implements Cl
     BlockCacheKey other = (BlockCacheKey) obj;
     if (block != other.block) return false;
     if (file != other.file) return false;
+    if (path == null) {
+      if (other.path != null) return false;
+    } else if (!path.equals(other.path)) return false;
     return true;
   }
-  
+
   @Override
   public BlockCacheKey clone() {
     try {

Modified: lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/BlockCacheLocation.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/BlockCacheLocation.java?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/BlockCacheLocation.java (original)
+++ lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/BlockCacheLocation.java Fri Mar  7 20:50:45 2014
@@ -19,6 +19,9 @@ package org.apache.solr.store.blockcache
 
 import java.util.concurrent.atomic.AtomicBoolean;
 
+/**
+ * @lucene.experimental
+ */
 public class BlockCacheLocation {
   
   private int block;

Modified: lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/BlockDirectory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/BlockDirectory.java?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/BlockDirectory.java (original)
+++ lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/BlockDirectory.java Fri Mar  7 20:50:45 2014
@@ -34,6 +34,9 @@ import org.apache.solr.store.hdfs.HdfsDi
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+/**
+ * @lucene.experimental
+ */
 public class BlockDirectory extends Directory {
   public static Logger LOG = LoggerFactory.getLogger(BlockDirectory.class);
   
@@ -82,11 +85,11 @@ public class BlockDirectory extends Dire
   private Directory directory;
   private int blockSize;
   private String dirName;
-  private Cache cache;
+  private final Cache cache;
   private Set<String> blockCacheFileTypes;
   private final boolean blockCacheReadEnabled;
   private final boolean blockCacheWriteEnabled;
-  
+
   public BlockDirectory(String dirName, Directory directory, Cache cache,
       Set<String> blockCacheFileTypes, boolean blockCacheReadEnabled,
       boolean blockCacheWriteEnabled) throws IOException {
@@ -265,6 +268,15 @@ public class BlockDirectory extends Dire
     return dirName + "/" + name;
   }
   
+  /**
+   * Expert: mostly for tests
+   * 
+   * @lucene.experimental
+   */
+  public Cache getCache() {
+    return cache;
+  }
+  
   @Override
   public void copy(Directory to, String src, String dest, IOContext context)
       throws IOException {
@@ -383,4 +395,13 @@ public class BlockDirectory extends Dire
     return directory;
   }
   
+  
+  public boolean isBlockCacheReadEnabled() {
+    return blockCacheReadEnabled;
+  }
+
+  public boolean isBlockCacheWriteEnabled() {
+    return blockCacheWriteEnabled;
+  }
+  
 }

Modified: lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/BlockDirectoryCache.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/BlockDirectoryCache.java?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/BlockDirectoryCache.java (original)
+++ lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/BlockDirectoryCache.java Fri Mar  7 20:50:45 2014
@@ -21,17 +21,31 @@ import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicInteger;
 
+/**
+ * @lucene.experimental
+ */
 public class BlockDirectoryCache implements Cache {
-  private BlockCache blockCache;
+  private final BlockCache blockCache;
   private AtomicInteger counter = new AtomicInteger();
   private Map<String,Integer> names = new ConcurrentHashMap<String,Integer>();
+  private String path;
   private Metrics metrics;
   
-  public BlockDirectoryCache(BlockCache blockCache, Metrics metrics) {
+  public BlockDirectoryCache(BlockCache blockCache, String path, Metrics metrics) {
     this.blockCache = blockCache;
+    this.path = path;
     this.metrics = metrics;
   }
   
+  /**
+   * Expert: mostly for tests
+   * 
+   * @lucene.experimental
+   */
+  public BlockCache getBlockCache() {
+    return blockCache;
+  }
+  
   @Override
   public void delete(String name) {
     names.remove(name);
@@ -46,6 +60,7 @@ public class BlockDirectoryCache impleme
       names.put(name, file);
     }
     BlockCacheKey blockCacheKey = new BlockCacheKey();
+    blockCacheKey.setPath(path);
     blockCacheKey.setBlock(blockId);
     blockCacheKey.setFile(file);
     blockCache.store(blockCacheKey, blockOffset, buffer, offset, length);
@@ -59,6 +74,7 @@ public class BlockDirectoryCache impleme
       return false;
     }
     BlockCacheKey blockCacheKey = new BlockCacheKey();
+    blockCacheKey.setPath(path);
     blockCacheKey.setBlock(blockId);
     blockCacheKey.setFile(file);
     boolean fetch = blockCache.fetch(blockCacheKey, b, blockOffset, off,

Modified: lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/BlockLocks.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/BlockLocks.java?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/BlockLocks.java (original)
+++ lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/BlockLocks.java Fri Mar  7 20:50:45 2014
@@ -21,6 +21,9 @@ import java.util.concurrent.atomic.Atomi
 
 import org.apache.lucene.util.LongBitSet;
 
+/**
+ * @lucene.experimental
+ */
 public class BlockLocks {
   
   private AtomicLongArray bits;

Modified: lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/BufferStore.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/BufferStore.java?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/BufferStore.java (original)
+++ lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/BufferStore.java Fri Mar  7 20:50:45 2014
@@ -22,7 +22,9 @@ import java.util.concurrent.BlockingQueu
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 
-
+/**
+ * @lucene.experimental
+ */
 public class BufferStore implements Store {
 
   private static final Store EMPTY = new Store() {

Modified: lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/Cache.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/Cache.java?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/Cache.java (original)
+++ lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/Cache.java Fri Mar  7 20:50:45 2014
@@ -17,6 +17,9 @@ package org.apache.solr.store.blockcache
  * limitations under the License.
  */
 
+/**
+ * @lucene.experimental
+ */
 public interface Cache {
   
   /**

Modified: lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/CachedIndexOutput.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/CachedIndexOutput.java?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/CachedIndexOutput.java (original)
+++ lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/CachedIndexOutput.java Fri Mar  7 20:50:45 2014
@@ -21,10 +21,11 @@ import java.io.IOException;
 
 import org.apache.lucene.store.IndexOutput;
 
-/*
+/**
  * Cache the blocks as they are written. The cache file name is the name of
  * the file until the file is closed, at which point the cache is updated
  * to include the last modified date (which is unknown until that point).
+ * @lucene.experimental
  */
 public class CachedIndexOutput extends ReusedBufferedIndexOutput {
   private final BlockDirectory directory;

Modified: lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/CustomBufferedIndexInput.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/CustomBufferedIndexInput.java?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/CustomBufferedIndexInput.java (original)
+++ lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/CustomBufferedIndexInput.java Fri Mar  7 20:50:45 2014
@@ -23,6 +23,9 @@ import java.io.IOException;
 import org.apache.lucene.store.IndexInput;
 import org.apache.lucene.store.IndexOutput;
 
+/**
+ * @lucene.experimental
+ */
 public abstract class CustomBufferedIndexInput extends IndexInput {
   
   public static final int BUFFER_SIZE = 32768;

Modified: lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/Metrics.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/Metrics.java?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/Metrics.java (original)
+++ lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/Metrics.java Fri Mar  7 20:50:45 2014
@@ -29,6 +29,9 @@ import org.apache.hadoop.metrics.Metrics
 import org.apache.hadoop.metrics.Updater;
 import org.apache.hadoop.metrics.jvm.JvmMetrics;
 
+/**
+ * @lucene.experimental
+ */
 public class Metrics implements Updater {
   
   public static class MethodCall {

Modified: lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/ReusedBufferedIndexOutput.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/ReusedBufferedIndexOutput.java?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/ReusedBufferedIndexOutput.java (original)
+++ lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/ReusedBufferedIndexOutput.java Fri Mar  7 20:50:45 2014
@@ -21,6 +21,9 @@ import java.io.IOException;
 
 import org.apache.lucene.store.IndexOutput;
 
+/**
+ * @lucene.experimental
+ */
 public abstract class ReusedBufferedIndexOutput extends IndexOutput {
   
   public static final int BUFFER_SIZE = 1024;

Modified: lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/Store.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/Store.java?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/Store.java (original)
+++ lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/blockcache/Store.java Fri Mar  7 20:50:45 2014
@@ -17,6 +17,9 @@ package org.apache.solr.store.blockcache
  * limitations under the License.
  */
 
+/**
+ * @lucene.experimental
+ */
 public interface Store {
 
   byte[] takeBuffer(int bufferSize);

Modified: lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/hdfs/HdfsFileReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/hdfs/HdfsFileReader.java?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/hdfs/HdfsFileReader.java (original)
+++ lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/hdfs/HdfsFileReader.java Fri Mar  7 20:50:45 2014
@@ -28,6 +28,9 @@ import org.apache.lucene.store.DataInput
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+/**
+ * @lucene.experimental
+ */
 public class HdfsFileReader extends DataInput {
   
   public static Logger LOG = LoggerFactory.getLogger(HdfsFileReader.class);

Modified: lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/hdfs/HdfsFileWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/hdfs/HdfsFileWriter.java?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/hdfs/HdfsFileWriter.java (original)
+++ lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/hdfs/HdfsFileWriter.java Fri Mar  7 20:50:45 2014
@@ -32,6 +32,9 @@ import org.apache.lucene.store.DataOutpu
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+/**
+ * @lucene.experimental
+ */
 public class HdfsFileWriter extends DataOutput implements Closeable {
   public static Logger LOG = LoggerFactory.getLogger(HdfsFileWriter.class);
   

Modified: lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/hdfs/NullIndexOutput.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/hdfs/NullIndexOutput.java?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/hdfs/NullIndexOutput.java (original)
+++ lucene/dev/branches/lucene5487/solr/core/src/java/org/apache/solr/store/hdfs/NullIndexOutput.java Fri Mar  7 20:50:45 2014
@@ -21,6 +21,9 @@ import java.io.IOException;
 
 import org.apache.lucene.store.IndexOutput;
 
+/**
+ * @lucene.experimental
+ */
 public class NullIndexOutput extends IndexOutput {
   
   private long pos;

Modified: lucene/dev/branches/lucene5487/solr/core/src/test-files/solr/collection1/conf/schema11.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/core/src/test-files/solr/collection1/conf/schema11.xml?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/core/src/test-files/solr/collection1/conf/schema11.xml (original)
+++ lucene/dev/branches/lucene5487/solr/core/src/test-files/solr/collection1/conf/schema11.xml Fri Mar  7 20:50:45 2014
@@ -287,6 +287,16 @@ valued. -->
                class="solr.ExternalFileField"/>
 
     <fieldType name="text_no_analyzer" stored="false" indexed="true" class="solr.TextField" />
+
+    <fieldtype name="text_length" class="solr.TextField">
+      <analyzer>
+        <tokenizer class="solr.StandardTokenizerFactory"/>
+        <filter class="solr.StandardFilterFactory"/>
+        <filter class="solr.LowerCaseFilterFactory"/>
+        <filter class="solr.LengthFilterFactory" min="2" max="32768"/>
+      </analyzer>
+    </fieldtype>  
+
  </types>
 
 
@@ -324,6 +334,9 @@ valued. -->
 
    <field name="_version_" type="long" indexed="true" stored="true" multiValued="false" />
 
+   <field name="cat" type="string" indexed="true" stored="true" multiValued="true"/>
+   <field name="cat_length" type="text_length" indexed="true" stored="true" multiValued="true"/>   
+
    <!-- Dynamic field definitions.  If a field name is not found, dynamicFields
         will be used if the name matches any of the patterns.
         RESTRICTION: the glob-like pattern in the name attribute must have

Modified: lucene/dev/branches/lucene5487/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog.xml?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog.xml (original)
+++ lucene/dev/branches/lucene5487/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog.xml Fri Mar  7 20:50:45 2014
@@ -28,6 +28,7 @@
     <int name="solr.hdfs.blockcache.blocksperbank">${solr.hdfs.blockcache.blocksperbank:1024}</int>
     <str name="solr.hdfs.home">${solr.hdfs.home:}</str>
     <str name="solr.hdfs.confdir">${solr.hdfs.confdir:}</str>
+    <str name="solr.hdfs.blockcache.global">${solr.hdfs.blockcache.global:false}</str>
   </directoryFactory>
   
   <dataDir>${solr.data.dir:}</dataDir>

Modified: lucene/dev/branches/lucene5487/solr/core/src/test-files/solr/collection1/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/core/src/test-files/solr/collection1/conf/solrconfig.xml?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/core/src/test-files/solr/collection1/conf/solrconfig.xml (original)
+++ lucene/dev/branches/lucene5487/solr/core/src/test-files/solr/collection1/conf/solrconfig.xml Fri Mar  7 20:50:45 2014
@@ -46,7 +46,8 @@
     <double name="maxWriteMBPerSecMerge">3000000</double>
     <double name="maxWriteMBPerSecRead">4000000</double>
     <str name="solr.hdfs.home">${solr.hdfs.home:}</str>
-    <bool name="solr.hdfs.blockcache.enabled">${solr.hdfs.blockcache.enabled:true}</bool>
+    <bool name="solr.hdfs.blockcache.enabled">${solr.hdfs.blockcache.enabled:true}</bool> 
+    <str name="solr.hdfs.blockcache.global">${solr.hdfs.blockcache.global:false}</str>
   </directoryFactory>
 
   <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>

Modified: lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeTest.java?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeTest.java (original)
+++ lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeTest.java Fri Mar  7 20:50:45 2014
@@ -131,7 +131,7 @@ public class ChaosMonkeyNothingIsSafeTes
       int threadCount = 1;
       int i = 0;
       for (i = 0; i < threadCount; i++) {
-        StopableIndexingThread indexThread = new StopableIndexingThread(Integer.toString(i), true);
+        StopableIndexingThread indexThread = new StopableIndexingThread(controlClient, cloudClient, Integer.toString(i), true);
         threads.add(indexThread);
         indexThread.start();
       }
@@ -270,7 +270,7 @@ public class ChaosMonkeyNothingIsSafeTes
     
     public FullThrottleStopableIndexingThread(List<SolrServer> clients,
         String id, boolean doDeletes) {
-      super(id, doDeletes);
+      super(controlClient, cloudClient, id, doDeletes);
       setName("FullThrottleStopableIndexingThread");
       setDaemon(true);
       this.clients = clients;

Modified: lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderTest.java?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderTest.java (original)
+++ lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderTest.java Fri Mar  7 20:50:45 2014
@@ -108,7 +108,7 @@ public class ChaosMonkeySafeLeaderTest e
     List<StopableIndexingThread> threads = new ArrayList<StopableIndexingThread>();
     int threadCount = 2;
     for (int i = 0; i < threadCount; i++) {
-      StopableIndexingThread indexThread = new StopableIndexingThread(Integer.toString(i), true);
+      StopableIndexingThread indexThread = new StopableIndexingThread(controlClient, cloudClient, Integer.toString(i), true);
       threads.add(indexThread);
       indexThread.start();
     }

Modified: lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/CollectionsAPIDistributedZkTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/CollectionsAPIDistributedZkTest.java?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/CollectionsAPIDistributedZkTest.java (original)
+++ lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/CollectionsAPIDistributedZkTest.java Fri Mar  7 20:50:45 2014
@@ -203,14 +203,14 @@ public class CollectionsAPIDistributedZk
     testCollectionsAPI();
     testCollectionsAPIAddRemoveStress();
     testErrorHandling();
+    testNoCollectionSpecified();
     deletePartiallyCreatedCollection();
     deleteCollectionRemovesStaleZkCollectionsNode();
     clusterPropTest();
-
     addReplicaTest();
-
     // last
     deleteCollectionWithDownNodes();
+    
     if (DEBUG) {
       super.printLayout();
     }
@@ -578,6 +578,40 @@ public class CollectionsAPIDistributedZk
     String val2 = failure.getVal(0).toString();
     assertTrue(val1.contains("SolrException") || val2.contains("SolrException"));
   }
+  
+  private void testNoCollectionSpecified() throws Exception {
+    
+    cloudClient.getZkStateReader().updateClusterState(true);
+    assertFalse(cloudClient.getZkStateReader().getAllCollections().contains("corewithnocollection"));
+    assertFalse(cloudClient.getZkStateReader().getAllCollections().contains("corewithnocollection2"));
+    
+    // try and create a SolrCore with no collection name
+    Create createCmd = new Create();
+    createCmd.setCoreName("corewithnocollection");
+    createCmd.setCollection("");
+    String dataDir = SolrTestCaseJ4.dataDir.getAbsolutePath() + File.separator
+        + System.currentTimeMillis() + "corewithnocollection" + "_1v";
+    createCmd.setDataDir(dataDir);
+    createCmd.setNumShards(1);
+    if (secondConfigSet) {
+      createCmd.setCollectionConfigName("conf1");
+    }
+    
+    createNewSolrServer("", getBaseUrl((HttpSolrServer) clients.get(1)))
+        .request(createCmd);
+    
+    // try and create a SolrCore with no collection name
+    createCmd.setCollection(null);
+    createCmd.setCoreName("corewithnocollection2");
+    
+    createNewSolrServer("", getBaseUrl((HttpSolrServer) clients.get(1)))
+        .request(createCmd);
+    
+    // in both cases, the collection should have default to the core name
+    cloudClient.getZkStateReader().updateClusterState(true);
+    assertTrue(cloudClient.getZkStateReader().getAllCollections().contains("corewithnocollection"));
+    assertTrue(cloudClient.getZkStateReader().getAllCollections().contains("corewithnocollection2"));
+  }
 
   private void testNodesUsedByCreate() throws Exception {
     // we can use this client because we just want base url
@@ -631,7 +665,7 @@ public class CollectionsAPIDistributedZk
     boolean disableLegacy = random().nextBoolean();
     CloudSolrServer client1 = null;
 
-    if(disableLegacy) {
+    if (disableLegacy) {
       log.info("legacyCloud=false");
       client1 = createCloudClient(null);
       setClusterProp(client1, ZkStateReader.LEGACY_CLOUD, "false");

Modified: lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java (original)
+++ lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java Fri Mar  7 20:50:45 2014
@@ -64,18 +64,18 @@ public class OverseerTest extends SolrTe
   private List<Overseer> overseers = new ArrayList<Overseer>();
   private List<ZkStateReader> readers = new ArrayList<ZkStateReader>();
   
+  private String collection = "collection1";
+  
   public static class MockZKController{
     
     private final SolrZkClient zkClient;
     private final ZkStateReader zkStateReader;
     private final String nodeName;
-    private final String collection;
     private final LeaderElector elector;
     private final Map<String, ElectionContext> electionContext = Collections.synchronizedMap(new HashMap<String, ElectionContext>());
     
-    public MockZKController(String zkAddress, String nodeName, String collection) throws InterruptedException, TimeoutException, IOException, KeeperException {
+    public MockZKController(String zkAddress, String nodeName) throws InterruptedException, TimeoutException, IOException, KeeperException {
       this.nodeName = nodeName;
-      this.collection = collection;
       zkClient = new SolrZkClient(zkAddress, TIMEOUT);
       zkStateReader = new ZkStateReader(zkClient);
       zkStateReader.createClusterStateWatchersAndUpdate();
@@ -105,7 +105,7 @@ public class OverseerTest extends SolrTe
       zkClient.close();
     }
     
-    public String publishState(String coreName, String coreNodeName, String stateName, int numShards)
+    public String publishState(String collection, String coreName, String coreNodeName, String stateName, int numShards)
         throws KeeperException, InterruptedException, IOException {
       if (stateName == null) {
         ElectionContext ec = electionContext.remove(coreName);
@@ -134,41 +134,40 @@ public class OverseerTest extends SolrTe
         q.offer(ZkStateReader.toJSON(m));
       }
       
-      for (int i = 0; i < 120; i++) {
-        String shardId = getShardId("http://" + nodeName + "/solr/", coreName);
-        if (shardId != null) {
-          try {
-            zkClient.makePath("/collections/" + collection + "/leader_elect/"
-                + shardId + "/election", true);
-          } catch (NodeExistsException nee) {}
-          ZkNodeProps props = new ZkNodeProps(ZkStateReader.BASE_URL_PROP,
-              "http://" + nodeName + "/solr/", ZkStateReader.NODE_NAME_PROP,
-              nodeName, ZkStateReader.CORE_NAME_PROP, coreName,
-              ZkStateReader.SHARD_ID_PROP, shardId,
-              ZkStateReader.COLLECTION_PROP, collection,
-              ZkStateReader.CORE_NODE_NAME_PROP, coreNodeName);
-          ShardLeaderElectionContextBase ctx = new ShardLeaderElectionContextBase(
-              elector, shardId, collection, nodeName + "_" + coreName, props,
-              zkStateReader);
-          elector.setup(ctx);
-          elector.joinElection(ctx, false);
-          return shardId;
+      if (collection.length() > 0) {
+        for (int i = 0; i < 120; i++) {
+          String shardId = getShardId(collection, coreNodeName);
+          if (shardId != null) {
+            try {
+              zkClient.makePath("/collections/" + collection + "/leader_elect/"
+                  + shardId + "/election", true);
+            } catch (NodeExistsException nee) {}
+            ZkNodeProps props = new ZkNodeProps(ZkStateReader.BASE_URL_PROP,
+                "http://" + nodeName + "/solr/", ZkStateReader.NODE_NAME_PROP,
+                nodeName, ZkStateReader.CORE_NAME_PROP, coreName,
+                ZkStateReader.SHARD_ID_PROP, shardId,
+                ZkStateReader.COLLECTION_PROP, collection,
+                ZkStateReader.CORE_NODE_NAME_PROP, coreNodeName);
+            ShardLeaderElectionContextBase ctx = new ShardLeaderElectionContextBase(
+                elector, shardId, collection, nodeName + "_" + coreName, props,
+                zkStateReader);
+            elector.setup(ctx);
+            elector.joinElection(ctx, false);
+            return shardId;
+          }
+          Thread.sleep(500);
         }
-        Thread.sleep(500);
       }
       return null;
     }
     
-    private String getShardId(final String baseUrl, final String coreName) {
-      Map<String,Slice> slices = zkStateReader.getClusterState().getSlicesMap(
-          collection);
+    private String getShardId(String collection, String coreNodeName) {
+      Map<String,Slice> slices = zkStateReader.getClusterState().getSlicesMap(collection);
       if (slices != null) {
         for (Slice slice : slices.values()) {
           for (Replica replica : slice.getReplicas()) {
-            // TODO: for really large clusters, we could 'index' on this
-            String rbaseUrl = replica.getStr(ZkStateReader.BASE_URL_PROP);
-            String rcore = replica.getStr(ZkStateReader.CORE_NAME_PROP);
-            if (baseUrl.equals(rbaseUrl) && coreName.equals(rcore)) {
+            String cnn = replica.getName();
+            if (coreNodeName.equals(cnn)) {
               return slice.getName();
             }
           }
@@ -226,17 +225,17 @@ public class OverseerTest extends SolrTe
       ZkStateReader reader = new ZkStateReader(zkClient);
       reader.createClusterStateWatchersAndUpdate();
       
-      zkController = new MockZKController(server.getZkAddress(), "127.0.0.1", "collection1");
+      zkController = new MockZKController(server.getZkAddress(), "127.0.0.1");
 
       final int numShards=6;
       
       for (int i = 0; i < numShards; i++) {
-        assertNotNull("shard got no id?", zkController.publishState("core" + (i+1), "node" + (i+1), ZkStateReader.ACTIVE, 3));
+        assertNotNull("shard got no id?", zkController.publishState(collection, "core" + (i+1), "node" + (i+1), ZkStateReader.ACTIVE, 3));
       }
-
-      assertEquals(2, reader.getClusterState().getSlice("collection1", "shard1").getReplicasMap().size());
-      assertEquals(2, reader.getClusterState().getSlice("collection1", "shard2").getReplicasMap().size());
-      assertEquals(2, reader.getClusterState().getSlice("collection1", "shard3").getReplicasMap().size());
+      Map<String,Replica> rmap = reader.getClusterState().getSlice("collection1", "shard1").getReplicasMap();
+      assertEquals(rmap.toString(), 2, rmap.size());
+      assertEquals(rmap.toString(), 2, reader.getClusterState().getSlice("collection1", "shard2").getReplicasMap().size());
+      assertEquals(rmap.toString(), 2, reader.getClusterState().getSlice("collection1", "shard3").getReplicasMap().size());
       
       //make sure leaders are in cloud state
       assertNotNull(reader.getLeaderUrl("collection1", "shard1", 15000));
@@ -259,6 +258,81 @@ public class OverseerTest extends SolrTe
   }
 
   @Test
+  public void testBadQueueItem() throws Exception {
+    String zkDir = dataDir.getAbsolutePath() + File.separator
+        + "zookeeper/server1/data";
+
+    ZkTestServer server = new ZkTestServer(zkDir);
+
+    MockZKController zkController = null;
+    SolrZkClient zkClient = null;
+    SolrZkClient overseerClient = null;
+
+    try {
+      server.run();
+      AbstractZkTestCase.tryCleanSolrZkNode(server.getZkHost());
+      AbstractZkTestCase.makeSolrZkNode(server.getZkHost());
+      
+      zkClient = new SolrZkClient(server.getZkAddress(), TIMEOUT);
+      zkClient.makePath(ZkStateReader.LIVE_NODES_ZKNODE, true);
+
+      overseerClient = electNewOverseer(server.getZkAddress());
+
+      ZkStateReader reader = new ZkStateReader(zkClient);
+      reader.createClusterStateWatchersAndUpdate();
+      
+      zkController = new MockZKController(server.getZkAddress(), "127.0.0.1");
+
+      final int numShards=3;
+      
+      for (int i = 0; i < numShards; i++) {
+        assertNotNull("shard got no id?", zkController.publishState(collection, "core" + (i+1), "node" + (i+1), ZkStateReader.ACTIVE, 3));
+      }
+
+      assertEquals(1, reader.getClusterState().getSlice(collection, "shard1").getReplicasMap().size());
+      assertEquals(1, reader.getClusterState().getSlice(collection, "shard2").getReplicasMap().size());
+      assertEquals(1, reader.getClusterState().getSlice(collection, "shard3").getReplicasMap().size());
+      
+      //make sure leaders are in cloud state
+      assertNotNull(reader.getLeaderUrl(collection, "shard1", 15000));
+      assertNotNull(reader.getLeaderUrl(collection, "shard2", 15000));
+      assertNotNull(reader.getLeaderUrl(collection, "shard3", 15000));
+      
+      // publish a bad queue item
+      String emptyCollectionName = "";
+      zkController.publishState(emptyCollectionName, "core0", "node0", ZkStateReader.ACTIVE, 1);
+      zkController.publishState(emptyCollectionName, "core0", "node0", null, 1);
+      
+      // make sure the Overseer is still processing items
+      for (int i = 0; i < numShards; i++) {
+        assertNotNull("shard got no id?", zkController.publishState("collection2", "core" + (i+1), "node" + (i+1), ZkStateReader.ACTIVE, 3));
+      }
+
+      assertEquals(1, reader.getClusterState().getSlice("collection2", "shard1").getReplicasMap().size());
+      assertEquals(1, reader.getClusterState().getSlice("collection2", "shard2").getReplicasMap().size());
+      assertEquals(1, reader.getClusterState().getSlice("collection2", "shard3").getReplicasMap().size());
+      
+      //make sure leaders are in cloud state
+      assertNotNull(reader.getLeaderUrl("collection2", "shard1", 15000));
+      assertNotNull(reader.getLeaderUrl("collection2", "shard2", 15000));
+      assertNotNull(reader.getLeaderUrl("collection2", "shard3", 15000));
+      
+    } finally {
+      if (DEBUG) {
+        if (zkController != null) {
+          zkClient.printLayoutToStdOut();
+        }
+      }
+      close(zkClient);
+      if (zkController != null) {
+        zkController.close();
+      }
+      close(overseerClient);
+      server.shutdown();
+    }
+  }
+  
+  @Test
   public void testShardAssignmentBigger() throws Exception {
     String zkDir = dataDir.getAbsolutePath() + File.separator
         + "zookeeper/server1/data";
@@ -289,7 +363,7 @@ public class OverseerTest extends SolrTe
       reader.createClusterStateWatchersAndUpdate();
 
       for (int i = 0; i < nodeCount; i++) {
-        controllers[i] = new MockZKController(server.getZkAddress(), "node" + i, "collection1");
+        controllers[i] = new MockZKController(server.getZkAddress(), "node" + i);
       }      
       for (int i = 0; i < nodeCount; i++) {
         nodeExecutors[i] = Executors.newFixedThreadPool(1, new DefaultSolrThreadFactory("testShardAssignment"));
@@ -306,7 +380,7 @@ public class OverseerTest extends SolrTe
             final String coreName = "core" + slot;
             
             try {
-              ids[slot]=controllers[slot % nodeCount].publishState(coreName, "node" + slot, ZkStateReader.ACTIVE, sliceCount);
+              ids[slot]=controllers[slot % nodeCount].publishState(collection, coreName, "node" + slot, ZkStateReader.ACTIVE, sliceCount);
             } catch (Throwable e) {
               e.printStackTrace();
               fail("register threw exception:" + e.getClass());
@@ -551,21 +625,20 @@ public class OverseerTest extends SolrTe
       reader = new ZkStateReader(zkClient);
       reader.createClusterStateWatchersAndUpdate();
       
-      mockController = new MockZKController(server.getZkAddress(), "node1",
-          "collection1");
+      mockController = new MockZKController(server.getZkAddress(), "node1");
       
       overseerClient = electNewOverseer(server.getZkAddress());
       
       Thread.sleep(1000);
-      mockController.publishState("core1", "core_node1",
+      mockController.publishState(collection, "core1", "core_node1",
           ZkStateReader.RECOVERING, 1);
       
-      waitForCollections(reader, "collection1");
+      waitForCollections(reader, collection);
       verifyStatus(reader, ZkStateReader.RECOVERING);
       
       int version = getClusterStateVersion(zkClient);
       
-      mockController.publishState("core1", "core_node1", ZkStateReader.ACTIVE,
+      mockController.publishState(collection, "core1", "core_node1", ZkStateReader.ACTIVE,
           1);
       
       while (version == getClusterStateVersion(zkClient));
@@ -575,7 +648,7 @@ public class OverseerTest extends SolrTe
       overseerClient.close();
       Thread.sleep(1000); // wait for overseer to get killed
       
-      mockController.publishState("core1", "core_node1",
+      mockController.publishState(collection, "core1", "core_node1",
           ZkStateReader.RECOVERING, 1);
       version = getClusterStateVersion(zkClient);
       
@@ -588,13 +661,13 @@ public class OverseerTest extends SolrTe
       assertEquals("Live nodes count does not match", 1, reader
           .getClusterState().getLiveNodes().size());
       assertEquals("Shard count does not match", 1, reader.getClusterState()
-          .getSlice("collection1", "shard1").getReplicasMap().size());
+          .getSlice(collection, "shard1").getReplicasMap().size());
       version = getClusterStateVersion(zkClient);
-      mockController.publishState("core1", "core_node1", null, 1);
+      mockController.publishState(collection, "core1", "core_node1", null, 1);
       while (version == getClusterStateVersion(zkClient));
       Thread.sleep(500);
       assertFalse("collection1 should be gone after publishing the null state",
-          reader.getClusterState().getCollections().contains("collection1"));
+          reader.getClusterState().getCollections().contains(collection));
     } finally {
       close(mockController);
       close(overseerClient);
@@ -676,17 +749,17 @@ public class OverseerTest extends SolrTe
 
       for (int i = 0; i < atLeast(4); i++) {
         killCounter.incrementAndGet(); //for each round allow 1 kill
-        mockController = new MockZKController(server.getZkAddress(), "node1", "collection1");
-        mockController.publishState("core1", "node1", "state1",1);
+        mockController = new MockZKController(server.getZkAddress(), "node1");
+        mockController.publishState(collection, "core1", "node1", "state1",1);
         if(mockController2!=null) {
           mockController2.close();
           mockController2 = null;
         }
-        mockController.publishState("core1", "node1","state2",1);
-        mockController2 = new MockZKController(server.getZkAddress(), "node2", "collection1");
-        mockController.publishState("core1", "node1", "state1",1);
+        mockController.publishState(collection, "core1", "node1","state2",1);
+        mockController2 = new MockZKController(server.getZkAddress(), "node2");
+        mockController.publishState(collection, "core1", "node1", "state1",1);
         verifyShardLeader(reader, "collection1", "shard1", "core1");
-        mockController2.publishState("core4", "node2", "state2" ,1);
+        mockController2.publishState(collection, "core4", "node2", "state2" ,1);
         mockController.close();
         mockController = null;
         verifyShardLeader(reader, "collection1", "shard1", "core4");
@@ -729,11 +802,11 @@ public class OverseerTest extends SolrTe
       reader = new ZkStateReader(controllerClient);
       reader.createClusterStateWatchersAndUpdate();
 
-      mockController = new MockZKController(server.getZkAddress(), "node1", "collection1");
+      mockController = new MockZKController(server.getZkAddress(), "node1");
       
       overseerClient = electNewOverseer(server.getZkAddress());
 
-      mockController.publishState("core1", "core_node1", ZkStateReader.RECOVERING, 1);
+      mockController.publishState(collection, "core1", "core_node1", ZkStateReader.RECOVERING, 1);
 
       waitForCollections(reader, "collection1");
       
@@ -743,8 +816,8 @@ public class OverseerTest extends SolrTe
 
       int version = getClusterStateVersion(controllerClient);
       
-      mockController = new MockZKController(server.getZkAddress(), "node1", "collection1");
-      mockController.publishState("core1", "core_node1", ZkStateReader.RECOVERING, 1);
+      mockController = new MockZKController(server.getZkAddress(), "node1");
+      mockController.publishState(collection, "core1", "core_node1", ZkStateReader.RECOVERING, 1);
 
       while (version == getClusterStateVersion(controllerClient));
       
@@ -794,11 +867,11 @@ public class OverseerTest extends SolrTe
       reader = new ZkStateReader(controllerClient);
       reader.createClusterStateWatchersAndUpdate();
 
-      mockController = new MockZKController(server.getZkAddress(), "node1", "collection1");
+      mockController = new MockZKController(server.getZkAddress(), "node1");
       
       overseerClient = electNewOverseer(server.getZkAddress());
 
-      mockController.publishState("core1", "node1", ZkStateReader.RECOVERING, 12);
+      mockController.publishState(collection, "core1", "node1", ZkStateReader.RECOVERING, 12);
 
       waitForCollections(reader, "collection1");
       

Modified: lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java (original)
+++ lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java Fri Mar  7 20:50:45 2014
@@ -66,10 +66,10 @@ public class RecoveryZkTest extends Abst
     
     int maxDoc = maxDocList[random().nextInt(maxDocList.length - 1)];
     
-    indexThread = new StopableIndexingThread("1", true, maxDoc);
+    indexThread = new StopableIndexingThread(controlClient, cloudClient, "1", true, maxDoc);
     indexThread.start();
     
-    indexThread2 = new StopableIndexingThread("2", true, maxDoc);
+    indexThread2 = new StopableIndexingThread(controlClient, cloudClient, "2", true, maxDoc);
     
     indexThread2.start();
 
@@ -100,7 +100,7 @@ public class RecoveryZkTest extends Abst
     
     Thread.sleep(1000);
   
-    waitForThingsToLevelOut(45);
+    waitForThingsToLevelOut(90);
     
     Thread.sleep(2000);
     

Modified: lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/TestDistribDocBasedVersion.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/TestDistribDocBasedVersion.java?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/TestDistribDocBasedVersion.java (original)
+++ lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/TestDistribDocBasedVersion.java Fri Mar  7 20:50:45 2014
@@ -103,6 +103,8 @@ public class TestDistribDocBasedVersion 
       doTestDocVersions();
       doTestHardFail();
 
+      commit(); // work arround SOLR-5628
+
       testFinished = true;
     } finally {
       if (!testFinished) {

Modified: lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/ZkControllerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/ZkControllerTest.java?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/ZkControllerTest.java (original)
+++ lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/ZkControllerTest.java Fri Mar  7 20:50:45 2014
@@ -190,7 +190,7 @@ public class ZkControllerTest extends So
       cc = getCoreContainer();
       
       ZkController zkController = new ZkController(cc, server.getZkAddress(), TIMEOUT, 10000,
-          "127.0.0.1", "8983", "solr", 0, true, new CurrentCoreDescriptorProvider() {
+          "127.0.0.1", "8983", "solr", 0, 60000, true, new CurrentCoreDescriptorProvider() {
             
             @Override
             public List<CoreDescriptor> getCurrentDescriptors() {
@@ -230,7 +230,7 @@ public class ZkControllerTest extends So
       cc = getCoreContainer();
       
       zkController = new ZkController(cc, server.getZkAddress(),
-          TIMEOUT, 10000, "127.0.0.1", "8983", "solr", 0, true, new CurrentCoreDescriptorProvider() {
+          TIMEOUT, 10000, "127.0.0.1", "8983", "solr", 0, 60000, true, new CurrentCoreDescriptorProvider() {
             
             @Override
             public List<CoreDescriptor> getCurrentDescriptors() {
@@ -284,7 +284,7 @@ public class ZkControllerTest extends So
 
       try {
         zkController = new ZkController(cc, server.getZkAddress(), TIMEOUT, 10000,
-            "http://127.0.0.1", "8983", "solr", 0, true, new CurrentCoreDescriptorProvider() {
+            "http://127.0.0.1", "8983", "solr", 0, 60000, true, new CurrentCoreDescriptorProvider() {
 
           @Override
           public List<CoreDescriptor> getCurrentDescriptors() {

Modified: lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/hdfs/HdfsTestUtil.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/hdfs/HdfsTestUtil.java?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/hdfs/HdfsTestUtil.java (original)
+++ lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/cloud/hdfs/HdfsTestUtil.java Fri Mar  7 20:50:45 2014
@@ -64,6 +64,8 @@ public class HdfsTestUtil {
     
     System.setProperty("solr.hdfs.home", "/solr_hdfs_home");
     
+    System.setProperty("solr.hdfs.blockcache.global", Boolean.toString(LuceneTestCase.random().nextBoolean()));
+    
     final MiniDFSCluster dfsCluster = new MiniDFSCluster(conf, dataNodes, true, null);
     dfsCluster.waitActive();
     
@@ -92,6 +94,7 @@ public class HdfsTestUtil {
     System.clearProperty("test.build.data");
     System.clearProperty("test.cache.data");
     System.clearProperty("solr.hdfs.home");
+    System.clearProperty("solr.hdfs.blockcache.global");
     if (dfsCluster != null) {
       timers.remove(dfsCluster);
       dfsCluster.shutdown();

Modified: lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/core/TestNonNRTOpen.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/core/TestNonNRTOpen.java?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/core/TestNonNRTOpen.java (original)
+++ lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/core/TestNonNRTOpen.java Fri Mar  7 20:50:45 2014
@@ -30,8 +30,12 @@ import org.apache.solr.util.RefCounted;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 public class TestNonNRTOpen extends SolrTestCaseJ4 {
-  
+  private static final Logger log = LoggerFactory.getLogger(TestNonNRTOpen.class);
+
   @BeforeClass
   public static void beforeClass() throws Exception {
     // use a filesystem, because we need to create an index, then "start up solr"
@@ -80,6 +84,7 @@ public class TestNonNRTOpen extends Solr
     
     // core reload
     String core = h.getCore().getName();
+    log.info("Reloading core: " + h.getCore().toString());
     h.getCoreContainer().reload(core);
     assertNotNRT(1);
     
@@ -90,6 +95,7 @@ public class TestNonNRTOpen extends Solr
     
     // add a doc and core reload
     assertU(adoc("bazz", "doc2"));
+    log.info("Reloading core: " + h.getCore().toString());
     h.getCoreContainer().reload(core);
     assertNotNRT(3);
   }
@@ -127,11 +133,15 @@ public class TestNonNRTOpen extends Solr
   }
   
   static void assertNotNRT(int maxDoc) {
-    RefCounted<SolrIndexSearcher> searcher = h.getCore().getSearcher();
+    SolrCore core = h.getCore();
+    log.info("Checking notNRT & maxDoc=" + maxDoc + " of core=" + core.toString());
+    RefCounted<SolrIndexSearcher> searcher = core.getSearcher();
     try {
-      DirectoryReader ir = searcher.get().getIndexReader();
-      assertEquals(maxDoc, ir.maxDoc());
-      assertFalse("expected non-NRT reader, got: " + ir, ir.toString().contains(":nrt"));
+      SolrIndexSearcher s = searcher.get();
+      DirectoryReader ir = s.getIndexReader();
+      assertEquals("SOLR-5815? : wrong maxDoc: core=" + core.toString() +" searcher=" + s.toString(),
+                   maxDoc, ir.maxDoc());
+      assertFalse("SOLR-5815? : expected non-NRT reader, got: " + ir, ir.toString().contains(":nrt"));
     } finally {
       searcher.decref();
     }

Modified: lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/store/blockcache/BlockCacheTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/store/blockcache/BlockCacheTest.java?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/store/blockcache/BlockCacheTest.java (original)
+++ lucene/dev/branches/lucene5487/solr/core/src/test/org/apache/solr/store/blockcache/BlockCacheTest.java Fri Mar  7 20:50:45 2014
@@ -51,6 +51,7 @@ public class BlockCacheTest extends Luce
       int file = 0;
       blockCacheKey.setBlock(block);
       blockCacheKey.setFile(file);
+      blockCacheKey.setPath("/");
 
       if (blockCache.fetch(blockCacheKey, buffer)) {
         hitsInCache.incrementAndGet();
@@ -91,6 +92,7 @@ public class BlockCacheTest extends Luce
     BlockCacheKey blockCacheKey = new BlockCacheKey();
     blockCacheKey.setBlock(0);
     blockCacheKey.setFile(0);
+    blockCacheKey.setPath("/");
     byte[] newData = new byte[blockSize*3];
     byte[] testData = testData(random, blockSize, newData);
 

Modified: lucene/dev/branches/lucene5487/solr/example/solr/collection1/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/example/solr/collection1/conf/solrconfig.xml?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/example/solr/collection1/conf/solrconfig.xml (original)
+++ lucene/dev/branches/lucene5487/solr/example/solr/collection1/conf/solrconfig.xml Fri Mar  7 20:50:45 2014
@@ -129,6 +129,9 @@
     <str name="solr.hdfs.confdir">${solr.hdfs.confdir:}</str>
     <!-- Enable/Disable the hdfs cache. -->    
     <str name="solr.hdfs.blockcache.enabled">${solr.hdfs.blockcache.enabled:true}</str>
+    <!-- Enable/Disable using one global cache for all SolrCores. 
+         The settings used will be from the first HdfsDirectoryFactory created. -->    
+    <str name="solr.hdfs.blockcache.global">${solr.hdfs.blockcache.global:true}</str>
     
   </directoryFactory> 
 

Modified: lucene/dev/branches/lucene5487/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java (original)
+++ lucene/dev/branches/lucene5487/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java Fri Mar  7 20:50:45 2014
@@ -626,7 +626,7 @@ public class ZkStateReader {
   }
   
   /**
-   * Returns the baseURL corrisponding to a given node's nodeName --
+   * Returns the baseURL corresponding to a given node's nodeName --
    * NOTE: does not (currently) imply that the nodeName (or resulting 
    * baseURL) exists in the cluster.
    * @lucene.experimental

Modified: lucene/dev/branches/lucene5487/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java?rev=1575397&r1=1575396&r2=1575397&view=diff
==============================================================================
--- lucene/dev/branches/lucene5487/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java (original)
+++ lucene/dev/branches/lucene5487/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java Fri Mar  7 20:50:45 2014
@@ -1428,122 +1428,13 @@ public abstract class AbstractFullDistri
     return rsp;
   }
   
-  abstract class StopableThread extends Thread {
+  static abstract class StopableThread extends Thread {
     public StopableThread(String name) {
       super(name);
     }
     public abstract void safeStop();
   }
   
-  class StopableIndexingThread extends StopableThread {
-    private volatile boolean stop = false;
-    protected final String id;
-    protected final List<String> deletes = new ArrayList<String>();
-    protected Set<String> addFails = new HashSet<String>();
-    protected Set<String> deleteFails = new HashSet<String>();
-    protected boolean doDeletes;
-    private int numCycles;
-    
-    public StopableIndexingThread(String id, boolean doDeletes) {
-      this(id, doDeletes, -1);
-    }
-    
-    public StopableIndexingThread(String id, boolean doDeletes, int numCycles) {
-      super("StopableIndexingThread");
-      this.id = id;
-      this.doDeletes = doDeletes;
-      this.numCycles = numCycles;
-      setDaemon(true);
-    }
-    
-    @Override
-    public void run() {
-      int i = 0;
-      int numDone = 0;
-      int numDeletes = 0;
-      int numAdds = 0;
-      
-      while (true && !stop) {
-        if (numCycles != -1) {
-          if (numDone > numCycles) {
-            break;
-          }
-        }
-        ++numDone;
-        String id = this.id + "-" + i;
-        ++i;
-        boolean addFailed = false;
-        
-        if (doDeletes && random().nextBoolean() && deletes.size() > 0) {
-          String delete = deletes.remove(0);
-          try {
-            numDeletes++;
-            UpdateRequest req = new UpdateRequest();
-            req.deleteById(delete);
-            req.setParam("CONTROL", "TRUE");
-            req.process(controlClient);
-            
-            cloudClient.deleteById(delete);
-          } catch (Exception e) {
-            System.err.println("REQUEST FAILED:");
-            e.printStackTrace();
-            if (e instanceof SolrServerException) {
-              System.err.println("ROOT CAUSE:");
-              ((SolrServerException) e).getRootCause().printStackTrace();
-            }
-            deleteFails.add(id);
-          }
-        }
-        
-        try {
-          numAdds++;
-          indexr("id", id, i1, 50, t1,
-              "to come to the aid of their country.");
-        } catch (Exception e) {
-          addFailed = true;
-          System.err.println("REQUEST FAILED:");
-          e.printStackTrace();
-          if (e instanceof SolrServerException) {
-            System.err.println("ROOT CAUSE:");
-            ((SolrServerException) e).getRootCause().printStackTrace();
-          }
-          addFails.add(id);
-        }
-        
-        if (!addFailed && doDeletes && random().nextBoolean()) {
-          deletes.add(id);
-        }
-        
-        try {
-          Thread.currentThread().sleep(random().nextInt(100));
-        } catch (InterruptedException e) {
-          Thread.currentThread().interrupt();
-        }
-      }
-      
-      System.err.println("added docs:" + numAdds + " with " + (addFails.size() + deleteFails.size()) + " fails"
-          + " deletes:" + numDeletes);
-    }
-    
-    @Override
-    public void safeStop() {
-      stop = true;
-    }
-    
-    public Set<String> getAddFails() {
-      return addFails;
-    }
-    
-    public Set<String> getDeleteFails() {
-      return deleteFails;
-    }
-    
-    public int getFailCount() {
-      return addFails.size() + deleteFails.size();
-    }
-    
-  };
-  
   class StopableSearchThread extends StopableThread {
     private volatile boolean stop = false;
     protected final AtomicInteger queryFails = new AtomicInteger();



Mime
View raw message