HBASE-13188 java.lang.ArithmeticException issue in BoundedByteBufferPool.putBuffer
This commit is contained in:
parent
cbf03787ea
commit
29104da013
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue