From 78d6a3402c43aa5bbdbcf66ab8dd097af3e391d9 Mon Sep 17 00:00:00 2001 From: stack Date: Tue, 10 Mar 2015 08:42:32 -0700 Subject: [PATCH] HBASE-13188 java.lang.ArithmeticException issue in BoundedByteBufferPool.putBuffer --- .../org/apache/hadoop/hbase/io/BoundedByteBufferPool.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/BoundedByteBufferPool.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/BoundedByteBufferPool.java index 10b9bf6ead7..bff0c7734c5 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/BoundedByteBufferPool.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/BoundedByteBufferPool.java @@ -101,7 +101,10 @@ public class BoundedByteBufferPool { } else { int size = this.buffers.size(); // This size may be inexact. this.totalReservoirCapacity += bb.capacity(); - int average = this.totalReservoirCapacity / size; + int average = 0; + if (size != 0) { + average = this.totalReservoirCapacity / size; + } if (average > this.runningAverage && average < this.maxByteBufferSizeToCache) { this.runningAverage = average; }