Class SegmentRoundingPolicy

java.lang.Object
org.apache.arrow.memory.rounding.SegmentRoundingPolicy
All Implemented Interfaces:
RoundingPolicy

public class SegmentRoundingPolicy extends Object implements RoundingPolicy
The rounding policy that each buffer size must a multiple of the segment size.
  • Field Details

    • MIN_SEGMENT_SIZE

      public static final long MIN_SEGMENT_SIZE
      The minimal segment size.
      See Also:
  • Constructor Details

    • SegmentRoundingPolicy

      @Deprecated(forRemoval=true) @InlineMe(replacement="this((long) segmentSize)") public SegmentRoundingPolicy(int segmentSize)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructor for the segment rounding policy.
      Parameters:
      segmentSize - the segment size.
      Throws:
      IllegalArgumentException - if the segment size is smaller than MIN_SEGMENT_SIZE, or is not a power of 2.
    • SegmentRoundingPolicy

      public SegmentRoundingPolicy(long segmentSize)
      Constructor for the segment rounding policy.
      Parameters:
      segmentSize - the segment size.
      Throws:
      IllegalArgumentException - if the segment size is smaller than MIN_SEGMENT_SIZE, or is not a power of 2.
  • Method Details

    • getRoundedSize

      public long getRoundedSize(long requestSize)
      Specified by:
      getRoundedSize in interface RoundingPolicy
    • getSegmentSize

      @Deprecated(forRemoval=true) public int getSegmentSize()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getSegmentSizeAsLong

      public long getSegmentSizeAsLong()