don't allow setting of defaut values via system properties anymore

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@216236 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Daniel Naber 2005-07-13 20:55:53 +00:00
parent 685b655822
commit 9ea49db638
2 changed files with 30 additions and 40 deletions

View File

@ -42,6 +42,16 @@ Changes in runtime behavior
is now initialized by the system time in milliseconds. is now initialized by the system time in milliseconds.
(Bernhard Messer via Daniel Naber) (Bernhard Messer via Daniel Naber)
7. Several default values cannot be set via system properties anymore, as
this has been considered inappropriate for a library like Lucene. For
most properties there are set/get methods available in IndexWriter which
you should use instead.
This affects the following properties: org.apache.lucene.writeLockTimeout,
org.apache.lucene.commitLockTimeout, org.apache.lucene.minMergeDocs,
org.apache.lucene.maxMergeDocs, org.apache.lucene.maxFieldLength,
org.apache.lucene.termIndexInterval, org.apache.lucene.mergeFactor
(Daniel Naber)
New features New features
1. Added support for stored compressed fields (patch #31149) 1. Added support for stored compressed fields (patch #31149)

View File

@ -28,7 +28,6 @@ import org.apache.lucene.store.Lock;
import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexInput;
import org.apache.lucene.store.IndexOutput; import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.search.Similarity; import org.apache.lucene.search.Similarity;
import org.apache.lucene.util.Constants;
import org.apache.lucene.document.Document; import org.apache.lucene.document.Document;
import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.Analyzer;
@ -60,66 +59,47 @@ import org.apache.lucene.analysis.Analyzer;
public class IndexWriter { public class IndexWriter {
/** /**
* Default value is 1000. Use <code>org.apache.lucene.writeLockTimeout</code> * Default value is 1,000.
* system property to override.
*/ */
public static long WRITE_LOCK_TIMEOUT = public final static long WRITE_LOCK_TIMEOUT = 1000;
Integer.parseInt(System.getProperty("org.apache.lucene.writeLockTimeout",
"1000"));
/** /**
* Default value is 10000. Use <code>org.apache.lucene.commitLockTimeout</code> * Default value is 10,000.
* system property to override.
*/ */
public static long COMMIT_LOCK_TIMEOUT = public final static long COMMIT_LOCK_TIMEOUT = 10000;
Integer.parseInt(System.getProperty("org.apache.lucene.commitLockTimeout",
"10000"));
public static final String WRITE_LOCK_NAME = "write.lock"; public static final String WRITE_LOCK_NAME = "write.lock";
public static final String COMMIT_LOCK_NAME = "commit.lock"; public static final String COMMIT_LOCK_NAME = "commit.lock";
/** /**
* Default value is 10. Use <code>org.apache.lucene.mergeFactor</code> * Default value is 10. Change using {@link #setMergeFactor(int)}.
* system property to override.
*/ */
public static final int DEFAULT_MERGE_FACTOR = public final static int DEFAULT_MERGE_FACTOR = 10;
Integer.parseInt(System.getProperty("org.apache.lucene.mergeFactor",
"10"));
/** /**
* Default value is 10. Use <code>org.apache.lucene.minMergeDocs</code> * Default value is 10. Change using {@link #setMaxBufferedDocs(int)}.
* system property to override.
*/ */
public static final int DEFAULT_MIN_MERGE_DOCS = public final static int DEFAULT_MAX_BUFFERED_DOCS = 10;
Integer.parseInt(System.getProperty("org.apache.lucene.minMergeDocs",
"10"));
/** /**
* Default value is {@link Integer#MAX_VALUE}. * @deprecated use {@link #DEFAULT_MAX_BUFFERED_DOCS} instead
* Use <code>org.apache.lucene.maxMergeDocs</code> system property to override.
*/ */
public static final int DEFAULT_MAX_MERGE_DOCS = public final static int DEFAULT_MIN_MERGE_DOCS = DEFAULT_MAX_BUFFERED_DOCS;
Integer.parseInt(System.getProperty("org.apache.lucene.maxMergeDocs",
String.valueOf(Integer.MAX_VALUE)));
/** /**
* Default value is 10000. Use <code>org.apache.lucene.maxFieldLength</code> * Default value is {@link Integer#MAX_VALUE}. Change using {@link #setMaxMergeDocs(int)}.
* system property to override.
*/ */
public static final int DEFAULT_MAX_FIELD_LENGTH = public final static int DEFAULT_MAX_MERGE_DOCS = Integer.MAX_VALUE;
Integer.parseInt(System.getProperty("org.apache.lucene.maxFieldLength",
"10000"));
/**
/** The default value for {@link #getTermIndexInterval()}. This is * Default value is 10,000. Change using {@link #setMaxFieldLength(int)}.
* determined by the <code>org.apache.lucene.termIndexInterval</code> system
* property. The default is 128.
*/ */
public static final int DEFAULT_TERM_INDEX_INTERVAL = public final static int DEFAULT_MAX_FIELD_LENGTH = 10000;
Integer.parseInt(System.getProperty("org.apache.lucene.termIndexInterval",
"128"));
/**
* Default value is 128. Change using {@link #setTermIndexInterval(int)}.
*/
public final static int DEFAULT_TERM_INDEX_INTERVAL = 128;
private Directory directory; // where this index resides private Directory directory; // where this index resides
private Analyzer analyzer; // how to analyze text private Analyzer analyzer; // how to analyze text