lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1445016 - in /lucene/dev/branches/lucene4765: ./ dev-tools/ dev-tools/maven/lucene/facet/ lucene/ lucene/core/ lucene/core/src/java/org/apache/lucene/index/ solr/ solr/core/ solr/core/src/java/org/apache/solr/core/
Date Tue, 12 Feb 2013 02:03:10 GMT
Author: rmuir
Date: Tue Feb 12 02:03:09 2013
New Revision: 1445016

URL: http://svn.apache.org/r1445016
Log:
Merged /lucene/dev/trunk:r1444646-1445015

Modified:
    lucene/dev/branches/lucene4765/   (props changed)
    lucene/dev/branches/lucene4765/dev-tools/   (props changed)
    lucene/dev/branches/lucene4765/dev-tools/maven/lucene/facet/pom.xml.template
    lucene/dev/branches/lucene4765/lucene/   (props changed)
    lucene/dev/branches/lucene4765/lucene/common-build.xml   (contents, props changed)
    lucene/dev/branches/lucene4765/lucene/core/   (props changed)
    lucene/dev/branches/lucene4765/lucene/core/src/java/org/apache/lucene/index/SegmentMerger.java
    lucene/dev/branches/lucene4765/solr/   (props changed)
    lucene/dev/branches/lucene4765/solr/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/lucene4765/solr/core/   (props changed)
    lucene/dev/branches/lucene4765/solr/core/src/java/org/apache/solr/core/NRTCachingDirectoryFactory.java

Modified: lucene/dev/branches/lucene4765/dev-tools/maven/lucene/facet/pom.xml.template
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4765/dev-tools/maven/lucene/facet/pom.xml.template?rev=1445016&r1=1445015&r2=1445016&view=diff
==============================================================================
--- lucene/dev/branches/lucene4765/dev-tools/maven/lucene/facet/pom.xml.template (original)
+++ lucene/dev/branches/lucene4765/dev-tools/maven/lucene/facet/pom.xml.template Tue Feb 12
02:03:09 2013
@@ -73,25 +73,5 @@
         </excludes>
       </testResource>
     </testResources>
-    <plugins>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>build-helper-maven-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>add-source</id>
-            <phase>generate-sources</phase>
-            <goals>
-              <goal>add-source</goal>
-            </goals>
-            <configuration>
-              <sources>
-                <source>${module-path}/src/examples</source>
-              </sources>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
   </build>
 </project>

Modified: lucene/dev/branches/lucene4765/lucene/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4765/lucene/common-build.xml?rev=1445016&r1=1445015&r2=1445016&view=diff
==============================================================================
--- lucene/dev/branches/lucene4765/lucene/common-build.xml (original)
+++ lucene/dev/branches/lucene4765/lucene/common-build.xml Tue Feb 12 02:03:09 2013
@@ -1930,7 +1930,7 @@ ${tests-output}/junit4-*.suites     - pe
   
   <!-- Forbidden API Task -->
   <target name="install-forbidden-apis" unless="forbidden-apis.loaded" depends="ivy-availability-check,ivy-configure">
-    <ivy:cachepath organisation="de.thetaphi" module="forbiddenapis" revision="1.0"
+    <ivy:cachepath organisation="de.thetaphi" module="forbiddenapis" revision="1.1"
       inline="true" conf="default" transitive="true" pathid="forbidden-apis.classpath"/>
     <taskdef name="forbidden-apis" classname="de.thetaphi.forbiddenapis.AntTask" classpathref="forbidden-apis.classpath"/>
     <property name="forbidden-apis.loaded" value="true"/>

