accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [4/7] accumulo git commit: ACCUMULO-4633: Added check to prevent division by zero
Date Wed, 03 May 2017 20:38:59 GMT
ACCUMULO-4633: Added check to prevent division by zero


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

Branch: refs/heads/1.8
Commit: 771475ad5c7f76c01dff9bdea78c1931688433d1
Parents: b4ed938
Author: Mike Miller <mmiller@apache.org>
Authored: Wed May 3 15:08:37 2017 -0400
Committer: Mike Miller <mmiller@apache.org>
Committed: Wed May 3 15:42:20 2017 -0400

----------------------------------------------------------------------
 .../accumulo/core/client/impl/TabletServerBatchWriter.java   | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/771475ad/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
index f951bfb..a0ffd0f 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
@@ -415,10 +415,10 @@ public class TabletServerBatchWriter {
       log.trace(String.format("Total bin time       : %,10.2f secs %6.2f%s", totalBinTime.get()
/ 1000.0,
           100.0 * totalBinTime.get() / (finishTime - startTime), "%"));
       log.trace(String.format("Average bin rate     : %,10.2f mutations/sec", totalBinned.get()
/ (totalBinTime.get() / 1000.0)));
-      log.trace(String.format("tservers per batch   : %,8.2f avg  %,6d min %,6d max", (float)
(tabletServersBatchSum.get() / numBatches.get()),
-          minTabletServersBatch.get(), maxTabletServersBatch.get()));
-      log.trace(String.format("tablets per batch    : %,8.2f avg  %,6d min %,6d max", (float)
(tabletBatchSum.get() / numBatches.get()), minTabletBatch.get(),
-          maxTabletBatch.get()));
+      log.trace(String.format("tservers per batch   : %,8.2f avg  %,6d min %,6d max",
+          (float) (numBatches.get() != 0 ? (tabletServersBatchSum.get() / numBatches.get())
: 0), minTabletServersBatch.get(), maxTabletServersBatch.get()));
+      log.trace(String.format("tablets per batch    : %,8.2f avg  %,6d min %,6d max",
+          (float) (numBatches.get() != 0 ? (tabletBatchSum.get() / numBatches.get()) : 0),
minTabletBatch.get(), maxTabletBatch.get()));
       log.trace("");
       log.trace("SYSTEM STATISTICS");
       log.trace(String.format("JVM GC Time          : %,10.2f secs", ((finalGCTimes - initialGCTimes)
/ 1000.0)));


Mime
View raw message