klsince commented on code in PR #15068:
URL: https://github.com/apache/pinot/pull/15068#discussion_r1956750676


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/io/util/FixedBitIntReaderWriterV2.java:
##########
@@ -25,11 +25,13 @@
 
 
 public final class FixedBitIntReaderWriterV2 implements Closeable {
-  private PinotDataBitSetV2 _dataBitSet;
+  private final PinotDataBitSetV2 _dataBitSet;
 
   public FixedBitIntReaderWriterV2(PinotDataBuffer dataBuffer, int numValues, 
int numBitsPerValue) {
-    Preconditions
-        .checkState(dataBuffer.size() == (int) (((long) numValues * 
numBitsPerValue + Byte.SIZE - 1) / Byte.SIZE));
+    long actualBufferSize = dataBuffer.size();
+    long expectedBufferSize = ((long) numValues * numBitsPerValue + Byte.SIZE 
- 1) / Byte.SIZE;
+    Preconditions.checkState(actualBufferSize == expectedBufferSize, "Buffer 
size mismatch: actual: %s, expected: %s",
+        actualBufferSize, expectedBufferSize);

Review Comment:
   no need to check this `actualBufferSize <= Integer.MAX_VALUE` here? 



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to