Skip to content

Commit

Permalink
HBASE-27990 BucketCache causes ArithmeticException due to improper bl…
Browse files Browse the repository at this point in the history
…ockSize value checking (#5389)

Signed-off-by: Duo Zhang <[email protected]>
  • Loading branch information
teamconfx authored Mar 28, 2024
1 parent 298c550 commit 5a0c4de
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ public BucketCache(String ioEngineName, long capacity, int blockSize, int[] buck
public BucketCache(String ioEngineName, long capacity, int blockSize, int[] bucketSizes,
int writerThreadNum, int writerQLen, String persistencePath, int ioErrorsTolerationDuration,
Configuration conf) throws IOException {
Preconditions.checkArgument(blockSize > 0, "BucketCache capacity is set to " + blockSize + ", can not be less than 0");
boolean useStrongRef = conf.getBoolean(STRONG_REF_KEY, STRONG_REF_DEFAULT);
if (useStrongRef) {
this.offsetLock = new IdReadWriteLockStrongRef<>();
Expand Down

0 comments on commit 5a0c4de

Please sign in to comment.