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
|
@Override
|
||||||
protected int readSkipData(int level, IndexInput skipStream) throws IOException {
|
protected int readSkipData(int level, IndexInput skipStream) throws IOException {
|
||||||
int delta = skipStream.readVInt();
|
int delta = skipStream.readVInt();
|
||||||
docPointer[level] += skipStream.readVInt();
|
docPointer[level] += skipStream.readVLong();
|
||||||
|
|
||||||
if (posPointer != null) {
|
if (posPointer != null) {
|
||||||
posPointer[level] += skipStream.readVInt();
|
posPointer[level] += skipStream.readVLong();
|
||||||
posBufferUpto[level] = skipStream.readVInt();
|
posBufferUpto[level] = skipStream.readVInt();
|
||||||
|
|
||||||
if (payloadByteUpto != null) {
|
if (payloadByteUpto != null) {
|
||||||
|
@ -190,7 +190,7 @@ final class Lucene50SkipReader extends MultiLevelSkipListReader {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (payPointer != null) {
|
if (payPointer != null) {
|
||||||
payPointer[level] += skipStream.readVInt();
|
payPointer[level] += skipStream.readVLong();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return delta;
|
return delta;
|
||||||
|
|
|
@ -147,12 +147,12 @@ final class Lucene50SkipWriter extends MultiLevelSkipListWriter {
|
||||||
skipBuffer.writeVInt(delta);
|
skipBuffer.writeVInt(delta);
|
||||||
lastSkipDoc[level] = curDoc;
|
lastSkipDoc[level] = curDoc;
|
||||||
|
|
||||||
skipBuffer.writeVInt((int) (curDocPointer - lastSkipDocPointer[level]));
|
skipBuffer.writeVLong(curDocPointer - lastSkipDocPointer[level]);
|
||||||
lastSkipDocPointer[level] = curDocPointer;
|
lastSkipDocPointer[level] = curDocPointer;
|
||||||
|
|
||||||
if (fieldHasPositions) {
|
if (fieldHasPositions) {
|
||||||
|
|
||||||
skipBuffer.writeVInt((int) (curPosPointer - lastSkipPosPointer[level]));
|
skipBuffer.writeVLong(curPosPointer - lastSkipPosPointer[level]);
|
||||||
lastSkipPosPointer[level] = curPosPointer;
|
lastSkipPosPointer[level] = curPosPointer;
|
||||||
skipBuffer.writeVInt(curPosBufferUpto);
|
skipBuffer.writeVInt(curPosBufferUpto);
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ final class Lucene50SkipWriter extends MultiLevelSkipListWriter {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fieldHasOffsets || fieldHasPayloads) {
|
if (fieldHasOffsets || fieldHasPayloads) {
|
||||||
skipBuffer.writeVInt((int) (curPayPointer - lastSkipPayPointer[level]));
|
skipBuffer.writeVLong(curPayPointer - lastSkipPayPointer[level]);
|
||||||
lastSkipPayPointer[level] = curPayPointer;
|
lastSkipPayPointer[level] = curPayPointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue