jpountz commented on a change in pull request #1126: LUCENE-4702: Terms
dictionary compression.
URL: https://github.com/apache/lucene-solr/pull/1126#discussion_r362461295
##########
File path:
lucene/core/src/java/org/apache/lucene/codecs/blocktree/SegmentTermsEnumFrame.java
##########
@@ -163,15 +179,48 @@ void loadBlock() throws IOException {
// instead of linear scan to find target term; eg
// we could have simple array of offsets
+ final long startSuffixFP = ste.in.getFilePointer();
// term suffixes:
- code = ste.in.readVInt();
- isLeafBlock = (code & 1) != 0;
- int numBytes = code >>> 1;
- if (suffixBytes.length < numBytes) {
- suffixBytes = new byte[ArrayUtil.oversize(numBytes, 1)];
+ if (version >= BlockTreeTermsReader.VERSION_COMPRESSED_SUFFIXES) {
+ final long codeL = ste.in.readVLong();
+ isLeafBlock = (codeL & 0x04) != 0;
+ final int numSuffixBytes = (int) (codeL >>> 3);
+ if (suffixBytes.length < numSuffixBytes) {
+ suffixBytes = new byte[ArrayUtil.oversize(numSuffixBytes, 1)];
+ }
+ compressionAlg = (int) codeL & 0x03;
Review comment:
I pushed a change that introduces an enum, does it look better?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]