You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ro...@apache.org on 2014/12/01 18:25:47 UTC

svn commit: r1642718 [6/12] - in /lucene/dev/branches/lucene2878: ./ dev-tools/ dev-tools/eclipse/dot.settings/ dev-tools/idea/.idea/ dev-tools/idea/lucene/benchmark/src/ dev-tools/idea/lucene/highlighter/ dev-tools/maven/ dev-tools/maven/solr/webapp/ ...

Modified: lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/index/BaseTermVectorsFormatTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/index/BaseTermVectorsFormatTestCase.java?rev=1642718&r1=1642717&r2=1642718&view=diff
==============================================================================
--- lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/index/BaseTermVectorsFormatTestCase.java (original)
+++ lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/index/BaseTermVectorsFormatTestCase.java Mon Dec  1 17:25:39 2014
@@ -94,17 +94,6 @@ public abstract class BaseTermVectorsFor
     return ft;
   }
 
-  protected BytesRef randomPayload() {
-    final int len = random().nextInt(5);
-    if (len == 0) {
-      return null;
-    }
-    final BytesRef payload = new BytesRef(len);
-    random().nextBytes(payload.bytes);
-    payload.length = len;
-    return payload;
-  }
-
   @Override
   protected void addRandomFields(Document doc) {
     for (Options opts : validOptions()) {
@@ -171,7 +160,9 @@ public abstract class BaseTermVectorsFor
   }
 
   // TODO: use CannedTokenStream?
-  protected class RandomTokenStream extends TokenStream {
+  // TODO: pull out and make top-level-utility, separate from TermVectors
+  /** Produces a random TokenStream based off of provided terms. */
+  public static class RandomTokenStream extends TokenStream {
 
     final String[] terms;
     final BytesRef[] termBytes;
@@ -190,11 +181,11 @@ public abstract class BaseTermVectorsFor
     final PayloadAttribute pAtt;
     int i = 0;
 
-    protected RandomTokenStream(int len, String[] sampleTerms, BytesRef[] sampleTermBytes) {
+    public RandomTokenStream(int len, String[] sampleTerms, BytesRef[] sampleTermBytes) {
       this(len, sampleTerms, sampleTermBytes, rarely());
     }
 
-    protected RandomTokenStream(int len, String[] sampleTerms, BytesRef[] sampleTermBytes, boolean offsetsGoBackwards) {
+    public RandomTokenStream(int len, String[] sampleTerms, BytesRef[] sampleTermBytes, boolean offsetsGoBackwards) {
       terms = new String[len];
       termBytes = new BytesRef[len];
       positionsIncrements = new int[len];
@@ -265,6 +256,17 @@ public abstract class BaseTermVectorsFor
       pAtt = addAttribute(PayloadAttribute.class);
     }
 
+    protected BytesRef randomPayload() {
+      final int len = random().nextInt(5);
+      if (len == 0) {
+        return null;
+      }
+      final BytesRef payload = new BytesRef(len);
+      random().nextBytes(payload.bytes);
+      payload.length = len;
+      return payload;
+    }
+
     public boolean hasPayloads() {
       for (BytesRef payload : payloads) {
         if (payload != null && payload.length > 0) {
@@ -274,9 +276,40 @@ public abstract class BaseTermVectorsFor
       return false;
     }
 
+    public String[] getTerms() {
+      return terms;
+    }
+
+    public BytesRef[] getTermBytes() {
+      return termBytes;
+    }
+
+    public int[] getPositionsIncrements() {
+      return positionsIncrements;
+    }
+
+    public int[] getStartOffsets() {
+      return startOffsets;
+    }
+
+    public int[] getEndOffsets() {
+      return endOffsets;
+    }
+
+    public BytesRef[] getPayloads() {
+      return payloads;
+    }
+
+    @Override
+    public void reset() throws IOException {
+      i = 0;
+      super.reset();
+    }
+
     @Override
     public final boolean incrementToken() throws IOException {
       if (i < terms.length) {
+        clearAttributes();
         termAtt.setLength(0).append(terms[i]);
         piAtt.setPositionIncrement(positionsIncrements[i]);
         oAtt.setOffset(startOffsets[i], endOffsets[i]);

Modified: lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/index/RandomCodec.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/index/RandomCodec.java?rev=1642718&r1=1642717&r2=1642718&view=diff
==============================================================================
--- lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/index/RandomCodec.java (original)
+++ lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/index/RandomCodec.java Mon Dec  1 17:25:39 2014
@@ -37,6 +37,7 @@ import org.apache.lucene.codecs.blockter
 import org.apache.lucene.codecs.blockterms.LuceneVarGapFixedInterval;
 import org.apache.lucene.codecs.blocktreeords.BlockTreeOrdsPostingsFormat;
 import org.apache.lucene.codecs.bloom.TestBloomFilteredLucenePostings;
+import org.apache.lucene.codecs.memory.DirectDocValuesFormat;
 import org.apache.lucene.codecs.memory.DirectPostingsFormat;
 import org.apache.lucene.codecs.memory.FSTOrdPostingsFormat;
 import org.apache.lucene.codecs.memory.FSTPostingsFormat;
@@ -72,7 +73,7 @@ public class RandomCodec extends Asserti
 
   public final Set<String> avoidCodecs;
 
-  /** memorized field->postingsformat mappings */
+  /** memorized field to postingsformat mappings */
   // note: we have to sync this map even though its just for debugging/toString, 
   // otherwise DWPT's .toString() calls that iterate over the map can 
   // cause concurrentmodificationexception if indexwriter's infostream is on
@@ -136,15 +137,16 @@ public class RandomCodec extends Asserti
         new LuceneFixedGap(TestUtil.nextInt(random, 1, 1000)),
         new LuceneVarGapFixedInterval(TestUtil.nextInt(random, 1, 1000)),
         new LuceneVarGapDocFreqInterval(TestUtil.nextInt(random, 1, 100), TestUtil.nextInt(random, 1, 1000)),
-        new SimpleTextPostingsFormat(),
+        random.nextInt(10) == 0 ? new SimpleTextPostingsFormat() : TestUtil.getDefaultPostingsFormat(),
         new AssertingPostingsFormat(),
         new MemoryPostingsFormat(true, random.nextFloat()),
         new MemoryPostingsFormat(false, random.nextFloat()));
     
     addDocValues(avoidCodecs,
         TestUtil.getDefaultDocValuesFormat(),
+        new DirectDocValuesFormat(), // maybe not a great idea...
         new MemoryDocValuesFormat(),
-        new SimpleTextDocValuesFormat(),
+        random.nextInt(10) == 0 ? new SimpleTextDocValuesFormat() : TestUtil.getDefaultDocValuesFormat(),
         new AssertingDocValuesFormat());
 
     Collections.shuffle(formats, random);

Modified: lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/search/BaseExplanationTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/search/BaseExplanationTestCase.java?rev=1642718&r1=1642717&r2=1642718&view=diff
==============================================================================
--- lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/search/BaseExplanationTestCase.java (original)
+++ lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/search/BaseExplanationTestCase.java Mon Dec  1 17:25:39 2014
@@ -46,7 +46,6 @@ import org.junit.BeforeClass;
  * then anything that rewrites to a primitive will work well also.
  * </p>
  *
- * @see "Subclasses for actual tests"
  */
 public abstract class BaseExplanationTestCase extends LuceneTestCase {
   protected static IndexSearcher searcher;

Modified: lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java?rev=1642718&r1=1642717&r2=1642718&view=diff
==============================================================================
--- lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java (original)
+++ lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java Mon Dec  1 17:25:39 2014
@@ -75,7 +75,7 @@ public class MockDirectoryWrapper extend
   boolean preventDoubleWrite = true;
   boolean trackDiskUsage = false;
   boolean wrapLocking = true;
-  boolean useSlowOpenClosers = true;
+  boolean useSlowOpenClosers = LuceneTestCase.TEST_NIGHTLY;
   boolean enableVirusScanner = true;
   boolean allowRandomFileNotFoundException = true;
   boolean allowReadingFilesStillOpenForWrite = false;
@@ -85,7 +85,7 @@ public class MockDirectoryWrapper extend
   Map<String,Exception> openLocks = Collections.synchronizedMap(new HashMap<String,Exception>());
   volatile boolean crashed;
   private ThrottledIndexOutput throttledOutput;
-  private Throttling throttling = Throttling.SOMETIMES;
+  private Throttling throttling = LuceneTestCase.TEST_NIGHTLY ? Throttling.SOMETIMES : Throttling.NEVER;
 
   final AtomicInteger inputCloneCount = new AtomicInteger();
 
@@ -191,9 +191,9 @@ public class MockDirectoryWrapper extend
   }
   
   /** 
-   * By default, opening and closing has a rare small sleep to catch race conditions
+   * Add a rare small sleep to catch race conditions in open/close
    * <p>
-   * You can disable this if you dont need it
+   * You can enable this if you need it.
    */
   public void setUseSlowOpenClosers(boolean v) {
     useSlowOpenClosers = v;

Modified: lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/util/BaseBitSetTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/util/BaseBitSetTestCase.java?rev=1642718&r1=1642717&r2=1642718&view=diff
==============================================================================
--- lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/util/BaseBitSetTestCase.java (original)
+++ lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/util/BaseBitSetTestCase.java Mon Dec  1 17:25:39 2014
@@ -176,7 +176,7 @@ public abstract class BaseBitSetTestCase
     final int numBits = 1 + random().nextInt(100000);
     BitSet set1 = new JavaUtilBitSet(randomSet(numBits, 0), numBits);
     T set2 = copyOf(set1, numBits);
-    final int iters = 50 + random().nextInt(50);
+    final int iters = TEST_NIGHTLY ? 50 + random().nextInt(50) : 10 + random().nextInt(10);
     for (int i = 0; i < iters; ++i) {
       // make extreme percents more likely
       float percentSet2 = rarely() ? 0 : (float) Math.pow(random().nextDouble(), 2);

Modified: lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/util/RamUsageTester.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/util/RamUsageTester.java?rev=1642718&r1=1642717&r2=1642718&view=diff
==============================================================================
--- lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/util/RamUsageTester.java (original)
+++ lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/util/RamUsageTester.java Mon Dec  1 17:25:39 2014
@@ -324,7 +324,7 @@ public final class RamUsageTester {
      * finalization step from Austin Appleby's
      * <code>MurmurHash3</code>.
      * 
-     * @see "http://sites.google.com/site/murmurhash/"
+     * @see <a href="http://sites.google.com/site/murmurhash/">http://sites.google.com/site/murmurhash/</a>
      */
     private static int rehash(Object o) {
       int k = System.identityHashCode(o);

Modified: lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/util/Rethrow.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/util/Rethrow.java?rev=1642718&r1=1642717&r2=1642718&view=diff
==============================================================================
--- lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/util/Rethrow.java (original)
+++ lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/util/Rethrow.java Mon Dec  1 17:25:39 2014
@@ -22,7 +22,7 @@ package org.apache.lucene.util;
  * ones. Eh, it is sometimes useful...
  *
  * <p>Pulled from <a href="http://www.javapuzzlers.com">Java Puzzlers</a>.</p>
- * @see "http://www.amazon.com/Java-Puzzlers-Traps-Pitfalls-Corner/dp/032133678X"
+ * @see <a href="http://www.amazon.com/Java-Puzzlers-Traps-Pitfalls-Corner/dp/032133678X">http://www.amazon.com/Java-Puzzlers-Traps-Pitfalls-Corner/dp/032133678X</a>
  */
 @SuppressWarnings({"unchecked","rawtypes"})
 public final class Rethrow {

Modified: lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java?rev=1642718&r1=1642717&r2=1642718&view=diff
==============================================================================
--- lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java (original)
+++ lucene/dev/branches/lucene2878/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java Mon Dec  1 17:25:39 2014
@@ -124,7 +124,10 @@ final class TestRuleTemporaryFilesCleanu
       fs = new HandleLimitFS(fs, MAX_OPEN_FILES).getFileSystem(null);
       // windows is currently slow
       if (random.nextInt(10) == 0) {
-        fs = new WindowsFS(fs).getFileSystem(null);
+        // don't try to emulate windows on windows: they don't get along
+        if (!Constants.WINDOWS) {
+          fs = new WindowsFS(fs).getFileSystem(null);
+        }
       }
     }
     if (LuceneTestCase.VERBOSE) {

Modified: lucene/dev/branches/lucene2878/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2878/solr/CHANGES.txt?rev=1642718&r1=1642717&r2=1642718&view=diff
==============================================================================
--- lucene/dev/branches/lucene2878/solr/CHANGES.txt (original)
+++ lucene/dev/branches/lucene2878/solr/CHANGES.txt Mon Dec  1 17:25:39 2014
@@ -29,6 +29,11 @@ Velocity 1.7 and Velocity Tools 2.0
 Apache UIMA 2.3.1
 Apache ZooKeeper 3.4.6
 
+System Requirements
+----------------------
+* LUCENE-5950: Move to Java 8 as minimum Java version.
+  (Ryan Ernst, Uwe Schindler)
+
 Upgrading from Solr 5.x
 ----------------------
 
@@ -40,7 +45,6 @@ Detailed Change List
 Other Changes
 ----------------------
 
-* SOLR-4792: Stop shipping a .war. (Robert Muir)
 
 ==================  5.0.0 ==================
 
@@ -100,6 +104,12 @@ Upgrading from Solr 4.x
   in the "def()" function. Example: changing "fl=sum(fieldA,fieldB)" to 
   "fl=sum(def(fieldA,0.0),def(fieldB,0.0))".  See LUCENE-5961 for more details.
 
+* AdminHandlers is deprecated , /admin/* are implicitly defined, /get ,/replacation and
+   handlers are also implicitly registered (refer to SOLR-6792)
+
+* SolrCore.reload(ConfigSet coreConfig, SolrCore prev) was deprecated in 4.10.3 and
+  removed in 5.0. use SolrCore.reload(ConfigSet coreConfig). See SOLR-5864.
+
 Detailed Change List
 ----------------------
 
@@ -133,7 +143,7 @@ New Features
   (Timothy Potter)
 
 * SOLR-5473 : Split clusterstate.json per collection and watch states selectively
-              (Noble Paul, Mark Miller, shalin, Jessica Cheng Mallet, Timothy Potter, Ashum Gupta)
+  (Noble Paul, Mark Miller, shalin, Jessica Cheng Mallet, Timothy Potter, Anshum Gupta)
 
 * SOLR-5474 : Support for SOLR-5473 in SolrJ (Timothy Potter, Noble Paul, Mark Miller)
 
@@ -205,7 +215,9 @@ New Features
   facet.pivot which refers to a 'tag' local param in one or more stats.field params.
   (hossman, Vitaliy Zhovtyuk, Steve Molloy)
 
-SOLR-6533: Support editing common solrconfig.xml values (Noble Paul)
+* SOLR-6533: Support editing common solrconfig.xml values (Noble Paul)
+
+* SOLR-6607: Managing requesthandlers throuh API (Noble Paul)
 
 Bug Fixes
 ----------------------
@@ -289,12 +301,28 @@ Bug Fixes
   scripts; remove -XX:+AggressiveOpts and only set -XX:-UseSuperWord for Java 1.7u40
   to u51. (Uwe Schindler, janhoy, hossman, Timothy Potter)
 
+* SOLR-6738: Admin UI - Escape Data on Plugins-View (steffkes)
+
+* SOLR-3774: Solr adds RequestHandler SolrInfoMBeans twice to the JMX server.
+  (Tomás Fernández Löbbe, hossman, Mark Miller)
+
+* SOLR-6763: Shard leader elections should not persist across session expiry
+  (Alan Woodward, Mark Miller)
+
 Optimizations
 ----------------------
 
 * SOLR-6603: LBHttpSolrServer - lazily allocate skipped-zombie-servers list.
   (Christine Poerschke via shalin)
 
+* SOLR-6554: Speed up overseer operations avoiding cluster state reads from
+  zookeeper at the start of each loop and instead relying on local state and
+  compare-and-set writes. This change also adds batching for consecutive messages
+  belonging to the same collection with stateFormat=2. (shalin)
+
+* SOLR-6680: DefaultSolrHighlighter can sometimes avoid CachingTokenFilter to save memory and
+  enable other optimizations. (David Smiley)
+
 Other Changes
 ----------------------
 
@@ -353,6 +381,9 @@ Other Changes
 
 * SOLR-6453: Stop throwing an error message from Overseer when node exits (Ramkumar Aiyengar, Noble Paul)
 
+* SOLR-6550: Provide simple mechanism for passing additional metadata / context about a server-side
+   SolrException back to the client-side (Timothy Potter)
+
 * SOLR-6249: Schema API changes return success before all cores are updated; client application
   can provide the optional updateTimeoutSecs parameter to cause the server handling the
   managed schema update to block until all replicas of the same collection have processed the
@@ -391,6 +422,48 @@ Other Changes
 
 * SOLR-6697: bin/solr start scripts allow setting SOLR_OPTS in solr.in.* (janhoy)
 
+* SOLR-6739: Admin UI - Sort list of command line args (steffkes)
+
+* SOLR-6740: Admin UI - improve Files View (steffkes)
+
+* SOLR-6570: Run SolrZkClient session watch asynchronously. 
+ (Ramkumar Aiyengar via Mark Miller)
+ 
+* SOLR-6747: Add an optional caching option as a workaround for SOLR-6586.
+  (Mark Miller, Gregory Chanan)
+
+* SOLR-6459: Normalize logging of operations in Overseer and log current queue size.
+  (Ramkumar Aiyengar, shalin via Mark Miller)
+
+* SOLR-6754: ZkController.publish doesn't use the updateLastState parameter.
+  (shalin)
+
+* SOLR-6715: ZkSolrResourceLoader constructors accept a parameter called 'collection'
+  but it should be 'configName'. (shalin)
+
+* SOLR-6751: Exceptions thrown in the analysis chain in DirectUpdateHandler2
+  should return a BAD_REQUEST status (Alan Woodward)
+
+* SOLR-6792 : deprecate AdminHandlers, Clean up solrconfig.xml of
+  unnecessary plugin definitions, implicit registration of /replication,
+  /get and /admin/* handlers (Noble Paul)
+
+* SOLR-5864: Remove previous SolrCore as parameter on reload.
+  (Tomás Fernández Löbbe) 
+
+* SOLR-4792: Stop shipping a .war. (Robert Muir, Ramkumar Aiyengar, Mark Miller)
+
+* SOLR-6799: Update Saxon-HE to 9.6.0-2. (Mark Miller)
+
+* SOLR-6454: Suppress EOFExceptions in SolrDispatchFilter. 
+  (Ramkumar Aiyengar via Mark Miller)
+
+* SOLR-6370: Allow tests to report/fail on many ZK watches being parallelly
+  requested on the same data (Ramkumar Aiyengar via Timothy Potter)
+
+* SOLR-6752: Buffer Cache allocate/lost metrics should be exposed.
+  (Mike Drob via Mark Miller)
+
 ==================  4.10.3 ==================
 
 Bug Fixes
@@ -402,6 +475,18 @@ Bug Fixes
 
 * SOLR-6085: Suggester crashes when prefixToken is longer than surface form (janhoy)
 
+* SOLR-6323: ReRankingQParserPlugin cleaner paging and fix bug with fuzzy, range and other queries 
+  that need to be re-written. (Adair Kovac, Joel Bernstein)
+
+* SOLR-6684: Fix-up /export JSON. (Joel Bernstein)
+
+* SOLR-6781: BBoxField didn't support dynamic fields. (David Smiley)
+
+* SOLR-6784: BBoxField's 'score' mode should have been optional. (David Smiley)
+
+* SOLR-6510: The collapse QParser would throw a NPE when used on a DocValues field on
+  an empty segment/index. (Christine Poerschke, David Smiley)
+
 ==================  4.10.2 ==================
 
 Bug Fixes

Modified: lucene/dev/branches/lucene2878/solr/README.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2878/solr/README.txt?rev=1642718&r1=1642717&r2=1642718&view=diff
==============================================================================
--- lucene/dev/branches/lucene2878/solr/README.txt (original)
+++ lucene/dev/branches/lucene2878/solr/README.txt Mon Dec  1 17:25:39 2014
@@ -111,10 +111,10 @@ docs/index.html
 Instructions for Building Apache Solr from Source
 -------------------------------------------------
 
-1. Download the Java SE 7 JDK (Java Development Kit) or later from http://java.sun.com/
+1. Download the Java SE 8 JDK (Java Development Kit) or later from http://www.oracle.com/java/
    You will need the JDK installed, and the $JAVA_HOME/bin (Windows: %JAVA_HOME%\bin) 
    folder included on your command path. To test this, issue a "java -version" command 
-   from your shell (command prompt) and verify that the Java version is 1.7 or later.
+   from your shell (command prompt) and verify that the Java version is 1.8 or later.
 
 2. Download the Apache Ant binary distribution (1.8.2+) from 
    http://ant.apache.org/  You will need Ant installed and the $ANT_HOME/bin (Windows: 

Modified: lucene/dev/branches/lucene2878/solr/SYSTEM_REQUIREMENTS.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2878/solr/SYSTEM_REQUIREMENTS.txt?rev=1642718&r1=1642717&r2=1642718&view=diff
==============================================================================
--- lucene/dev/branches/lucene2878/solr/SYSTEM_REQUIREMENTS.txt (original)
+++ lucene/dev/branches/lucene2878/solr/SYSTEM_REQUIREMENTS.txt Mon Dec  1 17:25:39 2014
@@ -1,9 +1,6 @@
 # System Requirements 
 
-Apache Solr runs of Java 7 or greater, Java 8 is verified to be
-compatible and may bring some performance improvements. When using
-Oracle Java 7 or OpenJDK 7, be sure to not use the GA build 147 or
-update versions u40, u45 and u51! We recommend using u55 or later.
+Apache Solr runs of Java 8 or greater.
 
 It is also recommended to always use the latest update version of your
 Java VM, because bugs may affect Solr. An overview of known JVM bugs

Modified: lucene/dev/branches/lucene2878/solr/bin/solr
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2878/solr/bin/solr?rev=1642718&r1=1642717&r2=1642718&view=diff
==============================================================================
--- lucene/dev/branches/lucene2878/solr/bin/solr (original)
+++ lucene/dev/branches/lucene2878/solr/bin/solr Mon Dec  1 17:25:39 2014
@@ -51,7 +51,7 @@ hasLsof=$(which lsof)
 stop_all=false
 
 # for now, we don't support running this script from cygwin due to problems
-# like not having lsof, ps waux, curl, and awkward directory handling
+# like not having lsof, ps auxww, curl, and awkward directory handling
 if [ "${THIS_OS:0:6}" == "CYGWIN" ]; then
   echo -e "This script does not support cygwin due to severe limitations and lack of adherence\nto BASH standards, such as lack of lsof, curl, and ps options.\n\nPlease use the native solr.cmd script on Windows!"
   exit 1
@@ -258,7 +258,7 @@ function solr_pid_by_port() {
   THE_PORT="$1"
   if [ -e "$SOLR_TIP/bin/solr-$THE_PORT.pid" ]; then
     PID=`cat $SOLR_TIP/bin/solr-$THE_PORT.pid`
-    CHECK_PID=`ps waux | awk '{print $2}' | grep $PID | sort -r | tr -d ' '`
+    CHECK_PID=`ps auxww | awk '{print $2}' | grep $PID | sort -r | tr -d ' '`
     if [ "$CHECK_PID" != "" ]; then
       local solrPID=$PID
     fi
@@ -269,7 +269,7 @@ function solr_pid_by_port() {
 # extract the value of the -Djetty.port parameter from a running Solr process 
 function jetty_port() {
   SOLR_PID="$1"
-  SOLR_PROC=`ps waux | grep $SOLR_PID | grep start.jar | grep jetty.port`      
+  SOLR_PROC=`ps auxww | grep $SOLR_PID | grep start.jar | grep jetty.port`      
   IFS=' ' read -a proc_args <<< "$SOLR_PROC"
   for arg in "${proc_args[@]}"
     do
@@ -316,10 +316,10 @@ function get_info() {
     done
   else
     # no pid files but check using ps just to be sure
-    numSolrs=`ps waux | grep java | grep start.jar | wc -l | sed -e 's/^[ \t]*//'`
+    numSolrs=`ps auxww | grep java | grep start.jar | wc -l | sed -e 's/^[ \t]*//'`
     if [ "$numSolrs" != "0" ]; then
       echo -e "\nFound $numSolrs Solr nodes: "
-      for ID in `ps waux | grep java | grep start.jar | awk '{print $2}' | sort -r`
+      for ID in `ps auxww | grep java | grep start.jar | awk '{print $2}' | sort -r`
         do
           port=`jetty_port "$ID"`
           if [ "$port" != "" ]; then
@@ -357,7 +357,7 @@ function stop_solr() {
     exit 0
   fi
 
-  CHECK_PID=`ps waux | awk '{print $2}' | grep $SOLR_PID | sort -r | tr -d ' '`
+  CHECK_PID=`ps auxww | awk '{print $2}' | grep $SOLR_PID | sort -r | tr -d ' '`
   if [ "$CHECK_PID" != "" ]; then
     echo -e "Solr process $SOLR_PID is still running; forcefully killing it now."
     kill -9 $SOLR_PID
@@ -366,7 +366,7 @@ function stop_solr() {
     sleep 1
   fi
 
-  CHECK_PID=`ps waux | awk '{print $2}' | grep $SOLR_PID | sort -r | tr -d ' '`
+  CHECK_PID=`ps auxww | awk '{print $2}' | grep $SOLR_PID | sort -r | tr -d ' '`
   if [ "$CHECK_PID" != "" ]; then
     echo "ERROR: Failed to kill previous Solr Java process $SOLR_PID ... script fails."
     exit 1
@@ -409,17 +409,17 @@ if [ "$SCRIPT_CMD" == "healthcheck" ]; t
       case $1 in
           -c|-collection)
               if [[ "$2" == "" || "${2:0:1}" == "-" ]]; then
-                print_usage "$SCRIPT_CMD" "Expected collection name but found $2 instead!"
-                exit 1            
+                print_usage "$SCRIPT_CMD" "Collection name is required when using the $1 option!"
+                exit 1
               fi
               HEALTHCHECK_COLLECTION=$2
               shift 2
           ;;
           -z|-zkhost)          
               if [[ "$2" == "" || "${2:0:1}" == "-" ]]; then
-                print_usage "$SCRIPT_CMD" "Expected a ZooKeeper connection string but found $2 instead!"
-                exit 1            
-              fi          
+                print_usage "$SCRIPT_CMD" "ZooKeepeer connection string is required when using the $1 option!"
+                exit 1
+              fi
               ZK_HOST="$2"
               shift 2
           ;;
@@ -473,7 +473,7 @@ if [[ "$SCRIPT_CMD" == "create_core" || 
       case $1 in
           -n|-name)
               if [[ "$2" == "" || "${2:0:1}" == "-" ]]; then
-                print_usage "$SCRIPT_CMD" "Expected $CREATE_TYPE name but found $2 instead!"
+                print_usage "$SCRIPT_CMD" "$CREATE_TYPE name is required when using the $1 option!"
                 exit 1
               fi
               CREATE_NAME=$2
@@ -481,7 +481,7 @@ if [[ "$SCRIPT_CMD" == "create_core" || 
           ;;
           -c|-configset)
               if [[ "$2" == "" || "${2:0:1}" == "-" ]]; then
-                print_usage "$SCRIPT_CMD" "Expected configset name but found $2 instead!"
+                print_usage "$SCRIPT_CMD" "Configset name is required when using the $1 option!"
                 exit 1
               fi
               CREATE_CONFIGSET="$2"
@@ -489,7 +489,7 @@ if [[ "$SCRIPT_CMD" == "create_core" || 
           ;;
           -shards)
               if [[ "$2" == "" || "${2:0:1}" == "-" ]]; then
-                print_usage "$SCRIPT_CMD" "Expected shard count but found $2 instead!"
+                print_usage "$SCRIPT_CMD" "Shard count is required when using the $1 option!"
                 exit 1
               fi
               CREATE_NUM_SHARDS="$2"
@@ -497,12 +497,20 @@ if [[ "$SCRIPT_CMD" == "create_core" || 
           ;;
           -replicationFactor)
               if [[ "$2" == "" || "${2:0:1}" == "-" ]]; then
-                print_usage "$SCRIPT_CMD" "Expected replication factor but found $2 instead!"
+                print_usage "$SCRIPT_CMD" "Replication factor is required when using the $1 option!"
                 exit 1
               fi
               CREATE_REPFACT="$2"
               shift 2
           ;;
+          -p|-port)
+              if [[ "$2" == "" || "${2:0:1}" == "-" ]]; then
+                print_usage "$SCRIPT_CMD" "Solr port is required when using the $1 option!"
+                exit 1
+              fi
+              CREATE_PORT="$2"
+              shift 2
+          ;;
           -help|-usage)
               print_usage "$SCRIPT_CMD"
               exit 0
@@ -533,41 +541,28 @@ if [[ "$SCRIPT_CMD" == "create_core" || 
     exit 1
   fi
 
-  for ID in `ps waux | grep java | grep start.jar | awk '{print $2}' | sort -r`
-    do
-      port=`jetty_port "$ID"`
-      if [ "$port" != "" ]; then
-        CREATE_PORT=$port
-        break
-      fi
-  done
-
   if [ "$CREATE_PORT" == "" ]; then
-    echo "Failed to determine the port of a local Solr instance, cannot create $CREATE_TYPE!"
-    exit 1
+    for ID in `ps auxww | grep java | grep start.jar | awk '{print $2}' | sort -r`
+      do
+        port=`jetty_port "$ID"`
+        if [ "$port" != "" ]; then
+          CREATE_PORT=$port
+          break
+        fi
+    done
   fi
 
-  STATUS_INFO=`run_tool status -solr http://localhost:$CREATE_PORT/solr | tr -d ' '`
-  IS_CLOUD=`echo $STATUS_INFO | grep $'"cloud":' | tr -d ' '`
-  if [ "$IS_CLOUD" != "" ]; then
-    if [ "$SCRIPT_CMD" == "create_core" ]; then
-      echo -e "\nERROR: Solr running on port $CREATE_PORT is running in SolrCloud mode, please use create_collection command instead.\n"
-      exit 1
-    fi
-  else
-    if [ "$SCRIPT_CMD" == "create_collection" ]; then
-      echo -e "\nERROR: Solr running on port $CREATE_PORT is running in standalone server mode, please use the create_core command instead\ncreate_collection can only be used when running in SolrCloud mode.\n"
-      exit 1
-    fi
+  if [ "$CREATE_PORT" == "" ]; then
+    echo "Failed to determine the port of a local Solr instance, cannot create $CREATE_TYPE $CREATE_NAME"
+    exit 1
   fi
 
   if [ "$SCRIPT_CMD" == "create_collection" ]; then
     run_tool create_collection -name $CREATE_NAME -shards $CREATE_NUM_SHARDS -replicationFactor $CREATE_REPFACT \
       -config $CREATE_CONFIGSET -configsetsDir $SOLR_TIP/server/solr/configsets -solrUrl http://localhost:$CREATE_PORT/solr
   else
-    CREATE_URL="http://localhost:$CREATE_PORT/solr/admin/cores?action=CREATE&name=$CREATE_NAME&configSet=$CREATE_CONFIGSET"
-    echo -e "Creating new core using command:\n$CREATE_URL\n"
-    run_tool api -get $CREATE_URL
+    run_tool create_core -name $CREATE_NAME -solrUrl http://localhost:$CREATE_PORT/solr \
+      -config $CREATE_CONFIGSET -configsetsDir $SOLR_TIP/server/solr/configsets
   fi
 
   exit $?
@@ -576,7 +571,7 @@ fi
 
 # verify the command given is supported
 if [ "$SCRIPT_CMD" != "stop" ] && [ "$SCRIPT_CMD" != "start" ] && [ "$SCRIPT_CMD" != "restart" ]; then
-  print_usage "" "$SCRIPT_CMD not supported!"
+  print_usage "" "$SCRIPT_CMD is not a valid command!"
   exit 1
 fi
 
@@ -593,8 +588,8 @@ if [ $# -gt 0 ]; then
         ;;
         -d|-dir)
             if [[ "$2" == "" || "${2:0:1}" == "-" ]]; then
-              print_usage "$SCRIPT_CMD" "Expected directory but found $2 instead!"
-              exit 1            
+              print_usage "$SCRIPT_CMD" "Server directory is required when using the $1 option!"
+              exit 1
             fi
 
             # see if the arg value is relative to the tip vs full path
@@ -607,7 +602,7 @@ if [ $# -gt 0 ]; then
         ;;
         -s|-solr.home)
             if [[ "$2" == "" || "${2:0:1}" == "-" ]]; then
-              print_usage "$SCRIPT_CMD" "Expected directory but found $2 instead!"
+              print_usage "$SCRIPT_CMD" "Solr home directory is required when using the $1 option!"
               exit 1
             fi
 
@@ -616,8 +611,8 @@ if [ $# -gt 0 ]; then
         ;;
         -e|-example)
             if [[ "$2" == "" || "${2:0:1}" == "-" ]]; then
-              print_usage "$SCRIPT_CMD" "Expected example name but found $2 instead!"
-              exit 1            
+              print_usage "$SCRIPT_CMD" "Example name is required when using the $1 option!"
+              exit 1
             fi
             EXAMPLE="$2"
             shift 2
@@ -628,34 +623,33 @@ if [ $# -gt 0 ]; then
         ;;
         -h|-host)
             if [[ "$2" == "" || "${2:0:1}" == "-" ]]; then
-              print_usage "$SCRIPT_CMD" "Expected hostname but found $2 instead!"
-              exit 1            
+              print_usage "$SCRIPT_CMD" "Hostname is required when using the $1 option!"
+              exit 1
             fi
             SOLR_HOST="$2"
             shift 2
         ;;
         -m|-memory)
             if [[ "$2" == "" || "${2:0:1}" == "-" ]]; then
-              print_usage "$SCRIPT_CMD" "Expected memory setting but found $2 instead!"
-              exit 1            
-            fi            
+              print_usage "$SCRIPT_CMD" "Memory setting is required when using the $1 option!"
+              exit 1
+            fi
             SOLR_HEAP="$2"
             shift 2
         ;;
         -p|-port)
             if [[ "$2" == "" || "${2:0:1}" == "-" ]]; then
-              print_usage "$SCRIPT_CMD" "Expected port number but found $2 instead!"
-              exit 1            
-            fi            
+              print_usage "$SCRIPT_CMD" "Port number is required when using the $1 option!"
+              exit 1
+            fi
             SOLR_PORT="$2"
             shift 2
         ;;
         -z|-zkhost)
             if [[ "$2" == "" || "${2:0:1}" == "-" ]]; then
-              print_usage "$SCRIPT_CMD" "Expected ZooKeeper connection string but found $2 instead!"
-              exit 1            
+              print_usage "$SCRIPT_CMD" "ZooKeeper connection string is required when using the $1 option!"
+              exit 1
             fi
-
             ZK_HOST="$2"
             shift 2
         ;;
@@ -689,7 +683,7 @@ if [ $# -gt 0 ]; then
         ;;
         *)
             if [ "$1" != "" ]; then            
-              print_usage "$SCRIPT_CMD" "Error parsing argument $1!"
+              print_usage "$SCRIPT_CMD" "$1 is not supported by this script"
               exit 1
             else
               break # out-of-args, stop looping
@@ -782,15 +776,32 @@ if [ "$EXAMPLE" != "" ]; then
                 done
               done
             fi       
-            
-            for (( s=0; s<$CLOUD_NUM_NODES; s++ ))
+
+            # first, clone the server directory (w/o pulling over existing cores)
+            if [ ! -d "$SOLR_TIP/node1" ]; then
+              echo "Cloning $DEFAULT_SERVER_DIR into $SOLR_TIP/node1"
+              mkdir -p $SOLR_TIP/node1
+              cp -r $DEFAULT_SERVER_DIR/contexts $SOLR_TIP/node1/
+              cp -r $DEFAULT_SERVER_DIR/etc $SOLR_TIP/node1/
+              cp -r $DEFAULT_SERVER_DIR/lib $SOLR_TIP/node1/
+              cp -r $DEFAULT_SERVER_DIR/resources $SOLR_TIP/node1/
+              cp -r $DEFAULT_SERVER_DIR/scripts $SOLR_TIP/node1/
+              cp -r $DEFAULT_SERVER_DIR/webapps $SOLR_TIP/node1/
+              cp $DEFAULT_SERVER_DIR/start.jar $SOLR_TIP/node1/
+              mkdir -p $SOLR_TIP/node1/solr-webapp
+              mkdir -p $SOLR_TIP/node1/solr
+              cp -r $DEFAULT_SERVER_DIR/solr/configsets $SOLR_TIP/node1/solr/
+              cp $DEFAULT_SERVER_DIR/solr/solr.xml $SOLR_TIP/node1/solr/
+              cp $DEFAULT_SERVER_DIR/solr/zoo.cfg $SOLR_TIP/node1/solr/
+            fi
+
+            for (( s=1; s<$CLOUD_NUM_NODES; s++ ))
             do
               ndx=$[$s+1]
               if [ ! -d "$SOLR_TIP/node$ndx" ]; then
-                echo "Cloning $DEFAULT_SERVER_DIR into $SOLR_TIP/node$ndx"                 
-                cp -r $DEFAULT_SERVER_DIR $SOLR_TIP/node$ndx
-                rm -rf $SOLR_TIP/node$ndx/solr/zoo_data
-              fi              
+                echo "Cloning $SOLR_TIP/node1 into $SOLR_TIP/node$ndx"
+                cp -r $SOLR_TIP/node1 $SOLR_TIP/node$ndx
+              fi
             done
             SOLR_MODE="solrcloud"
             SOLR_SERVER_DIR="$SOLR_TIP/node1"
@@ -861,7 +872,7 @@ if [[ "$SCRIPT_CMD" == "start" ]]; then
 
   if [ "$SOLR_PID" == "" ]; then
     # not found using the pid file ... but use ps to ensure not found
-    SOLR_PID=`ps waux | grep start.jar | grep $SOLR_PORT | grep -v grep | awk '{print $2}' | sort -r`
+    SOLR_PID=`ps auxww | grep start.jar | grep $SOLR_PORT | grep -v grep | awk '{print $2}' | sort -r`
   fi
 
   if [ "$SOLR_PID" != "" ]; then
@@ -875,7 +886,7 @@ else
   SOLR_PID=`solr_pid_by_port "$SOLR_PORT"`
   if [ "$SOLR_PID" == "" ]; then
     # not found using the pid file ... but use ps to ensure not found
-    SOLR_PID=`ps waux | grep start.jar | grep $SOLR_PORT | grep -v grep | awk '{print $2}' | sort -r`
+    SOLR_PID=`ps auxww | grep start.jar | grep $SOLR_PORT | grep -v grep | awk '{print $2}' | sort -r`
   fi
   if [ "$SOLR_PID" != "" ]; then
     stop_solr "$SOLR_SERVER_DIR" "$SOLR_PORT" "$STOP_KEY" "$SOLR_PID"
@@ -1071,14 +1082,14 @@ $SOLR_OPTS"
             exit;
           fi
         else
-          SOLR_PID=`ps waux | grep start.jar | grep $SOLR_PORT | grep -v grep | awk '{print $2}' | sort -r`
+          SOLR_PID=`ps auxww | grep start.jar | grep $SOLR_PORT | grep -v grep | awk '{print $2}' | sort -r`
           echo -e "\nStarted Solr server on port $SOLR_PORT (pid=$SOLR_PID). Happy searching!\n"
           exit;
         fi
       done) &
       spinner $!
     else
-      SOLR_PID=`ps waux | grep start.jar | grep $SOLR_PORT | grep -v grep | awk '{print $2}' | sort -r`
+      SOLR_PID=`ps auxww | grep start.jar | grep $SOLR_PORT | grep -v grep | awk '{print $2}' | sort -r`
       echo -e "\nStarted Solr server on port $SOLR_PORT (pid=$SOLR_PID). Happy searching!\n"
       exit;
     fi
@@ -1094,9 +1105,8 @@ if [ "$EXAMPLE" != "cloud" ]; then
       run_tool create_collection -name $EXAMPLE -shards 1 -replicationFactor 1 \
         -config $EXAMPLE_CONFIGSET -configsetsDir $SOLR_TIP/server/solr/configsets -solrUrl http://localhost:$SOLR_PORT/solr
     else
-      CREATE_URL="http://localhost:$SOLR_PORT/solr/admin/cores?action=CREATE&name=$EXAMPLE&configSet=$EXAMPLE_CONFIGSET"
-      echo -e "Creating new core using command:\n$CREATE_URL\n"
-      run_tool api -get $CREATE_URL
+      run_tool create_core -name $EXAMPLE -solrUrl http://localhost:$SOLR_PORT/solr \
+        -config $EXAMPLE_CONFIGSET -configsetsDir $SOLR_TIP/server/solr/configsets
     fi
 
     if [ "$EXAMPLE" == "techproducts" ]; then