lidavidm commented on code in PR #43903:
URL: https://github.com/apache/arrow/pull/43903#discussion_r1741437051


##########
java/performance/src/main/java/org/apache/arrow/memory/AllocatorBenchmarks.java:
##########
@@ -59,7 +59,7 @@ public void defaultAllocatorBenchmark() {
   public void segmentRoundingPolicyBenchmark() {
     final int bufferSize = 1024;

Review Comment:
   I would expect long here?



##########
java/memory/memory-core/src/main/java/org/apache/arrow/memory/rounding/SegmentRoundingPolicy.java:
##########
@@ -47,12 +49,29 @@ public SegmentRoundingPolicy(int segmentSize) {
     this.segmentSize = segmentSize;
   }
 
+  /**
+   * Constructor for the segment rounding policy.
+   *
+   * @param segmentSize the segment size.
+   * @throws IllegalArgumentException if the segment size is smaller than 
{@link
+   *     SegmentRoundingPolicy#MIN_SEGMENT_SIZE}, or is not a power of 2.
+   */
+  public SegmentRoundingPolicy(long segmentSize) {
+    Preconditions.checkArgument(
+        segmentSize >= MIN_SEGMENT_SIZE,
+        "The segment size cannot be smaller than %s",
+        MIN_SEGMENT_SIZE);
+    Preconditions.checkArgument(
+        (segmentSize & (segmentSize - 1)) == 0, "The segment size must be a 
power of 2");
+    this.segmentSize = segmentSize;
+  }
+
   @Override
   public long getRoundedSize(long requestSize) {
     return (requestSize + (segmentSize - 1)) / segmentSize * segmentSize;
   }
 
-  public int getSegmentSize() {
+  public long getSegmentSize() {

Review Comment:
   This is a breaking change, create a new method for the long version



##########
java/memory/memory-netty-buffer-patch/src/main/java/io/netty/buffer/NettyArrowBuf.java:
##########
@@ -47,7 +47,9 @@ public class NettyArrowBuf extends AbstractByteBuf implements 
AutoCloseable {
    * @param arrowBuf The buffer to wrap.
    * @param bufferAllocator The allocator for the buffer.
    * @param length The length of this buffer.
+   * @deprecated Use {@link #NettyArrowBuf(ArrowBuf, BufferAllocator, long)} 
instead.
    */
+  @Deprecated
   public NettyArrowBuf(

Review Comment:
   delegate the constructor



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

Reply via email to