You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by jp...@apache.org on 2026/08/23 19:13:13 UTC
(lucene) branch branch_10x updated: Fix stale block size comments in Lucene104 postings reader/writer (#16491)
This is an automated email from the ASF dual-hosted git repository.
jpountz pushed a commit to branch branch_10x
in repository https://gitbox.apache.org/repos/asf/lucene.git
The following commit(s) were added to refs/heads/branch_10x by this push:
new f10ca5c2c8f Fix stale block size comments in Lucene104 postings reader/writer (#16491)
f10ca5c2c8f is described below
commit f10ca5c2c8f0b4e47afcc7ee47dccdc468ce5f86
Author: vukasin-djuricic <14...@users.noreply.github.com>
AuthorDate: Sun Aug 23 21:12:32 2026 +0200
Fix stale block size comments in Lucene104 postings reader/writer (#16491)
---
.../org/apache/lucene/codecs/lucene104/Lucene104PostingsReader.java | 2 +-
.../org/apache/lucene/codecs/lucene104/Lucene104PostingsWriter.java | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene104/Lucene104PostingsReader.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene104/Lucene104PostingsReader.java
index 8cb2c6d8a77..409243c28bb 100644
--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene104/Lucene104PostingsReader.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene104/Lucene104PostingsReader.java
@@ -604,7 +604,7 @@ public final class Lucene104PostingsReader extends PostingsReaderBase {
int numLongs;
if (bitsPerValue == 0) {
// 0 is used to record that all 256 docs in the block are consecutive
- numLongs = BLOCK_SIZE / Long.SIZE; // 2
+ numLongs = BLOCK_SIZE / Long.SIZE; // 4
docBitSet.set(0, BLOCK_SIZE);
} else {
numLongs = -bitsPerValue;
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene104/Lucene104PostingsWriter.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene104/Lucene104PostingsWriter.java
index 3df59c93bda..78a51f72c8c 100644
--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene104/Lucene104PostingsWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene104/Lucene104PostingsWriter.java
@@ -454,7 +454,7 @@ public class Lucene104PostingsWriter extends PushPostingsWriterBase {
spareBitSet.set(s);
}
// We never use the bit set encoding when it requires more than Integer.SIZE=32 bits per
- // value. So the bit set cannot have more than BLOCK_SIZE * Integer.SIZE / Long.SIZE = 64
+ // value. So the bit set cannot have more than BLOCK_SIZE * Integer.SIZE / Long.SIZE = 128
// longs, which fits on a byte.
assert numBitSetLongs <= BLOCK_SIZE / 2;
level0Output.writeByte((byte) -numBitSetLongs);
@@ -486,7 +486,7 @@ public class Lucene104PostingsWriter extends PushPostingsWriterBase {
level0FreqNormAccumulator.clear();
}
- if ((docCount & LEVEL1_MASK) == 0) { // true every 32 blocks (4,096 docs)
+ if ((docCount & LEVEL1_MASK) == 0) { // true every 32 blocks (8,192 docs)
writeLevel1SkipData();
level1LastDocID = docID;
level1CompetitiveFreqNormAccumulator.clear();