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 <zhangduo@apache.org>
(cherry picked from commit 5a0c4de)
  • Loading branch information
teamconfx authored and Apache9 committed Mar 28, 2024
1 parent c2f8047 commit 9e1c1cb
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ 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");
this.algorithm = conf.get(FILE_VERIFY_ALGORITHM, DEFAULT_FILE_VERIFY_ALGORITHM);
this.ioEngine = getIOEngineFromName(ioEngineName, capacity, persistencePath);
this.writerThreads = new WriterThread[writerThreadNum];
Expand Down

0 comments on commit 9e1c1cb

Please sign in to comment.