Skip to content

Commit

Permalink
feat: adding long usage for SegmentRoundingPolicy
Browse files Browse the repository at this point in the history
  • Loading branch information
vibhatha committed Sep 1, 2024
1 parent aba751c commit 1d9e25f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class SegmentRoundingPolicy implements RoundingPolicy {
* The segment size. It must be at least {@link SegmentRoundingPolicy#MIN_SEGMENT_SIZE}, and be a
* power of 2.
*/
private int segmentSize;
private long segmentSize;

/**
* Constructor for the segment rounding policy.
Expand All @@ -37,7 +37,7 @@ public class SegmentRoundingPolicy implements RoundingPolicy {
* @throws IllegalArgumentException if the segment size is smaller than {@link
* SegmentRoundingPolicy#MIN_SEGMENT_SIZE}, or is not a power of 2.
*/
public SegmentRoundingPolicy(int segmentSize) {
public SegmentRoundingPolicy(long segmentSize) {
Preconditions.checkArgument(
segmentSize >= MIN_SEGMENT_SIZE,
"The segment size cannot be smaller than %s",
Expand All @@ -52,7 +52,7 @@ public long getRoundedSize(long requestSize) {
return (requestSize + (segmentSize - 1)) / segmentSize * segmentSize;
}

public int getSegmentSize() {
public long getSegmentSize() {
return segmentSize;
}
}

0 comments on commit 1d9e25f

Please sign in to comment.