You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2019/12/27 09:49:47 UTC

[GitHub] [lucene-solr] dweiss commented on a change in pull request #1126: LUCENE-4702: Terms dictionary compression.

dweiss commented on a change in pull request #1126: LUCENE-4702: Terms dictionary compression.
URL: https://github.com/apache/lucene-solr/pull/1126#discussion_r361624773
 
 

 ##########
 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:
   An enum with final code field for clarity in this and other places, maybe? Should be effectively the same at runtime.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org