lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r924568 - in /lucene/java/branches/flex_1458: ./ backwards/src/ backwards/src/java/org/apache/lucene/search/ backwards/src/test/org/apache/lucene/analysis/ backwards/src/test/org/apache/lucene/document/ backwards/src/test/org/apache/lucene/...
Date Thu, 18 Mar 2010 00:18:50 GMT
Author: mikemccand
Date: Thu Mar 18 00:18:49 2010
New Revision: 924568

URL: http://svn.apache.org/viewvc?rev=924568&view=rev
Log:
LUCENE-2293 (on flex branch): merge to flex trunk 923238

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/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/TestBackwardsCompatibility.java
  (props changed)
    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/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/src/java/org/apache/lucene/analysis/Tokenizer.java   (props
changed)
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocumentsWriter.java
    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/search/MultiTermQueryWrapperFilter.java
  (props changed)
    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/TestBackwardsCompatibility.java
  (props changed)
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexWriterConfig.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestStressIndexing2.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 Thu Mar 18 00:18:49 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,924151,924207,924286
+/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

Modified: lucene/java/branches/flex_1458/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/CHANGES.txt?rev=924568&r1=924567&r2=924568&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/CHANGES.txt (original)
+++ lucene/java/branches/flex_1458/CHANGES.txt Thu Mar 18 00:18:49 2010
@@ -202,6 +202,11 @@ New features
   for captureState()/restoreState(), if the state itsself
   needs to be inspected/modified.  (Uwe Schindler)
 
+* LUCENE-2293: Expose control over max number of threads that
+  IndexWriter will allow to run concurrently while indexing
+  documents (previously this was hardwired to 5), using
+  IndexWriterConfig.setMaxThreadStates.  (Mike McCandless)
+
 Optimizations
 
 * LUCENE-2075: Terms dict cache is now shared across threads instead

Propchange: lucene/java/branches/flex_1458/backwards/src/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 18 00:18:49 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:922806,924286
+/lucene/java/trunk/backwards/src:922624,922806,923238,924286
 /lucene/java/trunk/src:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214

Propchange: lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 18 00:18:49 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:922806,924286
+/lucene/java/trunk/backwards/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:922624,922806,923238,924286
 /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 Thu Mar 18 00:18:49 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:922806,924286
+/lucene/java/trunk/backwards/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:922624,922806,923238,924286
 /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 Thu Mar 18 00:18:49 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:922806,924286
+/lucene/java/trunk/backwards/src/test/org/apache/lucene/document/TestDateTools.java:922624,922806,923238,924286
 /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 Thu Mar 18 00:18:49 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:922806,924286
+/lucene/java/trunk/backwards/src/test/org/apache/lucene/document/TestNumberTools.java:922624,922806,923238,924286
 /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

Propchange: lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 18 00:18:49 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:922806,924286
+/lucene/java/trunk/backwards/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:922624,922806,923238,924286
 /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

Propchange: lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/util/TestAttributeSource.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 18 00:18:49 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:922806,924286
+/lucene/java/trunk/backwards/src/test/org/apache/lucene/util/TestAttributeSource.java:922624,922806,923238,924286
 /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 Thu Mar 18 00:18:49 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,924151,924207,924286
+/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

Propchange: lucene/java/branches/flex_1458/contrib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 18 00:18:49 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,924151,924207,924286
+/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

Propchange: lucene/java/branches/flex_1458/contrib/CHANGES.txt
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 18 00:18:49 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,924151,924207,924286
+/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

Propchange: lucene/java/branches/flex_1458/contrib/highlighter/src/test/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 18 00:18:49 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,924151,924207,924286
+/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

Propchange: lucene/java/branches/flex_1458/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 18 00:18:49 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,924151,924207,924286
+/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

