HBASE-13188 java.lang.ArithmeticException issue in BoundedByteBufferPool.putBuffer

This commit is contained in:
stack 2015-03-10 08:42:32 -07:00
parent cbf03787ea
commit 29104da013
1 changed files with 4 additions and 1 deletions

View File

@ -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;
}