jaisonbi commented on a change in pull request #2213:
URL: https://github.com/apache/lucene-solr/pull/2213#discussion_r563698470



##########
File path: 
lucene/core/src/java/org/apache/lucene/codecs/lucene80/Lucene80DocValuesConsumer.java
##########
@@ -731,7 +731,22 @@ private void doAddSortedField(FieldInfo field, 
DocValuesProducer valuesProducer)
       meta.writeLong(data.getFilePointer() - start); // ordsLength
     }
 
-    addTermsDict(DocValues.singleton(valuesProducer.getSorted(field)));
+    int valuesCount = values.getValueCount();
+    switch (mode) {

Review comment:
       yes, should use "if" instead of "switch", thanks:)

##########
File path: 
lucene/core/src/java/org/apache/lucene/codecs/lucene80/Lucene80DocValuesProducer.java
##########
@@ -370,6 +378,11 @@ public void close() throws IOException {
     long termsIndexLength;
     long termsIndexAddressesOffset;
     long termsIndexAddressesLength;
+
+    boolean compressed;
+    // Reserved for support other compressors.
+    int compressorCode;

Review comment:
       will remove this..just thought we could support more types of 
compression algorithms here...

##########
File path: 
lucene/core/src/java/org/apache/lucene/codecs/lucene80/Lucene80DocValuesProducer.java
##########
@@ -1144,6 +1157,7 @@ public TermsEnum termsEnum() throws IOException {
   }
 
   private static class TermsDict extends BaseTermsEnum {
+    static final int PADDING_LENGTH = 7;

Review comment:
       Just refer from CompressionMode$LZ4_DECOMPRESSOR...it said add 7 padding 
bytes can help decompression run faster...

##########
File path: 
lucene/core/src/java/org/apache/lucene/codecs/lucene80/Lucene80DocValuesConsumer.java
##########
@@ -791,6 +806,107 @@ private void addTermsDict(SortedSetDocValues values) 
throws IOException {
     writeTermsIndex(values);
   }
 
+  private void addCompressedTermsDict(SortedSetDocValues values) throws 
IOException {

Review comment:
       I will try to optimize this method...thanks for the comment.




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



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

Reply via email to