Propchange: lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/Tokenizer.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 18 00:18:49 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,924151,924207,924286
+/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

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocumentsWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocumentsWriter.java?rev=924568&r1=924567&r2=924568&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocumentsWriter.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocumentsWriter.java Thu
Mar 18 00:18:49 2010
@@ -127,7 +127,6 @@ final class DocumentsWriter {
 
   // Max # ThreadState instances; if there are more threads
   // than this they share ThreadStates
-  private final static int MAX_THREAD_STATE = 5;
   private DocumentsWriterThreadState[] threadStates = new DocumentsWriterThreadState[0];
   private final HashMap<Thread,DocumentsWriterThreadState> threadBindings = new HashMap<Thread,DocumentsWriterThreadState>();
 
@@ -143,6 +142,10 @@ final class DocumentsWriter {
   int maxFieldLength = IndexWriterConfig.UNLIMITED_FIELD_LENGTH;
   Similarity similarity;
 
+  // max # simultaneous threads; if there are more than
+  // this, they wait for others to finish first
+  private final int maxThreadStates;
+
   List<String> newFiles;
 
   static class DocState {
@@ -303,10 +306,11 @@ final class DocumentsWriter {
 
   private boolean closed;
 
-  DocumentsWriter(Directory directory, IndexWriter writer, IndexingChain indexingChain) throws
IOException {
+  DocumentsWriter(Directory directory, IndexWriter writer, IndexingChain indexingChain, int
maxThreadStates) throws IOException {
     this.directory = directory;
     this.writer = writer;
     this.similarity = writer.getConfig().getSimilarity();
+    this.maxThreadStates = maxThreadStates;
     flushedDocCount = writer.maxDoc();
 
     consumer = indexingChain.getChain(this);
@@ -735,7 +739,7 @@ final class DocumentsWriter {
         if (minThreadState == null || ts.numThreads < minThreadState.numThreads)
           minThreadState = ts;
       }
-      if (minThreadState != null && (minThreadState.numThreads == 0 || threadStates.length
>= MAX_THREAD_STATE)) {
+      if (minThreadState != null && (minThreadState.numThreads == 0 || threadStates.length
>= maxThreadStates)) {
         state = minThreadState;
         state.numThreads++;
       } else {

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=924568&r1=924567&r2=924568&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 Thu Mar
18 00:18:49 2010
@@ -1158,7 +1158,7 @@ public class IndexWriter implements Clos
 
       setRollbackSegmentInfos(segmentInfos);
 
-      docWriter = new DocumentsWriter(directory, this, conf.getIndexingChain());
+      docWriter = new DocumentsWriter(directory, this, conf.getIndexingChain(), conf.getMaxThreadStates());
       docWriter.setInfoStream(infoStream);
       docWriter.setMaxFieldLength(maxFieldLength);
 

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=924568&r1=924567&r2=924568&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
Thu Mar 18 00:18:49 2010
@@ -82,6 +82,12 @@ public final class IndexWriterConfig imp
   /** Default {@link CodecProvider}. */
   public final static CodecProvider DEFAULT_CODEC_PROVIDER = CodecProvider.getDefault();
 
+  /** The maximum number of simultaneous threads that may be
+   *  indexing documents at once in IndexWriter; if more
+   *  than this many threads arrive they will wait for
+   *  others to finish. */
+  public final static int DEFAULT_MAX_THREAD_STATES = 8;
+
   /**
    * Sets the default (for any instance) maximum time to wait for a write lock
    * (in milliseconds).
@@ -115,6 +121,7 @@ public final class IndexWriterConfig imp
   private IndexingChain indexingChain;
   private IndexReaderWarmer mergedSegmentWarmer;
   private CodecProvider codecProvider;
+  private int maxThreadStates;
   
   // required for clone
   private Version matchVersion;
@@ -143,6 +150,7 @@ public final class IndexWriterConfig imp
     indexingChain = DocumentsWriter.defaultIndexingChain;
     mergedSegmentWarmer = null;
     codecProvider = DEFAULT_CODEC_PROVIDER;
+    maxThreadStates = DEFAULT_MAX_THREAD_STATES;
   }
   
   @Override
@@ -500,6 +508,19 @@ public final class IndexWriterConfig imp
     return codecProvider;
   }
 
+  /** Sets the max number of simultaneous threads that may
+   *  be indexing documents at once in IndexWriter. */
+  public IndexWriterConfig setMaxThreadStates(int maxThreadStates) {
+    this.maxThreadStates = maxThreadStates;
+    return this;
+  }
+
+  /** Returns the max number of simultaneous threads that
+   *  may be indexing documents at once in IndexWriter. */
+  public int getMaxThreadStates() {
+    return maxThreadStates;
+  }
+
   /** Expert: sets the {@link DocConsumer} chain to be used to process documents. */
   IndexWriterConfig setIndexingChain(IndexingChain indexingChain) {
     this.indexingChain = indexingChain == null ? DocumentsWriter.defaultIndexingChain : indexingChain;
@@ -530,6 +551,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("maxThreadStates=").append(maxThreadStates).append("\n");
     return sb.toString();
   }
 }

Propchange: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 18 00:18:49 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,924151,924207,924286
+/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

Propchange: lucene/java/branches/flex_1458/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 18 00:18:49 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,924151,924207,924286
+/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

Propchange: lucene/java/branches/flex_1458/src/test/org/apache/lucene/document/TestDateTools.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 18 00:18:49 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,924151,924207,924286
+/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

Propchange: lucene/java/branches/flex_1458/src/test/org/apache/lucene/document/TestNumberTools.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 18 00:18:49 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,924151,924207,924286
+/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

Propchange: lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 18 00:18:49 2010
@@ -1,4 +1,4 @@
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:748824
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:829134,829881,831036,896850,909334
 /lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:880793,896906
-/lucene/java/trunk/src/test/org/apache/lucene/index/TestBackwardsCompatibility.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,924151,924207,924286
+/lucene/java/trunk/src/test/org/apache/lucene/index/TestBackwardsCompatibility.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

Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexWriterConfig.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexWriterConfig.java?rev=924568&r1=924567&r2=924568&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexWriterConfig.java
(original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexWriterConfig.java
Thu Mar 18 00:18:49 2010
@@ -101,6 +101,7 @@ public class TestIndexWriterConfig exten
     getters.add("getIndexingChain");
     getters.add("getMergedSegmentWarmer");
     getters.add("getCodecProvider");
+    getters.add("getMaxThreadStates");
     for (Method m : IndexWriterConfig.class.getDeclaredMethods()) {
       if (m.getDeclaringClass() == IndexWriterConfig.class && m.getName().startsWith("get"))
{
         assertTrue("method " + m.getName() + " is not tested for defaults", getters.contains(m.getName()));

Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestStressIndexing2.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestStressIndexing2.java?rev=924568&r1=924567&r2=924568&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestStressIndexing2.java
(original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestStressIndexing2.java
Thu Mar 18 00:18:49 2010
@@ -84,7 +84,8 @@ public class TestStressIndexing2 extends
     // dir1 = FSDirectory.open("foofoofoo");
     Directory dir2 = new MockRAMDirectory();
     // mergeFactor=2; maxBufferedDocs=2; Map docs = indexRandom(1, 3, 2, dir1);
-    Map<String,Document> docs = indexRandom(10, 10, 100, dir1);
+    int maxThreadStates = 1+r.nextInt(10);
+    Map<String,Document> docs = indexRandom(10, 10, 100, dir1, maxThreadStates);
     indexSerial(docs, dir2);
 
     // verifying verify
@@ -105,6 +106,7 @@ public class TestStressIndexing2 extends
       sameFieldOrder=r.nextBoolean();
       mergeFactor=r.nextInt(3)+2;
       maxBufferedDocs=r.nextInt(3)+2;
+      int maxThreadStates = 1+r.nextInt(10);
       seed++;
 
       int nThreads=r.nextInt(5)+1;
@@ -112,9 +114,7 @@ public class TestStressIndexing2 extends
       int range=r.nextInt(20)+1;
       Directory dir1 = new MockRAMDirectory();
       Directory dir2 = new MockRAMDirectory();
-      //System.out.println("iter=" + iter + " range=" + range);
-      //System.out.println("TEST: index random");
-      Map<String,Document> docs = indexRandom(nThreads, iter, range, dir1);
+      Map<String,Document> docs = indexRandom(nThreads, iter, range, dir1, maxThreadStates);
       //System.out.println("TEST: index serial");
       indexSerial(docs, dir2);
       //System.out.println("TEST: verify");
@@ -193,12 +193,12 @@ public class TestStressIndexing2 extends
     return dw;
   }
   
-  public Map<String,Document> indexRandom(int nThreads, int iterations, int range,
Directory dir) throws IOException, InterruptedException {
+  public Map<String,Document> indexRandom(int nThreads, int iterations, int range,
Directory dir, int maxThreadStates) throws IOException, InterruptedException {
     Map<String,Document> docs = new HashMap<String,Document>();
     for(int iter=0;iter<3;iter++) {
       IndexWriter w = new MockIndexWriter(dir, new IndexWriterConfig(
           TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).setOpenMode(OpenMode.CREATE)
-          .setRAMBufferSizeMB(0.1).setMaxBufferedDocs(maxBufferedDocs));
+               .setRAMBufferSizeMB(0.1).setMaxBufferedDocs(maxBufferedDocs).setMaxThreadStates(maxThreadStates));
       LogMergePolicy lmp = (LogMergePolicy) w.getMergePolicy();
       lmp.setUseCompoundFile(false);
       lmp.setUseCompoundDocStore(false);

Propchange: lucene/java/branches/flex_1458/src/test/org/apache/lucene/util/TestAttributeSource.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 18 00:18:49 2010
@@ -1,2 +1,2 @@
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/util/TestAttributeSource.java:909334
-/lucene/java/trunk/src/test/org/apache/lucene/util/TestAttributeSource.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,924151,924207,924286
+/lucene/java/trunk/src/test/org/apache/lucene/util/TestAttributeSource.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



Mime
View raw message