You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2017/01/09 23:36:46 UTC

[1/2] lucene-solr:jira/solr-5944: Fix typo updatEable -> updatable

Repository: lucene-solr
Updated Branches:
  refs/heads/jira/solr-5944 a5b2d0960 -> 5e7c2543b


Fix typo updatEable -> updatable

(only one 'e' in proper spelling)


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/36ce0446
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/36ce0446
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/36ce0446

Branch: refs/heads/jira/solr-5944
Commit: 36ce0446dfa608d135a53b66298c0559de7d0d2a
Parents: a5b2d09
Author: Chris Hostetter <ho...@apache.org>
Authored: Mon Jan 9 16:32:46 2017 -0700
Committer: Chris Hostetter <ho...@apache.org>
Committed: Mon Jan 9 16:32:46 2017 -0700

----------------------------------------------------------------------
 .../org/apache/solr/update/DocumentBuilder.java |  2 +-
 .../processor/AtomicUpdateDocumentMerger.java   |  2 +-
 .../processor/DistributedUpdateProcessor.java   |  2 +-
 .../collection1/conf/schema-inplace-updates.xml | 10 +--
 .../update/TestInPlaceUpdatesStandalone.java    | 75 ++++++++++----------
 .../test/org/apache/solr/update/TestUpdate.java |  2 +-
 6 files changed, 45 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/36ce0446/solr/core/src/java/org/apache/solr/update/DocumentBuilder.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/update/DocumentBuilder.java b/solr/core/src/java/org/apache/solr/update/DocumentBuilder.java
index 0b2539f..eb6612e 100644
--- a/solr/core/src/java/org/apache/solr/update/DocumentBuilder.java
+++ b/solr/core/src/java/org/apache/solr/update/DocumentBuilder.java
@@ -47,7 +47,7 @@ public class DocumentBuilder {
    * @param forInPlaceUpdate Whether the field is to be added for in-place update. If true,
    *        only numeric docValues based fields are added to the document. This can be true
    *        when constructing a Lucene document for writing an in-place update, and we don't need
-   *        presence of non-updateable fields (non NDV) in such a document.
+   *        presence of non-updatable fields (non NDV) in such a document.
    */
   private static void addField(Document doc, SchemaField field, Object val, float boost, 
       boolean forInPlaceUpdate) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/36ce0446/solr/core/src/java/org/apache/solr/update/processor/AtomicUpdateDocumentMerger.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/update/processor/AtomicUpdateDocumentMerger.java b/solr/core/src/java/org/apache/solr/update/processor/AtomicUpdateDocumentMerger.java
index cc8b89e..0d5a0c8 100644
--- a/solr/core/src/java/org/apache/solr/update/processor/AtomicUpdateDocumentMerger.java
+++ b/solr/core/src/java/org/apache/solr/update/processor/AtomicUpdateDocumentMerger.java
@@ -150,7 +150,7 @@ public class AtomicUpdateDocumentMerger {
    * 
    * @return Return a set of fields that can be in-place updated.
    */
-  public static Set<String> computeInPlaceUpdateableFields(AddUpdateCommand cmd) throws IOException {
+  public static Set<String> computeInPlaceUpdatableFields(AddUpdateCommand cmd) throws IOException {
     SolrInputDocument sdoc = cmd.getSolrInputDocument();
     IndexSchema schema = cmd.getReq().getSchema();
     

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/36ce0446/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java b/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
index 5696a29..8f5d909 100644
--- a/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
+++ b/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
@@ -1339,7 +1339,7 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
   boolean getUpdatedDocument(AddUpdateCommand cmd, long versionOnUpdate) throws IOException {
     if (!AtomicUpdateDocumentMerger.isAtomicUpdate(cmd)) return false;
 
-    Set<String> inPlaceUpdatedFields = AtomicUpdateDocumentMerger.computeInPlaceUpdateableFields(cmd);
+    Set<String> inPlaceUpdatedFields = AtomicUpdateDocumentMerger.computeInPlaceUpdatableFields(cmd);
     if (inPlaceUpdatedFields.size() > 0) { // non-empty means this is suitable for in-place updates
       if (docMerger.doInPlaceUpdateMerge(cmd, inPlaceUpdatedFields)) {
         return true;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/36ce0446/solr/core/src/test-files/solr/collection1/conf/schema-inplace-updates.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-inplace-updates.xml b/solr/core/src/test-files/solr/collection1/conf/schema-inplace-updates.xml
index b3e1f38..f01335c 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-inplace-updates.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-inplace-updates.xml
@@ -16,10 +16,6 @@
  limitations under the License.
  -->
 <schema name="inplace-updates" version="1.6">
-  <!-- nocommit: the entire code base (configs & java) needs to be searched for "updatEable"
-       nocommit: and all usages need to be replaced with the correct spelling:  "updatable"
-       nocommit: (this isn't a schema specific concern, just needed a file to track it so i don't forget)
-  -->
   
   <uniqueKey>id</uniqueKey>
   <field name="id" type="string" indexed="true" stored="true" docValues="true"/>
@@ -46,12 +42,12 @@
   
   <!-- Copy fields -->
   
-  <!-- The id field  has a non in-place updateable copy target, but in-place updates should still work. -->
+  <!-- The id field  has a non in-place updatable copy target, but in-place updates should still work. -->
   <copyField source="id" dest="id_field_copy_that_does_not_support_in_place_update_s"/>
   
   <!-- copyfield1: src and dest are both updatable -->
-  <field name="copyfield1_src__both_updateable" type="int" indexed="false" stored="false" docValues="true" />
-  <copyField source="copyfield1_src__both_updateable" dest="copyfield1_dest__both_updatable_i_dvo"/>
+  <field name="copyfield1_src__both_updatable" type="int" indexed="false" stored="false" docValues="true" />
+  <copyField source="copyfield1_src__both_updatable" dest="copyfield1_dest__both_updatable_i_dvo"/>
 
   <!-- copyfield2: src is updatable but dest is not -->
   <field name="copyfield2_src__only_src_updatable" type="int" indexed="false" stored="false" docValues="true" />

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/36ce0446/solr/core/src/test/org/apache/solr/update/TestInPlaceUpdatesStandalone.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/update/TestInPlaceUpdatesStandalone.java b/solr/core/src/test/org/apache/solr/update/TestInPlaceUpdatesStandalone.java
index e83ba2e..cd464a7 100644
--- a/solr/core/src/test/org/apache/solr/update/TestInPlaceUpdatesStandalone.java
+++ b/solr/core/src/test/org/apache/solr/update/TestInPlaceUpdatesStandalone.java
@@ -361,7 +361,7 @@ public class TestInPlaceUpdatesStandalone extends SolrTestCaseJ4 {
       }
     }
 
-    // Update to recently deleted (or non-existent) document with a "set" on updateable 
+    // Update to recently deleted (or non-existent) document with a "set" on updatable 
     // field should succeed, since it is executed internally as a full update
     // because AUDM.doInPlaceUpdateMerge() returns false
     assertU(random().nextBoolean()? delI("1"): delQ("id:1"));
@@ -945,11 +945,11 @@ public class TestInPlaceUpdatesStandalone extends SolrTestCaseJ4 {
   }
 
   /** 
-   * @see #callComputeInPlaceUpdateableFields
-   * @see AtomicUpdateDocumentMerger#computeInPlaceUpdateableFields 
+   * @see #callComputeInPlaceUpdatableFields
+   * @see AtomicUpdateDocumentMerger#computeInPlaceUpdatableFields 
    */
   @Test
-  public void testComputeInPlaceUpdateableFields() throws Exception {
+  public void testComputeInPlaceUpdatableFields() throws Exception {
     Set<String> inPlaceUpdatedFields = new HashSet<String>();
 
     // these asserts should hold true regardless of type, or wether the field has a default
@@ -959,19 +959,19 @@ public class TestInPlaceUpdatesStandalone extends SolrTestCaseJ4 {
                                                "inplace_updatable_int_with_default");
     Collections.shuffle(fieldsToCheck, random()); // ... and regardless of order checked
     for (String field : fieldsToCheck) {
-      // In-place updateable field updated before it exists SHOULD NOT BE in-place updated:
-      inPlaceUpdatedFields = callComputeInPlaceUpdateableFields(sdoc("id", "1", "_version_", 42L,
-                                                                     field, map("set", 10)));
+      // In-place updatable field updated before it exists SHOULD NOT BE in-place updated:
+      inPlaceUpdatedFields = callComputeInPlaceUpdatableFields(sdoc("id", "1", "_version_", 42L,
+                                                                    field, map("set", 10)));
       assertFalse(field, inPlaceUpdatedFields.contains(field));
       
-      // In-place updateable field updated after it exists SHOULD BE in-place updated:
+      // In-place updatable field updated after it exists SHOULD BE in-place updated:
       addAndGetVersion(sdoc("id", "1", field, "0"), params()); // setting up the dv
-      inPlaceUpdatedFields = callComputeInPlaceUpdateableFields(sdoc("id", "1", "_version_", 42L,
-                                                                     field, map("set", 10)));
+      inPlaceUpdatedFields = callComputeInPlaceUpdatableFields(sdoc("id", "1", "_version_", 42L,
+                                                                    field, map("set", 10)));
       assertTrue(field, inPlaceUpdatedFields.contains(field));
 
-      inPlaceUpdatedFields = callComputeInPlaceUpdateableFields(sdoc("id", "1", "_version_", 42L,
-                                                                     field, map("inc", 10)));
+      inPlaceUpdatedFields = callComputeInPlaceUpdatableFields(sdoc("id", "1", "_version_", 42L,
+                                                                    field, map("inc", 10)));
       assertTrue(field, inPlaceUpdatedFields.contains(field));
 
       final String altFieldWithDefault = field.contains("float") ?
@@ -980,8 +980,8 @@ public class TestInPlaceUpdatesStandalone extends SolrTestCaseJ4 {
       // Updating an in-place updatable field (with a default) for the first time.
       // DV for it should have been already created when first document was indexed (above),
       // since it has a default value
-      inPlaceUpdatedFields = callComputeInPlaceUpdateableFields(sdoc("id", "1", "_version_", 42L,
-                                                                     altFieldWithDefault, map("set", 10)));
+      inPlaceUpdatedFields = callComputeInPlaceUpdatableFields(sdoc("id", "1", "_version_", 42L,
+                                                                    altFieldWithDefault, map("set", 10)));
       assertTrue(field + " -> " + altFieldWithDefault, inPlaceUpdatedFields.contains(altFieldWithDefault));
       
       deleteAllAndCommit();
@@ -990,48 +990,49 @@ public class TestInPlaceUpdatesStandalone extends SolrTestCaseJ4 {
     // Non in-place updates
     addAndGetVersion(sdoc("id", "1", "stored_i", "0"), params()); // setting up the dv
     assertTrue("stored field updated",
-               callComputeInPlaceUpdateableFields(sdoc("id", "1", "_version_", 42L, "stored_i", map("inc", 1))).isEmpty());
+               callComputeInPlaceUpdatableFields(sdoc("id", "1", "_version_", 42L,
+                                                      "stored_i", map("inc", 1))).isEmpty());
     
     assertTrue("full document update",
-               callComputeInPlaceUpdateableFields(sdoc("id", "1", "_version_", 42L,
-                                        "inplace_updatable_int_with_default", "100")).isEmpty());
+               callComputeInPlaceUpdatableFields(sdoc("id", "1", "_version_", 42L,
+                                                      "inplace_updatable_int_with_default", "100")).isEmpty());
   
     assertTrue("non existent dynamic dv field updated first time",
-               callComputeInPlaceUpdateableFields(sdoc("id", "1", "_version_", 42L,
-                                        "new_updatable_int_i_dvo", map("set", 10))).isEmpty());
+               callComputeInPlaceUpdatableFields(sdoc("id", "1", "_version_", 42L,
+                                                      "new_updatable_int_i_dvo", map("set", 10))).isEmpty());
     
     // After adding a full document with the dynamic dv field, in-place update should work
-    addAndGetVersion(sdoc("id", "2", "new_updateable_int_i_dvo", "0"), params()); // setting up the dv
+    addAndGetVersion(sdoc("id", "2", "new_updatable_int_i_dvo", "0"), params()); // setting up the dv
     if (random().nextBoolean()) {
       assertU(commit("softCommit", "false"));
     }
-    inPlaceUpdatedFields = callComputeInPlaceUpdateableFields(sdoc("id", "2", "_version_", 42L,
-                                                    "new_updateable_int_i_dvo", map("set", 10)));
-    assertTrue(inPlaceUpdatedFields.contains("new_updateable_int_i_dvo"));
+    inPlaceUpdatedFields = callComputeInPlaceUpdatableFields(sdoc("id", "2", "_version_", 42L,
+                                                                  "new_updatable_int_i_dvo", map("set", 10)));
+    assertTrue(inPlaceUpdatedFields.contains("new_updatable_int_i_dvo"));
 
     // for copy fields, regardless of wether the source & target support inplace updates,
     // it won't be inplace if the DVs don't exist yet...
     assertTrue("inplace fields should be empty when doc has no copyfield src values yet",
-               callComputeInPlaceUpdateableFields(sdoc("id", "1", "_version_", 42L,
-                                                       "copyfield1_src__both_updateable", map("set", 1),
-                                                       "copyfield2_src__only_src_updatable", map("set", 2))).isEmpty());
+               callComputeInPlaceUpdatableFields(sdoc("id", "1", "_version_", 42L,
+                                                      "copyfield1_src__both_updatable", map("set", 1),
+                                                      "copyfield2_src__only_src_updatable", map("set", 2))).isEmpty());
 
     // now add a doc that *does* have the src field for each copyfield...
     addAndGetVersion(sdoc("id", "3",
-                          "copyfield1_src__both_updateable", -13,
+                          "copyfield1_src__both_updatable", -13,
                           "copyfield2_src__only_src_updatable", -15), params()); 
     if (random().nextBoolean()) {
       assertU(commit("softCommit", "false"));
     }
     
     // If a supported dv field has a copyField target which is supported, it should be an in-place update
-    inPlaceUpdatedFields = callComputeInPlaceUpdateableFields(sdoc("id", "3", "_version_", 42L,
-                                                    "copyfield1_src__both_updateable", map("set", 10)));
-    assertTrue(inPlaceUpdatedFields.contains("copyfield1_src__both_updateable"));
+    inPlaceUpdatedFields = callComputeInPlaceUpdatableFields(sdoc("id", "3", "_version_", 42L,
+                                                                  "copyfield1_src__both_updatable", map("set", 10)));
+    assertTrue(inPlaceUpdatedFields.contains("copyfield1_src__both_updatable"));
 
     // If a supported dv field has a copyField target which is not supported, it should not be an in-place update
-    inPlaceUpdatedFields = callComputeInPlaceUpdateableFields(sdoc("id", "3", "_version_", 42L,
-                                                    "copyfield2_src__only_src_updatable", map("set", 10)));
+    inPlaceUpdatedFields = callComputeInPlaceUpdatableFields(sdoc("id", "3", "_version_", 42L,
+                                                                  "copyfield2_src__only_src_updatable", map("set", 10)));
     assertTrue(inPlaceUpdatedFields.isEmpty());
   }
 
@@ -1055,7 +1056,7 @@ public class TestInPlaceUpdatesStandalone extends SolrTestCaseJ4 {
       AddUpdateCommand cmd = buildAddUpdateCommand(req, sdoc("id", "1", "_version_", 42L,
                                                              "inplace_updatable_float", map("inc", 10)));
       AtomicUpdateDocumentMerger docMerger = new AtomicUpdateDocumentMerger(req);
-      assertTrue(docMerger.doInPlaceUpdateMerge(cmd, AtomicUpdateDocumentMerger.computeInPlaceUpdateableFields(cmd)));
+      assertTrue(docMerger.doInPlaceUpdateMerge(cmd, AtomicUpdateDocumentMerger.computeInPlaceUpdatableFields(cmd)));
       assertEquals(42L, cmd.getSolrInputDocument().getFieldValue("_version_"));
       assertEquals(42L, cmd.getSolrInputDocument().getFieldValue("_version_"));
       assertEquals(210f, cmd.getSolrInputDocument().getFieldValue("inplace_updatable_float"));
@@ -1072,7 +1073,7 @@ public class TestInPlaceUpdatesStandalone extends SolrTestCaseJ4 {
       AddUpdateCommand cmd = buildAddUpdateCommand(req, sdoc("id", "1", "_version_", 42L,
                                                              "inplace_updatable_float", map("inc", 10)));
       AtomicUpdateDocumentMerger docMerger = new AtomicUpdateDocumentMerger(req);
-      assertTrue(docMerger.doInPlaceUpdateMerge(cmd, AtomicUpdateDocumentMerger.computeInPlaceUpdateableFields(cmd)));
+      assertTrue(docMerger.doInPlaceUpdateMerge(cmd, AtomicUpdateDocumentMerger.computeInPlaceUpdatableFields(cmd)));
       assertEquals(42L, cmd.getSolrInputDocument().getFieldValue("_version_"));
       assertEquals(42L, cmd.getSolrInputDocument().getFieldValue("_version_"));
       assertEquals(210f, cmd.getSolrInputDocument().getFieldValue("inplace_updatable_float"));
@@ -1083,16 +1084,16 @@ public class TestInPlaceUpdatesStandalone extends SolrTestCaseJ4 {
   }
   
   /** 
-   * Helper method that sets up a req/cmd to run {@link AtomicUpdateDocumentMerger#computeInPlaceUpdateableFields} 
+   * Helper method that sets up a req/cmd to run {@link AtomicUpdateDocumentMerger#computeInPlaceUpdatableFields} 
    * on the specified solr input document.
    */
-  private static Set<String> callComputeInPlaceUpdateableFields(final SolrInputDocument sdoc) throws Exception {
+  private static Set<String> callComputeInPlaceUpdatableFields(final SolrInputDocument sdoc) throws Exception {
     try (SolrQueryRequest req = req()) {
       AddUpdateCommand cmd = new AddUpdateCommand(req);
       cmd.solrDoc = sdoc;
       assertTrue(cmd.solrDoc.containsKey(DistributedUpdateProcessor.VERSION_FIELD));
       cmd.setVersion(Long.parseLong(cmd.solrDoc.getFieldValue(DistributedUpdateProcessor.VERSION_FIELD).toString()));
-      return AtomicUpdateDocumentMerger.computeInPlaceUpdateableFields(cmd);
+      return AtomicUpdateDocumentMerger.computeInPlaceUpdatableFields(cmd);
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/36ce0446/solr/core/src/test/org/apache/solr/update/TestUpdate.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/update/TestUpdate.java b/solr/core/src/test/org/apache/solr/update/TestUpdate.java
index 6efa5bb..f16c384 100644
--- a/solr/core/src/test/org/apache/solr/update/TestUpdate.java
+++ b/solr/core/src/test/org/apache/solr/update/TestUpdate.java
@@ -32,7 +32,7 @@ public class TestUpdate extends SolrTestCaseJ4 {
   }
 
   @Test
-  public void testUpdateableDocs() throws Exception {
+  public void testUpdatableDocs() throws Exception {
     // The document may be retrieved from the index or from the transaction log.
     // Test both by running the same test with and without commits
 


[2/2] lucene-solr:jira/solr-5944: move nocommit comment to the relevant assert that fails

Posted by ho...@apache.org.
move nocommit comment to the relevant assert that fails


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/5e7c2543
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/5e7c2543
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/5e7c2543

Branch: refs/heads/jira/solr-5944
Commit: 5e7c2543b15a8eb5ff43870cdd1adaea7c532468
Parents: 36ce044
Author: Chris Hostetter <ho...@apache.org>
Authored: Mon Jan 9 16:36:37 2017 -0700
Committer: Chris Hostetter <ho...@apache.org>
Committed: Mon Jan 9 16:36:37 2017 -0700

----------------------------------------------------------------------
 solr/core/src/test/org/apache/solr/search/TestRecovery.java | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5e7c2543/solr/core/src/test/org/apache/solr/search/TestRecovery.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestRecovery.java b/solr/core/src/test/org/apache/solr/search/TestRecovery.java
index 00d8906..2782ef9 100644
--- a/solr/core/src/test/org/apache/solr/search/TestRecovery.java
+++ b/solr/core/src/test/org/apache/solr/search/TestRecovery.java
@@ -1121,7 +1121,6 @@ public class TestRecovery extends SolrTestCaseJ4 {
 
   @Test
   public void testLogReplayWithInPlaceUpdatesAndDeletes() throws Exception {
-    // nocommit: Fails due to SOLR-9941
 
     try {
 
@@ -1196,7 +1195,7 @@ public class TestRecovery extends SolrTestCaseJ4 {
       assertTrue(logReplayFinish.tryAcquire(timeout, TimeUnit.SECONDS));
       assertJQ(req("q","val_i_dvo:202") ,"/response/numFound==1"); // assert that in-place update is retained
 
-      assertJQ(req("q","*:*") ,"/response/numFound==2");
+      assertJQ(req("q","*:*") ,"/response/numFound==2");     // nocommit: Fails due to SOLR-9941
       assertJQ(req("q","id:A2") ,"/response/numFound==0");
       assertJQ(req("q","id:A3") ,"/response/numFound==0");
       assertJQ(req("q","id:A4") ,"/response/numFound==1");