You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ja...@apache.org on 2013/07/04 01:26:45 UTC

svn commit: r1499601 [18/20] - in /lucene/dev/branches/security: ./ dev-tools/ dev-tools/eclipse/ dev-tools/idea/.idea/libraries/ dev-tools/idea/solr/core/src/test/ dev-tools/maven/ dev-tools/maven/lucene/ dev-tools/maven/lucene/analysis/stempel/ dev-t...

Modified: lucene/dev/branches/security/solr/core/src/test/org/apache/solr/search/TestFoldingMultitermQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test/org/apache/solr/search/TestFoldingMultitermQuery.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test/org/apache/solr/search/TestFoldingMultitermQuery.java (original)
+++ lucene/dev/branches/security/solr/core/src/test/org/apache/solr/search/TestFoldingMultitermQuery.java Wed Jul  3 23:26:32 2013
@@ -46,8 +46,6 @@ public class TestFoldingMultitermQuery e
           "float_f", num,
           "long_f", num,
           "double_f", num,
-          "byte_f", num,
-          "short_f", num,
           "bool_f", boolVal,
           "date_f", "200" + Integer.toString(i % 10) + "-01-01T00:00:00Z",
           "content", docs[i],
@@ -269,7 +267,7 @@ public class TestFoldingMultitermQuery e
 
   @Test
   public void testNonTextTypes() {
-    String[] intTypes = {"int_f", "float_f", "long_f", "double_f", "byte_f", "short_f"};
+    String[] intTypes = {"int_f", "float_f", "long_f", "double_f"};
 
     for (String str : intTypes) {
       assertQ(req("q", str + ":" + "0"),

Modified: lucene/dev/branches/security/solr/core/src/test/org/apache/solr/search/TestPseudoReturnFields.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test/org/apache/solr/search/TestPseudoReturnFields.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test/org/apache/solr/search/TestPseudoReturnFields.java (original)
+++ lucene/dev/branches/security/solr/core/src/test/org/apache/solr/search/TestPseudoReturnFields.java Wed Jul  3 23:26:32 2013
@@ -49,6 +49,7 @@ public class TestPseudoReturnFields exte
 
   @BeforeClass
   public static void beforeTests() throws Exception {
+    System.setProperty("enable.update.log", "false"); // schema12 doesn't support _version_
     initCore("solrconfig.xml","schema12.xml");
 
 

Modified: lucene/dev/branches/security/solr/core/src/test/org/apache/solr/search/TestRecovery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test/org/apache/solr/search/TestRecovery.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test/org/apache/solr/search/TestRecovery.java (original)
+++ lucene/dev/branches/security/solr/core/src/test/org/apache/solr/search/TestRecovery.java Wed Jul  3 23:26:32 2013
@@ -17,6 +17,9 @@
 package org.apache.solr.search;
 
 
+import static org.apache.solr.update.processor.DistributingUpdateProcessorFactory.DISTRIB_UPDATE_PARAM;
+
+import org.apache.solr.common.SolrException;
 import org.noggit.ObjectBuilder;
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.request.SolrQueryRequest;
@@ -41,8 +44,16 @@ import java.util.concurrent.Future;
 import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
 
-import static org.apache.solr.update.processor.DistributingUpdateProcessorFactory.DISTRIB_UPDATE_PARAM;
-import static org.apache.solr.update.processor.DistributedUpdateProcessor.DistribPhase;
+import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.request.SolrQueryRequest;
+import org.apache.solr.update.DirectUpdateHandler2;
+import org.apache.solr.update.UpdateHandler;
+import org.apache.solr.update.UpdateLog;
+import org.apache.solr.update.processor.DistributedUpdateProcessor.DistribPhase;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.noggit.ObjectBuilder;
 
 public class TestRecovery extends SolrTestCaseJ4 {
 
@@ -487,7 +498,40 @@ public class TestRecovery extends SolrTe
   }
 
 
+
+  // we need to make sure that the log is informed of a core reload
   @Test
+  public void testReload() throws Exception {
+    long version = addAndGetVersion(sdoc("id","reload1") , null);
+
+    h.reload();
+
+    version = addAndGetVersion(sdoc("id","reload1", "_version_", Long.toString(version)), null);
+
+    assertU(commit());
+
+    // if we try the optimistic concurrency again, the tlog lookup maps should be clear
+    // and we should go to the index to check the version.  This indirectly tests that
+    // the update log was informed of the reload.  See SOLR-4858
+
+    version = addAndGetVersion(sdoc("id","reload1", "_version_", Long.toString(version)), null);
+
+    // a deleteByQuery currently forces open a new realtime reader via the update log.
+    // This also tests that the update log was informed of the new udpate handler.
+
+    deleteByQueryAndGetVersion("foo_t:hownowbrowncow", null);
+
+    version = addAndGetVersion(sdoc("id","reload1", "_version_", Long.toString(version)), null);
+
+    // if the update log was not informed of the new update handler, then the old core will
+    // incorrectly be used for some of the operations above and opened searchers
+    // will never be closed.  This used to cause the test framework to fail because of unclosed directory checks.
+    // SolrCore.openNewSearcher was modified to throw an error if the core is closed, resulting in
+    // a faster fail.
+  }
+
+
+    @Test
   public void testBufferingFlags() throws Exception {
 
     DirectUpdateHandler2.commitOnClose = false;
@@ -710,16 +754,17 @@ public class TestRecovery extends SolrTe
       clearIndex();
       assertU(commit());
 
-      File logDir = h.getCore().getUpdateHandler().getUpdateLog().getLogDir();
+      UpdateLog ulog = h.getCore().getUpdateHandler().getUpdateLog();
+      File logDir = new File(h.getCore().getUpdateHandler().getUpdateLog().getLogDir());
 
       h.close();
 
-      String[] files = UpdateLog.getLogList(logDir);
+      String[] files = ulog.getLogList(logDir);
       for (String file : files) {
         new File(logDir, file).delete();
       }
 
-      assertEquals(0, UpdateLog.getLogList(logDir).length);
+      assertEquals(0, ulog.getLogList(logDir).length);
 
       createCore();
 
@@ -737,7 +782,7 @@ public class TestRecovery extends SolrTe
       assertU(commit());
       assertJQ(req("qt","/get", "getVersions",""+maxReq), "/versions==" + versions.subList(0,Math.min(maxReq,start)));
 
-      assertEquals(2, UpdateLog.getLogList(logDir).length);
+      assertEquals(2, ulog.getLogList(logDir).length);
 
       addDocs(105, start, versions);  start+=105;
       assertJQ(req("qt","/get", "getVersions",""+maxReq), "/versions==" + versions.subList(0,Math.min(maxReq,start)));
@@ -745,7 +790,7 @@ public class TestRecovery extends SolrTe
       assertJQ(req("qt","/get", "getVersions",""+maxReq), "/versions==" + versions.subList(0,Math.min(maxReq,start)));
 
       // previous two logs should be gone now
-      assertEquals(1, UpdateLog.getLogList(logDir).length);
+      assertEquals(1, ulog.getLogList(logDir).length);
 
       addDocs(1, start, versions);  start+=1;
       h.close();
@@ -765,14 +810,14 @@ public class TestRecovery extends SolrTe
       assertJQ(req("qt","/get", "getVersions",""+maxReq), "/versions==" + versions.subList(0,Math.min(maxReq,start)));
 
       // previous logs should be gone now
-      assertEquals(1, UpdateLog.getLogList(logDir).length);
+      assertEquals(1, ulog.getLogList(logDir).length);
 
       //
       // test that a corrupt tlog file doesn't stop us from coming up, or seeing versions before that tlog file.
       //
       addDocs(1, start, new LinkedList<Long>()); // don't add this to the versions list because we are going to lose it...
       h.close();
-      files = UpdateLog.getLogList(logDir);
+      files = ulog.getLogList(logDir);
       Arrays.sort(files);
       RandomAccessFile raf = new RandomAccessFile(new File(logDir, files[files.length-1]), "rw");
       raf.writeChars("This is a trashed log file that really shouldn't work at all, but we'll see...");
@@ -820,7 +865,8 @@ public class TestRecovery extends SolrTe
         }
       };
 
-      File logDir = h.getCore().getUpdateHandler().getUpdateLog().getLogDir();
+      UpdateLog ulog = h.getCore().getUpdateHandler().getUpdateLog();
+      File logDir = new File(h.getCore().getUpdateHandler().getUpdateLog().getLogDir());
 
       clearIndex();
       assertU(commit());
@@ -830,7 +876,7 @@ public class TestRecovery extends SolrTe
       assertU(adoc("id","F3"));
 
       h.close();
-      String[] files = UpdateLog.getLogList(logDir);
+      String[] files = ulog.getLogList(logDir);
       Arrays.sort(files);
       RandomAccessFile raf = new RandomAccessFile(new File(logDir, files[files.length-1]), "rw");
       raf.seek(raf.length());  // seek to end
@@ -874,7 +920,8 @@ public class TestRecovery extends SolrTe
     try {
       DirectUpdateHandler2.commitOnClose = false;
 
-      File logDir = h.getCore().getUpdateHandler().getUpdateLog().getLogDir();
+      UpdateLog ulog = h.getCore().getUpdateHandler().getUpdateLog();
+      File logDir = new File(h.getCore().getUpdateHandler().getUpdateLog().getLogDir());
 
       clearIndex();
       assertU(commit());
@@ -886,7 +933,7 @@ public class TestRecovery extends SolrTe
       h.close();
 
 
-      String[] files = UpdateLog.getLogList(logDir);
+      String[] files = ulog.getLogList(logDir);
       Arrays.sort(files);
       RandomAccessFile raf = new RandomAccessFile(new File(logDir, files[files.length-1]), "rw");
       long len = raf.length();
@@ -957,7 +1004,8 @@ public class TestRecovery extends SolrTe
         }
       };
 
-      File logDir = h.getCore().getUpdateHandler().getUpdateLog().getLogDir();
+      UpdateLog ulog = h.getCore().getUpdateHandler().getUpdateLog();
+      File logDir = new File(h.getCore().getUpdateHandler().getUpdateLog().getLogDir());
 
       clearIndex();
       assertU(commit());
@@ -967,7 +1015,7 @@ public class TestRecovery extends SolrTe
       assertU(adoc("id","CCCCCC"));
 
       h.close();
-      String[] files = UpdateLog.getLogList(logDir);
+      String[] files = ulog.getLogList(logDir);
       Arrays.sort(files);
       String fname = files[files.length-1];
       RandomAccessFile raf = new RandomAccessFile(new File(logDir, fname), "rw");
@@ -1037,17 +1085,18 @@ public class TestRecovery extends SolrTe
 
   // stops the core, removes the transaction logs, restarts the core.
   void deleteLogs() throws Exception {
-    File logDir = h.getCore().getUpdateHandler().getUpdateLog().getLogDir();
+    UpdateLog ulog = h.getCore().getUpdateHandler().getUpdateLog();
+    File logDir = new File(h.getCore().getUpdateHandler().getUpdateLog().getLogDir());
 
     h.close();
 
     try {
-      String[] files = UpdateLog.getLogList(logDir);
+      String[] files = ulog.getLogList(logDir);
       for (String file : files) {
         new File(logDir, file).delete();
       }
 
-      assertEquals(0, UpdateLog.getLogList(logDir).length);
+      assertEquals(0, ulog.getLogList(logDir).length);
     } finally {
       // make sure we create the core again, even if the assert fails so it won't mess
       // up the next test.

Modified: lucene/dev/branches/security/solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java (original)
+++ lucene/dev/branches/security/solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java Wed Jul  3 23:26:32 2013
@@ -25,6 +25,7 @@ import org.junit.Test;
 public class TestSolrQueryParser extends SolrTestCaseJ4 {
   @BeforeClass
   public static void beforeClass() throws Exception {
+    System.setProperty("enable.update.log", "false"); // schema12 doesn't support _version_
     initCore("solrconfig.xml", "schema12.xml");
     createIndex();
   }

Modified: lucene/dev/branches/security/solr/core/src/test/org/apache/solr/search/TestValueSourceCache.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test/org/apache/solr/search/TestValueSourceCache.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test/org/apache/solr/search/TestValueSourceCache.java (original)
+++ lucene/dev/branches/security/solr/core/src/test/org/apache/solr/search/TestValueSourceCache.java Wed Jul  3 23:26:32 2013
@@ -78,8 +78,6 @@ public class TestValueSourceCache extend
         "val1_i1",
         "val1_l1",
         "val1_b1",
-        "val1_by1",
-        "val1_sh1"
     };
     for (String template : templates) {
       for (String nums : numbers) {

Modified: lucene/dev/branches/security/solr/core/src/test/org/apache/solr/search/function/distance/DistanceFunctionTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test/org/apache/solr/search/function/distance/DistanceFunctionTest.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test/org/apache/solr/search/function/distance/DistanceFunctionTest.java (original)
+++ lucene/dev/branches/security/solr/core/src/test/org/apache/solr/search/function/distance/DistanceFunctionTest.java Wed Jul  3 23:26:32 2013
@@ -30,6 +30,7 @@ import org.junit.Test;
 public class DistanceFunctionTest extends SolrTestCaseJ4 {
   @BeforeClass
   public static void beforeClass() throws Exception {
+    System.setProperty("enable.update.log", "false"); // schema12 doesn't support _version_
     initCore("solrconfig.xml", "schema12.xml");
   }
 

Modified: lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/DirectUpdateHandlerOptimizeTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/DirectUpdateHandlerOptimizeTest.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/DirectUpdateHandlerOptimizeTest.java (original)
+++ lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/DirectUpdateHandlerOptimizeTest.java Wed Jul  3 23:26:32 2013
@@ -35,6 +35,7 @@ public class DirectUpdateHandlerOptimize
 
   @BeforeClass
   public static void beforeClass() throws Exception {
+    System.setProperty("enable.update.log", "false"); // schema12 doesn't support _version_
     initCore("solrconfig.xml", "schema12.xml");
   }
 

Modified: lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/DirectUpdateHandlerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/DirectUpdateHandlerTest.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/DirectUpdateHandlerTest.java (original)
+++ lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/DirectUpdateHandlerTest.java Wed Jul  3 23:26:32 2013
@@ -45,6 +45,7 @@ public class DirectUpdateHandlerTest ext
   public static void beforeClass() throws Exception {
     savedFactory = System.getProperty("solr.DirectoryFactory");
     System.setProperty("solr.directoryFactory", "org.apache.solr.core.MockFSDirectoryFactory");
+    System.setProperty("enable.update.log", "false"); // schema12 doesn't support _version_
     initCore("solrconfig.xml", "schema12.xml");
   }
   

Modified: lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/DocumentBuilderTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/DocumentBuilderTest.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/DocumentBuilderTest.java (original)
+++ lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/DocumentBuilderTest.java Wed Jul  3 23:26:32 2013
@@ -357,9 +357,7 @@ public class DocumentBuilderTest extends
    */
   private static byte expectedNorm(final DefaultSimilarity sim,
                                    final int length, final float boost) {
-    
-    return sim.encodeNormValue(boost / ((float) Math.sqrt(length)));
-
+    return (byte) sim.encodeNormValue(boost / ((float) Math.sqrt(length)));
   }
     
 

Modified: lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/SolrIndexSplitterTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/SolrIndexSplitterTest.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/SolrIndexSplitterTest.java (original)
+++ lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/SolrIndexSplitterTest.java Wed Jul  3 23:26:32 2013
@@ -45,6 +45,7 @@ public class SolrIndexSplitterTest exten
 
   @BeforeClass
   public static void beforeClass() throws Exception {
+    System.setProperty("enable.update.log", "false"); // schema12 doesn't support _version_
     initCore("solrconfig.xml", "schema12.xml");
   }
 
@@ -135,12 +136,21 @@ public class SolrIndexSplitterTest exten
       CoreDescriptor dcore1 = new CoreDescriptor(h.getCoreContainer(), "split1", h.getCore().getCoreDescriptor().getInstanceDir());
       dcore1.setDataDir(indexDir1.getAbsolutePath());
       dcore1.setSchemaName("schema12.xml");
+      
+      if (h.getCoreContainer().getZkController() != null) {
+        h.getCoreContainer().preRegisterInZk(dcore1);
+      }
+      
       core1 = h.getCoreContainer().create(dcore1);
       h.getCoreContainer().register(core1, false);
 
       CoreDescriptor dcore2 = new CoreDescriptor(h.getCoreContainer(), "split2", h.getCore().getCoreDescriptor().getInstanceDir());
       dcore2.setDataDir(indexDir2.getAbsolutePath());
       dcore2.setSchemaName("schema12.xml");
+      
+      if (h.getCoreContainer().getZkController() != null) {
+        h.getCoreContainer().preRegisterInZk(dcore2);
+      }
       core2 = h.getCoreContainer().create(dcore2);
       h.getCoreContainer().register(core2, false);
 

Modified: lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/TestAtomicUpdateErrorCases.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/TestAtomicUpdateErrorCases.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/TestAtomicUpdateErrorCases.java (original)
+++ lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/TestAtomicUpdateErrorCases.java Wed Jul  3 23:26:32 2013
@@ -24,6 +24,7 @@ public class TestAtomicUpdateErrorCases 
 
   public void testUpdateNoTLog() throws Exception {
     try {
+      System.setProperty("enable.update.log", "false");
       initCore("solrconfig.xml","schema15.xml");
       
       UpdateHandler uh = h.getCore().getUpdateHandler();
@@ -56,6 +57,7 @@ public class TestAtomicUpdateErrorCases 
       }
 
     } finally {
+      System.clearProperty("enable.update.log");
       deleteCore();
     }
   }

Modified: lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/processor/FieldMutatingUpdateProcessorTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/processor/FieldMutatingUpdateProcessorTest.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/processor/FieldMutatingUpdateProcessorTest.java (original)
+++ lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/processor/FieldMutatingUpdateProcessorTest.java Wed Jul  3 23:26:32 2013
@@ -552,6 +552,8 @@ public class FieldMutatingUpdateProcesso
     IndexSchema schema = h.getCore().getLatestSchema();
     assertNull("test expects 'foo_giberish' to not be a valid field, looks like schema was changed out from under us",
                schema.getFieldTypeNoEx("foo_giberish"));
+    assertNull("test expects 'bar_giberish' to not be a valid field, looks like schema was changed out from under us",
+               schema.getFieldTypeNoEx("bar_giberish"));
     assertNotNull("test expects 't_raw' to be a valid field, looks like schema was changed out from under us",
                   schema.getFieldTypeNoEx("t_raw"));
     assertNotNull("test expects 'foo_s' to be a valid field, looks like schema was changed out from under us",
@@ -561,11 +563,13 @@ public class FieldMutatingUpdateProcesso
     
     d = processAdd("ignore-not-in-schema",       
                    doc(f("id", "1111"),
+                       f("bar_giberish", "123456789", "", 42, "abcd"),
                        f("foo_giberish", "123456789", "", 42, "abcd"),
                        f("t_raw", "123456789", "", 42, "abcd"),
                        f("foo_s", "hoss")));
     
     assertNotNull(d);
+    assertFalse(d.containsKey("bar_giberish"));
     assertFalse(d.containsKey("foo_giberish"));
     assertEquals(Arrays.asList("123456789", "", 42, "abcd"), 
                  d.getFieldValues("t_raw"));
@@ -574,15 +578,98 @@ public class FieldMutatingUpdateProcesso
     d = processAdd("ignore-some",
                    doc(f("id", "1111"),
                        f("foo_giberish", "123456789", "", 42, "abcd"),
+                       f("bar_giberish", "123456789", "", 42, "abcd"),
                        f("t_raw", "123456789", "", 42, "abcd"),
                        f("foo_s", "hoss")));
 
     assertNotNull(d);
     assertEquals(Arrays.asList("123456789", "", 42, "abcd"), 
                  d.getFieldValues("foo_giberish"));
+    assertEquals(Arrays.asList("123456789", "", 42, "abcd"), 
+                 d.getFieldValues("bar_giberish"));
     assertFalse(d.containsKey("t_raw"));
     assertEquals("hoss", d.getFieldValue("foo_s"));
-    
+
+    d = processAdd("ignore-not-in-schema-explicit-selector",
+                   doc(f("id", "1111"),
+                       f("foo_giberish", "123456789", "", 42, "abcd"),
+                       f("bar_giberish", "123456789", "", 42, "abcd"),
+                       f("t_raw", "123456789", "", 42, "abcd"),
+                       f("foo_s", "hoss")));
+    assertNotNull(d);
+    assertFalse(d.containsKey("foo_giberish"));
+    assertFalse(d.containsKey("bar_giberish"));
+    assertEquals(Arrays.asList("123456789", "", 42, "abcd"),
+                 d.getFieldValues("t_raw"));
+    assertEquals("hoss", d.getFieldValue("foo_s"));
+
+    d = processAdd("ignore-not-in-schema-and-foo-name-prefix",
+                   doc(f("id", "1111"),
+                       f("foo_giberish", "123456789", "", 42, "abcd"),
+                       f("bar_giberish", "123456789", "", 42, "abcd"),
+                       f("t_raw", "123456789", "", 42, "abcd"),
+                       f("foo_s", "hoss")));
+    assertNotNull(d);
+    assertFalse(d.containsKey("foo_giberish"));
+    assertEquals(Arrays.asList("123456789", "", 42, "abcd"),
+                 d.getFieldValues("bar_giberish"));
+    assertEquals(Arrays.asList("123456789", "", 42, "abcd"),
+                 d.getFieldValues("t_raw"));
+    assertEquals("hoss", d.getFieldValue("foo_s"));
+
+    d = processAdd("ignore-foo-name-prefix-except-not-schema",
+                   doc(f("id", "1111"),
+                       f("foo_giberish", "123456789", "", 42, "abcd"),
+                       f("bar_giberish", "123456789", "", 42, "abcd"),
+                       f("t_raw", "123456789", "", 42, "abcd"),
+                       f("foo_s", "hoss")));
+    assertNotNull(d);
+    assertEquals(Arrays.asList("123456789", "", 42, "abcd"),
+                 d.getFieldValues("foo_giberish"));
+    assertEquals(Arrays.asList("123456789", "", 42, "abcd"),
+                 d.getFieldValues("bar_giberish"));
+    assertEquals(Arrays.asList("123456789", "", 42, "abcd"),
+                 d.getFieldValues("t_raw"));
+    assertFalse(d.containsKey("foo_s"));
+
+    d = processAdd("ignore-in-schema",
+                   doc(f("id", "1111"),
+                       f("foo_giberish", "123456789", "", 42, "abcd"),
+                       f("bar_giberish", "123456789", "", 42, "abcd"),
+                       f("t_raw", "123456789", "", 42, "abcd"),
+                       f("foo_s", "hoss")));
+    assertNotNull(d);
+    assertTrue(d.containsKey("foo_giberish"));
+    assertTrue(d.containsKey("bar_giberish"));
+    assertFalse(d.containsKey("id"));
+    assertFalse(d.containsKey("t_raw"));
+    assertFalse(d.containsKey("foo_s"));
+
+    d = processAdd("ignore-not-in-schema-explicit-str-selector",
+                   doc(f("id", "1111"),
+                       f("foo_giberish", "123456789", "", 42, "abcd"),
+                       f("bar_giberish", "123456789", "", 42, "abcd"),
+                       f("t_raw", "123456789", "", 42, "abcd"),
+                       f("foo_s", "hoss")));
+    assertNotNull(d);
+    assertFalse(d.containsKey("foo_giberish"));
+    assertFalse(d.containsKey("bar_giberish"));
+    assertEquals(Arrays.asList("123456789", "", 42, "abcd"),
+                 d.getFieldValues("t_raw"));
+    assertEquals("hoss", d.getFieldValue("foo_s"));
+
+    d = processAdd("ignore-in-schema-str-selector",
+                   doc(f("id", "1111"),
+                       f("foo_giberish", "123456789", "", 42, "abcd"),
+                       f("bar_giberish", "123456789", "", 42, "abcd"),
+                       f("t_raw", "123456789", "", 42, "abcd"),
+                       f("foo_s", "hoss")));
+    assertNotNull(d);
+    assertTrue(d.containsKey("foo_giberish"));
+    assertTrue(d.containsKey("bar_giberish"));
+    assertFalse(d.containsKey("id"));
+    assertFalse(d.containsKey("t_raw"));
+    assertFalse(d.containsKey("foo_s"));
 
   }
 

Modified: lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/processor/RegexBoostProcessorTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/processor/RegexBoostProcessorTest.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/processor/RegexBoostProcessorTest.java (original)
+++ lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/processor/RegexBoostProcessorTest.java Wed Jul  3 23:26:32 2013
@@ -38,6 +38,7 @@ public class RegexBoostProcessorTest ext
 
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
+    System.setProperty("enable.update.log", "false"); // schema12 doesn't support _version_
     initCore("solrconfig.xml", "schema12.xml");
     SolrCore core = h.getCore();
     _parser = new SolrRequestParsers( null );

Modified: lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/processor/SignatureUpdateProcessorFactoryTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/processor/SignatureUpdateProcessorFactoryTest.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/processor/SignatureUpdateProcessorFactoryTest.java (original)
+++ lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/processor/SignatureUpdateProcessorFactoryTest.java Wed Jul  3 23:26:32 2013
@@ -52,6 +52,7 @@ public class SignatureUpdateProcessorFac
 
   @BeforeClass
   public static void beforeClass() throws Exception {
+    System.setProperty("enable.update.log", "false"); // schema12 doesn't support _version_
     initCore("solrconfig.xml", "schema12.xml");
   }
 

Modified: lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/processor/UniqFieldsUpdateProcessorFactoryTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/processor/UniqFieldsUpdateProcessorFactoryTest.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/processor/UniqFieldsUpdateProcessorFactoryTest.java (original)
+++ lucene/dev/branches/security/solr/core/src/test/org/apache/solr/update/processor/UniqFieldsUpdateProcessorFactoryTest.java Wed Jul  3 23:26:32 2013
@@ -43,6 +43,7 @@ public class UniqFieldsUpdateProcessorFa
 
   @BeforeClass
   public static void beforeClass() throws Exception {
+    System.setProperty("enable.update.log", "false"); // schema12 doesn't support _version_
     initCore("solrconfig.xml", "schema12.xml");
   }
 

Modified: lucene/dev/branches/security/solr/example/resources/log4j.properties
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/resources/log4j.properties?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/resources/log4j.properties (original)
+++ lucene/dev/branches/security/solr/example/resources/log4j.properties Wed Jul  3 23:26:32 2013
@@ -1,4 +1,5 @@
 #  Logging level
+solr.log=logs/
 log4j.rootLogger=INFO, file, CONSOLE
 
 log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
@@ -12,8 +13,12 @@ log4j.appender.file.MaxFileSize=4MB
 log4j.appender.file.MaxBackupIndex=9
 
 #- File to log to and log format
-log4j.appender.file.File=logs/solr.log
+log4j.appender.file.File=${solr.log}/solr.log
 log4j.appender.file.layout=org.apache.log4j.PatternLayout
 log4j.appender.file.layout.ConversionPattern=%-5p - %d{yyyy-MM-dd HH:mm:ss.SSS}; %C; %m\n
 
-log4j.logger.org.apache.zookeeper=WARN
\ No newline at end of file
+log4j.logger.org.apache.zookeeper=WARN
+log4j.logger.org.apache.hadoop=WARN
+
+# set to INFO to enable infostream log messages
+log4j.logger.org.apache.solr.update.LoggingInfoStream=OFF

Modified: lucene/dev/branches/security/solr/example/solr/collection1/conf/schema.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/solr/collection1/conf/schema.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/solr/collection1/conf/schema.xml (original)
+++ lucene/dev/branches/security/solr/example/solr/collection1/conf/schema.xml Wed Jul  3 23:26:32 2013
@@ -1031,8 +1031,9 @@
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_no.txt" format="snowball" />
         <filter class="solr.SnowballPorterFilterFactory" language="Norwegian"/>
-        <!-- less aggressive: <filter class="solr.NorwegianLightStemFilterFactory"/> -->
-        <!-- singular/plural: <filter class="solr.NorwegianMinimalStemFilterFactory"/> -->
+        <!-- less aggressive: <filter class="solr.NorwegianLightStemFilterFactory" variant="nb"/> -->
+        <!-- singular/plural: <filter class="solr.NorwegianMinimalStemFilterFactory" variant="nb"/> -->
+        <!-- The "light" and "minimal" stemmers support variants: nb=Bokmål, nn=Nynorsk, no=Both -->
       </analyzer>
     </fieldType>
     

Modified: lucene/dev/branches/security/solr/example/solr/collection1/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/solr/collection1/conf/solrconfig.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/solr/collection1/conf/solrconfig.xml (original)
+++ lucene/dev/branches/security/solr/example/solr/collection1/conf/solrconfig.xml Wed Jul  3 23:26:32 2013
@@ -66,6 +66,9 @@
        files in that directory which completely match the regex
        (anchored on both ends) will be included.
 
+       If a 'dir' option (with or without a regex) is used and nothing
+       is found that matches, a warning will be logged.
+
        The examples below can be used to load some solr-contribs along 
        with their external dependencies.
     -->
@@ -81,11 +84,6 @@
   <lib dir="../../../contrib/velocity/lib" regex=".*\.jar" />
   <lib dir="../../../dist/" regex="solr-velocity-\d.*\.jar" />
 
-  <!-- If a 'dir' option (with or without a regex) is used and nothing
-       is found that matches, a warning will be logged.
-    -->
-  <lib dir="/non/existent/dir/yields/warning" /> 
-
   <!-- an exact 'path' can be used instead of a 'dir' to specify a 
        specific jar file.  This will cause a serious error to be logged 
        if it can't be loaded.
@@ -186,7 +184,8 @@
          maxBufferedDocs sets a limit on the number of documents buffered
          before flushing.
          If both ramBufferSizeMB and maxBufferedDocs is set, then
-         Lucene will flush based on whichever limit is hit first.  -->
+         Lucene will flush based on whichever limit is hit first.
+         The default is 100 MB.  -->
     <!-- <ramBufferSizeMB>100</ramBufferSizeMB> -->
     <!-- <maxBufferedDocs>1000</maxBufferedDocs> -->
 
@@ -306,10 +305,11 @@
          To aid in advanced debugging, Lucene provides an "InfoStream"
          of detailed information when indexing.
 
-         Setting The value to true will instruct the underlying Lucene
-         IndexWriter to write its debugging info the specified file
+         Setting the value to true will instruct the underlying Lucene
+         IndexWriter to write its info stream to solr's log. By default,
+         this is enabled here, and controlled through log4j.properties.
       -->
-     <!-- <infoStream file="INFOSTREAM.txt">false</infoStream> --> 
+     <infoStream>true</infoStream>
   </indexConfig>
 
 
@@ -366,7 +366,7 @@
          have some sort of hard autoCommit to limit the log size.
       -->
      <autoCommit> 
-       <maxTime>15000</maxTime> 
+       <maxTime>${solr.autoCommit.maxTime:15000}</maxTime> 
        <openSearcher>false</openSearcher> 
      </autoCommit>
 
@@ -375,11 +375,10 @@
          but does not ensure that data is synced to disk.  This is
          faster and more near-realtime friendly than a hard commit.
       -->
-     <!--
-       <autoSoftCommit> 
-         <maxTime>1000</maxTime> 
-       </autoSoftCommit>
-      -->
+
+     <autoSoftCommit> 
+       <maxTime>${solr.autoSoftCommit.maxTime:-1}</maxTime> 
+     </autoSoftCommit>
 
     <!-- Update Related Event Listeners
          

Modified: lucene/dev/branches/security/solr/example/solr/solr.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/solr/solr.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/solr/solr.xml (original)
+++ lucene/dev/branches/security/solr/example/solr/solr.xml Wed Jul  3 23:26:32 2013
@@ -33,6 +33,7 @@
     <int name="hostPort">${jetty.port:8983}</int>
     <str name="hostContext">${hostContext:solr}</str>
     <int name="zkClientTimeout">${zkClientTimeout:15000}</int>
+    <bool name="genericCoreNodeNames">${genericCoreNodeNames:true}</bool>
   </solrcloud>
 
   <shardHandlerFactory name="shardHandlerFactory"

Modified: lucene/dev/branches/security/solr/licenses/morfologik-fsa-LICENSE-BSD.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/licenses/morfologik-fsa-LICENSE-BSD.txt?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/licenses/morfologik-fsa-LICENSE-BSD.txt (original)
+++ lucene/dev/branches/security/solr/licenses/morfologik-fsa-LICENSE-BSD.txt Wed Jul  3 23:26:32 2013
@@ -1,6 +1,6 @@
 
 Copyright (c) 2006 Dawid Weiss
-Copyright (c) 2007-2012 Dawid Weiss, Marcin Miłkowski
+Copyright (c) 2007-2013 Dawid Weiss, Marcin Miłkowski
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without modification, 
@@ -26,4 +26,4 @@ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIA
 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file

Modified: lucene/dev/branches/security/solr/licenses/morfologik-polish-LICENSE-BSD.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/licenses/morfologik-polish-LICENSE-BSD.txt?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/licenses/morfologik-polish-LICENSE-BSD.txt (original)
+++ lucene/dev/branches/security/solr/licenses/morfologik-polish-LICENSE-BSD.txt Wed Jul  3 23:26:32 2013
@@ -1,62 +1,26 @@
 BSD-licensed dictionary of Polish (Morfologik)
 
-Copyright (c) 2012, Marcin Miłkowski
+Morfologik Polish dictionary.
+Version: 2.0 PoliMorf
+Copyright (c) 2013, Marcin Miłkowski
 All rights reserved.
 
-Redistribution and  use in  source and binary  forms, with  or without
-modification, are permitted provided that the following conditions are
-met:
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met: 
 
-1. Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
+1. Redistributions of source code must retain the above copyright notice, this
+  list of conditions and the following disclaimer. 
+2. Redistributions in binary form must reproduce the above copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution. 
 
-2. Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in the
-   documentation and/or other materials provided with the
-   distribution.
-
-THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDERS “AS IS” AND ANY EXPRESS
-OR  IMPLIED WARRANTIES,  INCLUDING, BUT  NOT LIMITED  TO,  THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED.  IN NO EVENT  SHALL COPYRIGHT  HOLDERS OR  CONTRIBUTORS BE
-LIABLE FOR  ANY DIRECT,  INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES  (INCLUDING, BUT NOT LIMITED  TO, PROCUREMENT OF
-SUBSTITUTE  GOODS OR  SERVICES;  LOSS  OF USE,  DATA,  OR PROFITS;  OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED  AND ON ANY THEORY OF LIABILITY,
-WHETHER IN  CONTRACT, STRICT LIABILITY, OR  TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
---
-
-BSD-licensed dictionary of Polish (SGJP)
-http://sgjp.pl/morfeusz/
-
-Copyright © 2011 Zygmunt Saloni, Włodzimierz Gruszczyński, 
-	    	 Marcin Woliński, Robert Wołosz
-
-All rights reserved.
-
-Redistribution and  use in  source and binary  forms, with  or without
-modification, are permitted provided that the following conditions are
-met:
-
-1. Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in the
-   documentation and/or other materials provided with the
-   distribution.
-
-THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDERS “AS IS” AND ANY EXPRESS
-OR  IMPLIED WARRANTIES,  INCLUDING, BUT  NOT LIMITED  TO,  THE IMPLIED
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED.  IN NO EVENT  SHALL COPYRIGHT  HOLDERS OR  CONTRIBUTORS BE
-LIABLE FOR  ANY DIRECT,  INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES  (INCLUDING, BUT NOT LIMITED  TO, PROCUREMENT OF
-SUBSTITUTE  GOODS OR  SERVICES;  LOSS  OF USE,  DATA,  OR PROFITS;  OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED  AND ON ANY THEORY OF LIABILITY,
-WHETHER IN  CONTRACT, STRICT LIABILITY, OR  TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Modified: lucene/dev/branches/security/solr/licenses/morfologik-polish-NOTICE.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/licenses/morfologik-polish-NOTICE.txt?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/licenses/morfologik-polish-NOTICE.txt (original)
+++ lucene/dev/branches/security/solr/licenses/morfologik-polish-NOTICE.txt Wed Jul  3 23:26:32 2013
@@ -1,6 +1,3 @@
 
-This product includes data from BSD-licensed dictionary of Polish (Morfologik)
-(http://morfologik.blogspot.com/)
-
-This product includes data from BSD-licensed dictionary of Polish (SGJP)
-(http://sgjp.pl/morfeusz/)
+This product includes data from BSD-licensed dictionary of Polish (Morfologik, PoliMorf)
+(http://morfologik.blogspot.com/)
\ No newline at end of file

Modified: lucene/dev/branches/security/solr/licenses/morfologik-stemming-LICENSE-BSD.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/licenses/morfologik-stemming-LICENSE-BSD.txt?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/licenses/morfologik-stemming-LICENSE-BSD.txt (original)
+++ lucene/dev/branches/security/solr/licenses/morfologik-stemming-LICENSE-BSD.txt Wed Jul  3 23:26:32 2013
@@ -1,6 +1,6 @@
 
 Copyright (c) 2006 Dawid Weiss
-Copyright (c) 2007-2012 Dawid Weiss, Marcin Miłkowski
+Copyright (c) 2007-2013 Dawid Weiss, Marcin Miłkowski
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without modification, 
@@ -26,4 +26,4 @@ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIA
 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file

Modified: lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java (original)
+++ lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java Wed Jul  3 23:26:32 2013
@@ -91,6 +91,13 @@ public class CloudSolrServer extends Sol
       this.lbServer = new LBHttpSolrServer(myClient);
       this.updatesToLeaders = true;
   }
+  
+  public CloudSolrServer(String zkHost, boolean updatesToLeaders) throws MalformedURLException {
+    this.zkHost = zkHost;
+    this.myClient = HttpClientUtil.createClient(null);
+    this.lbServer = new LBHttpSolrServer(myClient);
+    this.updatesToLeaders = updatesToLeaders;
+}
 
   /**
    * @param zkHost The client endpoint of the zookeeper quorum containing the cloud state,
@@ -124,6 +131,11 @@ public class CloudSolrServer extends Sol
     this.defaultCollection = collection;
   }
 
+  /** Gets the default collection for request */
+  public String getDefaultCollection() {
+    return defaultCollection;
+  }
+
   /** Set the connect timeout to the zookeeper ensemble in ms */
   public void setZkConnectTimeout(int zkConnectTimeout) {
     this.zkConnectTimeout = zkConnectTimeout;
@@ -348,6 +360,10 @@ public class CloudSolrServer extends Sol
   public LBHttpSolrServer getLbServer() {
     return lbServer;
   }
+  
+  public boolean isUpdatesToLeaders() {
+    return updatesToLeaders;
+  }
 
   // for tests
   Map<String,List<String>> getUrlLists() {

Modified: lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrServer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrServer.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrServer.java (original)
+++ lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrServer.java Wed Jul  3 23:26:32 2013
@@ -658,7 +658,7 @@ public class HttpSolrServer extends Solr
    * status code that may have been returned by the remote server or a 
    * proxy along the way.
    */
-  protected static class RemoteSolrException extends SolrException {
+  public static class RemoteSolrException extends SolrException {
     /**
      * @param code Arbitrary HTTP status code
      * @param msg Exception Message

Modified: lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/impl/StreamingBinaryResponseParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/impl/StreamingBinaryResponseParser.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/impl/StreamingBinaryResponseParser.java (original)
+++ lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/impl/StreamingBinaryResponseParser.java Wed Jul  3 23:26:32 2013
@@ -16,17 +16,17 @@
  */
 package org.apache.solr.client.solrj.impl;
 
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+
 import org.apache.solr.client.solrj.StreamingResponseCallback;
 import org.apache.solr.common.SolrDocument;
 import org.apache.solr.common.SolrDocumentList;
 import org.apache.solr.common.SolrException;
-import org.apache.solr.common.util.FastInputStream;
-import org.apache.solr.common.util.NamedList;
+import org.apache.solr.common.util.DataInputInputStream;
 import org.apache.solr.common.util.JavaBinCodec;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
+import org.apache.solr.common.util.NamedList;
 
 /**
  * A BinaryResponseParser that sends callback events rather then build
@@ -49,14 +49,14 @@ public class StreamingBinaryResponsePars
       JavaBinCodec codec = new JavaBinCodec() {
 
         @Override
-        public SolrDocument readSolrDocument(FastInputStream dis) throws IOException {
+        public SolrDocument readSolrDocument(DataInputInputStream dis) throws IOException {
           SolrDocument doc = super.readSolrDocument(dis);
           callback.streamSolrDocument( doc );
           return null;
         }
 
         @Override
-        public SolrDocumentList readSolrDocumentList(FastInputStream dis) throws IOException {
+        public SolrDocumentList readSolrDocumentList(DataInputInputStream dis) throws IOException {
           SolrDocumentList solrDocs = new SolrDocumentList();
           List list = (List) readVal(dis);
           solrDocs.setNumFound((Long) list.get(0));

Modified: lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/request/JavaBinUpdateRequestCodec.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/request/JavaBinUpdateRequestCodec.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/request/JavaBinUpdateRequestCodec.java (original)
+++ lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/request/JavaBinUpdateRequestCodec.java Wed Jul  3 23:26:32 2013
@@ -16,18 +16,21 @@
  */
 package org.apache.solr.client.solrj.request;
 
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
 import org.apache.solr.common.SolrInputDocument;
 import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.common.params.SolrParams;
-import org.apache.solr.common.util.FastInputStream;
+import org.apache.solr.common.util.DataInputInputStream;
 import org.apache.solr.common.util.JavaBinCodec;
 import org.apache.solr.common.util.NamedList;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.*;
-
 /**
  * Provides methods for marshalling an UpdateRequest to a NamedList which can be serialized in the javabin format and
  * vice versa.
@@ -94,7 +97,7 @@ public class JavaBinUpdateRequestCodec {
       private boolean seenOuterMostDocIterator = false;
         
       @Override
-      public NamedList readNamedList(FastInputStream dis) throws IOException {
+      public NamedList readNamedList(DataInputInputStream dis) throws IOException {
         int sz = readSize(dis);
         NamedList nl = new NamedList();
         if (namedList[0] == null) {
@@ -109,7 +112,7 @@ public class JavaBinUpdateRequestCodec {
       }
 
       @Override
-      public List readIterator(FastInputStream fis) throws IOException {
+      public List readIterator(DataInputInputStream fis) throws IOException {
 
         // default behavior for reading any regular Iterator in the stream
         if (seenOuterMostDocIterator) return super.readIterator(fis);
@@ -120,7 +123,7 @@ public class JavaBinUpdateRequestCodec {
         return readOuterMostDocIterator(fis);
       }
 
-      private List readOuterMostDocIterator(FastInputStream fis) throws IOException {
+      private List readOuterMostDocIterator(DataInputInputStream fis) throws IOException {
         NamedList params = (NamedList) namedList[0].getVal(0);
         updateRequest.setParams(new ModifiableSolrParams(SolrParams.toSolrParams(params)));
         if (handler == null) return super.readIterator(fis);

Modified: lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java (original)
+++ lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java Wed Jul  3 23:26:32 2013
@@ -165,15 +165,18 @@ public class ClusterState implements JSO
     return Collections.unmodifiableSet(liveNodes);
   }
 
-  /**
-   * Get the slice/shardId for a core.
-   * @param coreNodeName in the form of nodeName_coreName (the name of the replica)
-   */
-  public String getShardId(String coreNodeName) {
-    //  System.out.println("###### getShardId("+coreNodeName+") in " + collectionStates);
+  public String getShardId(String baseUrl, String coreName) {
+    // System.out.println("###### getShardId(" + baseUrl + "," + coreName + ") in " + collectionStates);
     for (DocCollection coll : collectionStates.values()) {
       for (Slice slice : coll.getSlices()) {
-        if (slice.getReplicasMap().containsKey(coreNodeName)) return slice.getName();
+        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)) {
+            return slice.getName();
+          }
+        }
       }
     }
     return null;

Modified: lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/common/cloud/ConnectionManager.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/common/cloud/ConnectionManager.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/common/cloud/ConnectionManager.java (original)
+++ lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/common/cloud/ConnectionManager.java Wed Jul  3 23:26:32 2013
@@ -95,7 +95,7 @@ class ConnectionManager implements Watch
                 // if keeper does not replace oldKeeper we must be sure to close it
                 synchronized (connectionUpdateLock) {
                   try {
-                    waitForConnected(SolrZkClient.DEFAULT_CLIENT_CONNECT_TIMEOUT);
+                    waitForConnected(Long.MAX_VALUE);
                   } catch (Exception e1) {
                     closeKeeper(keeper);
                     throw new RuntimeException(e1);

Modified: lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java (original)
+++ lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java Wed Jul  3 23:26:32 2013
@@ -508,6 +508,7 @@ public class ZkStateReader {
   
   public List<ZkCoreNodeProps> getReplicaProps(String collection,
       String shardId, String thisCoreNodeName, String coreName, String mustMatchStateFilter, String mustNotMatchStateFilter) {
+    assert thisCoreNodeName != null;
     ClusterState clusterState = this.clusterState;
     if (clusterState == null) {
       return null;
@@ -540,7 +541,7 @@ public class ZkStateReader {
       }
     }
     if (nodes.size() == 0) {
-      // no replicas - go local
+      // no replicas
       return null;
     }
 

Modified: lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/common/util/FastInputStream.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/common/util/FastInputStream.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/common/util/FastInputStream.java (original)
+++ lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/common/util/FastInputStream.java Wed Jul  3 23:26:32 2013
@@ -22,7 +22,7 @@ import java.io.*;
 /** Single threaded buffered InputStream
  *  Internal Solr use only, subject to change.
  */
-public class FastInputStream extends InputStream implements DataInput {
+public class FastInputStream extends DataInputInputStream {
   protected final InputStream in;
   protected final byte[] buf;
   protected int pos;

Modified: lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/common/util/JavaBinCodec.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/common/util/JavaBinCodec.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/common/util/JavaBinCodec.java (original)
+++ lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/common/util/JavaBinCodec.java Wed Jul  3 23:26:32 2013
@@ -113,7 +113,7 @@ public class JavaBinCodec {
   }
 
 
-  public SimpleOrderedMap<Object> readOrderedMap(FastInputStream dis) throws IOException {
+  public SimpleOrderedMap<Object> readOrderedMap(DataInputInputStream dis) throws IOException {
     int sz = readSize(dis);
     SimpleOrderedMap<Object> nl = new SimpleOrderedMap<Object>();
     for (int i = 0; i < sz; i++) {
@@ -124,7 +124,7 @@ public class JavaBinCodec {
     return nl;
   }
 
-  public NamedList<Object> readNamedList(FastInputStream dis) throws IOException {
+  public NamedList<Object> readNamedList(DataInputInputStream dis) throws IOException {
     int sz = readSize(dis);
     NamedList<Object> nl = new NamedList<Object>();
     for (int i = 0; i < sz; i++) {
@@ -164,7 +164,7 @@ public class JavaBinCodec {
 
   protected byte tagByte;
 
-  public Object readVal(FastInputStream dis) throws IOException {
+  public Object readVal(DataInputInputStream dis) throws IOException {
     tagByte = dis.readByte();
 
     // if ((tagByte & 0xe0) == 0) {
@@ -304,7 +304,7 @@ public class JavaBinCodec {
     daos.write(arr, offset, len);
   }
 
-  public byte[] readByteArray(FastInputStream dis) throws IOException {
+  public byte[] readByteArray(DataInputInputStream dis) throws IOException {
     byte[] arr = new byte[readVInt(dis)];
     dis.readFully(arr);
     return arr;
@@ -321,7 +321,7 @@ public class JavaBinCodec {
     }
   }
 
-  public SolrDocument readSolrDocument(FastInputStream dis) throws IOException {
+  public SolrDocument readSolrDocument(DataInputInputStream dis) throws IOException {
     NamedList nl = (NamedList) readVal(dis);
     SolrDocument doc = new SolrDocument();
     for (int i = 0; i < nl.size(); i++) {
@@ -332,7 +332,7 @@ public class JavaBinCodec {
     return doc;
   }
 
-  public SolrDocumentList readSolrDocumentList(FastInputStream dis) throws IOException {
+  public SolrDocumentList readSolrDocumentList(DataInputInputStream dis) throws IOException {
     SolrDocumentList solrDocs = new SolrDocumentList();
     List list = (List) readVal(dis);
     solrDocs.setNumFound((Long) list.get(0));
@@ -356,7 +356,7 @@ public class JavaBinCodec {
     writeArray(docs);
   }
 
-  public SolrInputDocument readSolrInputDocument(FastInputStream dis) throws IOException {
+  public SolrInputDocument readSolrInputDocument(DataInputInputStream dis) throws IOException {
     int sz = readVInt(dis);
     float docBoost = (Float)readVal(dis);
     SolrInputDocument sdoc = new SolrInputDocument();
@@ -390,7 +390,7 @@ public class JavaBinCodec {
   }
 
 
-  public Map<Object,Object> readMap(FastInputStream dis)
+  public Map<Object,Object> readMap(DataInputInputStream dis)
           throws IOException {
     int sz = readVInt(dis);
     Map<Object,Object> m = new LinkedHashMap<Object,Object>();
@@ -411,7 +411,7 @@ public class JavaBinCodec {
     writeVal(END_OBJ);
   }
 
-  public List<Object> readIterator(FastInputStream fis) throws IOException {
+  public List<Object> readIterator(DataInputInputStream fis) throws IOException {
     ArrayList<Object> l = new ArrayList<Object>();
     while (true) {
       Object o = readVal(fis);
@@ -444,7 +444,7 @@ public class JavaBinCodec {
     }
   }
 
-  public List<Object> readArray(FastInputStream dis) throws IOException {
+  public List<Object> readArray(DataInputInputStream dis) throws IOException {
     int sz = readSize(dis);
     ArrayList<Object> l = new ArrayList<Object>(sz);
     for (int i = 0; i < sz; i++) {
@@ -473,7 +473,7 @@ public class JavaBinCodec {
   byte[] bytes;
   CharArr arr = new CharArr();
 
-  public String readStr(FastInputStream dis) throws IOException {
+  public String readStr(DataInputInputStream dis) throws IOException {
     int sz = readSize(dis);
     if (bytes == null || bytes.length < sz) bytes = new byte[sz];
     dis.readFully(bytes, 0, sz);
@@ -501,7 +501,7 @@ public class JavaBinCodec {
     }
   }
 
-  public int readSmallInt(FastInputStream dis) throws IOException {
+  public int readSmallInt(DataInputInputStream dis) throws IOException {
     int v = tagByte & 0x0F;
     if ((tagByte & 0x10) != 0)
       v = (readVInt(dis) << 4) | v;
@@ -525,7 +525,7 @@ public class JavaBinCodec {
     }
   }
 
-  public long readSmallLong(FastInputStream dis) throws IOException {
+  public long readSmallLong(DataInputInputStream dis) throws IOException {
     long v = tagByte & 0x0F;
     if ((tagByte & 0x10) != 0)
       v = (readVLong(dis) << 4) | v;
@@ -607,7 +607,7 @@ public class JavaBinCodec {
   }
 
 
-  public int readSize(FastInputStream in) throws IOException {
+  public int readSize(DataInputInputStream in) throws IOException {
     int sz = tagByte & 0x1f;
     if (sz == 0x1f) sz += readVInt(in);
     return sz;
@@ -634,7 +634,7 @@ public class JavaBinCodec {
    *
    * @throws IOException If there is a low-level I/O error.
    */
-  public static int readVInt(FastInputStream in) throws IOException {
+  public static int readVInt(DataInputInputStream in) throws IOException {
     byte b = in.readByte();
     int i = b & 0x7F;
     for (int shift = 7; (b & 0x80) != 0; shift += 7) {
@@ -653,7 +653,7 @@ public class JavaBinCodec {
     out.writeByte((byte) i);
   }
 
-  public static long readVLong(FastInputStream in) throws IOException {
+  public static long readVLong(DataInputInputStream in) throws IOException {
     byte b = in.readByte();
     long i = b & 0x7F;
     for (int shift = 7; (b & 0x80) != 0; shift += 7) {
@@ -683,7 +683,7 @@ public class JavaBinCodec {
 
   }
 
-  public String readExternString(FastInputStream fis) throws IOException {
+  public String readExternString(DataInputInputStream fis) throws IOException {
     int idx = readSize(fis);
     if (idx != 0) {// idx != 0 is the index of the extern string
       return stringsList.get(idx - 1);

Modified: lucene/dev/branches/security/solr/solrj/src/test-files/solrj/log4j.properties
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/test-files/solrj/log4j.properties?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/test-files/solrj/log4j.properties (original)
+++ lucene/dev/branches/security/solr/solrj/src/test-files/solrj/log4j.properties Wed Jul  3 23:26:32 2013
@@ -7,3 +7,4 @@ log4j.appender.CONSOLE.layout=org.apache
 log4j.appender.CONSOLE.layout.ConversionPattern=%-5p - %d{yyyy-MM-dd HH:mm:ss.SSS}; %C; %m\n
 
 log4j.logger.org.apache.zookeeper=WARN
+log4j.logger.org.apache.hadoop=WARN

Modified: lucene/dev/branches/security/solr/solrj/src/test-files/solrj/solr/collection1/conf/solrconfig-slave1.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/test-files/solrj/solr/collection1/conf/solrconfig-slave1.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/test-files/solrj/solr/collection1/conf/solrconfig-slave1.xml (original)
+++ lucene/dev/branches/security/solr/solrj/src/test-files/solrj/solr/collection1/conf/solrconfig-slave1.xml Wed Jul  3 23:26:32 2013
@@ -19,11 +19,12 @@
 
 <config>
   <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
+  <indexConfig>
+    <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
+  </indexConfig>
   <dataDir>${solr.data.dir:}</dataDir>
   <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
 
-  <!-- <indexConfig> section could go here, but we want the defaults -->
-
   <updateHandler class="solr.DirectUpdateHandler2">
   </updateHandler>
 

Modified: lucene/dev/branches/security/solr/solrj/src/test-files/solrj/solr/collection1/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/test-files/solrj/solr/collection1/conf/solrconfig.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/test-files/solrj/solr/collection1/conf/solrconfig.xml (original)
+++ lucene/dev/branches/security/solr/solrj/src/test-files/solrj/solr/collection1/conf/solrconfig.xml Wed Jul  3 23:26:32 2013
@@ -22,6 +22,9 @@
 -->
 <config>
   <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
+  <indexConfig>
+    <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
+  </indexConfig>
    <dataDir>${solr.data.dir:}</dataDir>
   <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/>
 

Modified: lucene/dev/branches/security/solr/solrj/src/test-files/solrj/solr/shared/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/test-files/solrj/solr/shared/conf/solrconfig.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/test-files/solrj/solr/shared/conf/solrconfig.xml (original)
+++ lucene/dev/branches/security/solr/solrj/src/test-files/solrj/solr/shared/conf/solrconfig.xml Wed Jul  3 23:26:32 2013
@@ -22,6 +22,9 @@
 -->
 <config>
   <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
+  <indexConfig>
+    <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
+  </indexConfig>
   <dataDir>${tempDir}/data/${l10n:}-${version:}</dataDir>
   <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
 

Modified: lucene/dev/branches/security/solr/solrj/src/test-files/solrj/solr/shared/solr.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/test-files/solrj/solr/shared/solr.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/test-files/solrj/solr/shared/solr.xml (original)
+++ lucene/dev/branches/security/solr/solrj/src/test-files/solrj/solr/shared/solr.xml Wed Jul  3 23:26:32 2013
@@ -30,7 +30,7 @@
   adminPath: RequestHandler path to manage cores.  
     If 'null' (or absent), cores will not be manageable via REST
   -->
-  <cores adminPath="/admin/cores" defaultCoreName="core0" host="127.0.0.1" hostPort="${hostPort:8983}" hostContext="${hostContext:solr}" zkClientTimeout="8000">
+  <cores adminPath="/admin/cores" defaultCoreName="core0" host="127.0.0.1" hostPort="${hostPort:8983}" hostContext="${hostContext:solr}" zkClientTimeout="8000" genericCoreNodeNames="${genericCoreNodeNames:true}">
     <core name="collection1" instanceDir="." />
     <core name="core0" instanceDir="${theInstanceDir:./}" dataDir="${dataDir1}" collection="${collection:acollection}">
       <property name="version" value="3.5"/>

Modified: lucene/dev/branches/security/solr/solrj/src/test-files/solrj/solr/solr.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/test-files/solrj/solr/solr.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/test-files/solrj/solr/solr.xml (original)
+++ lucene/dev/branches/security/solr/solrj/src/test-files/solrj/solr/solr.xml Wed Jul  3 23:26:32 2013
@@ -28,7 +28,7 @@
   adminPath: RequestHandler path to manage cores.  
     If 'null' (or absent), cores will not be manageable via request handler
   -->
-  <cores adminPath="/admin/cores" defaultCoreName="collection1" host="127.0.0.1" hostPort="${hostPort:8983}" hostContext="${hostContext:solr}" zkClientTimeout="8000" numShards="${numShards:3}">
+  <cores adminPath="/admin/cores" defaultCoreName="collection1" host="127.0.0.1" hostPort="${hostPort:8983}" hostContext="${hostContext:solr}" zkClientTimeout="8000" genericCoreNodeNames="${genericCoreNodeNames:true}">
     <core name="collection1" instanceDir="collection1" shard="${shard:}" collection="${collection:collection1}" config="${solrconfig:solrconfig.xml}" schema="${schema:schema.xml}"/>
   </cores>
 </solr>

Modified: lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/MergeIndexesExampleTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/MergeIndexesExampleTestBase.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/MergeIndexesExampleTestBase.java (original)
+++ lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/MergeIndexesExampleTestBase.java Wed Jul  3 23:26:32 2013
@@ -17,10 +17,6 @@
 
 package org.apache.solr.client.solrj;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.Arrays;
-
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.client.solrj.request.AbstractUpdateRequest;
 import org.apache.solr.client.solrj.request.CoreAdminRequest;
@@ -32,9 +28,12 @@ import org.apache.solr.common.params.Sol
 import org.apache.solr.core.CoreContainer;
 import org.apache.solr.core.SolrCore;
 import org.apache.solr.util.ExternalPaths;
-import org.junit.AfterClass;
 import org.junit.BeforeClass;
 
+import java.io.File;
+import java.io.IOException;
+import java.util.Arrays;
+
 /**
  * Abstract base class for testing merge indexes command
  *
@@ -42,7 +41,8 @@ import org.junit.BeforeClass;
  *
  */
 public abstract class MergeIndexesExampleTestBase extends SolrExampleTestBase {
-  protected static CoreContainer cores;
+
+  protected CoreContainer cores;
   private String saveProp;
   private File dataDir2;
 
@@ -56,13 +56,12 @@ public abstract class MergeIndexesExampl
     if (dataDir == null) {
       createTempDir();
     }
-    cores = new CoreContainer();
   }
-  
-  @AfterClass
-  public static void afterClass() {
-    cores.shutdown();
-    cores = null;
+
+  protected void setupCoreContainer() {
+    cores = new CoreContainer(getSolrHome());
+    cores.load();
+    //cores = CoreContainer.createAndLoad(getSolrHome(), new File(TEMP_DIR, "solr.xml"));
   }
   
   @Override
@@ -71,17 +70,19 @@ public abstract class MergeIndexesExampl
     System.setProperty("solr.directoryFactory", "solr.StandardDirectoryFactory");
     super.setUp();
 
-    SolrCore.log.info("CORES=" + cores + " : " + cores.getCoreNames());
-    cores.setPersistent(false);
-    
     // setup datadirs
-    System.setProperty( "solr.core0.data.dir", SolrTestCaseJ4.dataDir.getCanonicalPath() ); 
-    
+    System.setProperty( "solr.core0.data.dir", SolrTestCaseJ4.dataDir.getCanonicalPath() );
+
     dataDir2 = new File(TEMP_DIR, getClass().getName() + "-"
         + System.currentTimeMillis());
     dataDir2.mkdirs();
-    
-    System.setProperty( "solr.core1.data.dir", this.dataDir2.getCanonicalPath() ); 
+
+    System.setProperty( "solr.core1.data.dir", this.dataDir2.getCanonicalPath() );
+
+    setupCoreContainer();
+    SolrCore.log.info("CORES=" + cores + " : " + cores.getCoreNames());
+    cores.setPersistent(false);
+
   }
 
   @Override
@@ -96,6 +97,8 @@ public abstract class MergeIndexesExampl
         System.err.println("!!!! WARNING: best effort to remove " + dataDir2.getAbsolutePath() + " FAILED !!!!!");
       }
     }
+
+    cores.shutdown();
     
     if (saveProp == null) System.clearProperty("solr.directoryFactory");
     else System.setProperty("solr.directoryFactory", saveProp);

Modified: lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/MultiCoreExampleTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/MultiCoreExampleTestBase.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/MultiCoreExampleTestBase.java (original)
+++ lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/MultiCoreExampleTestBase.java Wed Jul  3 23:26:32 2013
@@ -17,8 +17,6 @@
 
 package org.apache.solr.client.solrj;
 
-import java.io.File;
-
 import org.apache.solr.client.solrj.request.AbstractUpdateRequest.ACTION;
 import org.apache.solr.client.solrj.request.CoreAdminRequest;
 import org.apache.solr.client.solrj.request.CoreAdminRequest.Unload;
@@ -30,10 +28,10 @@ import org.apache.solr.common.util.Named
 import org.apache.solr.core.CoreContainer;
 import org.apache.solr.core.SolrCore;
 import org.apache.solr.util.ExternalPaths;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
 import org.junit.Test;
 
+import java.io.File;
+
 
 /**
  *
@@ -41,30 +39,21 @@ import org.junit.Test;
  */
 public abstract class MultiCoreExampleTestBase extends SolrExampleTestBase 
 {
-  protected static CoreContainer cores;
+  protected CoreContainer cores;
 
   private File dataDir2;
   private File dataDir1;
 
   @Override public String getSolrHome() { return ExternalPaths.EXAMPLE_MULTICORE_HOME; }
 
-  
-  @BeforeClass
-  public static void beforeThisClass2() throws Exception {
+  protected void setupCoreContainer() {
     cores = new CoreContainer();
-  }
-  
-  @AfterClass
-  public static void afterClass() {
-    cores.shutdown();
+    cores.load();
   }
   
   @Override public void setUp() throws Exception {
     super.setUp();
 
-    SolrCore.log.info("CORES=" + cores + " : " + cores.getCoreNames());
-    cores.setPersistent(false);
-    
     dataDir1 = new File(TEMP_DIR, getClass().getName() + "-core0-"
         + System.currentTimeMillis());
     dataDir1.mkdirs();
@@ -74,7 +63,14 @@ public abstract class MultiCoreExampleTe
     dataDir2.mkdirs();
     
     System.setProperty( "solr.core0.data.dir", this.dataDir1.getCanonicalPath() ); 
-    System.setProperty( "solr.core1.data.dir", this.dataDir2.getCanonicalPath() ); 
+    System.setProperty( "solr.core1.data.dir", this.dataDir2.getCanonicalPath() );
+
+    setupCoreContainer();
+
+    SolrCore.log.info("CORES=" + cores + " : " + cores.getCoreNames());
+    cores.setPersistent(false);
+
+
   }
   
   @Override
@@ -89,6 +85,8 @@ public abstract class MultiCoreExampleTe
         System.err.println("!!!! WARNING: best effort to remove " + dataDir2.getAbsolutePath() + " FAILED !!!!!");
       }
     }
+
+    cores.shutdown();
   }
 
   @Override

Modified: lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/AbstractEmbeddedSolrServerTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/AbstractEmbeddedSolrServerTestCase.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/AbstractEmbeddedSolrServerTestCase.java (original)
+++ lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/AbstractEmbeddedSolrServerTestCase.java Wed Jul  3 23:26:32 2013
@@ -51,6 +51,7 @@ public abstract class AbstractEmbeddedSo
     super.setUp();
 
     System.setProperty("solr.solr.home", SOLR_HOME.getAbsolutePath());
+    System.out.println("Solr home: " + SOLR_HOME.getAbsolutePath());
 
     //The index is always stored within a temporary directory
     createTempDir();
@@ -61,7 +62,8 @@ public abstract class AbstractEmbeddedSo
     System.setProperty("dataDir2", dataDir2.getAbsolutePath());
     System.setProperty("tempDir", tempDir.getAbsolutePath());
     System.setProperty("tests.shardhandler.randomSeed", Long.toString(random().nextLong()));
-    cores = new CoreContainer(SOLR_HOME.getAbsolutePath(), getSolrXml());
+    cores = CoreContainer.createAndLoad(SOLR_HOME.getAbsolutePath(), getSolrXml());
+    cores.setPersistent(false);
   }
   
   protected abstract File getSolrXml() throws Exception;

Modified: lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/MergeIndexesEmbeddedTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/MergeIndexesEmbeddedTest.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/MergeIndexesEmbeddedTest.java (original)
+++ lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/MergeIndexesEmbeddedTest.java Wed Jul  3 23:26:32 2013
@@ -17,8 +17,6 @@
 
 package org.apache.solr.client.solrj.embedded;
 
-import java.io.File;
-
 import org.apache.solr.client.solrj.MergeIndexesExampleTestBase;
 import org.apache.solr.client.solrj.SolrServer;
 import org.apache.solr.core.SolrCore;
@@ -36,10 +34,6 @@ public class MergeIndexesEmbeddedTest ex
     // TODO: fix this test to use MockDirectoryFactory
     System.clearProperty("solr.directoryFactory");
     super.setUp();
-
-    File home = new File(getSolrHome());
-    File f = new File(home, "solr.xml");
-    cores.load(getSolrHome(), f);
   }
 
   @Override

Modified: lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/MultiCoreEmbeddedTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/MultiCoreEmbeddedTest.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/MultiCoreEmbeddedTest.java (original)
+++ lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/MultiCoreEmbeddedTest.java Wed Jul  3 23:26:32 2013
@@ -17,8 +17,6 @@
 
 package org.apache.solr.client.solrj.embedded;
 
-import java.io.File;
-
 import org.apache.solr.client.solrj.MultiCoreExampleTestBase;
 import org.apache.solr.client.solrj.SolrServer;
 
@@ -35,10 +33,6 @@ public class MultiCoreEmbeddedTest exten
     // TODO: fix this test to use MockDirectoryFactory
     System.clearProperty("solr.directoryFactory");
     super.setUp();
-    
-    File home = new File( getSolrHome() );
-    File f = new File( home, "solr.xml" );
-    cores.load( getSolrHome(), f );
   }
 
   @Override

Modified: lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java (original)
+++ lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java Wed Jul  3 23:26:32 2013
@@ -17,20 +17,16 @@
 
 package org.apache.solr.client.solrj.embedded;
 
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStreamReader;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.xpath.*;
-
+import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;
+import com.google.common.io.ByteStreams;
 import org.apache.commons.io.IOUtils;
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.SolrServer;
 import org.apache.solr.client.solrj.request.AbstractUpdateRequest.ACTION;
-import org.apache.solr.client.solrj.request.*;
+import org.apache.solr.client.solrj.request.CoreAdminRequest;
+import org.apache.solr.client.solrj.request.QueryRequest;
+import org.apache.solr.client.solrj.request.UpdateRequest;
 import org.apache.solr.client.solrj.response.CoreAdminResponse;
 import org.apache.solr.common.SolrInputDocument;
 import org.apache.solr.core.CoreContainer;
@@ -46,7 +42,17 @@ import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
 
-import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
 
 /**
  *
@@ -75,6 +81,17 @@ public class TestSolrProperties extends 
   public void tearDown() throws Exception {
    super.tearDown(); 
   }
+
+  private static void dumpFile(File fileToDump) throws IOException {
+    System.out.println("Dumping " + fileToDump.getAbsolutePath());
+    InputStream is = new FileInputStream(fileToDump);
+    try {
+      ByteStreams.copy(is, System.out);
+    }
+    finally {
+      IOUtils.closeQuietly(is);
+    }
+  }
   
   @Override
   protected File getSolrXml() throws Exception {
@@ -107,6 +124,10 @@ public class TestSolrProperties extends 
 
   @Test
   public void testProperties() throws Exception {
+
+    String persistedSolrXml = new File(tempDir, SOLR_PERSIST_XML).getAbsolutePath();
+    log.info("persistedSolrXml: {}", persistedSolrXml);
+
     UpdateRequest up = new UpdateRequest();
     up.setAction(ACTION.COMMIT, true, true);
     up.deleteByQuery("*:*");
@@ -176,14 +197,14 @@ public class TestSolrProperties extends 
     long after = mcr.getStartTime(name).getTime();
     assertTrue("should have more recent time: " + after + "," + before, after > before);
 
-    mcr = CoreAdminRequest.persist(SOLR_PERSIST_XML, coreadmin);
+    mcr = CoreAdminRequest.persist(persistedSolrXml, coreadmin);
 
     DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
-    FileInputStream fis = new FileInputStream(new File(tempDir, SOLR_PERSIST_XML));
+    FileInputStream fis = new FileInputStream(new File(persistedSolrXml));
     try {
       Document document = builder.parse(fis);
       fis.close();
-      fis = new FileInputStream(new File(tempDir, SOLR_PERSIST_XML));
+      fis = new FileInputStream(new File(persistedSolrXml));
       String solrPersistXml = IOUtils.toString(new InputStreamReader(fis, "UTF-8"));
       //System.out.println("xml:" + solrPersistXml);
       assertTrue("\"/solr/cores[@defaultCoreName='core0']\" doesn't match in:\n" + solrPersistXml,
@@ -196,21 +217,22 @@ public class TestSolrProperties extends 
                  exists("/solr/cores[@zkClientTimeout='8000']", document));
       assertTrue("\"/solr/cores[@hostContext='${hostContext:solr}']\" doesn't match in:\n" + solrPersistXml,
                  exists("/solr/cores[@hostContext='${hostContext:solr}']", document));
-      
+      assertTrue("\"/solr/cores[@genericCoreNodeNames='${genericCoreNodeNames:true}']\" doesn't match in:\n" + solrPersistXml,
+          exists("/solr/cores[@genericCoreNodeNames='${genericCoreNodeNames:true}']", document));
     } finally {
       fis.close();
     }
     
     CoreAdminRequest.renameCore(name, "renamed_core", coreadmin);
     
-    mcr = CoreAdminRequest.persist(SOLR_PERSIST_XML, getRenamedSolrAdmin());
+    mcr = CoreAdminRequest.persist(persistedSolrXml, getRenamedSolrAdmin());
     
 //    fis = new FileInputStream(new File(tempDir, SOLR_PERSIST_XML));
 //    String solrPersistXml = IOUtils.toString(fis);
 //    System.out.println("xml:" + solrPersistXml);
 //    fis.close();
     
-    fis = new FileInputStream(new File(tempDir, SOLR_PERSIST_XML));
+    fis = new FileInputStream(new File(persistedSolrXml));
     try {
       Document document = builder.parse(fis);
       assertTrue(exists("/solr/cores/core[@name='renamed_core']", document));
@@ -234,17 +256,17 @@ public class TestSolrProperties extends 
 //    System.out.println("xml:" + solrPersistXml);
 //    fis.close();
     
-    mcr = CoreAdminRequest.persist(SOLR_PERSIST_XML, getRenamedSolrAdmin());
+    mcr = CoreAdminRequest.persist(persistedSolrXml, getRenamedSolrAdmin());
     
 //    fis = new FileInputStream(new File(solrXml.getParent(), SOLR_PERSIST_XML));
 //    solrPersistXml = IOUtils.toString(fis);
 //    System.out.println("xml:" + solrPersistXml);
 //    fis.close();
     
-    fis = new FileInputStream(new File(tempDir, SOLR_PERSIST_XML));
+    fis = new FileInputStream(new File(persistedSolrXml));
     try {
       Document document = builder.parse(fis);
-      assertTrue(exists("/solr/cores/core[@name='collection1' and (@instanceDir='./' or @instanceDir='.\\')]", document));
+      assertTrue(exists("/solr/cores/core[@name='collection1' and @instanceDir='.']", document));
     } finally {
       fis.close();
     }
@@ -258,9 +280,9 @@ public class TestSolrProperties extends 
 //   System.out.println("xml:" + solrPersistXml);
 //   fis.close();
     
-    cores = new CoreContainer(SOLR_HOME.getAbsolutePath(), new File(tempDir, SOLR_PERSIST_XML));
+    cores = CoreContainer.createAndLoad(SOLR_HOME.getAbsolutePath(), new File(persistedSolrXml));
  
-    mcr = CoreAdminRequest.persist(SOLR_PERSIST_XML, getRenamedSolrAdmin());
+    //mcr = CoreAdminRequest.persist(SOLR_PERSIST_XML, getRenamedSolrAdmin());
     
 //     fis = new FileInputStream(new File(solrXml.getParent(),
 //     SOLR_PERSIST_XML));

Modified: lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/impl/BasicHttpSolrServerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/impl/BasicHttpSolrServerTest.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/impl/BasicHttpSolrServerTest.java (original)
+++ lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/impl/BasicHttpSolrServerTest.java Wed Jul  3 23:26:32 2013
@@ -495,6 +495,22 @@ public class BasicHttpSolrServerTest ext
     client.getConnectionManager().shutdown();
   }
 
+  /**
+   * A trivial test that verifies the example keystore used for SSL testing can be 
+   * found using the base class. this helps future-proof against hte possibility of 
+   * something moving/breaking thekeystore path in a way that results in the SSL 
+   * randomization logic being forced to silently never use SSL.  (We can't enforce 
+   * this type of check in the base class because then it would not be usable by client 
+   * code depending on the test framework
+   */
+  public void testExampleKeystorePath() {
+    assertNotNull("Example keystore is null, meaning that something has changed in the " +
+                  "structure of the example configs and/or ExternalPaths.java - " + 
+                  "SSL randomization is broken",
+                  getExampleKeystoreFile());
+  }
+
+
   private int findUnusedPort() {
     for (int port = 0; port < 65535; port++) {
       Socket s = new Socket();