lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r926725 [1/3] - in /lucene/java/branches/flex_1458: ./ backwards/src/ backwards/src/java/org/apache/lucene/index/ backwards/src/java/org/apache/lucene/search/ backwards/src/test/org/apache/lucene/analysis/ backwards/src/test/org/apache/luce...
Date Tue, 23 Mar 2010 18:52:21 GMT
Author: uschindler
Date: Tue Mar 23 18:52:19 2010
New Revision: 926725

URL: http://svn.apache.org/viewvc?rev=926725&view=rev
Log:
merge flex up to latest trunk rev 925462 - after that trunk is closed

Added:
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/SetOnce.java
      - copied unchanged from r925462, lucene/java/trunk/src/java/org/apache/lucene/util/SetOnce.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/util/TestSetOnce.java
      - copied unchanged from r925462, lucene/java/trunk/src/test/org/apache/lucene/util/TestSetOnce.java
Modified:
    lucene/java/branches/flex_1458/   (props changed)
    lucene/java/branches/flex_1458/CHANGES.txt
    lucene/java/branches/flex_1458/backwards/src/   (props changed)
    lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/index/IndexWriter.java
    lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/index/LogByteSizeMergePolicy.java
    lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/index/LogDocMergePolicy.java
    lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/index/LogMergePolicy.java
    lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/index/MergePolicy.java
    lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java   (props changed)
    lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java   (props changed)
    lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/document/TestDateTools.java   (props changed)
    lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/document/TestNumberTools.java   (props changed)
    lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestAddIndexesNoOptimize.java
    lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java   (props changed)
    lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java
    lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestIndexReaderReopen.java
    lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestIndexWriter.java
    lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java
    lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestIndexWriterReader.java
    lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/util/TestAttributeSource.java   (props changed)
    lucene/java/branches/flex_1458/build.xml   (props changed)
    lucene/java/branches/flex_1458/contrib/   (props changed)
    lucene/java/branches/flex_1458/contrib/CHANGES.txt   (props changed)
    lucene/java/branches/flex_1458/contrib/ant/src/java/org/apache/lucene/ant/IndexTask.java
    lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CreateIndexTask.java
    lucene/java/branches/flex_1458/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
    lucene/java/branches/flex_1458/contrib/highlighter/src/test/   (props changed)
    lucene/java/branches/flex_1458/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java   (props changed)
    lucene/java/branches/flex_1458/contrib/misc/src/java/org/apache/lucene/index/BalancedSegmentMergePolicy.java
    lucene/java/branches/flex_1458/contrib/remote/src/test/org/apache/lucene/search/TestRemoteSort.java
    lucene/java/branches/flex_1458/contrib/spatial/build.xml
    lucene/java/branches/flex_1458/contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java
    lucene/java/branches/flex_1458/contrib/wordnet/src/java/org/apache/lucene/wordnet/Syns2Index.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/Tokenizer.java   (props changed)
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexWriter.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexWriterConfig.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LogByteSizeMergePolicy.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LogDocMergePolicy.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LogMergePolicy.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/MergePolicy.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/MergeScheduler.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java   (props changed)
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/TestSearch.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/TestSearchForDuplicates.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java   (props changed)
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/document/TestDateTools.java   (props changed)
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/document/TestNumberTools.java   (props changed)
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestAddIndexesNoOptimize.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestAtomicUpdate.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java   (contents, props changed)
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestDeletionPolicy.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestFieldsReader.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexReader.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexReaderClone.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexReaderCloneNorms.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexReaderReopen.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexWriter.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexWriterConfig.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexWriterMerging.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexWriterReader.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestLazyBug.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestLazyProxSkipping.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestNRTReaderWithThreads.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestNorms.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestOmitTf.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestStressIndexing2.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestTermVectorsReader.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestTermdocPerf.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestThreadedOptimize.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestTransactions.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestElevationComparator.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestSort.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/store/TestBufferedIndexInput.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/store/TestFileSwitchDirectory.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/util/TestAttributeSource.java   (props changed)

Propchange: lucene/java/branches/flex_1458/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 23 18:52:19 2010
@@ -2,4 +2,4 @@
 /lucene/java/branches/lucene_2_9:817269-818600,829134,829881,831036,896850,909334
 /lucene/java/branches/lucene_2_9_back_compat_tests:818601-821336
 /lucene/java/branches/lucene_3_0:880793,896906
-/lucene/java/trunk:824912-825292,827043-833960,880727-886190,889185,889614-916543,916596,916685,916755,916769,917019,917148,917154,917161,917203-917204,919060,919119,919718,919731,919869,920237-920499,922013,922277,922525,922528,922583,922593,922602,922624,922797,922799,922806,922886-922887,923112,923238,924151,924207,924286,924321-924731,924781
+/lucene/java/trunk:824912-825292,827043-833960,880727-886190,889185,889614-916543,916596,916685,916755,916769,917019,917148,917154,917161,917203-917204,919060,919119,919718,919731,919869,920237-920499,922013,922277,922525,922528,922583,922593,922602,922624,922797,922799,922806,922886-922887,923112,923238,924151,924207,924286,924321-924731,924781,925176-925462

Modified: lucene/java/branches/flex_1458/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/CHANGES.txt?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/CHANGES.txt (original)
+++ lucene/java/branches/flex_1458/CHANGES.txt Tue Mar 23 18:52:19 2010
@@ -57,6 +57,15 @@ Changes in backwards compatibility polic
   This means that terms with a position increment gap of zero do not
   affect the norms calculation by default.  (Robert Muir)
 
