lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1058986 [1/2] - in /lucene/dev/branches/bulkpostings: ./ lucene/ lucene/contrib/demo/src/java/org/apache/lucene/demo/ lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/ lucene/contrib/instantiated/src/test/org/apache/l...
Date Fri, 14 Jan 2011 12:40:06 GMT
Author: rmuir
Date: Fri Jan 14 12:40:04 2011
New Revision: 1058986

URL: http://svn.apache.org/viewvc?rev=1058986&view=rev
Log:
merge trunk (1058018:1058327)

Added:
    lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/index/TestSegmentInfo.java
      - copied unchanged from r1058327, lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestSegmentInfo.java
Modified:
    lucene/dev/branches/bulkpostings/   (props changed)
    lucene/dev/branches/bulkpostings/lucene/   (props changed)
    lucene/dev/branches/bulkpostings/lucene/CHANGES.txt
    lucene/dev/branches/bulkpostings/lucene/contrib/demo/src/java/org/apache/lucene/demo/SearchFiles.java
    lucene/dev/branches/bulkpostings/lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterPhraseTest.java
    lucene/dev/branches/bulkpostings/lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestRealTime.java
    lucene/dev/branches/bulkpostings/lucene/contrib/lucli/src/java/lucli/LuceneMethods.java
    lucene/dev/branches/bulkpostings/lucene/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
    lucene/dev/branches/bulkpostings/lucene/contrib/misc/src/test/org/apache/lucene/index/TestFieldNormModifier.java
    lucene/dev/branches/bulkpostings/lucene/contrib/misc/src/test/org/apache/lucene/misc/TestLengthNormModifier.java
    lucene/dev/branches/bulkpostings/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/surround/query/BooleanQueryTst.java
    lucene/dev/branches/bulkpostings/lucene/contrib/spatial/src/java/org/apache/lucene/spatial/tier/DistanceFieldComparatorSource.java
    lucene/dev/branches/bulkpostings/lucene/contrib/swing/src/java/org/apache/lucene/swing/models/ListSearcher.java
    lucene/dev/branches/bulkpostings/lucene/contrib/wordnet/src/java/org/apache/lucene/wordnet/SynExpand.java
    lucene/dev/branches/bulkpostings/lucene/contrib/wordnet/src/java/org/apache/lucene/wordnet/SynLookup.java
    lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/SegmentInfo.java
    lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/pulsing/PulsingPostingsWriterImpl.java
    lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/BooleanScorer.java
    lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/Collector.java
    lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/ConstantScoreQuery.java
    lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/FieldComparator.java
    lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/IndexSearcher.java
    lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/MultiCollector.java
    lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/PositiveScoresOnlyCollector.java
    lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/TimeLimitingCollector.java
    lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/TopFieldCollector.java
    lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/TopScoreDocCollector.java
    lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/TotalHitCountCollector.java
    lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/index/TestOmitTf.java
    lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/CheckHits.java
    lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/JustCompileSearch.java
    lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/MultiCollectorTest.java
    lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/QueryUtils.java
    lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestConstantScoreQuery.java
    lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestDocBoost.java
    lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestElevationComparator.java
    lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java
    lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java
    lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestScorerPerf.java
    lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestSetNorm.java
    lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestSimilarity.java
    lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestSort.java
    lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestSubScorerFreqs.java
    lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestTermScorer.java
    lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java
    lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestTopDocsCollector.java
    lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java
    lucene/dev/branches/bulkpostings/solr/   (props changed)
    lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/handler/component/QueryComponent.java
    lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/handler/component/QueryElevationComponent.java
    lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/handler/component/TermsComponent.java
    lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/schema/RandomSortField.java
    lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/search/DocSetHitCollector.java
    lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/search/Grouping.java
    lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/search/MissingStringLastComparatorSource.java
    lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/search/SolrIndexSearcher.java
    lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/search/function/ValueSource.java
    lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/update/UpdateHandler.java
    lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/cloud/AbstractZkTestCase.java
    lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/cloud/ZkControllerTest.java
    lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/handler/TestReplicationHandler.java
    lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/search/TestDocSet.java
    lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/search/TestIndexSearcher.java
    lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/search/TestSort.java
    lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/spelling/SpellPossibilityIteratorTest.java
    lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/update/DirectUpdateHandlerTest.java

Modified: lucene/dev/branches/bulkpostings/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/CHANGES.txt?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/CHANGES.txt (original)
+++ lucene/dev/branches/bulkpostings/lucene/CHANGES.txt Fri Jan 14 12:40:04 2011
@@ -128,8 +128,8 @@ Changes in backwards compatibility polic
   ParallelMultiSearcher into IndexSearcher as an optional
   ExecutorServiced passed to its ctor.  (Mike McCandless)
 
-* LUCENE-2837: Changed Weight#scorer, Weight#explain & Filter#getDocIdSet to
-  operate on a ReaderContext instead of directly on IndexReader to enable
+* LUCENE-2831: Changed Weight#scorer, Weight#explain & Filter#getDocIdSet to
+  operate on a AtomicReaderContext instead of directly on IndexReader to enable
   searches to be aware of IndexSearcher's context. (Simon Willnauer)
   
 * LUCENE-2839: Scorer#score(Collector,int,int) is now public because it is
@@ -188,6 +188,10 @@ API Changes
 
 * LUCENE-2778: RAMDirectory now exposes newRAMFile() which allows to override
   and return a different RAMFile implementation. (Shai Erera)
+  
+* LUCENE-2831: Weight#scorer, Weight#explain, Filter#getDocIdSet,
+  Collector#setNextReader & FieldComparator#setNextReader now expect an
+  AtomicReaderContext instead of an IndexReader. (Simon Willnauer)
 
 New features
 
@@ -375,7 +379,8 @@ Bug fixes
   to a mutable reference to the IndexWriters SegmentInfos. 
   (Simon Willnauer, Earwin Burrfoot)
 
-
+* LUCENE-2860: Fixed SegmentInfo.sizeInBytes to factor includeDocStores when it 
+  decides whether to return the cached computed size or not. (Shai Erera)
 
 ======================= Lucene 3.x (not yet released) =======================
 

Modified: lucene/dev/branches/bulkpostings/lucene/contrib/demo/src/java/org/apache/lucene/demo/SearchFiles.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/contrib/demo/src/java/org/apache/lucene/demo/SearchFiles.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/contrib/demo/src/java/org/apache/lucene/demo/SearchFiles.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/contrib/demo/src/java/org/apache/lucene/demo/SearchFiles.java Fri Jan 14 12:40:04 2011
@@ -28,6 +28,7 @@ import org.apache.lucene.analysis.Analyz
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.queryParser.QueryParser;
 import org.apache.lucene.search.Collector;
 import org.apache.lucene.search.IndexSearcher;
@@ -160,9 +161,9 @@ public class SearchFiles {
       }
 
       @Override
-      public void setNextReader(IndexReader reader, int docBase)
+      public void setNextReader(AtomicReaderContext context)
           throws IOException {
-        this.docBase = docBase;
+        this.docBase = context.docBase;
       }
 
       @Override

Modified: lucene/dev/branches/bulkpostings/lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterPhraseTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterPhraseTest.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterPhraseTest.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterPhraseTest.java Fri Jan 14 12:40:04 2011
@@ -36,6 +36,7 @@ import org.apache.lucene.index.IndexRead
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.index.TermPositionVector;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.Collector;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.PhraseQuery;
@@ -133,9 +134,9 @@ public class HighlighterPhraseTest exten
           }
 
           @Override
