hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bra...@apache.org
Subject [2/3] hadoop git commit: HDFS-9480. Expose nonDfsUsed via StorageTypeStats. Contributed by Brahma Reddy Battula
Date Thu, 20 Oct 2016 15:24:44 GMT
HDFS-9480. Expose nonDfsUsed via StorageTypeStats. Contributed by Brahma Reddy Battula

(cherry picked from commit 4c73be135ca6ee2ba0b075a507097900db206b09)


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

Branch: refs/heads/branch-2
Commit: df5671db7402cf4493c80ff62b2690f6f3eea6cb
Parents: c640ba5
Author: Brahma Reddy Battula <brahma@apache.org>
Authored: Thu Oct 20 20:45:45 2016 +0530
Committer: Brahma Reddy Battula <brahma@apache.org>
Committed: Thu Oct 20 20:47:37 2016 +0530

----------------------------------------------------------------------
 .../server/blockmanagement/StorageTypeStats.java    | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/df5671db/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/StorageTypeStats.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/StorageTypeStats.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/StorageTypeStats.java
index 005e6d5..978009e 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/StorageTypeStats.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/StorageTypeStats.java
@@ -32,16 +32,19 @@ import org.apache.hadoop.classification.InterfaceStability;
 public class StorageTypeStats {
   private long capacityTotal = 0L;
   private long capacityUsed = 0L;
+  private long capacityNonDfsUsed = 0L;
   private long capacityRemaining = 0L;
   private long blockPoolUsed = 0L;
   private int nodesInService = 0;
 
-  @ConstructorProperties({"capacityTotal",
-      "capacityUsed", "capacityRemaining",  "blockPoolUsed", "nodesInService"})
-  public StorageTypeStats(long capacityTotal, long capacityUsed,
+  @ConstructorProperties({"capacityTotal", "capacityUsed", "capacityNonDfsUsed",
+      "capacityRemaining", "blockPoolUsed", "nodesInService"})
+  public StorageTypeStats(
+      long capacityTotal, long capacityUsed, long capacityNonDfsUsedUsed,
       long capacityRemaining, long blockPoolUsed, int nodesInService) {
     this.capacityTotal = capacityTotal;
     this.capacityUsed = capacityUsed;
+    this.capacityNonDfsUsed = capacityNonDfsUsedUsed;
     this.capacityRemaining = capacityRemaining;
     this.blockPoolUsed = blockPoolUsed;
     this.nodesInService = nodesInService;
@@ -55,6 +58,10 @@ public class StorageTypeStats {
     return capacityUsed;
   }
 
+  public long getCapacityNonDfsUsed() {
+    return capacityNonDfsUsed;
+  }
+
   public long getCapacityRemaining() {
     return capacityRemaining;
   }
@@ -72,6 +79,7 @@ public class StorageTypeStats {
   StorageTypeStats(StorageTypeStats other) {
     capacityTotal = other.capacityTotal;
     capacityUsed = other.capacityUsed;
+    capacityNonDfsUsed = other.capacityNonDfsUsed;
     capacityRemaining = other.capacityRemaining;
     blockPoolUsed = other.blockPoolUsed;
     nodesInService = other.nodesInService;
@@ -80,6 +88,7 @@ public class StorageTypeStats {
   void addStorage(final DatanodeStorageInfo info,
       final DatanodeDescriptor node) {
     capacityUsed += info.getDfsUsed();
+    capacityNonDfsUsed += info.getNonDfsUsed();
     blockPoolUsed += info.getBlockPoolUsed();
     if (node.isInService()) {
       capacityTotal += info.getCapacity();
@@ -98,6 +107,7 @@ public class StorageTypeStats {
   void subtractStorage(final DatanodeStorageInfo info,
       final DatanodeDescriptor node) {
     capacityUsed -= info.getDfsUsed();
+    capacityNonDfsUsed -= info.getNonDfsUsed();
     blockPoolUsed -= info.getBlockPoolUsed();
     if (node.isInService()) {
       capacityTotal -= info.getCapacity();


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message