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

      public SegmentRoundingPolicy(int 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

      public int getSegmentSize()