gortiz commented on code in PR #15571:
URL: https://github.com/apache/pinot/pull/15571#discussion_r2052078798
##########
pinot-common/src/main/java/org/apache/pinot/common/datablock/DataBlockUtils.java:
##########
@@ -230,6 +230,28 @@ public static ByteString toByteString(DataBlock dataBlock)
return byteString;
}
+ public static List<ByteString> toByteStrings(DataBlock dataBlock, int
maxBlockSize)
+ throws IOException {
+ List<ByteBuffer> bytes = dataBlock.serialize();
+ if (bytes.isEmpty()) {
+ return List.of(ByteString.EMPTY);
+ }
+
+ List<ByteString> byteStrings = new ArrayList<>();
Review Comment:
Nit: it may be worth calculating the initial size of the array list. I think
an upper bound would be to calculate the total byte size (iterating over
`bytes`) divided by maxBlockSize and then add the number of elements in `bytes`
(as in the worst case scenario, we add an extra small ByteString for each page
in `bytes`)
--
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]