This is an automated email from the ASF dual-hosted git repository.

jackie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 4a540ed  Add link to the ZeroInWord algorithm. (#7764)
4a540ed is described below

commit 4a540edbb1034f5994fef6cadff429a789527fc2
Author: Mayank Shrivastava <[email protected]>
AuthorDate: Fri Nov 12 17:31:38 2021 -0800

    Add link to the ZeroInWord algorithm. (#7764)
    
    Added link to the ZeroInWord Algorithm used in 
`FixedByteValueReaderWriter.getUnpaddedString()`.
---
 .../apache/pinot/segment/local/io/util/FixedByteValueReaderWriter.java   | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/io/util/FixedByteValueReaderWriter.java
 
b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/io/util/FixedByteValueReaderWriter.java
index 620b671..6e8dfa6 100644
--- 
a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/io/util/FixedByteValueReaderWriter.java
+++ 
b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/io/util/FixedByteValueReaderWriter.java
@@ -55,6 +55,7 @@ public final class FixedByteValueReaderWriter implements 
ValueReader {
 
   @Override
   public String getUnpaddedString(int index, int numBytesPerValue, byte 
paddingByte, byte[] buffer) {
+    // Based on the ZeroInWord algorithm: 
http://graphics.stanford.edu/~seander/bithacks.html#ZeroInWord
     assert buffer.length >= numBytesPerValue;
     long startOffset = (long) index * numBytesPerValue;
     long pattern = (paddingByte & 0xFFL) * 0x101010101010101L;

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to