Apache Solr open-source search software
LUCENE-3892: comment out all sops
Michael McCandlessf7a0f007240b
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/block/BlockPostingsReader.java b/lucene/core/src/java/org/apache/lucene/codecs/block/BlockPostingsReader.javaindex 3928bf4760c..3f7b919003d 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/block/BlockPostingsReader.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/block/BlockPostingsReader.java@@ -60,7 +60,7 @@ public final class BlockPostingsReader extends PostingsReaderBase {private final ForUtil forUtil;- public static boolean DEBUG = false;+ // public static boolean DEBUG = false;public BlockPostingsReader(Directory dir, FieldInfos fieldInfos, SegmentInfo segmentInfo, IOContext ioContext, String segmentSuffix) throws IOException {boolean success = false;@@ -371,9 +371,9 @@ public final class BlockPostingsReader extends PostingsReaderBase {public DocsEnum reset(Bits liveDocs, IntBlockTermState termState) throws IOException {this.liveDocs = liveDocs;- if (DEBUG) {- System.out.println(" FPR.reset: termState=" + termState);- }+ // if (DEBUG) {+ // System.out.println(" FPR.reset: termState=" + termState);+ // }docFreq = termState.docFreq;docTermStartFP = termState.docStartFP;docIn.seek(docTermStartFP);@@ -406,22 +406,22 @@ public final class BlockPostingsReader extends PostingsReaderBase {assert left > 0;if (left >= BLOCK_SIZE) {- if (DEBUG) {- System.out.println(" fill doc block from fp=" + docIn.getFilePointer());- }+ // if (DEBUG) {+ // System.out.println(" fill doc block from fp=" + docIn.getFilePointer());+ // }forUtil.readBlock(docIn, encoded, docDeltaBuffer);if (indexHasFreq) {- if (DEBUG) {- System.out.println(" fill freq block from fp=" + docIn.getFilePointer());- }+ // if (DEBUG) {+ // System.out.println(" fill freq block from fp=" + docIn.getFilePointer());+ // }forUtil.readBlock(docIn, encoded, freqBuffer);}} else {// Read vInts:- if (DEBUG) {- System.out.println(" fill last vInt block from fp=" + docIn.getFilePointer());- }+ // if (DEBUG) {+ // System.out.println(" fill last vInt block from fp=" + docIn.getFilePointer());+ // }readVIntBlock(docIn, docDeltaBuffer, freqBuffer, left, indexHasFreq);}docBufferUpto = 0;@@ -429,27 +429,27 @@ public final class BlockPostingsReader extends PostingsReaderBase {@Overridepublic int nextDoc() throws IOException {- if (DEBUG) {- System.out.println("\nFPR.nextDoc");- }+ // if (DEBUG) {+ // System.out.println("\nFPR.nextDoc");+ // }while (true) {- if (DEBUG) {- System.out.println(" docUpto=" + docUpto + " (of df=" + docFreq + ") docBufferUpto=" + docBufferUpto);- }+ // if (DEBUG) {+ // System.out.println(" docUpto=" + docUpto + " (of df=" + docFreq + ") docBufferUpto=" + docBufferUpto);+ // }if (docUpto == docFreq) {- if (DEBUG) {- System.out.println(" return doc=END");- }+ // if (DEBUG) {+ // System.out.println(" return doc=END");+ // }return doc = NO_MORE_DOCS;}if (docBufferUpto == BLOCK_SIZE) {refillDocs();}- if (DEBUG) {- System.out.println(" accum=" + accum + " docDeltaBuffer[" + docBufferUpto + "]=" + docDeltaBuffer[docBufferUpto]);- }+ // if (DEBUG) {+ // System.out.println(" accum=" + accum + " docDeltaBuffer[" + docBufferUpto + "]=" + docDeltaBuffer[docBufferUpto]);+ // }accum += docDeltaBuffer[docBufferUpto];docUpto++;@@ -457,14 +457,14 @@ public final class BlockPostingsReader extends PostingsReaderBase {doc = accum;freq = freqBuffer[docBufferUpto];docBufferUpto++;- if (DEBUG) {- System.out.println(" return doc=" + doc + " freq=" + freq);- }+ // if (DEBUG) {+ // System.out.println(" return doc=" + doc + " freq=" + freq);+ // }return doc;}- if (DEBUG) {- System.out.println(" doc=" + accum + " is deleted; try next doc");- }+ // if (DEBUG) {+ // System.out.println(" doc=" + accum + " is deleted; try next doc");+ // }docBufferUpto++;}}@@ -472,17 +472,17 @@ public final class BlockPostingsReader extends PostingsReaderBase {@Overridepublic int advance(int target) throws IOException {// TODO: make frq block load lazy/skippable- if (DEBUG) {- System.out.println(" FPR.advance target=" + target);- }+ // if (DEBUG) {+ // System.out.println(" FPR.advance target=" + target);+ // }// current skip docID < docIDs generated from current buffer <= next skip docID// we don't need to skip if target is buffered alreadyif (docFreq > BLOCK_SIZE && target > nextSkipDoc) {- if (DEBUG) {- System.out.println("load skipper");- }+ // if (DEBUG) {+ // System.out.println("load skipper");+ // }if (skipper == null) {// Lazy init: first time this enum has ever been used for skipping@@ -506,9 +506,9 @@ public final class BlockPostingsReader extends PostingsReaderBase {if (newDocUpto > docUpto) {// Skipper moved- if (DEBUG) {- System.out.println("skipper moved to docUpto=" + newDocUpto + " vs current=" + docUpto + "; docID=" + skipper.getDoc() + " fp=" + skipper.getDocPointer());- }+ // if (DEBUG) {+ // System.out.println("skipper moved to docUpto=" + newDocUpto + " vs current=" + docUpto + "; docID=" + skipper.getDoc() + " fp=" + skipper.getDocPointer());+ // }assert newDocUpto % BLOCK_SIZE == 0 : "got " + newDocUpto;docUpto = newDocUpto;@@ -529,9 +529,9 @@ public final class BlockPostingsReader extends PostingsReaderBase {// Now scan... this is an inlined/pared down version// of nextDoc():while (true) {- if (DEBUG) {- System.out.println(" scan doc=" + accum + " docBufferUpto=" + docBufferUpto);- }+ // if (DEBUG) {+ // System.out.println(" scan doc=" + accum + " docBufferUpto=" + docBufferUpto);+ // }accum += docDeltaBuffer[docBufferUpto];docUpto++;@@ -545,16 +545,16 @@ public final class BlockPostingsReader extends PostingsReaderBase {}if (liveDocs == null || liveDocs.get(accum)) {- if (DEBUG) {- System.out.println(" return doc=" + accum);- }+ // if (DEBUG) {+ // System.out.println(" return doc=" + accum);+ // }freq = freqBuffer[docBufferUpto];docBufferUpto++;return doc = accum;} else {- if (DEBUG) {- System.out.println(" now do nextDoc()");- }+ // if (DEBUG) {+ // System.out.println(" now do nextDoc()");+ // }docBufferUpto++;return nextDoc();}@@ -640,9 +640,9 @@ public final class BlockPostingsReader extends PostingsReaderBase {public DocsAndPositionsEnum reset(Bits liveDocs, IntBlockTermState termState) throws IOException {this.liveDocs = liveDocs;- if (DEBUG) {- System.out.println(" FPR.reset: termState=" + termState);- }+ // if (DEBUG) {+ // System.out.println(" FPR.reset: termState=" + termState);+ // }docFreq = termState.docFreq;docTermStartFP = termState.docStartFP;posTermStartFP = termState.posStartFP;@@ -683,32 +683,32 @@ public final class BlockPostingsReader extends PostingsReaderBase {assert left > 0;if (left >= BLOCK_SIZE) {- if (DEBUG) {- System.out.println(" fill doc block from fp=" + docIn.getFilePointer());- }+ // if (DEBUG) {+ // System.out.println(" fill doc block from fp=" + docIn.getFilePointer());+ // }forUtil.readBlock(docIn, encoded, docDeltaBuffer);- if (DEBUG) {- System.out.println(" fill freq block from fp=" + docIn.getFilePointer());- }+ // if (DEBUG) {+ // System.out.println(" fill freq block from fp=" + docIn.getFilePointer());+ // }forUtil.readBlock(docIn, encoded, freqBuffer);} else {// Read vInts:- if (DEBUG) {- System.out.println(" fill last vInt doc block from fp=" + docIn.getFilePointer());- }+ // if (DEBUG) {+ // System.out.println(" fill last vInt doc block from fp=" + docIn.getFilePointer());+ // }readVIntBlock(docIn, docDeltaBuffer, freqBuffer, left, true);}docBufferUpto = 0;}private void refillPositions() throws IOException {- if (DEBUG) {- System.out.println(" refillPositions");- }+ // if (DEBUG) {+ // System.out.println(" refillPositions");+ // }if (posIn.getFilePointer() == lastPosBlockFP) {- if (DEBUG) {- System.out.println(" vInt pos block @ fp=" + posIn.getFilePointer() + " hasPayloads=" + indexHasPayloads + " hasOffsets=" + indexHasOffsets);- }+ // if (DEBUG) {+ // System.out.println(" vInt pos block @ fp=" + posIn.getFilePointer() + " hasPayloads=" + indexHasPayloads + " hasOffsets=" + indexHasOffsets);+ // }final int count = posIn.readVInt();int payloadLength = 0;for(int i=0;i<count;i++) {@@ -730,31 +730,31 @@ public final class BlockPostingsReader extends PostingsReaderBase {}}} else {- if (DEBUG) {- System.out.println(" bulk pos block @ fp=" + posIn.getFilePointer());- }+ // if (DEBUG) {+ // System.out.println(" bulk pos block @ fp=" + posIn.getFilePointer());+ // }forUtil.readBlock(posIn, encoded, posDeltaBuffer);}}@Overridepublic int nextDoc() throws IOException {- if (DEBUG) {- System.out.println(" FPR.nextDoc");- }+ // if (DEBUG) {+ // System.out.println(" FPR.nextDoc");+ // }while (true) {- if (DEBUG) {- System.out.println(" docUpto=" + docUpto + " (of df=" + docFreq + ") docBufferUpto=" + docBufferUpto);- }+ // if (DEBUG) {+ // System.out.println(" docUpto=" + docUpto + " (of df=" + docFreq + ") docBufferUpto=" + docBufferUpto);+ // }if (docUpto == docFreq) {return doc = NO_MORE_DOCS;}if (docBufferUpto == BLOCK_SIZE) {refillDocs();}- if (DEBUG) {- System.out.println(" accum=" + accum + " docDeltaBuffer[" + docBufferUpto + "]=" + docDeltaBuffer[docBufferUpto]);- }+ // if (DEBUG) {+ // System.out.println(" accum=" + accum + " docDeltaBuffer[" + docBufferUpto + "]=" + docDeltaBuffer[docBufferUpto]);+ // }accum += docDeltaBuffer[docBufferUpto];freq = freqBuffer[docBufferUpto];posPendingCount += freq;@@ -764,33 +764,33 @@ public final class BlockPostingsReader extends PostingsReaderBase {if (liveDocs == null || liveDocs.get(accum)) {doc = accum;position = 0;- if (DEBUG) {- System.out.println(" return doc=" + doc + " freq=" + freq + " posPendingCount=" + posPendingCount);- }+ // if (DEBUG) {+ // System.out.println(" return doc=" + doc + " freq=" + freq + " posPendingCount=" + posPendingCount);+ // }return doc;}- if (DEBUG) {- System.out.println(" doc=" + accum + " is deleted; try next doc");- }+ // if (DEBUG) {+ // System.out.println(" doc=" + accum + " is deleted; try next doc");+ // }}}@Overridepublic int advance(int target) throws IOException {// TODO: make frq block load lazy/skippable- if (DEBUG) {- System.out.println(" FPR.advance target=" + target);- }+ // if (DEBUG) {+ // System.out.println(" FPR.advance target=" + target);+ // }if (docFreq > BLOCK_SIZE && target > nextSkipDoc) {- if (DEBUG) {- System.out.println(" try skipper");- }+ // if (DEBUG) {+ // System.out.println(" try skipper");+ // }if (skipper == null) {// Lazy init: first time this enum has ever been used for skipping- if (DEBUG) {- System.out.println(" create skipper");- }+ // if (DEBUG) {+ // System.out.println(" create skipper");+ // }skipper = new BlockSkipReader((IndexInput) docIn.clone(),BlockPostingsWriter.maxSkipLevels,BLOCK_SIZE,@@ -803,9 +803,9 @@ public final class BlockPostingsReader extends PostingsReaderBase {assert skipOffset != -1;// This is the first time this enum has skipped// since reset() was called; load the skip data:- if (DEBUG) {- System.out.println(" init skipper");- }+ // if (DEBUG) {+ // System.out.println(" init skipper");+ // }skipper.init(docTermStartFP+skipOffset, docTermStartFP, posTermStartFP, payTermStartFP, docFreq);skipped = true;}@@ -814,9 +814,9 @@ public final class BlockPostingsReader extends PostingsReaderBase {if (newDocUpto > docUpto) {// Skipper moved- if (DEBUG) {- System.out.println(" skipper moved to docUpto=" + newDocUpto + " vs current=" + docUpto + "; docID=" + skipper.getDoc() + " fp=" + skipper.getDocPointer() + " pos.fp=" + skipper.getPosPointer() + " pos.bufferUpto=" + skipper.getPosBufferUpto());- }+ // if (DEBUG) {+ // System.out.println(" skipper moved to docUpto=" + newDocUpto + " vs current=" + docUpto + "; docID=" + skipper.getDoc() + " fp=" + skipper.getDocPointer() + " pos.fp=" + skipper.getPosPointer() + " pos.bufferUpto=" + skipper.getPosBufferUpto());+ // }assert newDocUpto % BLOCK_SIZE == 0 : "got " + newDocUpto;docUpto = newDocUpto;@@ -840,9 +840,9 @@ public final class BlockPostingsReader extends PostingsReaderBase {// Now scan... this is an inlined/pared down version// of nextDoc():while (true) {- if (DEBUG) {- System.out.println(" scan doc=" + accum + " docBufferUpto=" + docBufferUpto);- }+ // if (DEBUG) {+ // System.out.println(" scan doc=" + accum + " docBufferUpto=" + docBufferUpto);+ // }if (docUpto == docFreq) {return doc = NO_MORE_DOCS;}@@ -861,15 +861,15 @@ public final class BlockPostingsReader extends PostingsReaderBase {}if (liveDocs == null || liveDocs.get(accum)) {- if (DEBUG) {- System.out.println(" return doc=" + accum);- }+ // if (DEBUG) {+ // System.out.println(" return doc=" + accum);+ // }position = 0;return doc = accum;} else {- if (DEBUG) {- System.out.println(" now do nextDoc()");- }+ // if (DEBUG) {+ // System.out.println(" now do nextDoc()");+ // }return nextDoc();}}@@ -881,31 +881,31 @@ public final class BlockPostingsReader extends PostingsReaderBase {private void skipPositions() throws IOException {// Skip positions now:int toSkip = posPendingCount - freq;- if (DEBUG) {- System.out.println(" FPR.skipPositions: toSkip=" + toSkip);- }+ // if (DEBUG) {+ // System.out.println(" FPR.skipPositions: toSkip=" + toSkip);+ // }final int leftInBlock = BLOCK_SIZE - posBufferUpto;if (toSkip < leftInBlock) {posBufferUpto += toSkip;- if (DEBUG) {- System.out.println(" skip w/in block to posBufferUpto=" + posBufferUpto);- }+ // if (DEBUG) {+ // System.out.println(" skip w/in block to posBufferUpto=" + posBufferUpto);+ // }} else {toSkip -= leftInBlock;while(toSkip >= BLOCK_SIZE) {- if (DEBUG) {- System.out.println(" skip whole block @ fp=" + posIn.getFilePointer());- }+ // if (DEBUG) {+ // System.out.println(" skip whole block @ fp=" + posIn.getFilePointer());+ // }assert posIn.getFilePointer() != lastPosBlockFP;forUtil.skipBlock(posIn);toSkip -= BLOCK_SIZE;}refillPositions();posBufferUpto = toSkip;- if (DEBUG) {- System.out.println(" skip w/in block to posBufferUpto=" + posBufferUpto);- }+ // if (DEBUG) {+ // System.out.println(" skip w/in block to posBufferUpto=" + posBufferUpto);+ // }}position = 0;@@ -913,13 +913,13 @@ public final class BlockPostingsReader extends PostingsReaderBase {@Overridepublic int nextPosition() throws IOException {- if (DEBUG) {- System.out.println(" FPR.nextPosition posPendingCount=" + posPendingCount + " posBufferUpto=" + posBufferUpto);- }+ // if (DEBUG) {+ // System.out.println(" FPR.nextPosition posPendingCount=" + posPendingCount + " posBufferUpto=" + posBufferUpto);+ // }if (posPendingFP != -1) {- if (DEBUG) {- System.out.println(" seek to pendingFP=" + posPendingFP);- }+ // if (DEBUG) {+ // System.out.println(" seek to pendingFP=" + posPendingFP);+ // }posIn.seek(posPendingFP);posPendingFP = -1;@@ -938,9 +938,9 @@ public final class BlockPostingsReader extends PostingsReaderBase {}position += posDeltaBuffer[posBufferUpto++];posPendingCount--;- if (DEBUG) {- System.out.println(" return pos=" + position);- }+ // if (DEBUG) {+ // System.out.println(" return pos=" + position);+ // }return position;}@@ -1077,9 +1077,9 @@ public final class BlockPostingsReader extends PostingsReaderBase {public EverythingEnum reset(Bits liveDocs, IntBlockTermState termState) throws IOException {this.liveDocs = liveDocs;- if (DEBUG) {- System.out.println(" FPR.reset: termState=" + termState);- }+ // if (DEBUG) {+ // System.out.println(" FPR.reset: termState=" + termState);+ // }docFreq = termState.docFreq;docTermStartFP = termState.docStartFP;posTermStartFP = termState.posStartFP;@@ -1121,31 +1121,31 @@ public final class BlockPostingsReader extends PostingsReaderBase {assert left > 0;if (left >= BLOCK_SIZE) {- if (DEBUG) {- System.out.println(" fill doc block from fp=" + docIn.getFilePointer());- }+ // if (DEBUG) {+ // System.out.println(" fill doc block from fp=" + docIn.getFilePointer());+ // }forUtil.readBlock(docIn, encoded, docDeltaBuffer);- if (DEBUG) {- System.out.println(" fill freq block from fp=" + docIn.getFilePointer());- }+ // if (DEBUG) {+ // System.out.println(" fill freq block from fp=" + docIn.getFilePointer());+ // }forUtil.readBlock(docIn, encoded, freqBuffer);} else {- if (DEBUG) {- System.out.println(" fill last vInt doc block from fp=" + docIn.getFilePointer());- }+ // if (DEBUG) {+ // System.out.println(" fill last vInt doc block from fp=" + docIn.getFilePointer());+ // }readVIntBlock(docIn, docDeltaBuffer, freqBuffer, left, true);}docBufferUpto = 0;}private void refillPositions() throws IOException {- if (DEBUG) {- System.out.println(" refillPositions");- }+ // if (DEBUG) {+ // System.out.println(" refillPositions");+ // }if (posIn.getFilePointer() == lastPosBlockFP) {- if (DEBUG) {- System.out.println(" vInt pos block @ fp=" + posIn.getFilePointer() + " hasPayloads=" + indexHasPayloads + " hasOffsets=" + indexHasOffsets);- }+ // if (DEBUG) {+ // System.out.println(" vInt pos block @ fp=" + posIn.getFilePointer() + " hasPayloads=" + indexHasPayloads + " hasOffsets=" + indexHasOffsets);+ // }final int count = posIn.readVInt();int payloadLength = 0;payloadByteUpto = 0;@@ -1155,9 +1155,9 @@ public final class BlockPostingsReader extends PostingsReaderBase {if ((code & 1) != 0) {payloadLength = posIn.readVInt();}- if (DEBUG) {- System.out.println(" i=" + i + " payloadLen=" + payloadLength);- }+ // if (DEBUG) {+ // System.out.println(" i=" + i + " payloadLen=" + payloadLength);+ // }payloadLengthBuffer[i] = payloadLength;posDeltaBuffer[i] = code >>> 1;if (payloadLength != 0) {@@ -1173,32 +1173,32 @@ public final class BlockPostingsReader extends PostingsReaderBase {}if (indexHasOffsets) {- if (DEBUG) {- System.out.println(" i=" + i + " read offsets from posIn.fp=" + posIn.getFilePointer());- }+ // if (DEBUG) {+ // System.out.println(" i=" + i + " read offsets from posIn.fp=" + posIn.getFilePointer());+ // }offsetStartDeltaBuffer[i] = posIn.readVInt();offsetLengthBuffer[i] = posIn.readVInt();- if (DEBUG) {- System.out.println(" startOffDelta=" + offsetStartDeltaBuffer[i] + " offsetLen=" + offsetLengthBuffer[i]);- }+ // if (DEBUG) {+ // System.out.println(" startOffDelta=" + offsetStartDeltaBuffer[i] + " offsetLen=" + offsetLengthBuffer[i]);+ // }}}payloadByteUpto = 0;} else {- if (DEBUG) {- System.out.println(" bulk pos block @ fp=" + posIn.getFilePointer());- }+ // if (DEBUG) {+ // System.out.println(" bulk pos block @ fp=" + posIn.getFilePointer());+ // }forUtil.readBlock(posIn, encoded, posDeltaBuffer);if (indexHasPayloads) {- if (DEBUG) {- System.out.println(" bulk payload block @ pay.fp=" + payIn.getFilePointer());- }+ // if (DEBUG) {+ // System.out.println(" bulk payload block @ pay.fp=" + payIn.getFilePointer());+ // }forUtil.readBlock(payIn, encoded, payloadLengthBuffer);int numBytes = payIn.readVInt();- if (DEBUG) {- System.out.println(" " + numBytes + " payload bytes @ pay.fp=" + payIn.getFilePointer());- }+ // if (DEBUG) {+ // System.out.println(" " + numBytes + " payload bytes @ pay.fp=" + payIn.getFilePointer());+ // }if (numBytes > payloadBytes.length) {payloadBytes = ArrayUtil.grow(payloadBytes, numBytes);}@@ -1207,9 +1207,9 @@ public final class BlockPostingsReader extends PostingsReaderBase {}if (indexHasOffsets) {- if (DEBUG) {- System.out.println(" bulk offset block @ pay.fp=" + payIn.getFilePointer());- }+ // if (DEBUG) {+ // System.out.println(" bulk offset block @ pay.fp=" + payIn.getFilePointer());+ // }forUtil.readBlock(payIn, encoded, offsetStartDeltaBuffer);forUtil.readBlock(payIn, encoded, offsetLengthBuffer);}@@ -1218,22 +1218,22 @@ public final class BlockPostingsReader extends PostingsReaderBase {@Overridepublic int nextDoc() throws IOException {- if (DEBUG) {- System.out.println(" FPR.nextDoc");- }+ // if (DEBUG) {+ // System.out.println(" FPR.nextDoc");+ // }while (true) {- if (DEBUG) {- System.out.println(" docUpto=" + docUpto + " (of df=" + docFreq + ") docBufferUpto=" + docBufferUpto);- }+ // if (DEBUG) {+ // System.out.println(" docUpto=" + docUpto + " (of df=" + docFreq + ") docBufferUpto=" + docBufferUpto);+ // }if (docUpto == docFreq) {return doc = NO_MORE_DOCS;}if (docBufferUpto == BLOCK_SIZE) {refillDocs();}- if (DEBUG) {- System.out.println(" accum=" + accum + " docDeltaBuffer[" + docBufferUpto + "]=" + docDeltaBuffer[docBufferUpto]);- }+ // if (DEBUG) {+ // System.out.println(" accum=" + accum + " docDeltaBuffer[" + docBufferUpto + "]=" + docDeltaBuffer[docBufferUpto]);+ // }accum += docDeltaBuffer[docBufferUpto];freq = freqBuffer[docBufferUpto];posPendingCount += freq;@@ -1242,38 +1242,38 @@ public final class BlockPostingsReader extends PostingsReaderBase {if (liveDocs == null || liveDocs.get(accum)) {doc = accum;- if (DEBUG) {- System.out.println(" return doc=" + doc + " freq=" + freq + " posPendingCount=" + posPendingCount);- }+ // if (DEBUG) {+ // System.out.println(" return doc=" + doc + " freq=" + freq + " posPendingCount=" + posPendingCount);+ // }position = 0;lastStartOffset = 0;return doc;}- if (DEBUG) {- System.out.println(" doc=" + accum + " is deleted; try next doc");- }+ // if (DEBUG) {+ // System.out.println(" doc=" + accum + " is deleted; try next doc");+ // }}}@Overridepublic int advance(int target) throws IOException {// TODO: make frq block load lazy/skippable- if (DEBUG) {- System.out.println(" FPR.advance target=" + target);- }+ // if (DEBUG) {+ // System.out.println(" FPR.advance target=" + target);+ // }if (docFreq > BLOCK_SIZE && target > nextSkipDoc) {- if (DEBUG) {- System.out.println(" try skipper");- }+ // if (DEBUG) {+ // System.out.println(" try skipper");+ // }if (skipper == null) {// Lazy init: first time this enum has ever been used for skipping- if (DEBUG) {- System.out.println(" create skipper");- }+ // if (DEBUG) {+ // System.out.println(" create skipper");+ // }skipper = new BlockSkipReader((IndexInput) docIn.clone(),BlockPostingsWriter.maxSkipLevels,BLOCK_SIZE,@@ -1286,9 +1286,9 @@ public final class BlockPostingsReader extends PostingsReaderBase {assert skipOffset != -1;// This is the first time this enum has skipped// since reset() was called; load the skip data:- if (DEBUG) {- System.out.println(" init skipper");- }+ // if (DEBUG) {+ // System.out.println(" init skipper");+ // }skipper.init(docTermStartFP+skipOffset, docTermStartFP, posTermStartFP, payTermStartFP, docFreq);skipped = true;}@@ -1297,9 +1297,9 @@ public final class BlockPostingsReader extends PostingsReaderBase {if (newDocUpto > docUpto) {// Skipper moved- if (DEBUG) {- System.out.println(" skipper moved to docUpto=" + newDocUpto + " vs current=" + docUpto + "; docID=" + skipper.getDoc() + " fp=" + skipper.getDocPointer() + " pos.fp=" + skipper.getPosPointer() + " pos.bufferUpto=" + skipper.getPosBufferUpto() + " pay.fp=" + skipper.getPayPointer() + " lastStartOffset=" + lastStartOffset);- }+ // if (DEBUG) {+ // System.out.println(" skipper moved to docUpto=" + newDocUpto + " vs current=" + docUpto + "; docID=" + skipper.getDoc() + " fp=" + skipper.getDocPointer() + " pos.fp=" + skipper.getPosPointer() + " pos.bufferUpto=" + skipper.getPosBufferUpto() + " pay.fp=" + skipper.getPayPointer() + " lastStartOffset=" + lastStartOffset);+ // }assert newDocUpto % BLOCK_SIZE == 0 : "got " + newDocUpto;docUpto = newDocUpto;@@ -1324,9 +1324,9 @@ public final class BlockPostingsReader extends PostingsReaderBase {// Now scan:while (true) {- if (DEBUG) {- System.out.println(" scan doc=" + accum + " docBufferUpto=" + docBufferUpto);- }+ // if (DEBUG) {+ // System.out.println(" scan doc=" + accum + " docBufferUpto=" + docBufferUpto);+ // }accum += docDeltaBuffer[docBufferUpto];freq = freqBuffer[docBufferUpto];posPendingCount += freq;@@ -1342,16 +1342,16 @@ public final class BlockPostingsReader extends PostingsReaderBase {}if (liveDocs == null || liveDocs.get(accum)) {- if (DEBUG) {- System.out.println(" return doc=" + accum);- }+ // if (DEBUG) {+ // System.out.println(" return doc=" + accum);+ // }position = 0;lastStartOffset = 0;return doc = accum;} else {- if (DEBUG) {- System.out.println(" now do nextDoc()");- }+ // if (DEBUG) {+ // System.out.println(" now do nextDoc()");+ // }return nextDoc();}}@@ -1363,9 +1363,9 @@ public final class BlockPostingsReader extends PostingsReaderBase {private void skipPositions() throws IOException {// Skip positions now:int toSkip = posPendingCount - freq;- if (DEBUG) {- System.out.println(" FPR.skipPositions: toSkip=" + toSkip);- }+ // if (DEBUG) {+ // System.out.println(" FPR.skipPositions: toSkip=" + toSkip);+ // }final int leftInBlock = BLOCK_SIZE - posBufferUpto;if (toSkip < leftInBlock) {@@ -1376,15 +1376,15 @@ public final class BlockPostingsReader extends PostingsReaderBase {}posBufferUpto++;}- if (DEBUG) {- System.out.println(" skip w/in block to posBufferUpto=" + posBufferUpto);- }+ // if (DEBUG) {+ // System.out.println(" skip w/in block to posBufferUpto=" + posBufferUpto);+ // }} else {toSkip -= leftInBlock;while(toSkip >= BLOCK_SIZE) {- if (DEBUG) {- System.out.println(" skip whole block @ fp=" + posIn.getFilePointer());- }+ // if (DEBUG) {+ // System.out.println(" skip whole block @ fp=" + posIn.getFilePointer());+ // }assert posIn.getFilePointer() != lastPosBlockFP;forUtil.skipBlock(posIn);@@ -1412,9 +1412,9 @@ public final class BlockPostingsReader extends PostingsReaderBase {}posBufferUpto++;}- if (DEBUG) {- System.out.println(" skip w/in block to posBufferUpto=" + posBufferUpto);- }+ // if (DEBUG) {+ // System.out.println(" skip w/in block to posBufferUpto=" + posBufferUpto);+ // }}position = 0;@@ -1423,20 +1423,20 @@ public final class BlockPostingsReader extends PostingsReaderBase {@Overridepublic int nextPosition() throws IOException {- if (DEBUG) {- System.out.println(" FPR.nextPosition posPendingCount=" + posPendingCount + " posBufferUpto=" + posBufferUpto + " payloadByteUpto=" + payloadByteUpto);- }+ // if (DEBUG) {+ // System.out.println(" FPR.nextPosition posPendingCount=" + posPendingCount + " posBufferUpto=" + posBufferUpto + " payloadByteUpto=" + payloadByteUpto)// ;+ // }if (posPendingFP != -1) {- if (DEBUG) {- System.out.println(" seek pos to pendingFP=" + posPendingFP);- }+ // if (DEBUG) {+ // System.out.println(" seek pos to pendingFP=" + posPendingFP);+ // }posIn.seek(posPendingFP);posPendingFP = -1;if (payPendingFP != -1) {- if (DEBUG) {- System.out.println(" seek pay to pendingFP=" + payPendingFP);- }+ // if (DEBUG) {+ // System.out.println(" seek pay to pendingFP=" + payPendingFP);+ // }payIn.seek(payPendingFP);payPendingFP = -1;}@@ -1472,9 +1472,9 @@ public final class BlockPostingsReader extends PostingsReaderBase {posBufferUpto++;posPendingCount--;- if (DEBUG) {- System.out.println(" return pos=" + position);- }+ // if (DEBUG) {+ // System.out.println(" return pos=" + position);+ // }return position;}@@ -1490,9 +1490,9 @@ public final class BlockPostingsReader extends PostingsReaderBase {@Overridepublic BytesRef getPayload() {- if (DEBUG) {- System.out.println(" FPR.getPayload payloadLength=" + payloadLength + " payloadByteUpto=" + payloadByteUpto);- }+ // if (DEBUG) {+ // System.out.println(" FPR.getPayload payloadLength=" + payloadLength + " payloadByteUpto=" + payloadByteUpto);+ // }if (payloadLength == 0) {return null;} else {diff --git a/lucene/core/src/java/org/apache/lucene/codecs/block/BlockPostingsWriter.java b/lucene/core/src/java/org/apache/lucene/codecs/block/BlockPostingsWriter.javaindex 5ef1ea47bc7..e07b411139b 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/block/BlockPostingsWriter.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/block/BlockPostingsWriter.java@@ -18,7 +18,6 @@ package org.apache.lucene.codecs.block;*/import static org.apache.lucene.codecs.block.BlockPostingsFormat.BLOCK_SIZE;-import static org.apache.lucene.codecs.block.BlockPostingsReader.DEBUG;import static org.apache.lucene.codecs.block.ForUtil.MAX_DATA_SIZE;import static org.apache.lucene.codecs.block.ForUtil.MAX_ENCODED_SIZE;@@ -211,24 +210,24 @@ final class BlockPostingsWriter extends PostingsWriterBase {}lastDocID = 0;lastBlockDocID = -1;- if (DEBUG) {- System.out.println("FPW.startTerm startFP=" + docTermStartFP);- }+ // if (DEBUG) {+ // System.out.println("FPW.startTerm startFP=" + docTermStartFP);+ // }skipWriter.resetSkip();}@Overridepublic void startDoc(int docID, int termDocFreq) throws IOException {- if (DEBUG) {- System.out.println("FPW.startDoc docID["+docBufferUpto+"]=" + docID);- }+ // if (DEBUG) {+ // System.out.println("FPW.startDoc docID["+docBufferUpto+"]=" + docID);+ // }// Have collected a block of docs, and get a new doc.// Should write skip data as well as postings list for// current block.if (lastBlockDocID != -1 && docBufferUpto == 0) {- if (DEBUG) {- System.out.println(" bufferSkip at writeBlock: lastDocID=" + lastBlockDocID + " docCount=" + (docCount-1));- }+ // if (DEBUG) {+ // System.out.println(" bufferSkip at writeBlock: lastDocID=" + lastBlockDocID + " docCount=" + (docCount-1));+ // }skipWriter.bufferSkip(lastBlockDocID, docCount, lastBlockPosFP, lastBlockPayFP, lastBlockPosBufferUpto, lastBlockStartOffset, lastBlockPayloadByteUpto);}@@ -239,9 +238,9 @@ final class BlockPostingsWriter extends PostingsWriterBase {}docDeltaBuffer[docBufferUpto] = docDelta;-// if (DEBUG) {-// System.out.println(" docDeltaBuffer[" + docBufferUpto + "]=" + docDelta);-// }+ // if (DEBUG) {+ // System.out.println(" docDeltaBuffer[" + docBufferUpto + "]=" + docDelta);+ // }if (fieldHasFreqs) {freqBuffer[docBufferUpto] = termDocFreq;}@@ -249,14 +248,14 @@ final class BlockPostingsWriter extends PostingsWriterBase {docCount++;if (docBufferUpto == BLOCK_SIZE) {- if (DEBUG) {- System.out.println(" write docDelta block @ fp=" + docOut.getFilePointer());- }+ // if (DEBUG) {+ // System.out.println(" write docDelta block @ fp=" + docOut.getFilePointer());+ // }forUtil.writeBlock(docDeltaBuffer, encoded, docOut);if (fieldHasFreqs) {- if (DEBUG) {- System.out.println(" write freq block @ fp=" + docOut.getFilePointer());- }+ // if (DEBUG) {+ // System.out.println(" write freq block @ fp=" + docOut.getFilePointer());+ // }forUtil.writeBlock(freqBuffer, encoded, docOut);}// NOTE: don't set docBufferUpto back to 0 here;@@ -273,9 +272,9 @@ final class BlockPostingsWriter extends PostingsWriterBase {/** Add a new position & payload */@Overridepublic void addPosition(int position, BytesRef payload, int startOffset, int endOffset) throws IOException {-// if (DEBUG) {-// System.out.println("FPW.addPosition pos=" + position + " posBufferUpto=" + posBufferUpto + (fieldHasPayloads ? " payloadByteUpto=" + payloadByteUpto: ""));-// }+ // if (DEBUG) {+ // System.out.println("FPW.addPosition pos=" + position + " posBufferUpto=" + posBufferUpto + (fieldHasPayloads ? " payloadByteUpto=" + payloadByteUpto: ""));+ // }posDeltaBuffer[posBufferUpto] = position - lastPosition;if (fieldHasPayloads) {if (payload == null || payload.length == 0) {@@ -302,9 +301,9 @@ final class BlockPostingsWriter extends PostingsWriterBase {posBufferUpto++;lastPosition = position;if (posBufferUpto == BLOCK_SIZE) {- if (DEBUG) {- System.out.println(" write pos bulk block @ fp=" + posOut.getFilePointer());- }+ // if (DEBUG) {+ // System.out.println(" write pos bulk block @ fp=" + posOut.getFilePointer());+ // }forUtil.writeBlock(posDeltaBuffer, encoded, posOut);if (fieldHasPayloads) {@@ -337,9 +336,9 @@ final class BlockPostingsWriter extends PostingsWriterBase {lastBlockStartOffset = lastStartOffset;lastBlockPayloadByteUpto = payloadByteUpto;}- if (DEBUG) {- System.out.println(" docBufferUpto="+docBufferUpto+" now get lastBlockDocID="+lastBlockDocID+" lastBlockPosFP=" + lastBlockPosFP + " lastBlockPosBufferUpto=" + lastBlockPosBufferUpto + " lastBlockPayloadByteUpto=" + lastBlockPayloadByteUpto);- }+ // if (DEBUG) {+ // System.out.println(" docBufferUpto="+docBufferUpto+" now get lastBlockDocID="+lastBlockDocID+" lastBlockPosFP=" + lastBlockPosFP + " lastBlockPosBufferUpto=" + lastBlockPosBufferUpto + " lastBlockPayloadByteUpto=" + lastBlockPayloadByteUpto);+ // }docBufferUpto = 0;}}@@ -371,15 +370,15 @@ final class BlockPostingsWriter extends PostingsWriterBase {// for this term) in two places?assert stats.docFreq == docCount: stats.docFreq + " vs " + docCount;- if (DEBUG) {- System.out.println("FPW.finishTerm docFreq=" + stats.docFreq);- }+ // if (DEBUG) {+ // System.out.println("FPW.finishTerm docFreq=" + stats.docFreq);+ // }- if (DEBUG) {- if (docBufferUpto > 0) {- System.out.println(" write doc/freq vInt block (count=" + docBufferUpto + ") at fp=" + docOut.getFilePointer() + " docTermStartFP=" + docTermStartFP);- }- }+ // if (DEBUG) {+ // if (docBufferUpto > 0) {+ // System.out.println(" write doc/freq vInt block (count=" + docBufferUpto + ") at fp=" + docOut.getFilePointer() + " docTermStartFP=" + docTermStartFP);+ // }+ // }// vInt encode the remaining doc deltas and freqs:for(int i=0;i<docBufferUpto;i++) {@@ -398,11 +397,11 @@ final class BlockPostingsWriter extends PostingsWriterBase {final int lastPosBlockOffset;if (fieldHasPositions) {- if (DEBUG) {- if (posBufferUpto > 0) {- System.out.println(" write pos vInt block (count=" + posBufferUpto + ") at fp=" + posOut.getFilePointer() + " posTermStartFP=" + posTermStartFP + " hasPayloads=" + fieldHasPayloads + " hasOffsets=" + fieldHasOffsets);- }- }+ // if (DEBUG) {+ // if (posBufferUpto > 0) {+ // System.out.println(" write pos vInt block (count=" + posBufferUpto + ") at fp=" + posOut.getFilePointer() + " posTermStartFP=" + posTermStartFP + " hasPayloads=" + fieldHasPayloads + " hasOffsets=" + fieldHasOffsets);+ // }+ // }assert stats.totalTermFreq != -1;if (stats.totalTermFreq > BLOCK_SIZE) {@@ -433,14 +432,14 @@ final class BlockPostingsWriter extends PostingsWriterBase {posOut.writeVInt(posDelta<<1);}- if (DEBUG) {- System.out.println(" i=" + i + " payloadLen=" + payloadLength);- }+ // if (DEBUG) {+ // System.out.println(" i=" + i + " payloadLen=" + payloadLength);+ // }if (payloadLength != 0) {- if (DEBUG) {- System.out.println(" write payload @ pos.fp=" + posOut.getFilePointer());- }+ // if (DEBUG) {+ // System.out.println(" write payload @ pos.fp=" + posOut.getFilePointer());+ // }posOut.writeBytes(payloadBytes, payloadBytesReadUpto, payloadLength);payloadBytesReadUpto += payloadLength;}@@ -449,9 +448,9 @@ final class BlockPostingsWriter extends PostingsWriterBase {}if (fieldHasOffsets) {- if (DEBUG) {- System.out.println(" write offset @ pos.fp=" + posOut.getFilePointer());- }+ // if (DEBUG) {+ // System.out.println(" write offset @ pos.fp=" + posOut.getFilePointer());+ // }posOut.writeVInt(offsetStartDeltaBuffer[i]);posOut.writeVInt(offsetLengthBuffer[i]);}@@ -462,9 +461,9 @@ final class BlockPostingsWriter extends PostingsWriterBase {payloadByteUpto = 0;}}- if (DEBUG) {- System.out.println(" totalTermFreq=" + stats.totalTermFreq + " lastPosBlockOffset=" + lastPosBlockOffset);- }+ // if (DEBUG) {+ // System.out.println(" totalTermFreq=" + stats.totalTermFreq + " lastPosBlockOffset=" + lastPosBlockOffset);+ // }} else {lastPosBlockOffset = -1;}@@ -473,14 +472,14 @@ final class BlockPostingsWriter extends PostingsWriterBase {if (docCount > BLOCK_SIZE) {skipOffset = (int) (skipWriter.writeSkip(docOut) - docTermStartFP);- if (DEBUG) {- System.out.println("skip packet " + (docOut.getFilePointer() - (docTermStartFP + skipOffset)) + " bytes");- }+ // if (DEBUG) {+ // System.out.println("skip packet " + (docOut.getFilePointer() - (docTermStartFP + skipOffset)) + " bytes");+ // }} else {skipOffset = -1;- if (DEBUG) {- System.out.println(" no skip: docCount=" + docCount);- }+ // if (DEBUG) {+ // System.out.println(" no skip: docCount=" + docCount);+ // }}long payStartFP;@@ -490,9 +489,9 @@ final class BlockPostingsWriter extends PostingsWriterBase {payStartFP = -1;}- if (DEBUG) {- System.out.println(" payStartFP=" + payStartFP);- }+ // if (DEBUG) {+ // System.out.println(" payStartFP=" + payStartFP);+ // }pendingTerms.add(new PendingTerm(docTermStartFP, posTermStartFP, payStartFP, skipOffset, lastPosBlockOffset));docBufferUpto = 0;diff --git a/lucene/core/src/java/org/apache/lucene/codecs/block/BlockSkipReader.java b/lucene/core/src/java/org/apache/lucene/codecs/block/BlockSkipReader.javaindex ac4baa67f38..206ec3d1713 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/block/BlockSkipReader.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/block/BlockSkipReader.java@@ -51,7 +51,7 @@ import org.apache.lucene.store.IndexInput;**/final class BlockSkipReader extends MultiLevelSkipListReader {- private boolean DEBUG = BlockPostingsReader.DEBUG;+ // private boolean DEBUG = BlockPostingsReader.DEBUG;private final int blockSize;private long docPointer[];@@ -158,9 +158,9 @@ final class BlockSkipReader extends MultiLevelSkipListReader {@Overrideprotected void seekChild(int level) throws IOException {super.seekChild(level);- if (DEBUG) {- System.out.println("seekChild level=" + level);- }+ // if (DEBUG) {+ // System.out.println("seekChild level=" + level);+ // }docPointer[level] = lastDocPointer;if (posPointer != null) {posPointer[level] = lastPosPointer;@@ -181,16 +181,16 @@ final class BlockSkipReader extends MultiLevelSkipListReader {protected void setLastSkipData(int level) {super.setLastSkipData(level);lastDocPointer = docPointer[level];- if (DEBUG) {- System.out.println("setLastSkipData level=" + level);- System.out.println(" lastDocPointer=" + lastDocPointer);- }+ // if (DEBUG) {+ // System.out.println("setLastSkipData level=" + level);+ // System.out.println(" lastDocPointer=" + lastDocPointer);+ // }if (posPointer != null) {lastPosPointer = posPointer[level];lastPosBufferUpto = posBufferUpto[level];- if (DEBUG) {- System.out.println(" lastPosPointer=" + lastPosPointer + " lastPosBUfferUpto=" + lastPosBufferUpto);- }+ // if (DEBUG) {+ // System.out.println(" lastPosPointer=" + lastPosPointer + " lastPosBUfferUpto=" + lastPosBufferUpto);+ // }if (payPointer != null) {lastPayPointer = payPointer[level];}@@ -205,27 +205,27 @@ final class BlockSkipReader extends MultiLevelSkipListReader {@Overrideprotected int readSkipData(int level, IndexInput skipStream) throws IOException {- if (DEBUG) {- System.out.println("readSkipData level=" + level);- }+ // if (DEBUG) {+ // System.out.println("readSkipData level=" + level);+ // }int delta = skipStream.readVInt();- if (DEBUG) {- System.out.println(" delta=" + delta);- }+ // if (DEBUG) {+ // System.out.println(" delta=" + delta);+ // }docPointer[level] += skipStream.readVInt();- if (DEBUG) {- System.out.println(" docFP=" + docPointer[level]);- }+ // if (DEBUG) {+ // System.out.println(" docFP=" + docPointer[level]);+ // }if (posPointer != null) {posPointer[level] += skipStream.readVInt();- if (DEBUG) {- System.out.println(" posFP=" + posPointer[level]);- }+ // if (DEBUG) {+ // System.out.println(" posFP=" + posPointer[level]);+ // }posBufferUpto[level] = skipStream.readVInt();- if (DEBUG) {- System.out.println(" posBufferUpto=" + posBufferUpto[level]);- }+ // if (DEBUG) {+ // System.out.println(" posBufferUpto=" + posBufferUpto[level]);+ // }if (payloadByteUpto != null) {payloadByteUpto[level] = skipStream.readVInt();diff --git a/lucene/core/src/java/org/apache/lucene/codecs/block/BlockSkipWriter.java b/lucene/core/src/java/org/apache/lucene/codecs/block/BlockSkipWriter.javaindex a172df4ec3e..8ece562ab5e 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/block/BlockSkipWriter.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/block/BlockSkipWriter.java@@ -44,7 +44,7 @@ import org.apache.lucene.codecs.MultiLevelSkipListWriter;**/final class BlockSkipWriter extends MultiLevelSkipListWriter {- private boolean DEBUG = BlockPostingsReader.DEBUG;+ // private boolean DEBUG = BlockPostingsReader.DEBUG;private int[] lastSkipDoc;private long[] lastSkipDocPointer;@@ -128,9 +128,9 @@ final class BlockSkipWriter extends MultiLevelSkipListWriter {@Overrideprotected void writeSkipData(int level, IndexOutput skipBuffer) throws IOException {int delta = curDoc - lastSkipDoc[level];- if (DEBUG) {- System.out.println("writeSkipData level=" + level + " lastDoc=" + curDoc + " delta=" + delta + " curDocPointer=" + curDocPointer);- }+ // if (DEBUG) {+ // System.out.println("writeSkipData level=" + level + " lastDoc=" + curDoc + " delta=" + delta + " curDocPointer=" + curDocPointer);+ // }skipBuffer.writeVInt(delta);lastSkipDoc[level] = curDoc;@@ -138,9 +138,9 @@ final class BlockSkipWriter extends MultiLevelSkipListWriter {lastSkipDocPointer[level] = curDocPointer;if (fieldHasPositions) {- if (DEBUG) {- System.out.println(" curPosPointer=" + curPosPointer + " curPosBufferUpto=" + curPosBufferUpto);- }+ // if (DEBUG) {+ // System.out.println(" curPosPointer=" + curPosPointer + " curPosBufferUpto=" + curPosBufferUpto);+ // }skipBuffer.writeVInt((int) (curPosPointer - lastSkipPosPointer[level]));lastSkipPosPointer[level] = curPosPointer;skipBuffer.writeVInt(curPosBufferUpto);