Modified: lucene/dev/branches/lucene4765/lucene/core/src/java/org/apache/lucene/index/SegmentMerger.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4765/lucene/core/src/java/org/apache/lucene/index/SegmentMerger.java?rev=1445016&r1=1445015&r2=1445016&view=diff
==============================================================================
--- lucene/dev/branches/lucene4765/lucene/core/src/java/org/apache/lucene/index/SegmentMerger.java
(original)
+++ lucene/dev/branches/lucene4765/lucene/core/src/java/org/apache/lucene/index/SegmentMerger.java
Tue Feb 12 02:03:09 2013
@@ -161,95 +161,90 @@ final class SegmentMerger {
   }
 
   private void mergeDocValues(SegmentWriteState segmentWriteState) throws IOException {
-
-    if (codec.docValuesFormat() != null) {
-      DocValuesConsumer consumer = codec.docValuesFormat().fieldsConsumer(segmentWriteState);
-      boolean success = false;
-      try {
-        for (FieldInfo field : mergeState.fieldInfos) {
-          DocValuesType type = field.getDocValuesType();
-          if (type != null) {
-            if (type == DocValuesType.NUMERIC) {
-              List<NumericDocValues> toMerge = new ArrayList<NumericDocValues>();
-              for (AtomicReader reader : mergeState.readers) {
-                NumericDocValues values = reader.getNumericDocValues(field.name);
-                if (values == null) {
-                  values = NumericDocValues.EMPTY;
-                }
-                toMerge.add(values);
+    DocValuesConsumer consumer = codec.docValuesFormat().fieldsConsumer(segmentWriteState);
+    boolean success = false;
+    try {
+      for (FieldInfo field : mergeState.fieldInfos) {
+        DocValuesType type = field.getDocValuesType();
+        if (type != null) {
+          if (type == DocValuesType.NUMERIC) {
+            List<NumericDocValues> toMerge = new ArrayList<NumericDocValues>();
+            for (AtomicReader reader : mergeState.readers) {
+              NumericDocValues values = reader.getNumericDocValues(field.name);
+              if (values == null) {
+                values = NumericDocValues.EMPTY;
               }
-              consumer.mergeNumericField(field, mergeState, toMerge);
-            } else if (type == DocValuesType.BINARY) {
-              List<BinaryDocValues> toMerge = new ArrayList<BinaryDocValues>();
-              for (AtomicReader reader : mergeState.readers) {
-                BinaryDocValues values = reader.getBinaryDocValues(field.name);
-                if (values == null) {
-                  values = BinaryDocValues.EMPTY;
-                }
-                toMerge.add(values);
+              toMerge.add(values);
+            }
+            consumer.mergeNumericField(field, mergeState, toMerge);
+          } else if (type == DocValuesType.BINARY) {
+            List<BinaryDocValues> toMerge = new ArrayList<BinaryDocValues>();
+            for (AtomicReader reader : mergeState.readers) {
+              BinaryDocValues values = reader.getBinaryDocValues(field.name);
+              if (values == null) {
+                values = BinaryDocValues.EMPTY;
               }
-              consumer.mergeBinaryField(field, mergeState, toMerge);
-            } else if (type == DocValuesType.SORTED) {
-              List<SortedDocValues> toMerge = new ArrayList<SortedDocValues>();
-              for (AtomicReader reader : mergeState.readers) {
-                SortedDocValues values = reader.getSortedDocValues(field.name);
-                if (values == null) {
-                  values = SortedDocValues.EMPTY;
-                }
-                toMerge.add(values);
+              toMerge.add(values);
+            }
+            consumer.mergeBinaryField(field, mergeState, toMerge);
+          } else if (type == DocValuesType.SORTED) {
+            List<SortedDocValues> toMerge = new ArrayList<SortedDocValues>();
+            for (AtomicReader reader : mergeState.readers) {
+              SortedDocValues values = reader.getSortedDocValues(field.name);
+              if (values == null) {
+                values = SortedDocValues.EMPTY;
               }
-              consumer.mergeSortedField(field, mergeState, toMerge);
-            } else if (type == DocValuesType.SORTED_SET) {
-              List<SortedSetDocValues> toMerge = new ArrayList<SortedSetDocValues>();
-              for (AtomicReader reader : mergeState.readers) {
-                SortedSetDocValues values = reader.getSortedSetDocValues(field.name);
-                if (values == null) {
-                  values = SortedSetDocValues.EMPTY;
-                }
-                toMerge.add(values);
+              toMerge.add(values);
+            }
+            consumer.mergeSortedField(field, mergeState, toMerge);
+          } else if (type == DocValuesType.SORTED_SET) {
+            List<SortedSetDocValues> toMerge = new ArrayList<SortedSetDocValues>();
+            for (AtomicReader reader : mergeState.readers) {
+              SortedSetDocValues values = reader.getSortedSetDocValues(field.name);
+              if (values == null) {
+                values = SortedSetDocValues.EMPTY;
               }
-              consumer.mergeSortedSetField(field, mergeState, toMerge);
-            } else {
-              throw new AssertionError("type=" + type);
+              toMerge.add(values);
             }
+            consumer.mergeSortedSetField(field, mergeState, toMerge);
+          } else {
+            throw new AssertionError("type=" + type);
           }
         }
-        success = true;
-      } finally {
-        if (success) {
-          IOUtils.close(consumer);
-        } else {
-          IOUtils.closeWhileHandlingException(consumer);            
-        }
+      }
+      success = true;
+    } finally {
+      if (success) {
+        IOUtils.close(consumer);
+      } else {
+        IOUtils.closeWhileHandlingException(consumer);            
       }
     }
   }
 
   private void mergeNorms(SegmentWriteState segmentWriteState) throws IOException {
-    if (codec.normsFormat() != null) {
-      DocValuesConsumer consumer = codec.normsFormat().normsConsumer(segmentWriteState);
-      boolean success = false;
-      try {
-        for (FieldInfo field : mergeState.fieldInfos) {
-          if (field.hasNorms()) {
-            List<NumericDocValues> toMerge = new ArrayList<NumericDocValues>();
-            for (AtomicReader reader : mergeState.readers) {
-              NumericDocValues norms = reader.getNormValues(field.name);
-              if (norms == null) {
-                norms = NumericDocValues.EMPTY;
-              }
-              toMerge.add(norms);
+    DocValuesConsumer consumer = codec.normsFormat().normsConsumer(segmentWriteState);
+    boolean success = false;
+    try {
+      for (FieldInfo field : mergeState.fieldInfos) {
+        if (field.hasNorms()) {
+          List<NumericDocValues> toMerge = new ArrayList<NumericDocValues>();
+          for (AtomicReader reader : mergeState.readers) {
+            NumericDocValues norms = reader.getNormValues(field.name);
+            if (norms == null) {
+              norms = NumericDocValues.EMPTY;
             }
-            consumer.mergeNumericField(field, mergeState, toMerge);
+            toMerge.add(norms);
           }
+          consumer.mergeNumericField(field, mergeState, toMerge);
         }
-        success = true;
-      } finally {
-        if (success) {
-          IOUtils.close(consumer);
-        } else {
-          IOUtils.closeWhileHandlingException(consumer);            
-        }
+      }
+      success = true;
+    } finally {
+      if (success) {
+        IOUtils.close(consumer);
+      } else {
+        IOUtils.closeWhileHandlingException(consumer);            
       }
     }
   }

Modified: lucene/dev/branches/lucene4765/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4765/solr/CHANGES.txt?rev=1445016&r1=1445015&r2=1445016&view=diff
==============================================================================
--- lucene/dev/branches/lucene4765/solr/CHANGES.txt (original)
+++ lucene/dev/branches/lucene4765/solr/CHANGES.txt Tue Feb 12 02:03:09 2013
@@ -114,6 +114,9 @@ Bug Fixes
 * SOLR-3655: A restarted node can briefly appear live and active before it really
   is in some cases. (Mark Miller)
 
+* SOLR-4426: NRTCachingDirectoryFactory does not initialize maxCachedMB and maxMergeSizeMB
+  if <directoryFactory> is not present in solrconfig.xml (Jack Krupansky via shalin)
+
 Optimizations
 ----------------------
 

Modified: lucene/dev/branches/lucene4765/solr/core/src/java/org/apache/solr/core/NRTCachingDirectoryFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4765/solr/core/src/java/org/apache/solr/core/NRTCachingDirectoryFactory.java?rev=1445016&r1=1445015&r2=1445016&view=diff
==============================================================================
--- lucene/dev/branches/lucene4765/solr/core/src/java/org/apache/solr/core/NRTCachingDirectoryFactory.java
(original)
+++ lucene/dev/branches/lucene4765/solr/core/src/java/org/apache/solr/core/NRTCachingDirectoryFactory.java
Tue Feb 12 02:03:09 2013
@@ -31,18 +31,20 @@ import org.apache.solr.core.DirectoryFac
  * Factory to instantiate {@link org.apache.lucene.store.NRTCachingDirectory}
  */
 public class NRTCachingDirectoryFactory extends StandardDirectoryFactory {
-  private double maxMergeSizeMB;
-  private double maxCachedMB;
+  public static final int DEFAULT_MAX_MERGE_SIZE_MB = 4;
+  private double maxMergeSizeMB = DEFAULT_MAX_MERGE_SIZE_MB;
+  public static final int DEFAULT_MAX_CACHED_MB = 48;
+  private double maxCachedMB = DEFAULT_MAX_CACHED_MB;
 
   @Override
   public void init(NamedList args) {
     super.init(args);
     SolrParams params = SolrParams.toSolrParams(args);
-    maxMergeSizeMB = params.getDouble("maxMergeSizeMB", 4);
+    maxMergeSizeMB = params.getDouble("maxMergeSizeMB", DEFAULT_MAX_MERGE_SIZE_MB);
     if (maxMergeSizeMB <= 0){
       throw new IllegalArgumentException("maxMergeSizeMB must be greater than 0");
     }
-    maxCachedMB = params.getDouble("maxCachedMB", 48);
+    maxCachedMB = params.getDouble("maxCachedMB", DEFAULT_MAX_CACHED_MB);
     if (maxCachedMB <= 0){
       throw new IllegalArgumentException("maxCachedMB must be greater than 0");
     }



Mime
View raw message