Jackie-Jiang commented on a change in pull request #4432: #4401 Reuse a
ThreadLocal byte[] when reading String elements from the variable length value
reader.
URL: https://github.com/apache/incubator-pinot/pull/4432#discussion_r303180537
##########
File path:
pinot-core/src/main/java/org/apache/pinot/core/io/util/VarLengthBytesValueReaderWriter.java
##########
@@ -146,6 +152,22 @@ public static boolean
isVarLengthBytesDictBuffer(PinotDataBuffer buffer) {
return false;
}
+ /**
+ * Returns the power of 2 >= n.
+ */
+ private static int nextPowerOf2(int n) {
Review comment:
Faster way:
```
n -= 1;
n |= n >>> 1;
n |= n >>> 2;
n |= n >>> 4;
n |= n >>> 8;
n |= n >>> 16;
return n + 1;
```
----------------------------------------------------------------
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]