Package org.apache.arrow.memory.rounding
Class SegmentRoundingPolicy
java.lang.Object
org.apache.arrow.memory.rounding.SegmentRoundingPolicy
- All Implemented Interfaces:
RoundingPolicy
The rounding policy that each buffer size must a multiple of the segment size.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSegmentRoundingPolicy
(int segmentSize) Constructor for the segment rounding policy. -
Method Summary
-
Field Details
-
MIN_SEGMENT_SIZE
public static final long MIN_SEGMENT_SIZEThe 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 thanMIN_SEGMENT_SIZE
, or is not a power of 2.
-
-
Method Details
-
getRoundedSize
public long getRoundedSize(long requestSize) - Specified by:
getRoundedSize
in interfaceRoundingPolicy
-
getSegmentSize
public int getSegmentSize()
-