You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sh...@apache.org on 2013/02/11 15:32:04 UTC

svn commit: r1444786 - in /lucene/dev/branches/branch_4x: ./ solr/ solr/CHANGES.txt solr/core/ solr/core/src/java/org/apache/solr/core/NRTCachingDirectoryFactory.java

Author: shalin
Date: Mon Feb 11 14:32:04 2013
New Revision: 1444786

URL: http://svn.apache.org/r1444786
Log:
SOLR-4426: NRTCachingDirectoryFactory does not initialize maxCachedMB and maxMergeSizeMB if <directoryFactory> is not present in solrconfig.xml

Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/solr/   (props changed)
    lucene/dev/branches/branch_4x/solr/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/branch_4x/solr/core/   (props changed)
    lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/core/NRTCachingDirectoryFactory.java

Modified: lucene/dev/branches/branch_4x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/CHANGES.txt?rev=1444786&r1=1444785&r2=1444786&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_4x/solr/CHANGES.txt Mon Feb 11 14:32:04 2013
@@ -92,6 +92,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/branch_4x/solr/core/src/java/org/apache/solr/core/NRTCachingDirectoryFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/core/NRTCachingDirectoryFactory.java?rev=1444786&r1=1444785&r2=1444786&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/core/NRTCachingDirectoryFactory.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/core/NRTCachingDirectoryFactory.java Mon Feb 11 14:32:04 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");
     }