-          public void setNextReader(IndexReader indexreader, int i)
+          public void setNextReader(AtomicReaderContext context)
               throws IOException {
-            this.baseDoc = i;
+            this.baseDoc = context.docBase;
           }
 
           @Override

Modified: lucene/dev/branches/bulkpostings/lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestRealTime.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestRealTime.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestRealTime.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestRealTime.java Fri Jan 14 12:40:04 2011
@@ -20,8 +20,8 @@ import org.apache.lucene.search.TermQuer
 import org.apache.lucene.search.Scorer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.index.Term;
-import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.util.LuceneTestCase;
 
 /**
@@ -67,7 +67,7 @@ public class TestRealTime extends Lucene
     @Override
     public void setScorer(Scorer scorer) {}
     @Override
-    public void setNextReader(IndexReader reader, int docBase) {}
+    public void setNextReader(AtomicReaderContext context) {}
     @Override
     public boolean acceptsDocsOutOfOrder() { return true; }
     @Override

Modified: lucene/dev/branches/bulkpostings/lucene/contrib/lucli/src/java/lucli/LuceneMethods.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/contrib/lucli/src/java/lucli/LuceneMethods.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/contrib/lucli/src/java/lucli/LuceneMethods.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/contrib/lucli/src/java/lucli/LuceneMethods.java Fri Jan 14 12:40:04 2011
@@ -41,6 +41,7 @@ import org.apache.lucene.analysis.tokena
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Fieldable;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.IndexWriterConfig;
 import org.apache.lucene.index.Fields;
@@ -232,7 +233,7 @@ class LuceneMethods {
     }
 
     @Override
-    public void setNextReader(IndexReader reader, int docBase) {}
+    public void setNextReader(AtomicReaderContext context) {}
     @Override
     public boolean acceptsDocsOutOfOrder() {
       return true;

Modified: lucene/dev/branches/bulkpostings/lucene/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java Fri Jan 14 12:40:04 2011
@@ -38,6 +38,7 @@ import org.apache.lucene.document.Docume
 import org.apache.lucene.document.FieldSelector;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.Fields;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.index.Terms;
 import org.apache.lucene.index.TermsEnum;
 import org.apache.lucene.index.FieldsEnum;
@@ -444,7 +445,7 @@ public class MemoryIndex implements Seri
         }
 
         @Override
-        public void setNextReader(IndexReader reader, int docBase) { }
+        public void setNextReader(AtomicReaderContext context) { }
       });
       float score = scores[0];
       return score;

Modified: lucene/dev/branches/bulkpostings/lucene/contrib/misc/src/test/org/apache/lucene/index/TestFieldNormModifier.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/contrib/misc/src/test/org/apache/lucene/index/TestFieldNormModifier.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/contrib/misc/src/test/org/apache/lucene/index/TestFieldNormModifier.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/contrib/misc/src/test/org/apache/lucene/index/TestFieldNormModifier.java Fri Jan 14 12:40:04 2011
@@ -23,6 +23,7 @@ import java.util.Arrays;
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.Collector;
 import org.apache.lucene.search.DefaultSimilarity;
 import org.apache.lucene.search.IndexSearcher;
@@ -122,8 +123,8 @@ public class TestFieldNormModifier exten
         scores[doc + docBase] = scorer.score();
       }
       @Override
-      public void setNextReader(IndexReader reader, int docBase) {
-        this.docBase = docBase;
+      public void setNextReader(AtomicReaderContext context) {
+        docBase = context.docBase;
       }
       @Override
       public void setScorer(Scorer scorer) throws IOException {
@@ -157,8 +158,8 @@ public class TestFieldNormModifier exten
         scores[doc + docBase] = scorer.score();
       }
       @Override
-      public void setNextReader(IndexReader reader, int docBase) {
-        this.docBase = docBase;
+      public void setNextReader(AtomicReaderContext context) {
+        docBase = context.docBase;
       }
       @Override
       public void setScorer(Scorer scorer) throws IOException {
@@ -209,8 +210,8 @@ public class TestFieldNormModifier exten
         scores[doc + docBase] = scorer.score();
       }
       @Override
-      public void setNextReader(IndexReader reader, int docBase) {
-        this.docBase = docBase;
+      public void setNextReader(AtomicReaderContext context) {
+        docBase = context.docBase;
       }
       @Override
       public void setScorer(Scorer scorer) throws IOException {

Modified: lucene/dev/branches/bulkpostings/lucene/contrib/misc/src/test/org/apache/lucene/misc/TestLengthNormModifier.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/contrib/misc/src/test/org/apache/lucene/misc/TestLengthNormModifier.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/contrib/misc/src/test/org/apache/lucene/misc/TestLengthNormModifier.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/contrib/misc/src/test/org/apache/lucene/misc/TestLengthNormModifier.java Fri Jan 14 12:40:04 2011
@@ -25,6 +25,7 @@ import org.apache.lucene.document.Field;
 import org.apache.lucene.index.FieldInvertState;
 import org.apache.lucene.index.FieldNormModifier;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.MultiNorms;
 import org.apache.lucene.index.Term;
@@ -139,8 +140,8 @@ public class TestLengthNormModifier exte
       scores[doc + docBase] = scorer.score();
     }
     @Override
-    public void setNextReader(IndexReader reader, int docBase) {
-      this.docBase = docBase;
+    public void setNextReader(AtomicReaderContext context) {
+      docBase = context.docBase;
     }
     @Override
     public void setScorer(Scorer scorer) throws IOException {
@@ -181,8 +182,8 @@ public class TestLengthNormModifier exte
         scores[doc + docBase] = scorer.score();
       }
       @Override
-      public void setNextReader(IndexReader reader, int docBase) {
-        this.docBase = docBase;
+      public void setNextReader(AtomicReaderContext context) {
+        docBase = context.docBase;
       }
       @Override
       public void setScorer(Scorer scorer) throws IOException {

Modified: lucene/dev/branches/bulkpostings/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/surround/query/BooleanQueryTst.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/surround/query/BooleanQueryTst.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/surround/query/BooleanQueryTst.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/surround/query/BooleanQueryTst.java Fri Jan 14 12:40:04 2011
@@ -19,7 +19,7 @@ package org.apache.lucene.queryParser.su
 
 import java.io.IOException;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.Collector;
 import org.apache.lucene.search.Scorer;
@@ -77,8 +77,8 @@ public class BooleanQueryTst {
     }
 
     @Override
-    public void setNextReader(IndexReader reader, int docBase) throws IOException {
-      this.docBase = docBase;
+    public void setNextReader(AtomicReaderContext context) throws IOException {
+      docBase = context.docBase;
     }
     
     @Override

Modified: lucene/dev/branches/bulkpostings/lucene/contrib/spatial/src/java/org/apache/lucene/spatial/tier/DistanceFieldComparatorSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/contrib/spatial/src/java/org/apache/lucene/spatial/tier/DistanceFieldComparatorSource.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/contrib/spatial/src/java/org/apache/lucene/spatial/tier/DistanceFieldComparatorSource.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/contrib/spatial/src/java/org/apache/lucene/spatial/tier/DistanceFieldComparatorSource.java Fri Jan 14 12:40:04 2011
@@ -19,7 +19,7 @@ package org.apache.lucene.spatial.tier;
 
 import java.io.IOException;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.Filter;
 import org.apache.lucene.search.FieldComparator;
 import org.apache.lucene.search.FieldComparatorSource;
@@ -108,16 +108,14 @@ public class DistanceFieldComparatorSour
 
 		}
 
-		@Override
-                public FieldComparator setNextReader(IndexReader reader, int docBase)
-                  throws IOException {
-			
-			// each reader in a segmented base
-			// has an offset based on the maxDocs of previous readers
-			offset = docBase;
-
-                        return this;
-		}
+    @Override
+    public FieldComparator setNextReader(AtomicReaderContext context)
+        throws IOException {
+      // each reader in a segmented base
+      // has an offset based on the maxDocs of previous readers
+      offset = context.docBase;
+      return this;
+    }
 
 		@Override
 		public Comparable<Double> value(int slot) {

Modified: lucene/dev/branches/bulkpostings/lucene/contrib/swing/src/java/org/apache/lucene/swing/models/ListSearcher.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/contrib/swing/src/java/org/apache/lucene/swing/models/ListSearcher.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/contrib/swing/src/java/org/apache/lucene/swing/models/ListSearcher.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/contrib/swing/src/java/org/apache/lucene/swing/models/ListSearcher.java Fri Jan 14 12:40:04 2011
@@ -32,6 +32,7 @@ import org.apache.lucene.document.Fielda
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.IndexWriterConfig;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.queryParser.MultiFieldQueryParser;
 import org.apache.lucene.search.Collector;
 import org.apache.lucene.search.IndexSearcher;
@@ -192,7 +193,7 @@ public class ListSearcher extends Abstra
       }
 
       @Override
-      public void setNextReader(IndexReader reader, int docBase) {}
+      public void setNextReader(AtomicReaderContext context) {}
       @Override
       public boolean acceptsDocsOutOfOrder() {
         return true;

Modified: lucene/dev/branches/bulkpostings/lucene/contrib/wordnet/src/java/org/apache/lucene/wordnet/SynExpand.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/contrib/wordnet/src/java/org/apache/lucene/wordnet/SynExpand.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/contrib/wordnet/src/java/org/apache/lucene/wordnet/SynExpand.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/contrib/wordnet/src/java/org/apache/lucene/wordnet/SynExpand.java Fri Jan 14 12:40:04 2011
@@ -33,6 +33,7 @@ import org.apache.lucene.analysis.tokena
 import org.apache.lucene.document.Document;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.Term;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.BooleanClause;
 import org.apache.lucene.search.BooleanQuery;
 import org.apache.lucene.search.Collector;
@@ -160,9 +161,9 @@ public final class SynExpand {
         }
 
         @Override
-        public void setNextReader(IndexReader reader, int docBase)
+        public void setNextReader(AtomicReaderContext context)
             throws IOException {
-          this.reader = reader;
+          this.reader = context.reader;
         }
 
         @Override

Modified: lucene/dev/branches/bulkpostings/lucene/contrib/wordnet/src/java/org/apache/lucene/wordnet/SynLookup.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/contrib/wordnet/src/java/org/apache/lucene/wordnet/SynLookup.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/contrib/wordnet/src/java/org/apache/lucene/wordnet/SynLookup.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/contrib/wordnet/src/java/org/apache/lucene/wordnet/SynLookup.java Fri Jan 14 12:40:04 2011
@@ -32,6 +32,7 @@ import org.apache.lucene.analysis.tokena
 import org.apache.lucene.document.Document;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.Term;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.BooleanClause;
 import org.apache.lucene.search.BooleanQuery;
 import org.apache.lucene.search.Collector;
@@ -59,7 +60,7 @@ public class SynLookup {
     }
 
     @Override
-    public void setNextReader(IndexReader reader, int docBase) {}
+    public void setNextReader(AtomicReaderContext context) {}
     @Override
     public boolean acceptsDocsOutOfOrder() {
       return true;
@@ -169,9 +170,9 @@ public class SynLookup {
         }
 
         @Override
-        public void setNextReader(IndexReader reader, int docBase)
+        public void setNextReader(AtomicReaderContext context)
             throws IOException {
-          this.reader = reader;
+          this.reader = context.reader;
         }
 
         @Override

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/SegmentInfo.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/SegmentInfo.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/SegmentInfo.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/SegmentInfo.java Fri Jan 14 12:40:04 2011
@@ -68,7 +68,8 @@ public final class SegmentInfo {
   private List<String> files;                     // cached list of files that this segment uses
                                                   // in the Directory
 
-  long sizeInBytes = -1;                          // total byte size of all of our files (computed on demand)
+  private long sizeInBytesNoStore = -1;           // total byte size of all but the store files (computed on demand)
+  private long sizeInBytesWithStore = -1;         // total byte size of all of our files (computed on demand)
 
   private int docStoreOffset;                     // if this segment shares stored fields & vectors, this
                                                   // offset is where in that file this segment's docs begin
@@ -217,26 +218,34 @@ public final class SegmentInfo {
       }
     }
   }
-  
-  /** Returns total size in bytes of all of files used by
-   *  this segment. */
+
+  /**
+   * Returns total size in bytes of all of files used by this segment (if
+   * {@code includeDocStores} is true), or the size of all files except the
+   * store files otherwise.
+   */
   public long sizeInBytes(boolean includeDocStores) throws IOException {
-    if (sizeInBytes == -1) {
-      List<String> files = files();
-      final int size = files.size();
-      sizeInBytes = 0;
-      for(int i=0;i<size;i++) {
-        final String fileName = files.get(i);
-        if (!includeDocStores && IndexFileNames.isDocStoreFile(fileName)) {
+    if (includeDocStores) {
+      if (sizeInBytesWithStore != -1) return sizeInBytesWithStore;
+      sizeInBytesWithStore = 0;
+      for (final String fileName : files()) {
+        // We don't count bytes used by a shared doc store against this segment
+        if (docStoreOffset == -1 || !IndexFileNames.isDocStoreFile(fileName)) {
+          sizeInBytesWithStore += dir.fileLength(fileName);
+        }
+      }
+      return sizeInBytesWithStore;
+    } else {
+      if (sizeInBytesNoStore != -1) return sizeInBytesNoStore;
+      sizeInBytesNoStore = 0;
+      for (final String fileName : files()) {
+        if (IndexFileNames.isDocStoreFile(fileName)) {
           continue;
         }
-        // We don't count bytes used by a shared doc store
-        // against this segment:
-        if (docStoreOffset == -1 || !IndexFileNames.isDocStoreFile(fileName))
-          sizeInBytes += dir.fileLength(fileName);
+        sizeInBytesNoStore += dir.fileLength(fileName);
       }
+      return sizeInBytesNoStore;
     }
-    return sizeInBytes;
   }
 
   public boolean getHasVectors() throws IOException {
@@ -552,7 +561,8 @@ public final class SegmentInfo {
    * files this segment has. */
   private void clearFiles() {
     files = null;
-    sizeInBytes = -1;
+    sizeInBytesNoStore = -1;
+    sizeInBytesWithStore = -1;
   }
 
   /** {@inheritDoc} */

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/pulsing/PulsingPostingsWriterImpl.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/pulsing/PulsingPostingsWriterImpl.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/pulsing/PulsingPostingsWriterImpl.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/pulsing/PulsingPostingsWriterImpl.java Fri Jan 14 12:40:04 2011
@@ -101,8 +101,8 @@ public final class PulsingPostingsWriter
   // our parent calls setField whenever the field changes
   @Override
   public void setField(FieldInfo fieldInfo) {
-    //System.out.println("PW field=" + fieldInfo.name);
     omitTF = fieldInfo.omitTermFreqAndPositions;
+    //System.out.println("PW field=" + fieldInfo.name + " omitTF=" + omitTF);
     storePayloads = fieldInfo.storePayloads;
     wrappedPostingsWriter.setField(fieldInfo);
   }
@@ -114,6 +114,7 @@ public final class PulsingPostingsWriter
 
     if (pendingCount == pending.length) {
       push();
+      //System.out.println("PW: wrapped.finishDoc");
       wrappedPostingsWriter.finishDoc();
     }
 
@@ -269,7 +270,7 @@ public final class PulsingPostingsWriter
 
   // Pushes pending positions to the wrapped codec
   private void push() throws IOException {
-    //System.out.println("PW now push @ " + pendingCount);
+    //System.out.println("PW now push @ " + pendingCount + " wrapped=" + wrappedPostingsWriter);
     assert pendingCount == pending.length;
       
     wrappedPostingsWriter.startTerm();
@@ -280,13 +281,17 @@ public final class PulsingPostingsWriter
       for(Position pos : pending) {
         if (doc == null) {
           doc = pos;
+          //System.out.println("PW: wrapped.startDoc docID=" + doc.docID + " tf=" + doc.termFreq);
           wrappedPostingsWriter.startDoc(doc.docID, doc.termFreq);
         } else if (doc.docID != pos.docID) {
           assert pos.docID > doc.docID;
+          //System.out.println("PW: wrapped.finishDoc");
           wrappedPostingsWriter.finishDoc();
           doc = pos;
+          //System.out.println("PW: wrapped.startDoc docID=" + doc.docID + " tf=" + doc.termFreq);
           wrappedPostingsWriter.startDoc(doc.docID, doc.termFreq);
         }
+        //System.out.println("PW:   wrapped.addPos pos=" + pos.pos);
         wrappedPostingsWriter.addPosition(pos.pos, pos.payload);
       }
       //wrappedPostingsWriter.finishDoc();

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/BooleanScorer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/BooleanScorer.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/BooleanScorer.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/BooleanScorer.java Fri Jan 14 12:40:04 2011
@@ -20,7 +20,7 @@ package org.apache.lucene.search;
 import java.io.IOException;
 import java.util.List;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.BooleanClause.Occur;
 
 /* Description from Doug Cutting (excerpted from
@@ -92,7 +92,7 @@ final class BooleanScorer extends Scorer
     }
     
     @Override
-    public void setNextReader(IndexReader reader, int docBase) {
+    public void setNextReader(AtomicReaderContext context) {
       // not needed by this implementation
     }
     

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/Collector.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/Collector.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/Collector.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/Collector.java Fri Jan 14 12:40:04 2011
@@ -19,7 +19,8 @@ package org.apache.lucene.search;
 
 import java.io.IOException;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
+import org.apache.lucene.index.IndexReader.ReaderContext;
 
 /**
  * <p>Expert: Collectors are primarily meant to be used to
@@ -98,8 +99,8 @@ import org.apache.lucene.index.IndexRead
  *     bits.set(doc + docBase);
  *   }
  * 
- *   public void setNextReader(IndexReader reader, int docBase) {
- *     this.docBase = docBase;
+ *   public void setNextReader(AtomicReaderContext context) {
+ *     this.docBase = context.docBase;
  *   }
  * });
  * </pre>
@@ -143,17 +144,16 @@ public abstract class Collector {
   public abstract void collect(int doc) throws IOException;
 
   /**
-   * Called before collecting from each IndexReader. All doc ids in
-   * {@link #collect(int)} will correspond to reader.
+   * Called before collecting from each {@link AtomicReaderContext}. All doc ids in
+   * {@link #collect(int)} will correspond to {@link ReaderContext#reader}.
    * 
-   * Add docBase to the current IndexReaders internal document id to re-base ids
-   * in {@link #collect(int)}.
+   * Add {@link AtomicReaderContext#docBase} to the current  {@link ReaderContext#reader}'s
+   * internal document id to re-base ids in {@link #collect(int)}.
    * 
-   * @param reader
-   *          next IndexReader
-   * @param docBase
+   * @param context
+   *          next atomic reader context
    */
-  public abstract void setNextReader(IndexReader reader, int docBase) throws IOException;
+  public abstract void setNextReader(AtomicReaderContext context) throws IOException;
 
   /**
    * Return <code>true</code> if this collector does not

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/ConstantScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/ConstantScoreQuery.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/ConstantScoreQuery.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/ConstantScoreQuery.java Fri Jan 14 12:40:04 2011
@@ -227,8 +227,8 @@ public class ConstantScoreQuery extends 
         }
         
         @Override
-        public void setNextReader(IndexReader reader, int docBase) throws IOException {
-          collector.setNextReader(reader, docBase);
+        public void setNextReader(AtomicReaderContext context) throws IOException {
+          collector.setNextReader(context);
         }
         
         @Override

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/FieldComparator.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/FieldComparator.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/FieldComparator.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/FieldComparator.java Fri Jan 14 12:40:04 2011
@@ -21,7 +21,7 @@ import java.io.IOException;
 import java.text.Collator;
 import java.util.Locale;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.FieldCache.DocTermsIndex;
 import org.apache.lucene.search.FieldCache.DocTerms;
 import org.apache.lucene.search.cache.ByteValuesCreator;
@@ -82,7 +82,7 @@ import org.apache.lucene.util.packed.Pac
  *       priority queue.  The {@link FieldValueHitQueue}
  *       calls this method when a new hit is competitive.
  *
- *  <li> {@link #setNextReader} Invoked
+ *  <li> {@link #setNextReader(AtomicReaderContext)} Invoked
  *       when the search is switching to the next segment.
  *       You may need to update internal state of the
  *       comparator, for example retrieving new values from
@@ -150,19 +150,18 @@ public abstract class FieldComparator {
   public abstract void copy(int slot, int doc) throws IOException;
 
   /**
-   * Set a new Reader. All subsequent docIDs are relative to
+   * Set a new {@link AtomicReaderContext}. All subsequent docIDs are relative to
    * the current reader (you must add docBase if you need to
    * map it to a top-level docID).
    * 
-   * @param reader current reader
-   * @param docBase docBase of this reader 
+   * @param context current reader context
    * @return the comparator to use for this segment; most
    *   comparators can just return "this" to reuse the same
    *   comparator across segments
    * @throws IOException
    * @throws IOException
    */
-  public abstract FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException;
+  public abstract FieldComparator setNextReader(AtomicReaderContext context) throws IOException;
 
   /** Sets the Scorer to use in case a document's score is
    *  needed.
@@ -242,8 +241,8 @@ public abstract class FieldComparator {
     }
 
     @Override
-    public FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException {
-      setup(FieldCache.DEFAULT.getBytes(reader, creator.field, creator));
+    public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+      setup(FieldCache.DEFAULT.getBytes(context.reader, creator.field, creator));
       docValues = cached.values;
       return this;
     }
@@ -314,8 +313,8 @@ public abstract class FieldComparator {
     }
 
     @Override
-    public FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException {
-      setup(FieldCache.DEFAULT.getDoubles(reader, creator.field, creator));
+    public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+      setup(FieldCache.DEFAULT.getDoubles(context.reader, creator.field, creator));
       docValues = cached.values;
       return this;
     }
@@ -388,8 +387,8 @@ public abstract class FieldComparator {
     }
 
     @Override
-    public FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException {
-      setup(FieldCache.DEFAULT.getFloats(reader, creator.field, creator));
+    public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+      setup(FieldCache.DEFAULT.getFloats(context.reader, creator.field, creator));
       docValues = cached.values;
       return this;
     }
@@ -444,8 +443,8 @@ public abstract class FieldComparator {
     }
 
     @Override
-    public FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException {
-      setup( FieldCache.DEFAULT.getShorts(reader, creator.field, creator));
+    public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+      setup( FieldCache.DEFAULT.getShorts(context.reader, creator.field, creator));
       docValues = cached.values;
       return this;
     }
@@ -522,8 +521,8 @@ public abstract class FieldComparator {
     }
 
     @Override
-    public FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException {
-      setup(FieldCache.DEFAULT.getInts(reader, creator.field, creator));
+    public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+      setup(FieldCache.DEFAULT.getInts(context.reader, creator.field, creator));
       docValues = cached.values;
       return this;
     }
@@ -597,8 +596,8 @@ public abstract class FieldComparator {
     }
 
     @Override
-    public FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException {
-      setup(FieldCache.DEFAULT.getLongs(reader, creator.field, creator));
+    public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+      setup(FieldCache.DEFAULT.getLongs(context.reader, creator.field, creator));
       docValues = cached.values;
       return this;
     }
@@ -648,7 +647,7 @@ public abstract class FieldComparator {
     }
 
     @Override
-    public FieldComparator setNextReader(IndexReader reader, int docBase) {
+    public FieldComparator setNextReader(AtomicReaderContext context) {
       return this;
     }
     
@@ -700,11 +699,11 @@ public abstract class FieldComparator {
     }
 
     @Override
-    public FieldComparator setNextReader(IndexReader reader, int docBase) {
+    public FieldComparator setNextReader(AtomicReaderContext context) {
       // TODO: can we "map" our docIDs to the current
       // reader? saves having to then subtract on every
       // compare call
-      this.docBase = docBase;
+      this.docBase = context.docBase;
       return this;
     }
     
@@ -781,8 +780,8 @@ public abstract class FieldComparator {
     }
 
     @Override
-    public FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException {
-      currentDocTerms = FieldCache.DEFAULT.getTerms(reader, field);
+    public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+      currentDocTerms = FieldCache.DEFAULT.getTerms(context.reader, field);
       return this;
     }
     
@@ -876,8 +875,8 @@ public abstract class FieldComparator {
     abstract class PerSegmentComparator extends FieldComparator {
       
       @Override
-      public FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException {
-        return TermOrdValComparator.this.setNextReader(reader, docBase);
+      public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+        return TermOrdValComparator.this.setNextReader(context);
       }
 
       @Override
@@ -1142,8 +1141,9 @@ public abstract class FieldComparator {
     }
 
     @Override
-    public FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException {
-      termsIndex = FieldCache.DEFAULT.getTermsIndex(reader, field);
+    public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+      final int docBase = context.docBase;
+      termsIndex = FieldCache.DEFAULT.getTermsIndex(context.reader, field);
       final PackedInts.Reader docToOrd = termsIndex.getDocToOrd();
       FieldComparator perSegComp;
       if (docToOrd instanceof Direct8) {
@@ -1257,8 +1257,8 @@ public abstract class FieldComparator {
     }
 
     @Override
-    public FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException {
-      docTerms = FieldCache.DEFAULT.getTerms(reader, field);
+    public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+      docTerms = FieldCache.DEFAULT.getTerms(context.reader, field);
       return this;
     }
     

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/IndexSearcher.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/IndexSearcher.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/IndexSearcher.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/IndexSearcher.java Fri Jan 14 12:40:04 2011
@@ -486,7 +486,7 @@ public class IndexSearcher {
     // always use single thread:
     if (filter == null) {
       for (int i = 0; i < leafContexts.length; i++) { // search each subreader
-        collector.setNextReader(leafContexts[i].reader, leafContexts[i].docBase);
+        collector.setNextReader(leafContexts[i]);
         Scorer scorer = weight.scorer(leafContexts[i], !collector.acceptsDocsOutOfOrder(), true);
         if (scorer != null) {
           scorer.score(collector);
@@ -494,7 +494,7 @@ public class IndexSearcher {
       }
     } else {
       for (int i = 0; i < leafContexts.length; i++) { // search each subreader
-        collector.setNextReader(leafContexts[i].reader, leafContexts[i].docBase);
+        collector.setNextReader(leafContexts[i]);
         searchWithFilter(leafContexts[i], weight, filter, collector);
       }
     }

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/MultiCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/MultiCollector.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/MultiCollector.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/MultiCollector.java Fri Jan 14 12:40:04 2011
@@ -19,7 +19,7 @@ package org.apache.lucene.search;
 
 import java.io.IOException;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.Collector;
 import org.apache.lucene.search.Scorer;
 
@@ -108,9 +108,9 @@ public class MultiCollector extends Coll
   }
 
   @Override
-  public void setNextReader(IndexReader reader, int o) throws IOException {
+  public void setNextReader(AtomicReaderContext context) throws IOException {
     for (Collector c : collectors) {
-      c.setNextReader(reader, o);
+      c.setNextReader(context);
     }
   }
 

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/PositiveScoresOnlyCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/PositiveScoresOnlyCollector.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/PositiveScoresOnlyCollector.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/PositiveScoresOnlyCollector.java Fri Jan 14 12:40:04 2011
@@ -19,7 +19,7 @@ package org.apache.lucene.search;
 
 import java.io.IOException;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 
 /**
  * A {@link Collector} implementation which wraps another
@@ -43,8 +43,8 @@ public class PositiveScoresOnlyCollector
   }
 
   @Override
-  public void setNextReader(IndexReader reader, int docBase) throws IOException {
-    c.setNextReader(reader, docBase);
+  public void setNextReader(AtomicReaderContext context) throws IOException {
+    c.setNextReader(context);
   }
 
   @Override

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/TimeLimitingCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/TimeLimitingCollector.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/TimeLimitingCollector.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/TimeLimitingCollector.java Fri Jan 14 12:40:04 2011
@@ -19,7 +19,7 @@ package org.apache.lucene.search;
 
 import java.io.IOException;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.util.ThreadInterruptedException;
 
 /**
@@ -213,9 +213,9 @@ public class TimeLimitingCollector exten
   }
   
   @Override
-  public void setNextReader(IndexReader reader, int base) throws IOException {
-    collector.setNextReader(reader, base);
-    this.docBase = base;
+  public void setNextReader(AtomicReaderContext context) throws IOException {
+    collector.setNextReader(context);
+    this.docBase = context.docBase;
   }
   
   @Override

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/TopFieldCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/TopFieldCollector.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/TopFieldCollector.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/TopFieldCollector.java Fri Jan 14 12:40:04 2011
@@ -19,7 +19,7 @@ package org.apache.lucene.search;
 
 import java.io.IOException;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.FieldValueHitQueue.Entry;
 import org.apache.lucene.util.PriorityQueue;
 
@@ -92,9 +92,9 @@ public abstract class TopFieldCollector 
     }
     
     @Override
-    public void setNextReader(IndexReader reader, int docBase) throws IOException {
-      this.docBase = docBase;
-      queue.setComparator(0, comparator.setNextReader(reader, docBase));
+    public void setNextReader(AtomicReaderContext context) throws IOException {
+      this.docBase = context.docBase;
+      queue.setComparator(0, comparator.setNextReader(context));
       comparator = queue.firstComparator;
     }
     
@@ -447,10 +447,10 @@ public abstract class TopFieldCollector 
     }
 
     @Override
-    public void setNextReader(IndexReader reader, int docBase) throws IOException {
-      this.docBase = docBase;
+    public void setNextReader(AtomicReaderContext context) throws IOException {
+      docBase = context.docBase;
       for (int i = 0; i < comparators.length; i++) {
-        queue.setComparator(i, comparators[i].setNextReader(reader, docBase));
+        queue.setComparator(i, comparators[i].setNextReader(context));
       }
     }
 

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/TopScoreDocCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/TopScoreDocCollector.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/TopScoreDocCollector.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/TopScoreDocCollector.java Fri Jan 14 12:40:04 2011
@@ -19,7 +19,7 @@ package org.apache.lucene.search;
 
 import java.io.IOException;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 
 /**
  * A {@link Collector} implementation that collects the top-scoring hits,
@@ -155,8 +155,8 @@ public abstract class TopScoreDocCollect
   }
   
   @Override
-  public void setNextReader(IndexReader reader, int base) {
-    docBase = base;
+  public void setNextReader(AtomicReaderContext context) {
+    docBase = context.docBase;
   }
   
   @Override

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/TotalHitCountCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/TotalHitCountCollector.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/TotalHitCountCollector.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/TotalHitCountCollector.java Fri Jan 14 12:40:04 2011
@@ -17,7 +17,7 @@ package org.apache.lucene.search;
  * limitations under the License.
  */
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 
 /**
  * Just counts the total number of hits.
@@ -38,7 +38,7 @@ public class TotalHitCountCollector exte
     totalHits++;
   }
 
-  public void setNextReader(IndexReader reader, int docBase) {
+  public void setNextReader(AtomicReaderContext context) {
   }
 
   public boolean acceptsDocsOutOfOrder() {

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/index/TestOmitTf.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/index/TestOmitTf.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/index/TestOmitTf.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/index/TestOmitTf.java Fri Jan 14 12:40:04 2011
@@ -26,6 +26,7 @@ import org.apache.lucene.analysis.Analyz
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.*;
 import org.apache.lucene.search.BooleanClause.Occur;
 import org.apache.lucene.store.Directory;
@@ -414,8 +415,8 @@ public class TestOmitTf extends LuceneTe
     public static int getSum() { return sum; }
     
     @Override
-    public void setNextReader(IndexReader reader, int docBase) {
-      this.docBase = docBase;
+    public void setNextReader(AtomicReaderContext context) {
+      docBase = context.docBase;
     }
     @Override
     public boolean acceptsDocsOutOfOrder() {

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/CheckHits.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/CheckHits.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/CheckHits.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/CheckHits.java Fri Jan 14 12:40:04 2011
@@ -25,6 +25,7 @@ import java.util.Random;
 import junit.framework.Assert;
 
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.store.Directory;
 
 public class CheckHits {
@@ -120,8 +121,8 @@ public class CheckHits {
       bag.add(Integer.valueOf(doc + base));
     }
     @Override
-    public void setNextReader(IndexReader reader, int docBase) {
-      base = docBase;
+    public void setNextReader(AtomicReaderContext context) {
+      base = context.docBase;
     }
     @Override
     public boolean acceptsDocsOutOfOrder() {
@@ -483,8 +484,8 @@ public class CheckHits {
       verifyExplanation(d,doc,scorer.score(),deep,exp);
     }
     @Override
-    public void setNextReader(IndexReader reader, int docBase) {
-      base = docBase;
+    public void setNextReader(AtomicReaderContext context) {
+      base = context.docBase;
     }
     @Override
     public boolean acceptsDocsOutOfOrder() {

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/JustCompileSearch.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/JustCompileSearch.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/JustCompileSearch.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/JustCompileSearch.java Fri Jan 14 12:40:04 2011
@@ -44,7 +44,7 @@ final class JustCompileSearch {
     }
 
     @Override
-    public void setNextReader(IndexReader reader, int docBase)
+    public void setNextReader(AtomicReaderContext context)
         throws IOException {
       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
     }
@@ -127,7 +127,7 @@ final class JustCompileSearch {
     }
 
     @Override
-    public FieldComparator setNextReader(IndexReader reader, int docBase)
+    public FieldComparator setNextReader(AtomicReaderContext context)
         throws IOException {
       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
     }
@@ -300,7 +300,7 @@ final class JustCompileSearch {
     }
 
     @Override
-    public void setNextReader(IndexReader reader, int docBase)
+    public void setNextReader(AtomicReaderContext context)
         throws IOException {
       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
     }

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/MultiCollectorTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/MultiCollectorTest.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/MultiCollectorTest.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/MultiCollectorTest.java Fri Jan 14 12:40:04 2011
@@ -19,7 +19,7 @@ package org.apache.lucene.search;
 
 import java.io.IOException;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.Collector;
 import org.apache.lucene.search.Scorer;
 import org.apache.lucene.util.LuceneTestCase;
@@ -46,7 +46,7 @@ public class MultiCollectorTest extends 
     }
 
     @Override
-    public void setNextReader(IndexReader reader, int docBase) throws IOException {
+    public void setNextReader(AtomicReaderContext context) throws IOException {
       setNextReaderCalled = true;
     }
 
@@ -73,7 +73,7 @@ public class MultiCollectorTest extends 
     assertTrue(c instanceof MultiCollector);
     assertTrue(c.acceptsDocsOutOfOrder());
     c.collect(1);
-    c.setNextReader(null, 0);
+    c.setNextReader(null);
     c.setScorer(null);
   }
 
@@ -95,7 +95,7 @@ public class MultiCollectorTest extends 
     Collector c = MultiCollector.wrap(dcs);
     assertTrue(c.acceptsDocsOutOfOrder());
     c.collect(1);
-    c.setNextReader(null, 0);
+    c.setNextReader(null);
     c.setScorer(null);
 
     for (DummyCollector dc : dcs) {

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/QueryUtils.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/QueryUtils.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/QueryUtils.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/QueryUtils.java Fri Jan 14 12:40:04 2011
@@ -220,7 +220,7 @@ public class QueryUtils {
    */
   public static void checkSkipTo(final Query q, final IndexSearcher s) throws IOException {
     //System.out.println("Checking "+q);
-    final AtomicReaderContext[] context = ReaderUtil.leaves(s.getTopReaderContext());
+    final AtomicReaderContext[] readerContextArray = ReaderUtil.leaves(s.getTopReaderContext());
     if (q.weight(s).scoresDocsOutOfOrder()) return;  // in this case order of skipTo() might differ from that of next().
 
     final int skip_op = 0;
@@ -265,7 +265,7 @@ public class QueryUtils {
             try {
               if (scorer == null) {
                 Weight w = q.weight(s);
-                scorer = w.scorer(context[leafPtr], true, false);
+                scorer = w.scorer(readerContextArray[leafPtr], true, false);
               }
               
               int op = order[(opidx[0]++) % order.length];
@@ -303,7 +303,7 @@ public class QueryUtils {
           }
 
           @Override
-          public void setNextReader(IndexReader reader, int docBase) throws IOException {
+          public void setNextReader(AtomicReaderContext context) throws IOException {
             // confirm that skipping beyond the last doc, on the
             // previous reader, hits NO_MORE_DOCS
             if (lastReader[0] != null) {
@@ -317,8 +317,8 @@ public class QueryUtils {
               }
               leafPtr++;
             }
-            lastReader[0] = reader;
-            assert context[leafPtr].reader == reader;
+            lastReader[0] = context.reader;
+            assert readerContextArray[leafPtr].reader == context.reader;
             this.scorer = null;
             lastDoc[0] = -1;
           }
@@ -385,7 +385,7 @@ public class QueryUtils {
       }
 
       @Override
-      public void setNextReader(IndexReader reader, int docBase) throws IOException {
+      public void setNextReader(AtomicReaderContext context) throws IOException {
         // confirm that skipping beyond the last doc, on the
         // previous reader, hits NO_MORE_DOCS
         if (lastReader[0] != null) {
@@ -400,7 +400,7 @@ public class QueryUtils {
           leafPtr++;
         }
 
-        lastReader[0] = reader;
+        lastReader[0] = context.reader;
         lastDoc[0] = -1;
       }
       @Override

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestConstantScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestConstantScoreQuery.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestConstantScoreQuery.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestConstantScoreQuery.java Fri Jan 14 12:40:04 2011
@@ -20,6 +20,7 @@ package org.apache.lucene.search;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.store.Directory;
@@ -68,7 +69,7 @@ public class TestConstantScoreQuery exte
       }
       
       @Override
-      public void setNextReader(IndexReader reader, int docBase) {
+      public void setNextReader(AtomicReaderContext context) {
       }
       
       @Override

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestDocBoost.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestDocBoost.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestDocBoost.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestDocBoost.java Fri Jan 14 12:40:04 2011
@@ -22,6 +22,7 @@ import java.io.IOException;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.document.*;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.store.Directory;
@@ -77,8 +78,8 @@ public class TestDocBoost extends Lucene
            scores[doc + base] = scorer.score();
          }
          @Override
-         public void setNextReader(IndexReader reader, int docBase) {
-           base = docBase;
+         public void setNextReader(AtomicReaderContext context) {
+           base = context.docBase;
          }
          @Override
          public boolean acceptsDocsOutOfOrder() {

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestElevationComparator.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestElevationComparator.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestElevationComparator.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestElevationComparator.java Fri Jan 14 12:40:04 2011
@@ -21,6 +21,7 @@ import org.apache.lucene.analysis.MockAn
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.index.*;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.FieldValueHitQueue.Entry;
 import org.apache.lucene.store.*;
 import org.apache.lucene.util.LuceneTestCase;
@@ -177,8 +178,8 @@ class ElevationComparatorSource extends 
      }
 
      @Override
-     public FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException {
-       idIndex = FieldCache.DEFAULT.getTermsIndex(reader, fieldname);
+     public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+       idIndex = FieldCache.DEFAULT.getTermsIndex(context.reader, fieldname);
        return this;
      }
 

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java Fri Jan 14 12:40:04 2011
@@ -22,6 +22,7 @@ import org.apache.lucene.analysis.MockTo
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.store.Directory;
@@ -197,8 +198,8 @@ public class TestMultiTermConstantScore 
         assertEquals("score for doc " + (doc + base) + " was not correct", 1.0f, scorer.score());
       }
       @Override
-      public void setNextReader(IndexReader reader, int docBase) {
-        base = docBase;
+      public void setNextReader(AtomicReaderContext context) {
+        base = context.docBase;
       }
       @Override
       public boolean acceptsDocsOutOfOrder() {

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java Fri Jan 14 12:40:04 2011
@@ -19,7 +19,7 @@ package org.apache.lucene.search;
 
 import java.io.IOException;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.util.LuceneTestCase;
 
 public class TestScoreCachingWrappingScorer extends LuceneTestCase {
@@ -76,7 +76,7 @@ public class TestScoreCachingWrappingSco
       ++idx;
     }
 
-    @Override public void setNextReader(IndexReader reader, int docBase)
+    @Override public void setNextReader(AtomicReaderContext context)
         throws IOException {
     }
 

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestScorerPerf.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestScorerPerf.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestScorerPerf.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestScorerPerf.java Fri Jan 14 12:40:04 2011
@@ -6,7 +6,6 @@ import org.apache.lucene.util.LuceneTest
 import java.util.BitSet;
 import java.io.IOException;
 
-import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.Term;
@@ -110,8 +109,8 @@ public class TestScorerPerf extends Luce
     public int getSum() { return sum; }
 
     @Override
-    public void setNextReader(IndexReader reader, int base) {
-      docBase = base;
+    public void setNextReader(AtomicReaderContext context) {
+      docBase = context.docBase;
     }
     @Override
     public boolean acceptsDocsOutOfOrder() {

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestSetNorm.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestSetNorm.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestSetNorm.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestSetNorm.java Fri Jan 14 12:40:04 2011
@@ -23,6 +23,7 @@ import org.apache.lucene.util.LuceneTest
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.*;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.store.Directory;
@@ -74,8 +75,8 @@ public class TestSetNorm extends LuceneT
            scores[doc + base] = scorer.score();
          }
          @Override
-         public void setNextReader(IndexReader reader, int docBase) {
-           base = docBase;
+         public void setNextReader(AtomicReaderContext context) {
+           base = context.docBase;
          }
          @Override
          public boolean acceptsDocsOutOfOrder() {

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestSimilarity.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestSimilarity.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestSimilarity.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestSimilarity.java Fri Jan 14 12:40:04 2011
@@ -23,6 +23,7 @@ import java.util.Collection;
 
 import org.apache.lucene.index.FieldInvertState;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.store.Directory;
@@ -94,7 +95,7 @@ public class TestSimilarity extends Luce
            assertEquals(1.0f, scorer.score());
          }
          @Override
-        public void setNextReader(IndexReader reader, int docBase) {}
+        public void setNextReader(AtomicReaderContext context) {}
          @Override
         public boolean acceptsDocsOutOfOrder() {
            return true;
@@ -118,8 +119,8 @@ public class TestSimilarity extends Luce
            assertEquals((float)doc+base+1, scorer.score());
          }
          @Override
-        public void setNextReader(IndexReader reader, int docBase) {
-           base = docBase;
+        public void setNextReader(AtomicReaderContext context) {
+           base = context.docBase;
          }
          @Override
         public boolean acceptsDocsOutOfOrder() {
@@ -144,7 +145,7 @@ public class TestSimilarity extends Luce
            assertEquals(1.0f, scorer.score());
          }
          @Override
-         public void setNextReader(IndexReader reader, int docBase) {}
+         public void setNextReader(AtomicReaderContext context) {}
          @Override
          public boolean acceptsDocsOutOfOrder() {
            return true;
@@ -165,7 +166,7 @@ public class TestSimilarity extends Luce
         assertEquals(2.0f, scorer.score());
       }
       @Override
-      public void setNextReader(IndexReader reader, int docBase) {}
+      public void setNextReader(AtomicReaderContext context) {}
       @Override
       public boolean acceptsDocsOutOfOrder() {
         return true;

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestSort.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestSort.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestSort.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestSort.java Fri Jan 14 12:40:04 2011
@@ -506,8 +506,8 @@ public class TestSort extends LuceneTest
     }
 
     @Override
-    public FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException {
-      docValues = FieldCache.DEFAULT.getInts(reader, "parser", new FieldCache.IntParser() {
+    public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+      docValues = FieldCache.DEFAULT.getInts(context.reader, "parser", new FieldCache.IntParser() {
           public final int parseInt(final BytesRef term) {
             return (term.bytes[term.offset]-'A') * 123456;
           }

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestSubScorerFreqs.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestSubScorerFreqs.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestSubScorerFreqs.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestSubScorerFreqs.java Fri Jan 14 12:40:04 2011
@@ -19,6 +19,7 @@ package org.apache.lucene.search;
 
 import org.apache.lucene.document.*;
 import org.apache.lucene.index.*;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.util.*;
 import org.apache.lucene.search.BooleanClause.Occur;
 import org.apache.lucene.search.Scorer.ScorerVisitor;
@@ -126,10 +127,10 @@ public class TestSubScorerFreqs extends 
     }
 
     @Override
-    public void setNextReader(IndexReader reader, int docBase)
+    public void setNextReader(AtomicReaderContext context)
         throws IOException {
-      this.docBase = docBase;
-      other.setNextReader(reader, docBase);
+      docBase = context.docBase;
+      other.setNextReader(context);
     }
 
     @Override

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestTermScorer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestTermScorer.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestTermScorer.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestTermScorer.java Fri Jan 14 12:40:04 2011
@@ -98,8 +98,8 @@ public class TestTermScorer extends Luce
       }
       
       @Override
-      public void setNextReader(IndexReader reader, int docBase) {
-        base = docBase;
+      public void setNextReader(AtomicReaderContext context) {
+        base = context.docBase;
       }
       
       @Override

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java Fri Jan 14 12:40:04 2011
@@ -24,6 +24,7 @@ import org.apache.lucene.analysis.MockAn
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.queryParser.QueryParser;
 import org.apache.lucene.search.TimeLimitingCollector.TimeExceededException;
@@ -339,8 +340,8 @@ public class TestTimeLimitingCollector e
     }
     
     @Override
-    public void setNextReader(IndexReader reader, int base) {
-      docBase = base;
+    public void setNextReader(AtomicReaderContext context) {
+      docBase = context.docBase;
     }
     
     @Override

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestTopDocsCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestTopDocsCollector.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestTopDocsCollector.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestTopDocsCollector.java Fri Jan 14 12:40:04 2011
@@ -21,6 +21,7 @@ import java.io.IOException;
 
 import org.apache.lucene.document.Document;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.LuceneTestCase;
@@ -60,9 +61,9 @@ public class TestTopDocsCollector extend
     }
 
     @Override
-    public void setNextReader(IndexReader reader, int docBase)
+    public void setNextReader(AtomicReaderContext context)
         throws IOException {
-      base = docBase;
+      base = context.docBase;
     }
 
     @Override

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java Fri Jan 14 12:40:04 2011
@@ -390,6 +390,16 @@ public abstract class LuceneTestCase ext
     if (testsFailed) {
       System.err.println("NOTE: all tests run in this JVM:");
       System.err.println(Arrays.toString(testClassesRun.toArray()));
+      System.err.println("NOTE: " + System.getProperty("os.name") + " " 
+          + System.getProperty("os.version") + " " 
+          + System.getProperty("os.arch") + "/"
+          + System.getProperty("java.vendor") + " "
+          + System.getProperty("java.version") + " "
+          + (Constants.JRE_IS_64BIT ? "(64-bit)" : "(32-bit)") + "/"
+          + "cpus=" + Runtime.getRuntime().availableProcessors() + ","
+          + "threads=" + Thread.activeCount() + ","
+          + "free=" + Runtime.getRuntime().freeMemory() + ","
+          + "total=" + Runtime.getRuntime().totalMemory());
     }
   }
 
@@ -1107,8 +1117,15 @@ public abstract class LuceneTestCase ext
 
     @Override
     protected void runChild(FrameworkMethod arg0, RunNotifier arg1) {
-      for (int i = 0; i < TEST_ITER; i++)
+      if (VERBOSE) {
+        System.out.println("\nNOTE: running test " + arg0.getName());
+      }
+      for (int i = 0; i < TEST_ITER; i++) {
+        if (VERBOSE && TEST_ITER > 1) {
+          System.out.println("\nNOTE: running iter=" + (1+i) + " of " + TEST_ITER);
+        }
         super.runChild(arg0, arg1);
+      }
     }
 
     public LuceneTestCaseRunner(Class<?> clazz) throws InitializationError {

Modified: lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/handler/component/QueryComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/handler/component/QueryComponent.java?rev=1058986&r1=1058985&r2=1058986&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/handler/component/QueryComponent.java (original)
+++ lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/handler/component/QueryComponent.java Fri Jan 14 12:40:04 2011
@@ -18,10 +18,13 @@
 package org.apache.solr.handler.component;
 
 import org.apache.lucene.document.Field;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
+import org.apache.lucene.index.IndexReader.ReaderContext;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.queryParser.ParseException;
 import org.apache.lucene.search.*;
 import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.ReaderUtil;
 import org.apache.solr.cloud.CloudDescriptor;
 import org.apache.solr.cloud.ZkController;
 import org.apache.solr.common.SolrDocument;
@@ -444,23 +447,21 @@ public class QueryComponent extends Sear
       SortField[] sortFields = sort==null ? new SortField[]{SortField.FIELD_SCORE} : sort.getSort();
       NamedList sortVals = new NamedList(); // order is important for the sort fields
       Field field = new Field("dummy", "", Field.Store.YES, Field.Index.NO); // a dummy Field
-
-      SolrIndexReader reader = searcher.getReader();
-      SolrIndexReader[] readers = reader.getLeafReaders();
-      SolrIndexReader subReader = reader;
-      if (readers.length==1) {
+      ReaderContext topReaderContext = searcher.getTopReaderContext();
+      AtomicReaderContext[] leaves = ReaderUtil.leaves(topReaderContext);
+      AtomicReaderContext currentLeaf = null;
+      if (leaves.length==1) {
         // if there is a single segment, use that subReader and avoid looking up each time
-        subReader = readers[0];
-        readers=null;
+        currentLeaf = leaves[0];
+        leaves=null;
       }
-      int[] offsets = reader.getLeafOffsets();
 
       for (SortField sortField: sortFields) {
         int type = sortField.getType();
         if (type==SortField.SCORE || type==SortField.DOC) continue;
 
         FieldComparator comparator = null;
-        FieldComparator comparators[] = (readers==null) ? null : new FieldComparator[readers.length];
+        FieldComparator comparators[] = (leaves==null) ? null : new FieldComparator[leaves.length];
 
         String fieldname = sortField.getField();
         FieldType ft = fieldname==null ? null : req.getSchema().getFieldTypeNoEx(fieldname);
@@ -469,26 +470,24 @@ public class QueryComponent extends Sear
         ArrayList<Object> vals = new ArrayList<Object>(docList.size());
         DocIterator it = rb.getResults().docList.iterator();
 
-        int offset = 0;
         int idx = 0;
 
         while(it.hasNext()) {
           int doc = it.nextDoc();
-          if (readers != null) {
-            idx = SolrIndexReader.readerIndex(doc, offsets);
-            subReader = readers[idx];
-            offset = offsets[idx];
+          if (leaves != null) {
+            idx = ReaderUtil.subIndex(doc, leaves);
+            currentLeaf = leaves[idx];
             comparator = comparators[idx];
           }
 
           if (comparator == null) {
             comparator = sortField.getComparator(1,0);
-            comparator = comparator.setNextReader(subReader, offset);
+            comparator = comparator.setNextReader(currentLeaf);
             if (comparators != null)
               comparators[idx] = comparator;
           }
 
-          doc -= offset;  // adjust for what segment this is in
+          doc -= currentLeaf.docBase;  // adjust for what segment this is in
           comparator.copy(0, doc);
           Object val = comparator.value(0);
 



Mime
View raw message