lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1663371 [2/2] - in /lucene/dev/trunk/lucene: ./ codecs/src/java/org/apache/lucene/codecs/blockterms/ codecs/src/java/org/apache/lucene/codecs/blocktreeords/ codecs/src/java/org/apache/lucene/codecs/bloom/ codecs/src/java/org/apache/lucene/...
Date Mon, 02 Mar 2015 17:24:49 GMT
Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SegmentInfo.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SegmentInfo.java?rev=1663371&r1=1663370&r2=1663371&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SegmentInfo.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SegmentInfo.java Mon Mar
 2 17:24:47 2015
@@ -52,7 +52,7 @@ public final class SegmentInfo {
   /** Unique segment name in the directory. */
   public final String name;
 
-  private int docCount;         // number of docs in seg
+  private int maxDoc;         // number of docs in seg
 
   /** Where this segment resides. */
   public final Directory dir;
@@ -90,14 +90,14 @@ public final class SegmentInfo {
    * <p>Note: this is public only to allow access from
    * the codecs package.</p>
    */
-  public SegmentInfo(Directory dir, Version version, String name, int docCount,
+  public SegmentInfo(Directory dir, Version version, String name, int maxDoc,
                      boolean isCompoundFile, Codec codec, Map<String,String> diagnostics,
                      byte[] id, Map<String,String> attributes) {
     assert !(dir instanceof TrackingDirectoryWrapper);
     this.dir = Objects.requireNonNull(dir);
     this.version = Objects.requireNonNull(version);
     this.name = Objects.requireNonNull(name);
-    this.docCount = docCount;
+    this.maxDoc = maxDoc;
     this.isCompoundFile = isCompoundFile;
     this.codec = codec;
     this.diagnostics = Objects.requireNonNull(diagnostics);
@@ -142,19 +142,19 @@ public final class SegmentInfo {
 
   /** Returns number of documents in this segment (deletions
    *  are not taken into account). */
-  public int getDocCount() {
-    if (this.docCount == -1) {
-      throw new IllegalStateException("docCount isn't set yet");
+  public int maxDoc() {
+    if (this.maxDoc == -1) {
+      throw new IllegalStateException("maxDoc isn't set yet");
     }
-    return docCount;
+    return maxDoc;
   }
 
   // NOTE: leave package private
-  void setDocCount(int docCount) {
-    if (this.docCount != -1) {
-      throw new IllegalStateException("docCount was already set: this.docCount=" + this.docCount
+ " vs docCount=" + docCount);
+  void setMaxDoc(int maxDoc) {
+    if (this.maxDoc != -1) {
+      throw new IllegalStateException("maxDoc was already set: this.maxDoc=" + this.maxDoc
+ " vs maxDoc=" + maxDoc);
     }
-    this.docCount = docCount;
+    this.maxDoc = maxDoc;
   }
 
   /** Return all files referenced by this SegmentInfo. */
@@ -186,7 +186,7 @@ public final class SegmentInfo {
     char cfs = getUseCompoundFile() ? 'c' : 'C';
     s.append(cfs);
 
-    s.append(docCount);
+    s.append(maxDoc);
 
     if (delCount != 0) {
       s.append('/').append(delCount);

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java?rev=1663371&r1=1663370&r2=1663371&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java Mon Mar
 2 17:24:47 2015
@@ -301,11 +301,11 @@ public final class SegmentInfos implemen
         Codec codec = Codec.forName(input.readString());
         SegmentInfo info = codec.segmentInfoFormat().read(directory, segName, segmentID,
IOContext.READ);
         info.setCodec(codec);
-        totalDocs += info.getDocCount();
+        totalDocs += info.maxDoc();
         long delGen = input.readLong();
         int delCount = input.readInt();
-        if (delCount < 0 || delCount > info.getDocCount()) {
-          throw new CorruptIndexException("invalid deletion count: " + delCount + " vs docCount="
+ info.getDocCount(), input);
+        if (delCount < 0 || delCount > info.maxDoc()) {
+          throw new CorruptIndexException("invalid deletion count: " + delCount + " vs maxDoc="
+ info.maxDoc(), input);
         }
         long fieldInfosGen = input.readLong();
         long dvGen = input.readLong();
@@ -402,8 +402,8 @@ public final class SegmentInfos implemen
         segnOutput.writeString(si.getCodec().getName());
         segnOutput.writeLong(siPerCommit.getDelGen());
         int delCount = siPerCommit.getDelCount();
-        if (delCount < 0 || delCount > si.getDocCount()) {
-          throw new IllegalStateException("cannot write segment: invalid docCount segment="
+ si.name + " docCount=" + si.getDocCount() + " delCount=" + delCount);
+        if (delCount < 0 || delCount > si.maxDoc()) {
+          throw new IllegalStateException("cannot write segment: invalid maxDoc segment="
+ si.name + " maxDoc=" + si.maxDoc() + " delCount=" + delCount);
         }
         segnOutput.writeInt(delCount);
         segnOutput.writeLong(siPerCommit.getFieldInfosGen());
@@ -742,12 +742,12 @@ public final class SegmentInfos implemen
     lastGeneration = other.lastGeneration;
   }
 
-  /** Returns sum of all segment's docCounts.  Note that
+  /** Returns sum of all segment's maxDocs.  Note that
    *  this does not include deletions */
-  public int totalDocCount() {
+  public int totalMaxDoc() {
     long count = 0;
     for(SegmentCommitInfo info : this) {
-      count += info.info.getDocCount();
+      count += info.info.maxDoc();
     }
     // we should never hit this, checks should happen elsewhere...
     assert count <= IndexWriter.getActualMaxDocs();

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SegmentMerger.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SegmentMerger.java?rev=1663371&r1=1663370&r2=1663371&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SegmentMerger.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SegmentMerger.java Mon Mar
 2 17:24:47 2015
@@ -62,7 +62,7 @@ final class SegmentMerger {
   
   /** True if any merging should happen */
   boolean shouldMerge() {
-    return mergeState.segmentInfo.getDocCount() > 0;
+    return mergeState.segmentInfo.maxDoc() > 0;
   }
 
   /**
@@ -85,7 +85,7 @@ final class SegmentMerger {
       long t1 = System.nanoTime();
       mergeState.infoStream.message("SM", ((t1-t0)/1000000) + " msec to merge stored fields
[" + numMerged + " docs]");
     }
-    assert numMerged == mergeState.segmentInfo.getDocCount(): "numMerged=" + numMerged +
" vs mergeState.segmentInfo.getDocCount()=" + mergeState.segmentInfo.getDocCount();
+    assert numMerged == mergeState.segmentInfo.maxDoc(): "numMerged=" + numMerged + " vs
mergeState.segmentInfo.maxDoc()=" + mergeState.segmentInfo.maxDoc();
 
     final SegmentWriteState segmentWriteState = new SegmentWriteState(mergeState.infoStream,
directory, mergeState.segmentInfo,
                                                                       mergeState.mergeFieldInfos,
null, context);
@@ -129,7 +129,7 @@ final class SegmentMerger {
         long t1 = System.nanoTime();
         mergeState.infoStream.message("SM", ((t1-t0)/1000000) + " msec to merge vectors ["
+ numMerged + " docs]");
       }
-      assert numMerged == mergeState.segmentInfo.getDocCount();
+      assert numMerged == mergeState.segmentInfo.maxDoc();
     }
     
     // write the merged infos

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SegmentReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SegmentReader.java?rev=1663371&r1=1663370&r2=1663371&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SegmentReader.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SegmentReader.java Mon Mar
 2 17:24:47 2015
@@ -43,9 +43,9 @@ public final class SegmentReader extends
   private final SegmentCommitInfo si;
   private final Bits liveDocs;
 
-  // Normally set to si.docCount - si.delDocCount, unless we
+  // Normally set to si.maxDoc - si.delDocCount, unless we
   // were created as an NRT reader from IW, in which case IW
-  // tells us the docCount:
+  // tells us the number of live docs:
   private final int numDocs;
 
   final SegmentCoreReaders core;
@@ -75,7 +75,7 @@ public final class SegmentReader extends
         assert si.getDelCount() == 0;
         liveDocs = null;
       }
-      numDocs = si.info.getDocCount() - si.getDelCount();
+      numDocs = si.info.maxDoc() - si.getDelCount();
       
       fieldInfos = initFieldInfos();
       docValuesProducer = initDocValuesProducer();
@@ -99,7 +99,7 @@ public final class SegmentReader extends
   SegmentReader(SegmentCommitInfo si, SegmentReader sr) throws IOException {
     this(si, sr,
          si.info.getCodec().liveDocsFormat().readLiveDocs(si.info.dir, si, IOContext.READONCE),
-         si.info.getDocCount() - si.getDelCount());
+         si.info.maxDoc() - si.getDelCount());
   }
 
   /** Create new SegmentReader sharing core from a previous
@@ -195,7 +195,7 @@ public final class SegmentReader extends
   @Override
   public int maxDoc() {
     // Don't call ensureOpen() here (it could affect performance)
-    return si.info.getDocCount();
+    return si.info.maxDoc();
   }
 
   @Override
@@ -232,7 +232,7 @@ public final class SegmentReader extends
   public String toString() {
     // SegmentInfo.toString takes dir and number of
     // *pending* deletions; so we reverse compute that here:
-    return si.toString(si.info.getDocCount() - numDocs - si.getDelCount());
+    return si.toString(si.info.maxDoc() - numDocs - si.getDelCount());
   }
   
   /**

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SortedDocValuesWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SortedDocValuesWriter.java?rev=1663371&r1=1663370&r2=1663371&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SortedDocValuesWriter.java
(original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SortedDocValuesWriter.java
Mon Mar  2 17:24:47 2015
@@ -108,7 +108,7 @@ class SortedDocValuesWriter extends DocV
 
   @Override
   public void flush(SegmentWriteState state, DocValuesConsumer dvConsumer) throws IOException
{
-    final int maxDoc = state.segmentInfo.getDocCount();
+    final int maxDoc = state.segmentInfo.maxDoc();
 
     assert pending.size() == maxDoc;
     final int valueCount = hash.size();

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SortedNumericDocValuesWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SortedNumericDocValuesWriter.java?rev=1663371&r1=1663370&r2=1663371&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SortedNumericDocValuesWriter.java
(original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SortedNumericDocValuesWriter.java
Mon Mar  2 17:24:47 2015
@@ -103,7 +103,7 @@ class SortedNumericDocValuesWriter exten
 
   @Override
   public void flush(SegmentWriteState state, DocValuesConsumer dvConsumer) throws IOException
{
-    final int maxDoc = state.segmentInfo.getDocCount();
+    final int maxDoc = state.segmentInfo.maxDoc();
     assert pendingCounts.size() == maxDoc;
     final PackedLongValues values = pending.build();
     final PackedLongValues valueCounts = pendingCounts.build();

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SortedSetDocValuesWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SortedSetDocValuesWriter.java?rev=1663371&r1=1663370&r2=1663371&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SortedSetDocValuesWriter.java
(original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SortedSetDocValuesWriter.java
Mon Mar  2 17:24:47 2015
@@ -147,7 +147,7 @@ class SortedSetDocValuesWriter extends D
 
   @Override
   public void flush(SegmentWriteState state, DocValuesConsumer dvConsumer) throws IOException
{
-    final int maxDoc = state.segmentInfo.getDocCount();
+    final int maxDoc = state.segmentInfo.maxDoc();
     final int maxCountPerDoc = maxCount;
     assert pendingCounts.size() == maxDoc;
     final int valueCount = hash.size();

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/StandardDirectoryReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/StandardDirectoryReader.java?rev=1663371&r1=1663370&r2=1663371&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/StandardDirectoryReader.java
(original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/StandardDirectoryReader.java
Mon Mar  2 17:24:47 2015
@@ -184,7 +184,7 @@ final class StandardDirectoryReader exte
 
             // Make a best effort to detect when the app illegally "rm -rf" their
             // index while a reader was open, and then called openIfChanged:
-            boolean illegalDocCountChange = commitInfo.info.getDocCount() != oldReader.getSegmentInfo().info.getDocCount();
+            boolean illegalDocCountChange = commitInfo.info.maxDoc() != oldReader.getSegmentInfo().info.maxDoc();
             
             boolean hasNeitherDeletionsNorUpdates = commitInfo.hasDeletions()== false &&
commitInfo.hasFieldUpdates() == false;
 

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/TermVectorsConsumer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/TermVectorsConsumer.java?rev=1663371&r1=1663370&r2=1663371&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/TermVectorsConsumer.java
(original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/TermVectorsConsumer.java
Mon Mar  2 17:24:47 2015
@@ -56,7 +56,7 @@ final class TermVectorsConsumer extends
   @Override
   void flush(Map<String, TermsHashPerField> fieldsToFlush, final SegmentWriteState
state) throws IOException {
     if (writer != null) {
-      int numDocs = state.segmentInfo.getDocCount();
+      int numDocs = state.segmentInfo.maxDoc();
       assert numDocs > 0;
       // At least one doc in this run had term vectors enabled
       try {

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/TieredMergePolicy.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/TieredMergePolicy.java?rev=1663371&r1=1663370&r2=1663371&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/TieredMergePolicy.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/TieredMergePolicy.java Mon
Mar  2 17:24:47 2015
@@ -585,7 +585,7 @@ public class TieredMergePolicy extends M
     final List<SegmentCommitInfo> eligible = new ArrayList<>();
     final Collection<SegmentCommitInfo> merging = writer.getMergingSegments();
     for(SegmentCommitInfo info : infos) {
-      double pctDeletes = 100.*((double) writer.numDeletedDocs(info))/info.info.getDocCount();
+      double pctDeletes = 100.*((double) writer.numDeletedDocs(info))/info.info.maxDoc();
       if (pctDeletes > forceMergeDeletesPctAllowed && !merging.contains(info))
{
         eligible.add(info);
       }

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/store/MergeInfo.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/store/MergeInfo.java?rev=1663371&r1=1663370&r2=1663371&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/store/MergeInfo.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/store/MergeInfo.java Mon Mar 
2 17:24:47 2015
@@ -23,7 +23,7 @@ package org.apache.lucene.store;
 
 public class MergeInfo {
   
-  public final int totalDocCount;
+  public final int totalMaxDoc;
   
   public final long estimatedMergeBytes;
   
@@ -40,8 +40,8 @@ public class MergeInfo {
    * 
    */
 
-  public MergeInfo(int totalDocCount, long estimatedMergeBytes, boolean isExternal, int mergeMaxNumSegments)
{
-    this.totalDocCount = totalDocCount;
+  public MergeInfo(int totalMaxDoc, long estimatedMergeBytes, boolean isExternal, int mergeMaxNumSegments)
{
+    this.totalMaxDoc = totalMaxDoc;
     this.estimatedMergeBytes = estimatedMergeBytes;
     this.isExternal = isExternal;
     this.mergeMaxNumSegments = mergeMaxNumSegments;
@@ -56,7 +56,7 @@ public class MergeInfo {
         + (int) (estimatedMergeBytes ^ (estimatedMergeBytes >>> 32));
     result = prime * result + (isExternal ? 1231 : 1237);
     result = prime * result + mergeMaxNumSegments;
-    result = prime * result + totalDocCount;
+    result = prime * result + totalMaxDoc;
     return result;
   }
 
@@ -75,14 +75,14 @@ public class MergeInfo {
       return false;
     if (mergeMaxNumSegments != other.mergeMaxNumSegments)
       return false;
-    if (totalDocCount != other.totalDocCount)
+    if (totalMaxDoc != other.totalMaxDoc)
       return false;
     return true;
   }
 
   @Override
   public String toString() {
-    return "MergeInfo [totalDocCount=" + totalDocCount
+    return "MergeInfo [totalMaxDoc=" + totalMaxDoc
         + ", estimatedMergeBytes=" + estimatedMergeBytes + ", isExternal="
         + isExternal + ", mergeMaxNumSegments=" + mergeMaxNumSegments + "]";
   }

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java?rev=1663371&r1=1663370&r2=1663371&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java Mon
Mar  2 17:24:47 2015
@@ -339,7 +339,7 @@ public class TestAddIndexes extends Luce
 
     writer.addIndexes(aux);
     assertEquals(1040, writer.maxDoc());
-    assertEquals(1000, writer.getDocCount(0));
+    assertEquals(1000, writer.maxDoc(0));
     writer.close();
 
     // make sure the index is correct
@@ -368,7 +368,7 @@ public class TestAddIndexes extends Luce
 
     writer.addIndexes(aux);
     assertEquals(1032, writer.maxDoc());
-    assertEquals(1000, writer.getDocCount(0));
+    assertEquals(1000, writer.maxDoc(0));
     writer.close();
 
     // make sure the index is correct
@@ -396,7 +396,7 @@ public class TestAddIndexes extends Luce
 
     writer.addIndexes(aux, new MockDirectoryWrapper(random(), TestUtil.ramCopyOf(aux)));
     assertEquals(1060, writer.maxDoc());
-    assertEquals(1000, writer.getDocCount(0));
+    assertEquals(1000, writer.maxDoc(0));
     writer.close();
 
     // make sure the index is correct
@@ -438,7 +438,7 @@ public class TestAddIndexes extends Luce
     }
     writer.addIndexes(aux, new MockDirectoryWrapper(random(), TestUtil.ramCopyOf(aux)));
     assertEquals(1020, writer.maxDoc());
-    assertEquals(1000, writer.getDocCount(0));
+    assertEquals(1000, writer.maxDoc(0));
     writer.close();
     dir.close();
     aux.close();
@@ -498,7 +498,7 @@ public class TestAddIndexes extends Luce
 
     writer.addIndexes(aux, aux2);
     assertEquals(1040, writer.maxDoc());
-    assertEquals(1000, writer.getDocCount(0));
+    assertEquals(1000, writer.maxDoc(0));
     writer.close();
     dir.close();
     aux.close();

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java?rev=1663371&r1=1663370&r2=1663371&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java
(original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java
Mon Mar  2 17:24:47 2015
@@ -248,7 +248,7 @@ public class TestIndexWriterMergePolicy
 
     int segmentCount = writer.getSegmentCount();
     for (int i = segmentCount - 1; i >= 0; i--) {
-      int docCount = writer.getDocCount(i);
+      int docCount = writer.maxDoc(i);
       assertTrue("docCount=" + docCount + " lowerBound=" + lowerBound + " upperBound=" +
upperBound + " i=" + i + " segmentCount=" + segmentCount + " index=" + writer.segString()
+ " config=" + writer.getConfig(), docCount > lowerBound);
 
       if (docCount <= upperBound) {

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMerging.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMerging.java?rev=1663371&r1=1663370&r2=1663371&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMerging.java
(original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMerging.java
Mon Mar  2 17:24:47 2015
@@ -320,7 +320,7 @@ public class TestIndexWriterMerging exte
           break;
         }
         for(int i=0;i<merge.segments.size();i++) {
-          assert merge.segments.get(i).info.getDocCount() < 20;
+          assert merge.segments.get(i).info.maxDoc() < 20;
         }
         writer.merge(merge);
       }

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestSegmentMerger.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestSegmentMerger.java?rev=1663371&r1=1663370&r2=1663371&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestSegmentMerger.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestSegmentMerger.java Mon
Mar  2 17:24:47 2015
@@ -90,7 +90,7 @@ public class TestSegmentMerger extends L
                                              new FieldInfos.FieldNumbers(),
                                              newIOContext(random(), new IOContext(new MergeInfo(-1,
-1, false, -1))));
     MergeState mergeState = merger.merge();
-    int docsMerged = mergeState.segmentInfo.getDocCount();
+    int docsMerged = mergeState.segmentInfo.maxDoc();
     assertTrue(docsMerged == 2);
     //Should be able to open a new SegmentReader against the new directory
     SegmentReader mergedReader = new SegmentReader(new SegmentCommitInfo(

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/makeEuroparlLineFile.py
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/makeEuroparlLineFile.py?rev=1663371&r1=1663370&r2=1663371&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/makeEuroparlLineFile.py (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/makeEuroparlLineFile.py Mon
Mar  2 17:24:47 2015
@@ -35,16 +35,16 @@ reChapterOnly = re.compile('^<CHAPTER ID
 reTagOnly = re.compile('^<.*?>$')
 reNumberOnly = re.compile(r'^\d+\.?$')
 
-docCount = 0
+maxDoc = 0
 didEnglish = False
 
 def write(date, title, pending, fOut):
-  global docCount
+  global maxDoc
   body = ' '.join(pending).replace('\t', ' ').strip()
   if len(body) > 0:
     line = '%s\t%s\t%s\n' % (title, date, body)
     fOut.write(line)
-    docCount += 1
+    maxDoc += 1
     del pending[:]
     if VERBOSE:
       print len(body)
@@ -109,10 +109,10 @@ fOut = open(fileOut, 'wb')
 
 for fileName in glob.glob('%s/??-??.tgz' % dirIn):
   if fileName.endswith('.tgz'):
-    print 'process %s; %d docs so far...' % (fileName, docCount)
+    print 'process %s; %d docs so far...' % (fileName, maxDoc)
     processTar(fileName, fOut)
 
-print 'TOTAL: %s' % docCount
+print 'TOTAL: %s' % maxDoc
 
 #run something like this:
 """

Modified: lucene/dev/trunk/lucene/misc/src/java/org/apache/lucene/index/IndexSplitter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/misc/src/java/org/apache/lucene/index/IndexSplitter.java?rev=1663371&r1=1663370&r2=1663371&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/misc/src/java/org/apache/lucene/index/IndexSplitter.java (original)
+++ lucene/dev/trunk/lucene/misc/src/java/org/apache/lucene/index/IndexSplitter.java Mon Mar
 2 17:24:47 2015
@@ -29,7 +29,6 @@ import java.util.List;
 import java.util.Locale;
 
 import org.apache.lucene.store.FSDirectory;
-import org.apache.lucene.util.StringHelper;
 
 /**
  * Command-line tool that enables listing segments in an
@@ -137,7 +136,7 @@ public class IndexSplitter {
       SegmentCommitInfo infoPerCommit = getInfo(n);
       SegmentInfo info = infoPerCommit.info;
       // Same info just changing the dir:
-      SegmentInfo newInfo = new SegmentInfo(destFSDir, info.getVersion(), info.name, info.getDocCount(),

+      SegmentInfo newInfo = new SegmentInfo(destFSDir, info.getVersion(), info.name, info.maxDoc(),
                                             info.getUseCompoundFile(), info.getCodec(), info.getDiagnostics(),
info.getId(), new HashMap<>());
       destInfos.add(new SegmentCommitInfo(newInfo, infoPerCommit.getDelCount(),
           infoPerCommit.getDelGen(), infoPerCommit.getFieldInfosGen(),

Modified: lucene/dev/trunk/lucene/sandbox/src/java/org/apache/lucene/codecs/idversion/VersionBlockTreeTermsReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/sandbox/src/java/org/apache/lucene/codecs/idversion/VersionBlockTreeTermsReader.java?rev=1663371&r1=1663370&r2=1663371&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/sandbox/src/java/org/apache/lucene/codecs/idversion/VersionBlockTreeTermsReader.java
(original)
+++ lucene/dev/trunk/lucene/sandbox/src/java/org/apache/lucene/codecs/idversion/VersionBlockTreeTermsReader.java
Mon Mar  2 17:24:47 2015
@@ -132,8 +132,8 @@ public final class VersionBlockTreeTerms
 
         BytesRef minTerm = readBytesRef(in);
         BytesRef maxTerm = readBytesRef(in);
-        if (docCount < 0 || docCount > state.segmentInfo.getDocCount()) { // #docs
with field must be <= #docs
-          throw new CorruptIndexException("invalid docCount: " + docCount + " maxDoc: " +
state.segmentInfo.getDocCount(), in);
+        if (docCount < 0 || docCount > state.segmentInfo.maxDoc()) { // #docs with
field must be <= #docs
+          throw new CorruptIndexException("invalid docCount: " + docCount + " maxDoc: " +
state.segmentInfo.maxDoc(), in);
         }
         if (sumDocFreq < docCount) {  // #postings must be >= #docs with field
           throw new CorruptIndexException("invalid sumDocFreq: " + sumDocFreq + " docCount:
" + docCount, in);

Modified: lucene/dev/trunk/lucene/sandbox/src/java/org/apache/lucene/codecs/idversion/VersionBlockTreeTermsWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/sandbox/src/java/org/apache/lucene/codecs/idversion/VersionBlockTreeTermsWriter.java?rev=1663371&r1=1663370&r2=1663371&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/sandbox/src/java/org/apache/lucene/codecs/idversion/VersionBlockTreeTermsWriter.java
(original)
+++ lucene/dev/trunk/lucene/sandbox/src/java/org/apache/lucene/codecs/idversion/VersionBlockTreeTermsWriter.java
Mon Mar  2 17:24:47 2015
@@ -178,7 +178,7 @@ public final class VersionBlockTreeTerms
   {
     BlockTreeTermsWriter.validateSettings(minItemsInBlock, maxItemsInBlock);
 
-    maxDoc = state.segmentInfo.getDocCount();
+    maxDoc = state.segmentInfo.maxDoc();
 
     final String termsFileName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix,
TERMS_EXTENSION);
     out = state.directory.createOutput(termsFileName, state.context);

Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingDocValuesFormat.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingDocValuesFormat.java?rev=1663371&r1=1663370&r2=1663371&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingDocValuesFormat.java
(original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingDocValuesFormat.java
Mon Mar  2 17:24:47 2015
@@ -58,7 +58,7 @@ public class AssertingDocValuesFormat ex
   public DocValuesConsumer fieldsConsumer(SegmentWriteState state) throws IOException {
     DocValuesConsumer consumer = in.fieldsConsumer(state);
     assert consumer != null;
-    return new AssertingDocValuesConsumer(consumer, state.segmentInfo.getDocCount());
+    return new AssertingDocValuesConsumer(consumer, state.segmentInfo.maxDoc());
   }
 
   @Override
@@ -66,7 +66,7 @@ public class AssertingDocValuesFormat ex
     assert state.fieldInfos.hasDocValues();
     DocValuesProducer producer = in.fieldsProducer(state);
     assert producer != null;
-    return new AssertingDocValuesProducer(producer, state.segmentInfo.getDocCount());
+    return new AssertingDocValuesProducer(producer, state.segmentInfo.maxDoc());
   }
   
   static class AssertingDocValuesConsumer extends DocValuesConsumer {

Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingLiveDocsFormat.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingLiveDocsFormat.java?rev=1663371&r1=1663370&r2=1663371&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingLiveDocsFormat.java
(original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingLiveDocsFormat.java
Mon Mar  2 17:24:47 2015
@@ -63,7 +63,7 @@ public class AssertingLiveDocsFormat ext
   public Bits readLiveDocs(Directory dir, SegmentCommitInfo info, IOContext context) throws
IOException {
     Bits raw = in.readLiveDocs(dir, info, context);
     assert raw != null;
-    check(raw, info.info.getDocCount(), info.getDelCount());
+    check(raw, info.info.maxDoc(), info.getDelCount());
     return new AssertingBits(raw);
   }
 
@@ -71,7 +71,7 @@ public class AssertingLiveDocsFormat ext
   public void writeLiveDocs(MutableBits bits, Directory dir, SegmentCommitInfo info, int
newDelCount, IOContext context) throws IOException {
     assert bits instanceof AssertingMutableBits;
     MutableBits raw = (MutableBits) ((AssertingMutableBits)bits).in;
-    check(raw, info.info.getDocCount(), info.getDelCount() + newDelCount);
+    check(raw, info.info.maxDoc(), info.getDelCount() + newDelCount);
     in.writeLiveDocs(raw, dir, info, newDelCount, context);
   }
   

Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingNormsFormat.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingNormsFormat.java?rev=1663371&r1=1663370&r2=1663371&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingNormsFormat.java
(original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingNormsFormat.java
Mon Mar  2 17:24:47 2015
@@ -41,7 +41,7 @@ public class AssertingNormsFormat extend
   public NormsConsumer normsConsumer(SegmentWriteState state) throws IOException {
     NormsConsumer consumer = in.normsConsumer(state);
     assert consumer != null;
-    return new AssertingNormsConsumer(consumer, state.segmentInfo.getDocCount());
+    return new AssertingNormsConsumer(consumer, state.segmentInfo.maxDoc());
   }
 
   @Override
@@ -49,7 +49,7 @@ public class AssertingNormsFormat extend
     assert state.fieldInfos.hasNorms();
     NormsProducer producer = in.normsProducer(state);
     assert producer != null;
-    return new AssertingNormsProducer(producer, state.segmentInfo.getDocCount());
+    return new AssertingNormsProducer(producer, state.segmentInfo.maxDoc());
   }
   
   static class AssertingNormsConsumer extends NormsConsumer {

Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingStoredFieldsFormat.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingStoredFieldsFormat.java?rev=1663371&r1=1663370&r2=1663371&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingStoredFieldsFormat.java
(original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingStoredFieldsFormat.java
Mon Mar  2 17:24:47 2015
@@ -41,7 +41,7 @@ public class AssertingStoredFieldsFormat
 
   @Override
   public StoredFieldsReader fieldsReader(Directory directory, SegmentInfo si, FieldInfos
fn, IOContext context) throws IOException {
-    return new AssertingStoredFieldsReader(in.fieldsReader(directory, si, fn, context), si.getDocCount());
+    return new AssertingStoredFieldsReader(in.fieldsReader(directory, si, fn, context), si.maxDoc());
   }
 
   @Override

Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/codecs/mockrandom/MockRandomPostingsFormat.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/codecs/mockrandom/MockRandomPostingsFormat.java?rev=1663371&r1=1663370&r2=1663371&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/codecs/mockrandom/MockRandomPostingsFormat.java
(original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/codecs/mockrandom/MockRandomPostingsFormat.java
Mon Mar  2 17:24:47 2015
@@ -84,7 +84,7 @@ public final class MockRandomPostingsFor
   @Override
   public FieldsConsumer fieldsConsumer(SegmentWriteState state) throws IOException {
     int minSkipInterval;
-    if (state.segmentInfo.getDocCount() > 1000000) {
+    if (state.segmentInfo.maxDoc() > 1000000) {
       // Test2BPostings can OOME otherwise:
       minSkipInterval = 3;
     } else {

Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/codecs/ramonly/RAMOnlyPostingsFormat.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/codecs/ramonly/RAMOnlyPostingsFormat.java?rev=1663371&r1=1663370&r2=1663371&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/codecs/ramonly/RAMOnlyPostingsFormat.java
(original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/codecs/ramonly/RAMOnlyPostingsFormat.java
Mon Mar  2 17:24:47 2015
@@ -248,7 +248,7 @@ public final class RAMOnlyPostingsFormat
         postings.fieldToTerms.put(field, ramField);
         termsConsumer.reset(ramField);
 
-        FixedBitSet docsSeen = new FixedBitSet(state.segmentInfo.getDocCount());
+        FixedBitSet docsSeen = new FixedBitSet(state.segmentInfo.maxDoc());
         long sumTotalTermFreq = 0;
         long sumDocFreq = 0;
         PostingsEnum postingsEnum = null;

Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BaseSegmentInfoFormatTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BaseSegmentInfoFormatTestCase.java?rev=1663371&r1=1663370&r2=1663371&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BaseSegmentInfoFormatTestCase.java
(original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BaseSegmentInfoFormatTestCase.java
Mon Mar  2 17:24:47 2015
@@ -212,7 +212,7 @@ public abstract class BaseSegmentInfoFor
     // we don't assert this, because SI format has nothing to do with it... set by SIS
     // assertSame(expected.getCodec(), actual.getCodec());
     assertEquals(expected.getDiagnostics(), actual.getDiagnostics());
-    assertEquals(expected.getDocCount(), actual.getDocCount());
+    assertEquals(expected.maxDoc(), actual.maxDoc());
     assertIDEquals(expected.getId(), actual.getId());
     assertEquals(expected.getUseCompoundFile(), actual.getUseCompoundFile());
     assertEquals(expected.getVersion(), actual.getVersion());



Mime
View raw message