lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject svn commit: r1444782 - in /lucene/dev/trunk/solr: CHANGES.txt core/src/java/org/apache/solr/core/NRTCachingDirectoryFactory.java
Date Mon, 11 Feb 2013 14:28:58 GMT
Author: shalin
Date: Mon Feb 11 14:28:57 2013
New Revision: 1444782

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

Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/NRTCachingDirectoryFactory.java

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1444782&r1=1444781&r2=1444782&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Mon Feb 11 14:28:57 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/trunk/solr/core/src/java/org/apache/solr/core/NRTCachingDirectoryFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/NRTCachingDirectoryFactory.java?rev=1444782&r1=1444781&r2=1444782&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/NRTCachingDirectoryFactory.java
(original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/NRTCachingDirectoryFactory.java
Mon Feb 11 14:28:57 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