cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject git commit: add null check to StreamingHistogram.sum
Date Tue, 13 Mar 2012 20:36:54 GMT
Updated Branches:
  refs/heads/trunk 79cabc3fa -> d8742aa46


add null check to StreamingHistogram.sum


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

Branch: refs/heads/trunk
Commit: d8742aa46242c128b73d82f397e303f5a79692ac
Parents: 79cabc3
Author: Brandon Williams <brandonwilliams@apache.org>
Authored: Tue Mar 13 15:36:38 2012 -0500
Committer: Brandon Williams <brandonwilliams@apache.org>
Committed: Tue Mar 13 15:36:38 2012 -0500

----------------------------------------------------------------------
 .../apache/cassandra/utils/StreamingHistogram.java |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/d8742aa4/src/java/org/apache/cassandra/utils/StreamingHistogram.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/StreamingHistogram.java b/src/java/org/apache/cassandra/utils/StreamingHistogram.java
index a95c259..38b9add 100644
--- a/src/java/org/apache/cassandra/utils/StreamingHistogram.java
+++ b/src/java/org/apache/cassandra/utils/StreamingHistogram.java
@@ -147,6 +147,8 @@ public class StreamingHistogram
         else
         {
             Map.Entry<Double, Long> pi = bin.floorEntry(b);
+            if (pi == null)
+                return 0;
             // calculate estimated count mb for point b
             double weight = (b - pi.getKey()) / (pnext.getKey() - pi.getKey());
             double mb = pi.getValue() + (pnext.getValue() - pi.getValue()) * weight;


Mime
View raw message