hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject hbase git commit: HBASE-13188 java.lang.ArithmeticException issue in BoundedByteBufferPool.putBuffer
Date Tue, 10 Mar 2015 15:42:56 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 eb2193afa -> 78d6a3402


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


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/78d6a340
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/78d6a340
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/78d6a340

Branch: refs/heads/branch-1
Commit: 78d6a3402c43aa5bbdbcf66ab8dd097af3e391d9
Parents: eb2193a
Author: stack <stack@apache.org>
Authored: Tue Mar 10 08:42:32 2015 -0700
Committer: stack <stack@apache.org>
Committed: Tue Mar 10 08:42:59 2015 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/io/BoundedByteBufferPool.java  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/78d6a340/hbase-common/src/main/java/org/apache/hadoop/hbase/io/BoundedByteBufferPool.java
----------------------------------------------------------------------
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 10b9bf6..bff0c77 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;
       }


Mime
View raw message