mirror of https://github.com/apache/lucene.git
LUCENE-6192: don't overflow int when writing skip data for high freq terms in extremely large indices
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1653588 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ab8d012df6
commit
aebec2a0f8
|
@ -179,10 +179,10 @@ final class Lucene50SkipReader extends MultiLevelSkipListReader {
|
|||
@Override
|
||||
protected int readSkipData(int level, IndexInput skipStream) throws IOException {
|
||||
int delta = skipStream.readVInt();
|
||||
docPointer[level] += skipStream.readVInt();
|
||||
docPointer[level] += skipStream.readVLong();
|
||||
|
||||
if (posPointer != null) {
|
||||
posPointer[level] += skipStream.readVInt();
|
||||
posPointer[level] += skipStream.readVLong();
|
||||
posBufferUpto[level] = skipStream.readVInt();
|
||||
|
||||
if (payloadByteUpto != null) {
|
||||
|
@ -190,7 +190,7 @@ final class Lucene50SkipReader extends MultiLevelSkipListReader {
|
|||
}
|
||||
|
||||
if (payPointer != null) {
|
||||
payPointer[level] += skipStream.readVInt();
|
||||
payPointer[level] += skipStream.readVLong();
|
||||
}
|
||||
}
|
||||
return delta;
|
||||
|
|
|
@ -147,12 +147,12 @@ final class Lucene50SkipWriter extends MultiLevelSkipListWriter {
|
|||
skipBuffer.writeVInt(delta);
|
||||
lastSkipDoc[level] = curDoc;
|
||||
|
||||
skipBuffer.writeVInt((int) (curDocPointer - lastSkipDocPointer[level]));
|
||||
skipBuffer.writeVLong(curDocPointer - lastSkipDocPointer[level]);
|
||||
lastSkipDocPointer[level] = curDocPointer;
|
||||
|
||||
if (fieldHasPositions) {
|
||||
|
||||
skipBuffer.writeVInt((int) (curPosPointer - lastSkipPosPointer[level]));
|
||||
skipBuffer.writeVLong(curPosPointer - lastSkipPosPointer[level]);
|
||||
lastSkipPosPointer[level] = curPosPointer;
|
||||
skipBuffer.writeVInt(curPosBufferUpto);
|
||||
|
||||
|
@ -161,7 +161,7 @@ final class Lucene50SkipWriter extends MultiLevelSkipListWriter {
|
|||
}
|
||||
|
||||
if (fieldHasOffsets || fieldHasPayloads) {
|
||||
skipBuffer.writeVInt((int) (curPayPointer - lastSkipPayPointer[level]));
|
||||
skipBuffer.writeVLong(curPayPointer - lastSkipPayPointer[level]);
|
||||
lastSkipPayPointer[level] = curPayPointer;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue