accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [2/2] accumulo git commit: ACCUMULO-3957 Remove getContentSummary calls in Monitor
Date Sat, 29 Aug 2015 21:01:37 GMT
ACCUMULO-3957 Remove getContentSummary calls in Monitor

We previously had two getContentSummary calls used for computing
a metric of how much HDFS space Accumulo is using against total
available HDFS space. Users often got confused when seeing a very
large percentage, thinking that it was a total HDFS usage metric.

These getContentSummary calls against a large HDFS instance can
be very problematic, causes resource contention in the namenode.

Since the metric is questionable in value and the call may impact
performance, remove the calls and the metric.


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

Branch: refs/heads/master
Commit: ffee9e5ae557a43dfdca71478551f075213043c9
Parents: 842b328
Author: Josh Elser <elserj@apache.org>
Authored: Sat Aug 29 16:59:29 2015 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Sat Aug 29 16:59:29 2015 -0400

----------------------------------------------------------------------
 .../monitor/servlets/DefaultServlet.java        | 48 --------------------
 1 file changed, 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/ffee9e5a/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/DefaultServlet.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/DefaultServlet.java
b/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/DefaultServlet.java
index 21aba35..3d2ae45 100644
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/DefaultServlet.java
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/DefaultServlet.java
@@ -251,55 +251,7 @@ public class DefaultServlet extends BasicServlet {
       long totalHdfsBytesUsed = 0l;
 
       try {
-        for (String baseDir : VolumeConfiguration.getVolumeUris(SiteConfiguration.getInstance()))
{
-          final Path basePath = new Path(baseDir);
-          final FileSystem fs = vm.getVolumeByPath(basePath).getFileSystem();
-
-          try {
-            // Calculate the amount of space used by Accumulo on the FileSystem
-            ContentSummary accumuloSummary = fs.getContentSummary(basePath);
-            long bytesUsedByAcuOnFs = accumuloSummary.getLength();
-            totalAcuBytesUsed += bytesUsedByAcuOnFs;
-
-            // Catch the overflow -- this is big data
-            if (totalAcuBytesUsed < bytesUsedByAcuOnFs) {
-              log.debug("Overflowed long in bytes used by Accumulo for " + baseDir);
-              totalAcuBytesUsed = 0l;
-              break;
-            }
-
-            // Calculate the total amount of space used on the FileSystem
-            ContentSummary volumeSummary = fs.getContentSummary(new Path("/"));
-            long bytesUsedOnVolume = volumeSummary.getLength();
-            totalHdfsBytesUsed += bytesUsedOnVolume;
-
-            // Catch the overflow -- this is big data
-            if (totalHdfsBytesUsed < bytesUsedOnVolume) {
-              log.debug("Overflowed long in bytes used in HDFS for " + baseDir);
-              totalHdfsBytesUsed = 0;
-              break;
-            }
-          } catch (Exception ex) {
-            log.trace("Unable to get disk usage information for " + baseDir, ex);
-          }
-        }
-
-        String diskUsed = "Unknown";
-        String consumed = null;
-        if (totalAcuBytesUsed > 0) {
-          // Convert Accumulo usage to a readable String
-          diskUsed = bytes(totalAcuBytesUsed);
-
-          if (totalHdfsBytesUsed > 0) {
-            // Compute amount of space used by Accumulo as a percentage of total space usage.
-            consumed = String.format("%.2f%%", totalAcuBytesUsed * 100. / totalHdfsBytesUsed);
-          }
-        }
-
         boolean highlight = false;
-        tableRow(sb, (highlight = !highlight), "Disk&nbsp;Used", diskUsed);
-        if (null != consumed)
-          tableRow(sb, (highlight = !highlight), "%&nbsp;of&nbsp;Used&nbsp;DFS",
consumed);
         tableRow(sb, (highlight = !highlight), "<a href='/tables'>Tables</a>",
NumberType.commas(Monitor.getTotalTables()));
         tableRow(sb, (highlight = !highlight), "<a href='/tservers'>Tablet&nbsp;Servers</a>",
NumberType.commas(info.tServerInfo.size(), 1, Long.MAX_VALUE));
         tableRow(sb, (highlight = !highlight), "<a href='/tservers'>Dead&nbsp;Tablet&nbsp;Servers</a>",
NumberType.commas(info.deadTabletServers.size(), 0, 0));


Mime
View raw message