hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ecl...@apache.org
Subject [20/50] [abbrv] hbase git commit: HBASE-15683 Min latency in latency histograms are emitted as Long.MAX_VALUE
Date Mon, 25 Apr 2016 21:13:04 GMT
HBASE-15683 Min latency in latency histograms are emitted as Long.MAX_VALUE


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

Branch: refs/heads/HBASE-14850
Commit: 9ba9cdeb4718daf6c3d1010ae60d58cb12a5a18b
Parents: ef47e1b
Author: Enis Soztutar <enis@apache.org>
Authored: Thu Apr 21 10:44:03 2016 -0700
Committer: Enis Soztutar <enis@apache.org>
Committed: Thu Apr 21 10:44:03 2016 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/util/FastLongHistogram.java     | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/9ba9cdeb/hbase-common/src/main/java/org/apache/hadoop/hbase/util/FastLongHistogram.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/FastLongHistogram.java
b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/FastLongHistogram.java
index 9b403d9..3c4eccc 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/FastLongHistogram.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/FastLongHistogram.java
@@ -58,7 +58,7 @@ public class FastLongHistogram {
     // set to true when any of data has been inserted to the Bins. It is set after the counts
are
     // updated.
     private final AtomicBoolean hasData = new AtomicBoolean(false);
-    
+
     /**
      * The constructor for creating a Bins without any prior data.
      */
@@ -134,7 +134,7 @@ public class FastLongHistogram {
       // hasData needs to be updated as last
       this.hasData.set(true);
     }
-    
+
     /**
      * Computes the quantiles give the ratios.
      */
@@ -157,7 +157,7 @@ public class FastLongHistogram {
       int rIndex = 0;
       double qCount = total * quantiles[0];
       long cum = 0L;
-      
+
       long[] res = new long[quantiles.length];
       countsLoop: for (int i = 0; i < counts.length; i++) {
         // mn and mx define a value range
@@ -281,7 +281,8 @@ public class FastLongHistogram {
   }
 
   public long getMin() {
-    return this.bins.min.get();
+    long min = this.bins.min.get();
+    return min == Long.MAX_VALUE ? 0 : min; // in case it is not initialized
   }
 
   public long getMax() {


Mime
View raw message