+* LUCENE-2320: MergePolicy.writer is now of type SetOnce, which allows setting
+  the IndexWriter for a MergePolicy exactly once. You can change references to
+  'writer' from <code>writer.doXYZ()</code> to <code>writer.get().doXYZ()</code>
+  (it is also advisable to add an <code>assert writer != null;</code> before you
+  access the wrapped IndexWriter.
+  In addition, MergePolicy only exposes a default constructor, and the one that
+  took IndexWriter as argument has been removed from all MergePolicy extensions.
+  (Shai Erera via Mike McCandless)
+
 Changes in runtime behavior
 
 * LUCENE-1923: Made IndexReader.toString() produce something
@@ -124,6 +133,10 @@ API Changes
   Additionally, the setter/getter related to MergePolicy were deprecated as 
   well. One should interact with the MergePolicy directly.
   (Shai Erera via Mike McCandless)
+  
+* LUCENE-2320: IndexWriter's MergePolicy configuration was moved to 
+  IndexWriterConfig and the respective methods on IndexWriter were deprecated.
+  (Shai Erera via Mike McCandless) 
 
 Bug fixes
 
@@ -196,6 +209,9 @@ New features
 
 * LUCENE-2247: Added a CharArrayMap<V> for performance improvements
   in some stemmers and synonym filters. (Uwe Schindler)
+  
+* LUCENE-2320: Added SetOnce which wraps an object and allows it to be set 
+  exactly once. (Shai Erera via Mike McCandless)
 
 * LUCENE-2314: Added AttributeSource.copyTo(AttributeSource) that
   allows to use cloneAttributes() and this method as a replacement

Propchange: lucene/java/branches/flex_1458/backwards/src/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 23 18:52:19 2010
@@ -3,5 +3,5 @@
 /lucene/java/branches/lucene_2_9_back_compat_tests/src:818601-821336
 /lucene/java/branches/lucene_3_0/src:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
 /lucene/java/branches/lucene_3_0_back_compat_tests/src:880869-912395
-/lucene/java/trunk/backwards/src:922624,922806,923238,924286,924321-924731,924781
+/lucene/java/trunk/backwards/src:922624,922806,923238,924286,924321-924731,924781,925176-925462
 /lucene/java/trunk/src:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214

Modified: lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/index/IndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/index/IndexWriter.java?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/index/IndexWriter.java (original)
+++ lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/index/IndexWriter.java Tue Mar 23 18:52:19 2010
@@ -279,7 +279,7 @@ public class IndexWriter implements Clos
   // merges
   private HashSet<SegmentInfo> mergingSegments = new HashSet<SegmentInfo>();
 
-  private MergePolicy mergePolicy = new LogByteSizeMergePolicy(this);
+  private MergePolicy mergePolicy = new LogByteSizeMergePolicy();
   private MergeScheduler mergeScheduler = new ConcurrentMergeScheduler();
   private LinkedList<MergePolicy.OneMerge> pendingMerges = new LinkedList<MergePolicy.OneMerge>();
   private Set<MergePolicy.OneMerge> runningMerges = new HashSet<MergePolicy.OneMerge>();

Modified: lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/index/LogByteSizeMergePolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/index/LogByteSizeMergePolicy.java?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/index/LogByteSizeMergePolicy.java (original)
+++ lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/index/LogByteSizeMergePolicy.java Tue Mar 23 18:52:19 2010
@@ -30,8 +30,7 @@ public class LogByteSizeMergePolicy exte
    *  or larger will never be merged.  @see setMaxMergeMB */
   public static final double DEFAULT_MAX_MERGE_MB = Long.MAX_VALUE;
 
-  public LogByteSizeMergePolicy(IndexWriter writer) {
-    super(writer);
+  public LogByteSizeMergePolicy() {
     minMergeSize = (long) (DEFAULT_MIN_MERGE_MB*1024*1024);
     maxMergeSize = (long) (DEFAULT_MAX_MERGE_MB*1024*1024);
   }

Modified: lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/index/LogDocMergePolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/index/LogDocMergePolicy.java?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/index/LogDocMergePolicy.java (original)
+++ lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/index/LogDocMergePolicy.java Tue Mar 23 18:52:19 2010
@@ -28,8 +28,7 @@ public class LogDocMergePolicy extends L
   /** Default minimum segment size.  @see setMinMergeDocs */
   public static final int DEFAULT_MIN_MERGE_DOCS = 1000;
 
-  public LogDocMergePolicy(IndexWriter writer) {
-    super(writer);
+  public LogDocMergePolicy() {
     minMergeSize = DEFAULT_MIN_MERGE_DOCS;
 
     // maxMergeSize is never used by LogDocMergePolicy; set

Modified: lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/index/LogMergePolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/index/LogMergePolicy.java?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/index/LogMergePolicy.java (original)
+++ lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/index/LogMergePolicy.java Tue Mar 23 18:52:19 2010
@@ -66,10 +66,6 @@ public abstract class LogMergePolicy ext
   private boolean useCompoundFile = true;
   private boolean useCompoundDocStore = true;
 
-  public LogMergePolicy(IndexWriter writer) {
-    super(writer);
-  }
-  
   protected boolean verbose() {
     return writer != null && writer.verbose();
   }

Modified: lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/index/MergePolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/index/MergePolicy.java?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/index/MergePolicy.java (original)
+++ lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/index/MergePolicy.java Tue Mar 23 18:52:19 2010
@@ -200,8 +200,8 @@ public abstract class MergePolicy implem
 
   final protected IndexWriter writer;
   
-  public MergePolicy(IndexWriter writer) {
-    this.writer = writer;
+  public MergePolicy() {
+    this.writer = null;
   }
 
   /**

Propchange: lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 23 18:52:19 2010
@@ -3,5 +3,5 @@
 /lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:818601-821336
 /lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080,912383
 /lucene/java/branches/lucene_3_0_back_compat_tests/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:880869-912395
-/lucene/java/trunk/backwards/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:922624,922806,923238,924286,924321-924731,924781
+/lucene/java/trunk/backwards/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:922624,922806,923238,924286,924321-924731,924781,925176-925462
 /lucene/java/trunk/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:881213,881315,881466,881819,881984,882374,882807,882888,882977,883074-883075,885214,912319,912324,912328,912335,912372

Propchange: lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 23 18:52:19 2010
@@ -2,5 +2,5 @@
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:825998,829134,829881,831036
 /lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080,912383
 /lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:880869-912395
-/lucene/java/trunk/backwards/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:922624,922806,923238,924286,924321-924731,924781
+/lucene/java/trunk/backwards/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:922624,922806,923238,924286,924321-924731,924781,925176-925462
 /lucene/java/trunk/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214,912319,912324,912328,912335,912372

Propchange: lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/document/TestDateTools.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 23 18:52:19 2010
@@ -2,5 +2,5 @@
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/document/TestDateTools.java:825998,829134,829881,831036
 /lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/document/TestDateTools.java:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080,912383
 /lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/document/TestDateTools.java:880869-912395
-/lucene/java/trunk/backwards/src/test/org/apache/lucene/document/TestDateTools.java:922624,922806,923238,924286,924321-924731,924781
+/lucene/java/trunk/backwards/src/test/org/apache/lucene/document/TestDateTools.java:922624,922806,923238,924286,924321-924731,924781,925176-925462
 /lucene/java/trunk/src/test/org/apache/lucene/document/TestDateTools.java:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214,912319,912324,912328,912335,912372

Propchange: lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/document/TestNumberTools.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 23 18:52:19 2010
@@ -2,5 +2,5 @@
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/document/TestNumberTools.java:825998,829134,829881,831036
 /lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/document/TestNumberTools.java:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080,912383
 /lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/document/TestNumberTools.java:880869-912395
-/lucene/java/trunk/backwards/src/test/org/apache/lucene/document/TestNumberTools.java:922624,922806,923238,924286,924321-924731,924781
+/lucene/java/trunk/backwards/src/test/org/apache/lucene/document/TestNumberTools.java:922624,922806,923238,924286,924321-924731,924781,925176-925462
 /lucene/java/trunk/src/test/org/apache/lucene/document/TestNumberTools.java:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214,912319,912324,912328,912335,912372

Modified: lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestAddIndexesNoOptimize.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestAddIndexesNoOptimize.java?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestAddIndexesNoOptimize.java (original)
+++ lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestAddIndexesNoOptimize.java Tue Mar 23 18:52:19 2010
@@ -429,7 +429,7 @@ public class TestAddIndexesNoOptimize ex
   private IndexWriter newWriter(Directory dir, boolean create)
       throws IOException {
     final IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(), create, IndexWriter.MaxFieldLength.UNLIMITED);
-    writer.setMergePolicy(new LogDocMergePolicy(writer));
+    writer.setMergePolicy(new LogDocMergePolicy());
     return writer;
   }
 
@@ -503,7 +503,7 @@ public class TestAddIndexesNoOptimize ex
 
     Directory dir = new MockRAMDirectory();
     IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
-    writer.setMergePolicy(new LogByteSizeMergePolicy(writer));
+    writer.setMergePolicy(new LogByteSizeMergePolicy());
     writer.setMaxBufferedDocs(5);
     writer.setUseCompoundFile(false);
     writer.setMergeFactor(100);
@@ -529,7 +529,7 @@ public class TestAddIndexesNoOptimize ex
 
     Directory dir2 = new MockRAMDirectory();
     writer = new IndexWriter(dir2, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
-    LogByteSizeMergePolicy lmp = new LogByteSizeMergePolicy(writer);
+    LogByteSizeMergePolicy lmp = new LogByteSizeMergePolicy();
     lmp.setMinMergeMB(0.0001);
     writer.setMergePolicy(lmp);
     writer.setMergeFactor(4);

Propchange: lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 23 18:52:19 2010
@@ -2,5 +2,5 @@
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:825998,829134,829881,831036
 /lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080,912383
 /lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:880869-912395
-/lucene/java/trunk/backwards/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:922624,922806,923238,924286,924321-924731,924781
+/lucene/java/trunk/backwards/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:922624,922806,923238,924286,924321-924731,924781,925176-925462
 /lucene/java/trunk/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214,912319,912324,912328,912335,912372

Modified: lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java (original)
+++ lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java Tue Mar 23 18:52:19 2010
@@ -120,7 +120,7 @@ public class TestConcurrentMergeSchedule
     ConcurrentMergeScheduler cms = new ConcurrentMergeScheduler();
     writer.setMergeScheduler(cms);
 
-    LogDocMergePolicy mp = new LogDocMergePolicy(writer);
+    LogDocMergePolicy mp = new LogDocMergePolicy();
     writer.setMergePolicy(mp);
 
     // Force degenerate merging so we can get a mix of

Modified: lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestIndexReaderReopen.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestIndexReaderReopen.java?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestIndexReaderReopen.java (original)
+++ lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestIndexReaderReopen.java Tue Mar 23 18:52:19 2010
@@ -949,7 +949,7 @@ public class TestIndexReaderReopen exten
     IndexWriter.unlock(dir);
     IndexWriter w = new IndexWriter(dir, new WhitespaceAnalyzer(), IndexWriter.MaxFieldLength.LIMITED);
 
-    w.setMergePolicy(new LogDocMergePolicy(w));
+    w.setMergePolicy(new LogDocMergePolicy());
     
     for (int i = 0; i < 100; i++) {
       w.addDocument(createDocument(i, 4));

Modified: lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestIndexWriter.java?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestIndexWriter.java (original)
+++ lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestIndexWriter.java Tue Mar 23 18:52:19 2010
@@ -615,7 +615,7 @@ public class TestIndexWriter extends Luc
 
       for(int numDocs=38;numDocs<500;numDocs += 38) {
         IndexWriter writer  = new IndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
-        LogDocMergePolicy ldmp = new LogDocMergePolicy(writer);
+        LogDocMergePolicy ldmp = new LogDocMergePolicy();
         ldmp.setMinMergeDocs(1);
         writer.setMergePolicy(ldmp);
         writer.setMergeFactor(5);
@@ -629,6 +629,8 @@ public class TestIndexWriter extends Luc
         final int segCount = sis.size();
 
         writer  = new IndexWriter(dir, new WhitespaceAnalyzer(), IndexWriter.MaxFieldLength.LIMITED);
+        ldmp = new LogDocMergePolicy();
+        ldmp.setMinMergeDocs(1);
         writer.setMergePolicy(ldmp);
         writer.setMergeFactor(5);
         writer.optimize(3);
@@ -652,7 +654,7 @@ public class TestIndexWriter extends Luc
       doc.add(new Field("content", "aaa", Field.Store.YES, Field.Index.ANALYZED));
 
       IndexWriter writer  = new IndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
-      LogDocMergePolicy ldmp = new LogDocMergePolicy(writer);
+      LogDocMergePolicy ldmp = new LogDocMergePolicy();
       ldmp.setMinMergeDocs(1);
       writer.setMergePolicy(ldmp);
       writer.setMergeFactor(4);
@@ -2764,7 +2766,7 @@ public class TestIndexWriter extends Luc
       writer.setMaxBufferedDocs(2);
       writer.setRAMBufferSizeMB(IndexWriter.DISABLE_AUTO_FLUSH);
       writer.setMergeScheduler(new SerialMergeScheduler());
-      writer.setMergePolicy(new LogDocMergePolicy(writer));
+      writer.setMergePolicy(new LogDocMergePolicy());
 
       Document document = new Document();
 
@@ -2797,7 +2799,7 @@ public class TestIndexWriter extends Luc
       writer.setMaxBufferedDocs(2);
       writer.setRAMBufferSizeMB(IndexWriter.DISABLE_AUTO_FLUSH);
       writer.setMergeScheduler(new SerialMergeScheduler());
-      writer.setMergePolicy(new LogDocMergePolicy(writer));
+      writer.setMergePolicy(new LogDocMergePolicy());
 
       Directory[] indexDirs = {new MockRAMDirectory(dir)};
       writer.addIndexesNoOptimize(indexDirs);
@@ -2816,7 +2818,7 @@ public class TestIndexWriter extends Luc
       writer.setMaxBufferedDocs(2);
       writer.setRAMBufferSizeMB(IndexWriter.DISABLE_AUTO_FLUSH);
       writer.setMergeScheduler(new SerialMergeScheduler());
-      writer.setMergePolicy(new LogDocMergePolicy(writer));
+      writer.setMergePolicy(new LogDocMergePolicy());
 
       Document document = new Document();
 
@@ -2854,7 +2856,7 @@ public class TestIndexWriter extends Luc
     writer.setMaxBufferedDocs(2);
     writer.setRAMBufferSizeMB(IndexWriter.DISABLE_AUTO_FLUSH);
     writer.setMergeScheduler(new SerialMergeScheduler());
-    writer.setMergePolicy(new LogDocMergePolicy(writer));
+    writer.setMergePolicy(new LogDocMergePolicy());
 
     Document document = new Document();
 
@@ -2876,7 +2878,7 @@ public class TestIndexWriter extends Luc
     writer.setMaxBufferedDocs(2);
     writer.setRAMBufferSizeMB(IndexWriter.DISABLE_AUTO_FLUSH);
     writer.setMergeScheduler(new SerialMergeScheduler());
-    writer.setMergePolicy(new LogDocMergePolicy(writer));
+    writer.setMergePolicy(new LogDocMergePolicy());
     for(int i=0;i<6;i++)
       writer.addDocument(document);
 

Modified: lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java (original)
+++ lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java Tue Mar 23 18:52:19 2010
@@ -37,7 +37,7 @@ public class TestIndexWriterMergePolicy 
     IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
     writer.setMaxBufferedDocs(10);
     writer.setMergeFactor(10);
-    writer.setMergePolicy(new LogDocMergePolicy(writer));
+    writer.setMergePolicy(new LogDocMergePolicy());
 
     for (int i = 0; i < 100; i++) {
       addDoc(writer);
@@ -54,7 +54,7 @@ public class TestIndexWriterMergePolicy 
     IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
     writer.setMaxBufferedDocs(10);
     writer.setMergeFactor(10);
-    writer.setMergePolicy(new LogDocMergePolicy(writer));
+    writer.setMergePolicy(new LogDocMergePolicy());
 
     boolean noOverMerge = false;
     for (int i = 0; i < 100; i++) {
@@ -76,7 +76,7 @@ public class TestIndexWriterMergePolicy 
     IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
     writer.setMaxBufferedDocs(10);
     writer.setMergeFactor(10);
-    LogDocMergePolicy mp = new LogDocMergePolicy(writer);
+    LogDocMergePolicy mp = new LogDocMergePolicy();
     mp.setMinMergeDocs(100);
     writer.setMergePolicy(mp);
 
@@ -86,6 +86,7 @@ public class TestIndexWriterMergePolicy 
 
       writer = new IndexWriter(dir, new WhitespaceAnalyzer(), false, IndexWriter.MaxFieldLength.LIMITED);
       writer.setMaxBufferedDocs(10);
+      mp = new LogDocMergePolicy();
       writer.setMergePolicy(mp);
       mp.setMinMergeDocs(100);
       writer.setMergeFactor(10);
@@ -102,7 +103,7 @@ public class TestIndexWriterMergePolicy 
     IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
     writer.setMaxBufferedDocs(10);
     writer.setMergeFactor(100);
-    writer.setMergePolicy(new LogDocMergePolicy(writer));
+    writer.setMergePolicy(new LogDocMergePolicy());
 
     for (int i = 0; i < 250; i++) {
       addDoc(writer);
@@ -128,7 +129,7 @@ public class TestIndexWriterMergePolicy 
     IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.UNLIMITED);
     writer.setMaxBufferedDocs(101);
     writer.setMergeFactor(101);
-    writer.setMergePolicy(new LogDocMergePolicy(writer));
+    writer.setMergePolicy(new LogDocMergePolicy());
 
     // leftmost* segment has 1 doc
     // rightmost* segment has 100 docs
@@ -142,7 +143,7 @@ public class TestIndexWriterMergePolicy 
       writer = new IndexWriter(dir, new WhitespaceAnalyzer(), false, IndexWriter.MaxFieldLength.UNLIMITED);
       writer.setMaxBufferedDocs(101);
       writer.setMergeFactor(101);
-      writer.setMergePolicy(new LogDocMergePolicy(writer));
+      writer.setMergePolicy(new LogDocMergePolicy());
     }
 
     writer.setMaxBufferedDocs(10);
@@ -171,7 +172,7 @@ public class TestIndexWriterMergePolicy 
     Directory dir = new RAMDirectory();
 
     IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.UNLIMITED);
-    writer.setMergePolicy(new LogDocMergePolicy(writer));
+    writer.setMergePolicy(new LogDocMergePolicy());
     writer.setMaxBufferedDocs(10);
     writer.setMergeFactor(100);
 
@@ -186,7 +187,7 @@ public class TestIndexWriterMergePolicy 
     reader.close();
 
     writer = new IndexWriter(dir, new WhitespaceAnalyzer(), false, IndexWriter.MaxFieldLength.UNLIMITED);
-    writer.setMergePolicy(new LogDocMergePolicy(writer));
+    writer.setMergePolicy(new LogDocMergePolicy());
     writer.setMaxBufferedDocs(10);
     writer.setMergeFactor(5);
 

Modified: lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestIndexWriterReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestIndexWriterReader.java?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestIndexWriterReader.java (original)
+++ lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestIndexWriterReader.java Tue Mar 23 18:52:19 2010
@@ -572,7 +572,7 @@ public class TestIndexWriterReader exten
       boolean multiSegment) throws IOException {
     IndexWriter w = new IndexWriter(dir1, new WhitespaceAnalyzer(),
         IndexWriter.MaxFieldLength.LIMITED);
-    w.setMergePolicy(new LogDocMergePolicy(w));
+    w.setMergePolicy(new LogDocMergePolicy());
     for (int i = 0; i < 100; i++) {
       w.addDocument(createDocument(i, indexName, 4));
       if (multiSegment && (i % 10) == 0) {

Propchange: lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/util/TestAttributeSource.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 23 18:52:19 2010
@@ -3,5 +3,5 @@
 /lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/util/TestAttributeSource.java:818601-821336
 /lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/util/TestAttributeSource.java:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080,912383
 /lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/util/TestAttributeSource.java:880869-912395
-/lucene/java/trunk/backwards/src/test/org/apache/lucene/util/TestAttributeSource.java:922624,922806,923238,924286,924321-924731,924781
+/lucene/java/trunk/backwards/src/test/org/apache/lucene/util/TestAttributeSource.java:922624,922806,923238,924286,924321-924731,924781,925176-925462
 /lucene/java/trunk/src/test/org/apache/lucene/util/TestAttributeSource.java:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,883079,885214,912319,912324,912328,912335,912372

Propchange: lucene/java/branches/flex_1458/build.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 23 18:52:19 2010
@@ -1,2 +1,2 @@
 /lucene/java/branches/lucene_2_9/build.xml:909334
-/lucene/java/trunk/build.xml:916596,916685,916755,916769,917019,917148,917154,917161,917203-917204,919060,919119,919718,919731,919869,920237-920499,922013,922277,922525,922528,922583,922593,922602,922624,922797,922799,922806,922886-922887,923112,923238,924151,924207,924286,924321-924731,924781
+/lucene/java/trunk/build.xml:916596,916685,916755,916769,917019,917148,917154,917161,917203-917204,919060,919119,919718,919731,919869,920237-920499,922013,922277,922525,922528,922583,922593,922602,922624,922797,922799,922806,922886-922887,923112,923238,924151,924207,924286,924321-924731,924781,925176-925462

Propchange: lucene/java/branches/flex_1458/contrib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 23 18:52:19 2010
@@ -2,4 +2,4 @@
 /lucene/java/branches/lucene_2_9/contrib:817269-818600,825998,829134,829816,829881,831036,896850,909334
 /lucene/java/branches/lucene_2_9_back_compat_tests/contrib:818601-821336
 /lucene/java/branches/lucene_3_0/contrib:880793,896906
-/lucene/java/trunk/contrib:824912-825292,827043-833960,880727-886190,889185,889614-916543,916596,916685,916755,916769,917019,917148,917154,917161,917203-917204,919060,919119,919718,919731,919869,920237-920499,922013,922277,922525,922528,922583,922593,922602,922624,922797,922799,922806,922886-922887,923112,923238,924151,924207,924286,924321-924731,924781
+/lucene/java/trunk/contrib:824912-825292,827043-833960,880727-886190,889185,889614-916543,916596,916685,916755,916769,917019,917148,917154,917161,917203-917204,919060,919119,919718,919731,919869,920237-920499,922013,922277,922525,922528,922583,922593,922602,922624,922797,922799,922806,922886-922887,923112,923238,924151,924207,924286,924321-924731,924781,925176-925462

Propchange: lucene/java/branches/flex_1458/contrib/CHANGES.txt
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 23 18:52:19 2010
@@ -2,4 +2,4 @@
 /lucene/java/branches/lucene_2_9/contrib/CHANGES.txt:817269-818600,825998,826775,829134,829816,829881,831036,896850
 /lucene/java/branches/lucene_2_9_back_compat_tests/contrib/CHANGES.txt:818601-821336
 /lucene/java/branches/lucene_3_0/contrib/CHANGES.txt:880793,896906
-/lucene/java/trunk/contrib/CHANGES.txt:829439-833960,880727-886190,889185,889622,889667,889866-899001,916596,916685,916755,916769,917019,917148,917154,917161,917203-917204,919060,919119,919718,919731,919869,920237-920499,922013,922277,922525,922528,922583,922593,922602,922624,922797,922799,922806,922886-922887,923112,923238,924151,924207,924286,924321-924731,924781
+/lucene/java/trunk/contrib/CHANGES.txt:829439-833960,880727-886190,889185,889622,889667,889866-899001,916596,916685,916755,916769,917019,917148,917154,917161,917203-917204,919060,919119,919718,919731,919869,920237-920499,922013,922277,922525,922528,922583,922593,922602,922624,922797,922799,922806,922886-922887,923112,923238,924151,924207,924286,924321-924731,924781,925176-925462

Modified: lucene/java/branches/flex_1458/contrib/ant/src/java/org/apache/lucene/ant/IndexTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/ant/src/java/org/apache/lucene/ant/IndexTask.java?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/ant/src/java/org/apache/lucene/ant/IndexTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/ant/src/java/org/apache/lucene/ant/IndexTask.java Tue Mar 23 18:52:19 2010
@@ -283,13 +283,14 @@ public class IndexTask extends Task {
 
       log("checkLastModified = " + checkLastModified, Project.MSG_VERBOSE);
 
-      IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig(
+      IndexWriterConfig conf = new IndexWriterConfig(
           Version.LUCENE_CURRENT, analyzer).setOpenMode(
-          create ? OpenMode.CREATE : OpenMode.APPEND));
-      LogMergePolicy lmp = (LogMergePolicy) writer.getMergePolicy();
+          create ? OpenMode.CREATE : OpenMode.APPEND);
+      LogMergePolicy lmp = (LogMergePolicy) conf.getMergePolicy();
       lmp.setUseCompoundFile(useCompoundIndex);
       lmp.setUseCompoundDocStore(useCompoundIndex);
       lmp.setMergeFactor(mergeFactor);
+      IndexWriter writer = new IndexWriter(dir, conf);
       int totalFiles = 0;
       int totalIndexed = 0;
       int totalIgnored = 0;

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CreateIndexTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CreateIndexTask.java?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CreateIndexTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CreateIndexTask.java Tue Mar 23 18:52:19 2010
@@ -91,7 +91,7 @@ public class CreateIndexTask extends Per
     final String mergePolicy = config.get("merge.policy",
                                           "org.apache.lucene.index.LogByteSizeMergePolicy");
     try {
-      writer.setMergePolicy(Class.forName(mergePolicy).asSubclass(MergePolicy.class).getConstructor(IndexWriter.class).newInstance(writer));
+      writer.setMergePolicy(Class.forName(mergePolicy).asSubclass(MergePolicy.class).newInstance());
     } catch (Exception e) {
       throw new RuntimeException("unable to instantiate class '" + mergePolicy + "' as merge policy", e);
     }

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java Tue Mar 23 18:52:19 2010
@@ -681,11 +681,11 @@ public class TestPerfTasksLogic extends 
 
   public static class MyMergePolicy extends LogDocMergePolicy {
     boolean called;
-    public MyMergePolicy(IndexWriter writer) {
-      super(writer);
+    public MyMergePolicy() {
       called = true;
     }
   }
+  
   /**
    * Test that we can set merge policy".
    */
@@ -715,7 +715,7 @@ public class TestPerfTasksLogic extends 
 
     // 2. execute the algorithm  (required in every "logic" test)
     Benchmark benchmark = execBenchmark(algLines);
-    assertTrue("did not use the specified MergeScheduler", ((MyMergePolicy) benchmark.getRunData().getIndexWriter().getMergePolicy()).called);
+    assertTrue("did not use the specified MergePolicy", ((MyMergePolicy) benchmark.getRunData().getIndexWriter().getConfig().getMergePolicy()).called);
     benchmark.getRunData().getIndexWriter().close();
     
     // 3. test number of docs in the index
@@ -759,8 +759,8 @@ public class TestPerfTasksLogic extends 
     final IndexWriter writer = benchmark.getRunData().getIndexWriter();
     assertEquals(2, writer.getConfig().getMaxBufferedDocs());
     assertEquals(IndexWriterConfig.DISABLE_AUTO_FLUSH, (int) writer.getConfig().getRAMBufferSizeMB());
-    assertEquals(3, ((LogMergePolicy) writer.getMergePolicy()).getMergeFactor());
-    assertFalse(((LogMergePolicy) writer.getMergePolicy()).getUseCompoundFile());
+    assertEquals(3, ((LogMergePolicy) writer.getConfig().getMergePolicy()).getMergeFactor());
+    assertFalse(((LogMergePolicy) writer.getConfig().getMergePolicy()).getUseCompoundFile());
     writer.close();
     Directory dir = benchmark.getRunData().getDirectory();
     IndexReader reader = IndexReader.open(dir, true);

Propchange: lucene/java/branches/flex_1458/contrib/highlighter/src/test/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 23 18:52:19 2010
@@ -2,4 +2,4 @@
 /lucene/java/branches/lucene_2_9/contrib/highlighter/src/test:817269-818600,825998,826775,829134,829816,829881,831036,896850,909334
 /lucene/java/branches/lucene_2_9_back_compat_tests/contrib/highlighter/src/test:818601-821336
 /lucene/java/branches/lucene_3_0/contrib/highlighter/src/test:880793,896906
-/lucene/java/trunk/contrib/highlighter/src/test:829439-833960,880727-886190,889185,889614-916543,916596,916685,916755,916769,917019,917148,917154,917161,917203-917204,919060,919119,919718,919731,919869,920237-920499,922013,922277,922525,922528,922583,922593,922602,922624,922797,922799,922806,922886-922887,923112,923238,924151,924207,924286,924321-924731,924781
+/lucene/java/trunk/contrib/highlighter/src/test:829439-833960,880727-886190,889185,889614-916543,916596,916685,916755,916769,917019,917148,917154,917161,917203-917204,919060,919119,919718,919731,919869,920237-920499,922013,922277,922525,922528,922583,922593,922602,922624,922797,922799,922806,922886-922887,923112,923238,924151,924207,924286,924321-924731,924781,925176-925462

Propchange: lucene/java/branches/flex_1458/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 23 18:52:19 2010
@@ -1,2 +1,2 @@
 /lucene/java/branches/lucene_2_9/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java:909334
-/lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java:916596,916685,916755,916769,917019,917148,917154,917161,917203-917204,919060,919119,919718,919731,919869,920237-920499,922013,922277,922525,922528,922583,922593,922602,922624,922797,922799,922806,922886-922887,923112,923238,924151,924207,924286,924321-924731,924781
+/lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java:916596,916685,916755,916769,917019,917148,917154,917161,917203-917204,919060,919119,919718,919731,919869,920237-920499,922013,922277,922525,922528,922583,922593,922602,922624,922797,922799,922806,922886-922887,923112,923238,924151,924207,924286,924321-924731,924781,925176-925462

Modified: lucene/java/branches/flex_1458/contrib/misc/src/java/org/apache/lucene/index/BalancedSegmentMergePolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/misc/src/java/org/apache/lucene/index/BalancedSegmentMergePolicy.java?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/misc/src/java/org/apache/lucene/index/BalancedSegmentMergePolicy.java (original)
+++ lucene/java/branches/flex_1458/contrib/misc/src/java/org/apache/lucene/index/BalancedSegmentMergePolicy.java Tue Mar 23 18:52:19 2010
@@ -30,19 +30,18 @@ import java.util.Set;
  * <p>This is based on code from zoie, described in more detail
  * at http://code.google.com/p/zoie/wiki/ZoieMergePolicy.</p>
  */
-public class BalancedSegmentMergePolicy extends LogByteSizeMergePolicy
-{
+public class BalancedSegmentMergePolicy extends LogByteSizeMergePolicy {
+  
   public static final int DEFAULT_NUM_LARGE_SEGMENTS = 10;
   
   private boolean _partialExpunge = false;
   private int _numLargeSegments = DEFAULT_NUM_LARGE_SEGMENTS;
   private int _maxSmallSegments = 2 * LogMergePolicy.DEFAULT_MERGE_FACTOR;
   private int _maxSegments = _numLargeSegments + _maxSmallSegments;
-  
-  public BalancedSegmentMergePolicy(IndexWriter writer) {
-    super(writer);
+
+  public BalancedSegmentMergePolicy() {
   }
-  
+
   public void setMergePolicyParams(MergePolicyParams params) {
     if (params!=null) {
       setPartialExpunge(params._doPartialExpunge);
@@ -122,6 +121,7 @@ public class BalancedSegmentMergePolicy 
   
   private boolean isOptimized(IndexWriter writer, SegmentInfo info)
     throws IOException {
+    assert writer != null;
     return !info.hasDeletions() &&
       !info.hasSeparateNorms() &&
       info.dir == writer.getDirectory() &&
@@ -135,7 +135,7 @@ public class BalancedSegmentMergePolicy 
 
     MergeSpecification spec = null;
 
-    if (!isOptimized(infos, writer, maxNumSegments, segmentsToOptimize)) {
+    if (!isOptimized(infos, writer.get(), maxNumSegments, segmentsToOptimize)) {
 
       // Find the newest (rightmost) segment that needs to
       // be optimized (other segments may have been flushed
@@ -158,7 +158,7 @@ public class BalancedSegmentMergePolicy 
           // Since we must optimize down to 1 segment, the
           // choice is simple:
           boolean useCompoundFile = getUseCompoundFile();
-          if (last > 1 || !isOptimized(writer, infos.info(0))) {
+          if (last > 1 || !isOptimized(writer.get(), infos.info(0))) {
 
             spec = new MergeSpecification();
             spec.add(new OneMerge(infos.range(0, last), useCompoundFile));

Modified: lucene/java/branches/flex_1458/contrib/remote/src/test/org/apache/lucene/search/TestRemoteSort.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/remote/src/test/org/apache/lucene/search/TestRemoteSort.java?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/remote/src/test/org/apache/lucene/search/TestRemoteSort.java (original)
+++ lucene/java/branches/flex_1458/contrib/remote/src/test/org/apache/lucene/search/TestRemoteSort.java Tue Mar 23 18:52:19 2010
@@ -115,7 +115,7 @@ public class TestRemoteSort extends Luce
     IndexWriter writer = new IndexWriter(indexStore, new IndexWriterConfig(
         TEST_VERSION_CURRENT, new SimpleAnalyzer(TEST_VERSION_CURRENT))
         .setMaxBufferedDocs(2));
-    ((LogMergePolicy) writer.getMergePolicy()).setMergeFactor(1000);
+    ((LogMergePolicy) writer.getConfig().getMergePolicy()).setMergeFactor(1000);
     for (int i=0; i<data.length; ++i) {
       if (((i%2)==0 && even) || ((i%2)==1 && odd)) {
         Document doc = new Document();

Modified: lucene/java/branches/flex_1458/contrib/spatial/build.xml
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/spatial/build.xml?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/spatial/build.xml (original)
+++ lucene/java/branches/flex_1458/contrib/spatial/build.xml Tue Mar 23 18:52:19 2010
@@ -26,7 +26,7 @@
   <import file="../contrib-build.xml"/>
 
   <property name="misc.jar" location="${common.dir}/build/contrib/misc/lucene-misc-${version}.jar"/>
-  <available property="memory.jar.present" type="file" file="${memory.jar}"/>
+  <available property="misc.jar.present" type="file" file="${misc.jar}"/>
 
   <path id="classpath">
     <pathelement path="${lucene.jar}"/>
@@ -36,7 +36,7 @@
 
   <target name="compile-core" depends="build-misc, common.compile-core" />
 
-  <target name="build-misc" unless="memory.jar.present">
+  <target name="build-misc" unless="misc.jar.present">
     <echo>Misc building dependency ${misc.jar}</echo>
     <ant antfile="../misc/build.xml" target="default" inheritall="false" dir="../misc" />
   </target>

Modified: lucene/java/branches/flex_1458/contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java (original)
+++ lucene/java/branches/flex_1458/contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java Tue Mar 23 18:52:19 2010
@@ -397,7 +397,7 @@ public class SpellChecker implements jav
       ensureOpen();
       final Directory dir = this.spellIndex;
       final IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig(Version.LUCENE_CURRENT, new WhitespaceAnalyzer(Version.LUCENE_CURRENT)).setRAMBufferSizeMB(ramMB));
-      ((LogMergePolicy) writer.getMergePolicy()).setMergeFactor(mergeFactor);
+      ((LogMergePolicy) writer.getConfig().getMergePolicy()).setMergeFactor(mergeFactor);
   
       Iterator<String> iter = dict.getWordsIterator();
       while (iter.hasNext()) {

Modified: lucene/java/branches/flex_1458/contrib/wordnet/src/java/org/apache/lucene/wordnet/Syns2Index.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/wordnet/src/java/org/apache/lucene/wordnet/Syns2Index.java?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/wordnet/src/java/org/apache/lucene/wordnet/Syns2Index.java (original)
+++ lucene/java/branches/flex_1458/contrib/wordnet/src/java/org/apache/lucene/wordnet/Syns2Index.java Tue Mar 23 18:52:19 2010
@@ -250,8 +250,8 @@ public class Syns2Index
           // override the specific index if it already exists
           IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig(
               Version.LUCENE_CURRENT, ana).setOpenMode(OpenMode.CREATE));
-          ((LogMergePolicy) writer.getMergePolicy()).setUseCompoundFile(true); // why?
-          ((LogMergePolicy) writer.getMergePolicy()).setUseCompoundDocStore(true); // why?
+          ((LogMergePolicy) writer.getConfig().getMergePolicy()).setUseCompoundFile(true); // why?
+          ((LogMergePolicy) writer.getConfig().getMergePolicy()).setUseCompoundDocStore(true); // why?
           Iterator<String> i1 = word2Nums.keySet().iterator();
           while (i1.hasNext()) // for each word
           {

Propchange: lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/Tokenizer.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 23 18:52:19 2010
@@ -1,2 +1,2 @@
 /lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/analysis/Tokenizer.java:909334
-/lucene/java/trunk/src/java/org/apache/lucene/analysis/Tokenizer.java:916596,916685,916755,916769,917019,917148,917154,917161,917203-917204,919060,919119,919718,919731,919869,920237-920499,922013,922277,922525,922528,922583,922593,922602,922624,922797,922799,922806,922886-922887,923112,923238,924151,924207,924286,924321-924731,924781
+/lucene/java/trunk/src/java/org/apache/lucene/analysis/Tokenizer.java:916596,916685,916755,916769,917019,917148,917154,917161,917203-917204,919060,919119,919718,919731,919869,920237-920499,922013,922277,922525,922528,922583,922593,922602,922624,922797,922799,922806,922886-922887,923112,923238,924151,924207,924286,924321-924731,924781,925176-925462

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexWriter.java?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexWriter.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexWriter.java Tue Mar 23 18:52:19 2010
@@ -292,7 +292,7 @@ public class IndexWriter implements Clos
   // merges
   private HashSet<SegmentInfo> mergingSegments = new HashSet<SegmentInfo>();
 
-  private MergePolicy mergePolicy = new LogByteSizeMergePolicy(this);
+  private MergePolicy mergePolicy;
   // TODO 4.0: this should be made final once the setter is removed
   private /*final*/MergeScheduler mergeScheduler;
   private LinkedList<MergePolicy.OneMerge> pendingMerges = new LinkedList<MergePolicy.OneMerge>();
@@ -873,8 +873,8 @@ public class IndexWriter implements Clos
   public void setTermIndexInterval(int interval) {
     ensureOpen();
     this.termIndexInterval = interval;
-    // Required so config.getSimilarity returns the right value. But this will
-    // go away together with the method in 4.0.
+    // Required so config.getTermIndexInterval returns the right value. But this
+    // will go away together with the method in 4.0.
     config.setTermIndexInterval(interval);
   }
 
@@ -1081,6 +1081,8 @@ public class IndexWriter implements Clos
     termIndexInterval = conf.getTermIndexInterval();
     writeLockTimeout = conf.getWriteLockTimeout();
     similarity = conf.getSimilarity();
+    mergePolicy = conf.getMergePolicy();
+    mergePolicy.setIndexWriter(this);
     mergeScheduler = conf.getMergeScheduler();
     mergedSegmentWarmer = conf.getMergedSegmentWarmer();
     codecs = conf.getCodecProvider();
@@ -1216,6 +1218,8 @@ public class IndexWriter implements Clos
   
   /**
    * Expert: set the merge policy used by this writer.
+   * 
+   * @deprecated use {@link IndexWriterConfig#setMergePolicy(MergePolicy)} instead.
    */
   public void setMergePolicy(MergePolicy mp) {
     ensureOpen();
@@ -1225,14 +1229,20 @@ public class IndexWriter implements Clos
     if (mergePolicy != mp)
       mergePolicy.close();
     mergePolicy = mp;
+    mergePolicy.setIndexWriter(this);
     pushMaxBufferedDocs();
     if (infoStream != null)
       message("setMergePolicy " + mp);
+    // Required so config.getMergePolicy returns the right value. But this will
+    // go away together with the method in 4.0.
+    config.setMergePolicy(mp);
   }
 
   /**
    * Expert: returns the current MergePolicy in use by this writer.
    * @see #setMergePolicy
+   * 
+   * @deprecated use {@link IndexWriterConfig#getMergePolicy()} instead
    */
   public MergePolicy getMergePolicy() {
     ensureOpen();
@@ -1255,7 +1265,7 @@ public class IndexWriter implements Clos
     this.mergeScheduler = mergeScheduler;
     if (infoStream != null)
       message("setMergeScheduler " + mergeScheduler);
-    // Required so config.getSimilarity returns the right value. But this will
+    // Required so config.getMergeScheduler returns the right value. But this will
     // go away together with the method in 4.0.
     config.setMergeScheduler(mergeScheduler);
   }
@@ -1333,8 +1343,8 @@ public class IndexWriter implements Clos
     docWriter.setMaxFieldLength(maxFieldLength);
     if (infoStream != null)
       message("setMaxFieldLength " + maxFieldLength);
-    // Required so config.getSimilarity returns the right value. But this will
-    // go away together with the method in 4.0.
+    // Required so config.getMaxFieldLength returns the right value. But this
+    // will go away together with the method in 4.0.
     config.setMaxFieldLength(maxFieldLength);
   }
 
@@ -1382,8 +1392,8 @@ public class IndexWriter implements Clos
     pushMaxBufferedDocs();
     if (infoStream != null)
       message("setMaxBufferedDocs " + maxBufferedDocs);
-    // Required so config.getSimilarity returns the right value. But this will
-    // go away together with the method in 4.0.
+    // Required so config.getMaxBufferedDocs returns the right value. But this
+    // will go away together with the method in 4.0.
     config.setMaxBufferedDocs(maxBufferedDocs);
   }
 
@@ -1470,8 +1480,8 @@ public class IndexWriter implements Clos
     docWriter.setRAMBufferSizeMB(mb);
     if (infoStream != null)
       message("setRAMBufferSizeMB " + mb);
-    // Required so config.getSimilarity returns the right value. But this will
-    // go away together with the method in 4.0.
+    // Required so config.getRAMBufferSizeMB returns the right value. But this
+    // will go away together with the method in 4.0.
     config.setRAMBufferSizeMB(mb);
   }
 
@@ -1505,8 +1515,8 @@ public class IndexWriter implements Clos
     docWriter.setMaxBufferedDeleteTerms(maxBufferedDeleteTerms);
     if (infoStream != null)
       message("setMaxBufferedDeleteTerms " + maxBufferedDeleteTerms);
-    // Required so config.getSimilarity returns the right value. But this will
-    // go away together with the method in 4.0.
+    // Required so config.getMaxBufferedDeleteTerms returns the right value. But
+    // this will go away together with the method in 4.0.
     config.setMaxBufferedDeleteTerms(maxBufferedDeleteTerms);
   }
 
@@ -1618,8 +1628,8 @@ public class IndexWriter implements Clos
   public void setWriteLockTimeout(long writeLockTimeout) {
     ensureOpen();
     this.writeLockTimeout = writeLockTimeout;
-    // Required so config.getSimilarity returns the right value. But this will
-    // go away together with the method in 4.0.
+    // Required so config.getWriteLockTimeout returns the right value. But this
+    // will go away together with the method in 4.0.
     config.setWriteLockTimeout(writeLockTimeout);
   }
 
@@ -4978,8 +4988,8 @@ public class IndexWriter implements Clos
    */
   public void setMergedSegmentWarmer(IndexReaderWarmer warmer) {
     mergedSegmentWarmer = warmer;
-    // Required so config.getSimilarity returns the right value. But this will
-    // go away together with the method in 4.0.
+    // Required so config.getMergedSegmentWarmer returns the right value. But
+    // this will go away together with the method in 4.0.
     config.setMergedSegmentWarmer(mergedSegmentWarmer);
   }
 

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexWriterConfig.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexWriterConfig.java?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexWriterConfig.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexWriterConfig.java Tue Mar 23 18:52:19 2010
@@ -121,6 +121,7 @@ public final class IndexWriterConfig imp
   private IndexingChain indexingChain;
   private IndexReaderWarmer mergedSegmentWarmer;
   private CodecProvider codecProvider;
+  private MergePolicy mergePolicy;
   private int maxThreadStates;
   
   // required for clone
@@ -150,6 +151,7 @@ public final class IndexWriterConfig imp
     indexingChain = DocumentsWriter.defaultIndexingChain;
     mergedSegmentWarmer = null;
     codecProvider = DEFAULT_CODEC_PROVIDER;
+    mergePolicy = new LogByteSizeMergePolicy();
     maxThreadStates = DEFAULT_MAX_THREAD_STATES;
   }
   
@@ -497,6 +499,18 @@ public final class IndexWriterConfig imp
     return mergedSegmentWarmer;
   }
 
+  /**
+   * Expert: {@link MergePolicy} is invoked whenever there are changes to the
+   * segments in the index. Its role is to select which merges to do, if any,
+   * and return a {@link MergePolicy.MergeSpecification} describing the merges.
+   * It also selects merges to do for optimize(). (The default is
+   * {@link LogByteSizeMergePolicy}.
+   */
+  public IndexWriterConfig setMergePolicy(MergePolicy mergePolicy) {
+    this.mergePolicy = mergePolicy == null ? new LogByteSizeMergePolicy() : mergePolicy;
+    return this;
+  }
+
   /** Set the CodecProvider. See {@link CodecProvider}. */
   public IndexWriterConfig setCodecProvider(CodecProvider codecProvider) {
     this.codecProvider = codecProvider;
@@ -508,10 +522,15 @@ public final class IndexWriterConfig imp
     return codecProvider;
   }
 
-  /** Sets the max number of simultaneous threads that may
-   *  be indexing documents at once in IndexWriter. */
+  
+  /**
+   * Sets the max number of simultaneous threads that may be indexing documents
+   * at once in IndexWriter. Values &lt; 1 are invalid and if passed
+   * <code>maxThreadStates</code> will be set to
+   * {@link #DEFAULT_MAX_THREAD_STATES}.
+   */
   public IndexWriterConfig setMaxThreadStates(int maxThreadStates) {
-    this.maxThreadStates = maxThreadStates;
+    this.maxThreadStates = maxThreadStates < 1 ? DEFAULT_MAX_THREAD_STATES : maxThreadStates;
     return this;
   }
 
@@ -521,6 +540,15 @@ public final class IndexWriterConfig imp
     return maxThreadStates;
   }
 
+  /**
+   * Returns the current MergePolicy in use by this writer.
+   * 
+   * @see #setMergePolicy(MergePolicy)
+   */
+  public MergePolicy getMergePolicy() {
+    return mergePolicy;
+  }
+
   /** Expert: sets the {@link DocConsumer} chain to be used to process documents. */
   IndexWriterConfig setIndexingChain(IndexingChain indexingChain) {
     this.indexingChain = indexingChain == null ? DocumentsWriter.defaultIndexingChain : indexingChain;
@@ -551,6 +579,7 @@ public final class IndexWriterConfig imp
     sb.append("maxBufferedDocs=").append(maxBufferedDocs).append("\n");
     sb.append("mergedSegmentWarmer=").append(mergedSegmentWarmer).append("\n");
     sb.append("codecProvider=").append(codecProvider).append("\n");
+    sb.append("mergePolicy=").append(mergePolicy).append("\n");
     sb.append("maxThreadStates=").append(maxThreadStates).append("\n");
     return sb.toString();
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LogByteSizeMergePolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LogByteSizeMergePolicy.java?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LogByteSizeMergePolicy.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LogByteSizeMergePolicy.java Tue Mar 23 18:52:19 2010
@@ -30,11 +30,11 @@ public class LogByteSizeMergePolicy exte
    *  or larger will never be merged.  @see setMaxMergeMB */
   public static final double DEFAULT_MAX_MERGE_MB = Long.MAX_VALUE;
 
-  public LogByteSizeMergePolicy(IndexWriter writer) {
-    super(writer);
+  public LogByteSizeMergePolicy() {
     minMergeSize = (long) (DEFAULT_MIN_MERGE_MB*1024*1024);
     maxMergeSize = (long) (DEFAULT_MAX_MERGE_MB*1024*1024);
   }
+  
   @Override
   protected long size(SegmentInfo info) throws IOException {
     return sizeBytes(info);

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LogDocMergePolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LogDocMergePolicy.java?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LogDocMergePolicy.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LogDocMergePolicy.java Tue Mar 23 18:52:19 2010
@@ -28,14 +28,14 @@ public class LogDocMergePolicy extends L
   /** Default minimum segment size.  @see setMinMergeDocs */
   public static final int DEFAULT_MIN_MERGE_DOCS = 1000;
 
-  public LogDocMergePolicy(IndexWriter writer) {
-    super(writer);
+  public LogDocMergePolicy() {
     minMergeSize = DEFAULT_MIN_MERGE_DOCS;
-
+    
     // maxMergeSize is never used by LogDocMergePolicy; set
     // it to Long.MAX_VALUE to disable it
     maxMergeSize = Long.MAX_VALUE;
   }
+
   @Override
   protected long size(SegmentInfo info) throws IOException {
     return sizeDocs(info);

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LogMergePolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LogMergePolicy.java?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LogMergePolicy.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LogMergePolicy.java Tue Mar 23 18:52:19 2010
@@ -66,17 +66,18 @@ public abstract class LogMergePolicy ext
   private boolean useCompoundFile = true;
   private boolean useCompoundDocStore = true;
 
-  public LogMergePolicy(IndexWriter writer) {
-    super(writer);
+  public LogMergePolicy() {
+    super();
   }
-  
+
   protected boolean verbose() {
-    return writer != null && writer.verbose();
+    IndexWriter w = writer.get();
+    return w != null && w.verbose();
   }
   
   private void message(String message) {
     if (verbose())
-      writer.message("LMP: " + message);
+      writer.get().message("LMP: " + message);
   }
 
   /** <p>Returns the number of segments that are merged at
@@ -160,7 +161,7 @@ public abstract class LogMergePolicy ext
 
   protected long sizeDocs(SegmentInfo info) throws IOException {
     if (calibrateSizeByDeletes) {
-      int delCount = writer.numDeletedDocs(info);
+      int delCount = writer.get().numDeletedDocs(info);
       return (info.docCount - (long)delCount);
     } else {
       return info.docCount;
@@ -170,7 +171,7 @@ public abstract class LogMergePolicy ext
   protected long sizeBytes(SegmentInfo info) throws IOException {
     long byteSize = info.sizeInBytes();
     if (calibrateSizeByDeletes) {
-      int delCount = writer.numDeletedDocs(info);
+      int delCount = writer.get().numDeletedDocs(info);
       float delRatio = (info.docCount <= 0 ? 0.0f : ((float)delCount / (float)info.docCount));
       return (info.docCount <= 0 ?  byteSize : (long)(byteSize * (1.0f - delRatio)));
     } else {
@@ -199,10 +200,12 @@ public abstract class LogMergePolicy ext
    *  writer, and matches the current compound file setting */
   private boolean isOptimized(SegmentInfo info)
     throws IOException {
-    boolean hasDeletions = writer.numDeletedDocs(info) > 0;
+    IndexWriter w = writer.get();
+    assert w != null;
+    boolean hasDeletions = w.numDeletedDocs(info) > 0;
     return !hasDeletions &&
       !info.hasSeparateNorms() &&
-      info.dir == writer.getDirectory() &&
+      info.dir == w.getDirectory() &&
       info.getUseCompoundFile() == useCompoundFile;
   }
 
@@ -309,9 +312,11 @@ public abstract class LogMergePolicy ext
 
     MergeSpecification spec = new MergeSpecification();
     int firstSegmentWithDeletions = -1;
+    IndexWriter w = writer.get();
+    assert w != null;
     for(int i=0;i<numSegments;i++) {
       final SegmentInfo info = segmentInfos.info(i);
-      int delCount = writer.numDeletedDocs(info);
+      int delCount = w.numDeletedDocs(info);
       if (delCount > 0) {
         if (verbose())
           message("  segment " + info.name + " has deletions");

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/MergePolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/MergePolicy.java?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/MergePolicy.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/MergePolicy.java Tue Mar 23 18:52:19 2010
@@ -18,6 +18,8 @@ package org.apache.lucene.index;
  */
 
 import org.apache.lucene.store.Directory;
+import org.apache.lucene.util.SetOnce;
+import org.apache.lucene.util.SetOnce.AlreadySetException;
 
 import java.io.IOException;
 import java.util.List;
@@ -52,12 +54,6 @@ import java.util.Set;
  * LogByteSizeMergePolicy}.</p>
  *
  * @lucene.experimental
- *
- * <p><b>NOTE</b>: This class typically requires access to
- * package-private APIs (e.g. <code>SegmentInfos</code>) to do its job;
- * if you implement your own MergePolicy, you'll need to put
- * it in package org.apache.lucene.index in order to use
- * these APIs.
  */
 
 public abstract class MergePolicy implements java.io.Closeable {
@@ -225,13 +221,29 @@ public abstract class MergePolicy implem
     }
   }
 
-  final protected IndexWriter writer;
-  
-  public MergePolicy(IndexWriter writer) {
-    this.writer = writer;
+  protected final SetOnce<IndexWriter> writer;
+
+  /**
+   * Creates a new merge policy instance. Note that if you intend to use it
+   * without passing it to {@link IndexWriter}, you should call
+   * {@link #setIndexWriter(IndexWriter)}.
+   */
+  public MergePolicy() {
+    writer = new SetOnce<IndexWriter>();
   }
 
   /**
+   * Sets the {@link IndexWriter} to use by this merge policy. This method is
+   * allowed to be called only once, and is usually set by IndexWriter. If it is
+   * called more than once, {@link AlreadySetException} is thrown.
+   * 
+   * @see SetOnce
+   */
+  public void setIndexWriter(IndexWriter writer) {
+    this.writer.set(writer);
+  }
+  
+  /**
    * Determine what set of merge operations are now necessary on the index.
    * {@link IndexWriter} calls this whenever there is a change to the segments.
    * This call is always synchronized on the {@link IndexWriter} instance so

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/MergeScheduler.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/MergeScheduler.java?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/MergeScheduler.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/MergeScheduler.java Tue Mar 23 18:52:19 2010
@@ -25,12 +25,6 @@ import java.io.IOException;
  *  MergeScheduler is {@link ConcurrentMergeScheduler}.</p>
  *
  * @lucene.experimental
- *
- * <p><b>NOTE</b>: This class typically requires access to
- * package-private APIs (eg, SegmentInfos) to do its job;
- * if you implement your own MergePolicy, you'll need to put
- * it in package org.apache.lucene.index in order to use
- * these APIs.
 */
 
 public abstract class MergeScheduler {

Propchange: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 23 18:52:19 2010
@@ -1,2 +1,2 @@
 /lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:909334
-/lucene/java/trunk/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:916596,916685,916755,916769,917019,917148,917154,917161,917203-917204,919060,919119,919718,919731,919869,920237-920499,922013,922277,922525,922528,922583,922593,922602,922624,922797,922799,922806,922886-922887,923112,923238,924151,924207,924286,924321-924731,924781
+/lucene/java/trunk/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:916596,916685,916755,916769,917019,917148,917154,917161,917203-917204,919060,919119,919718,919731,919869,920237-920499,922013,922277,922525,922528,922583,922593,922602,922624,922797,922799,922806,922886-922887,923112,923238,924151,924207,924286,924321-924731,924781,925176-925462

Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/TestSearch.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/TestSearch.java?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/TestSearch.java (original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/TestSearch.java Tue Mar 23 18:52:19 2010
@@ -73,11 +73,11 @@ public class TestSearch extends LuceneTe
     throws Exception {
       Directory directory = new RAMDirectory();
       Analyzer analyzer = new SimpleAnalyzer(TEST_VERSION_CURRENT);
-      IndexWriter writer = new IndexWriter(directory, new IndexWriterConfig(
-        TEST_VERSION_CURRENT, analyzer));
-      LogMergePolicy lmp = (LogMergePolicy) writer.getMergePolicy();
+      IndexWriterConfig conf = new IndexWriterConfig(TEST_VERSION_CURRENT, analyzer);
+      LogMergePolicy lmp = (LogMergePolicy) conf.getMergePolicy();
       lmp.setUseCompoundFile(useCompoundFile);
       lmp.setUseCompoundDocStore(useCompoundFile);
+      IndexWriter writer = new IndexWriter(directory, conf);
 
       String[] docs = {
         "a b c d e",

Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/TestSearchForDuplicates.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/TestSearchForDuplicates.java?rev=926725&r1=926724&r2=926725&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/TestSearchForDuplicates.java (original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/TestSearchForDuplicates.java Tue Mar 23 18:52:19 2010
@@ -78,11 +78,11 @@ public class TestSearchForDuplicates ext
   private void doTest(PrintWriter out, boolean useCompoundFiles) throws Exception {
       Directory directory = new RAMDirectory();
       Analyzer analyzer = new SimpleAnalyzer(TEST_VERSION_CURRENT);
-      IndexWriter writer = new IndexWriter(directory, new IndexWriterConfig(
-        TEST_VERSION_CURRENT, analyzer));
-      LogMergePolicy lmp = (LogMergePolicy) writer.getMergePolicy();
+      IndexWriterConfig conf = new IndexWriterConfig(TEST_VERSION_CURRENT, analyzer);
+      LogMergePolicy lmp = (LogMergePolicy) conf.getMergePolicy();
       lmp.setUseCompoundFile(useCompoundFiles);
       lmp.setUseCompoundDocStore(useCompoundFiles);
+      IndexWriter writer = new IndexWriter(directory, conf);
 
       final int MAX_DOCS = 225;
 

Propchange: lucene/java/branches/flex_1458/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 23 18:52:19 2010
@@ -1,4 +1,4 @@
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:748824
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:829134,829881,831036,896850,909334
 /lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:880793,896906
-/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:824912-825292,826213-833960,880727-886190,889185,889614-916543,916596,916685,916755,916769,917019,917148,917154,917161,917203-917204,919060,919119,919718,919731,919869,920237-920499,922013,922277,922525,922528,922583,922593,922602,922624,922797,922799,922806,922886-922887,923112,923238,924151,924207,924286,924321-924731,924781
+/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:824912-825292,826213-833960,880727-886190,889185,889614-916543,916596,916685,916755,916769,917019,917148,917154,917161,917203-917204,919060,919119,919718,919731,919869,920237-920499,922013,922277,922525,922528,922583,922593,922602,922624,922797,922799,922806,922886-922887,923112,923238,924151,924207,924286,924321-924731,924781,925176-925462

Propchange: lucene/java/branches/flex_1458/src/test/org/apache/lucene/document/TestDateTools.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 23 18:52:19 2010
@@ -1,4 +1,4 @@
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/document/TestDateTools.java:748824
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/document/TestDateTools.java:829134,829881,831036,896850,909334
 /lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/document/TestDateTools.java:880793,896906
-/lucene/java/trunk/src/test/org/apache/lucene/document/TestDateTools.java:824912-825292,826213-833960,880727-886190,889185,889614-916543,916596,916685,916755,916769,917019,917148,917154,917161,917203-917204,919060,919119,919718,919731,919869,920237-920499,922013,922277,922525,922528,922583,922593,922602,922624,922797,922799,922806,922886-922887,923112,923238,924151,924207,924286,924321-924731,924781
+/lucene/java/trunk/src/test/org/apache/lucene/document/TestDateTools.java:824912-825292,826213-833960,880727-886190,889185,889614-916543,916596,916685,916755,916769,917019,917148,917154,917161,917203-917204,919060,919119,919718,919731,919869,920237-920499,922013,922277,922525,922528,922583,922593,922602,922624,922797,922799,922806,922886-922887,923112,923238,924151,924207,924286,924321-924731,924781,925176-925462

Propchange: lucene/java/branches/flex_1458/src/test/org/apache/lucene/document/TestNumberTools.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 23 18:52:19 2010
@@ -1,4 +1,4 @@
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/document/TestNumberTools.java:748824
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/document/TestNumberTools.java:829134,829881,831036,896850,909334
 /lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/document/TestNumberTools.java:880793,896906
-/lucene/java/trunk/src/test/org/apache/lucene/document/TestNumberTools.java:824912-825292,826213-833960,880727-886190,889185,889614-916543,916596,916685,916755,916769,917019,917148,917154,917161,917203-917204,919060,919119,919718,919731,919869,920237-920499,922013,922277,922525,922528,922583,922593,922602,922624,922797,922799,922806,922886-922887,923112,923238,924151,924207,924286,924321-924731,924781
+/lucene/java/trunk/src/test/org/apache/lucene/document/TestNumberTools.java:824912-825292,826213-833960,880727-886190,889185,889614-916543,916596,916685,916755,916769,917019,917148,917154,917161,917203-917204,919060,919119,919718,919731,919869,920237-920499,922013,922277,922525,922528,922583,922593,922602,922624,922797,922799,922806,922886-922887,923112,923238,924151,924207,924286,924321-924731,924781,925176-925462



Mime
View raw message