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

2020-01-02 Thread GitBox
mikemccand commented on a change in pull request #1126: LUCENE-4702: Terms 
dictionary compression.
URL: https://github.com/apache/lucene-solr/pull/1126#discussion_r362543015
 
 

 ##
 File path: lucene/core/src/java/org/apache/lucene/codecs/blocktree/Stats.java
 ##
 @@ -75,6 +75,17 @@
   /** Total number of bytes used to store term suffixes. */
   public long totalBlockSuffixBytes;
 
+  /**
+   * Number of times each compression method has been used.
+   * 0 = uncompressed
+   * 1 = lowercase_ascii
+   * 2 = LZ4
+   */
+  public final long[] compressionAlgorithms = new long[3];
 
 Review comment:
   Cool that you track this in BlockTree stats!  Did you post the stats 
somewhere?  Edit: ahh, I see the [cool stats 
here](https://issues.apache.org/jira/browse/LUCENE-4702?focusedCommentId=17003640=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17003640),
 thanks. 


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


With regards,
Apache Git Services

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



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

2020-01-02 Thread GitBox
mikemccand commented on a change in pull request #1126: LUCENE-4702: Terms 
dictionary compression.
URL: https://github.com/apache/lucene-solr/pull/1126#discussion_r362545794
 
 

 ##
 File path: lucene/core/src/java/org/apache/lucene/util/compress/LZ4.java
 ##
 @@ -0,0 +1,397 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.util.compress;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Objects;
+
+import org.apache.lucene.store.DataInput;
+import org.apache.lucene.store.DataOutput;
+import org.apache.lucene.util.packed.PackedInts;
+
+/**
+ * LZ4 compression and decompression routines.
+ *
+ * http://code.google.com/p/lz4/
+ * http://fastcompression.blogspot.fr/p/lz4.html
 
 Review comment:
   Are these also Apache 2.0 licensed?


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


With regards,
Apache Git Services

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



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

2020-01-02 Thread GitBox
mikemccand commented on a change in pull request #1126: LUCENE-4702: Terms 
dictionary compression.
URL: https://github.com/apache/lucene-solr/pull/1126#discussion_r362542300
 
 

 ##
 File path: 
lucene/core/src/java/org/apache/lucene/codecs/blocktree/CompressionAlgorithm.java
 ##
 @@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.codecs.blocktree;
+
+import java.io.IOException;
+
+import org.apache.lucene.store.DataInput;
+import org.apache.lucene.util.compress.LowercaseAsciiCompression;
+
+/**
+ * Compression algorithm used for suffixes of a block of terms.
+ */
+enum CompressionAlgorithm {
+
+  NO_COMPRESSION(0x00) {
+
+@Override
+void read(DataInput in, byte[] out, int len) throws IOException {
+  in.readBytes(out, 0, len);
+}
+
+@Override
+public String toString() {
+  return "no_compression";
+}
+  },
+
+  LOWERCASE_ASCII(0x01) {
+
+@Override
+void read(DataInput in, byte[] out, int len) throws IOException {
+  LowercaseAsciiCompression.decompress(in, out, len);
+}
+
+@Override
+public String toString() {
+  return "lowercase_ascii";
+}
+  },
+
+  LZ4(0x02) {
+
+@Override
+void read(DataInput in, byte[] out, int len) throws IOException {
+  org.apache.lucene.util.compress.LZ4.decompress(in, len, out, 0);
+}
+
+@Override
+public String toString() {
+  return "lz4";
+}
+  };
+
+  private static final CompressionAlgorithm[] BY_CODE = new 
CompressionAlgorithm[3];
 
 Review comment:
   +1 for the explicit codes too.  Relying on enum ordinals is dangerously 
fragile ...


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


With regards,
Apache Git Services

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