Skip to content

Commit

Permalink
maybe fixed eof bug
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Alfonsi <[email protected]>
  • Loading branch information
Peter Alfonsi committed Dec 12, 2024
1 parent 5999e92 commit 5da2a70
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -892,8 +892,8 @@ private void serializeDocIdSet(DocIdSet set, BytesStreamOutput os) {
nextDoc = iterator.nextDoc();
os.writeVInt(nextDoc);
}
os.writeVInt(NO_MORE_DOCS);
os.writeVInt(0); // Spare value for deserializer to read, to spare us from checking if nextDoc == NO_MORE_DOCS on every read
//os.writeVInt(NO_MORE_DOCS);
//os.writeVInt(0); // Spare value for deserializer to read, to spare us from checking if nextDoc == NO_MORE_DOCS on every read
} catch (IOException e) {
throw new OpenSearchException("Error iterating through DocSetIdIterator", e);
}
Expand All @@ -914,7 +914,7 @@ private DocIdSet deserializeDocIdSet(BytesStreamInput is, int maxDoc) {
int bitSetLength = 0;
while (nextDoc != NO_MORE_DOCS) {
bitset.set(nextDoc);
nextDoc = is.readVInt();
nextDoc = is.readVInt(); // TODO: Was getting EOF here.
bitSetLength++;
}
return new BitDocIdSet(bitset, bitSetLength); // TODO: I *think* bitSetLength is the correct value for cost.
Expand Down

0 comments on commit 5da2a70

Please sign in to comment.