adoroszlai commented on code in PR #5542:
URL: https://github.com/apache/ozone/pull/5542#discussion_r1382374594


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/helpers/ChunkUtils.java:
##########
@@ -180,6 +183,15 @@ private static long writeDataToChannel(FileChannel 
channel, ChunkBuffer data,
     }
   }
 
+  public static ChunkBuffer readData(long len, int bufferCapacity,
+      CheckedConsumer<ByteBuffer[], StorageContainerException> readMethod)
+      throws StorageContainerException {
+    final ByteBuffer[] buffers = BufferUtils.assignByteBuffers(len,
+        bufferCapacity);
+    readMethod.accept(buffers);
+    return ChunkBuffer.wrap(Lists.newArrayList(buffers));

Review Comment:
   `ChunkBuffer` doesn't change the list's size, and it creates a defensive 
copy anyway.  So I think we could use `Arrays.asList()` 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