HBASE-13188 java.lang.ArithmeticException issue in BoundedByteBufferPool.putBuffer
This commit is contained in:
parent
eb2193afa0
commit
78d6a3402c
|
@ -101,7 +101,10 @@ public class BoundedByteBufferPool {
|
||||||
} else {
|
} else {
|
||||||
int size = this.buffers.size(); // This size may be inexact.
|
int size = this.buffers.size(); // This size may be inexact.
|
||||||
this.totalReservoirCapacity += bb.capacity();
|
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) {
|
if (average > this.runningAverage && average < this.maxByteBufferSizeToCache) {
|
||||||
this.runningAverage = average;
|
this.runningAverage = average;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue