hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hanishakon...@apache.org
Subject [39/50] [abbrv] hadoop git commit: HDDS-114. Ozone Datanode mbean registration fails for StorageLocation. Contributed by Elek, Marton.
Date Wed, 30 May 2018 21:12:29 GMT
HDDS-114. Ozone Datanode mbean registration fails for StorageLocation.
Contributed by Elek, Marton.


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

Branch: refs/heads/HDDS-48
Commit: 24169062e5f4e7798a47c5e6e3e94504cba73092
Parents: 30284d0
Author: Anu Engineer <aengineer@apache.org>
Authored: Tue May 29 13:23:58 2018 -0700
Committer: Anu Engineer <aengineer@apache.org>
Committed: Tue May 29 13:48:55 2018 -0700

----------------------------------------------------------------------
 .../common/impl/StorageLocationReport.java      | 52 +++++++++++---------
 .../ContainerLocationManagerMXBean.java         |  4 +-
 .../interfaces/StorageLocationReportMXBean.java | 40 +++++++++++++++
 3 files changed, 71 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/24169062/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/StorageLocationReport.java
----------------------------------------------------------------------
diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/StorageLocationReport.java
b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/StorageLocationReport.java
index 87b9656..061d09b 100644
--- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/StorageLocationReport.java
+++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/StorageLocationReport.java
@@ -23,6 +23,8 @@ import org.apache.hadoop.hdds.protocol.proto.
     StorageContainerDatanodeProtocolProtos.StorageReportProto;
 import org.apache.hadoop.hdds.protocol.proto.
     StorageContainerDatanodeProtocolProtos.StorageTypeProto;
+import org.apache.hadoop.ozone.container.common.interfaces
+    .StorageLocationReportMXBean;
 
 import java.io.IOException;
 
@@ -30,7 +32,8 @@ import java.io.IOException;
  * Storage location stats of datanodes that provide back store for containers.
  *
  */
-public class StorageLocationReport {
+public final class StorageLocationReport implements
+    StorageLocationReportMXBean {
 
   private final String id;
   private final boolean failed;
@@ -76,6 +79,11 @@ public class StorageLocationReport {
     return storageLocation;
   }
 
+  @Override
+  public String getStorageTypeName() {
+    return storageType.name();
+  }
+
   public StorageType getStorageType() {
     return storageType;
   }
@@ -204,76 +212,76 @@ public class StorageLocationReport {
     /**
      * Sets the storageId.
      *
-     * @param id storageId
+     * @param idValue storageId
      * @return StorageLocationReport.Builder
      */
-    public Builder setId(String id) {
-      this.id = id;
+    public Builder setId(String idValue) {
+      this.id = idValue;
       return this;
     }
 
     /**
      * Sets whether the volume failed or not.
      *
-     * @param failed whether volume failed or not
+     * @param failedValue whether volume failed or not
      * @return StorageLocationReport.Builder
      */
-    public Builder setFailed(boolean failed) {
-      this.failed = failed;
+    public Builder setFailed(boolean failedValue) {
+      this.failed = failedValue;
       return this;
     }
 
     /**
      * Sets the capacity of volume.
      *
-     * @param capacity capacity
+     * @param capacityValue capacity
      * @return StorageLocationReport.Builder
      */
-    public Builder setCapacity(long capacity) {
-      this.capacity = capacity;
+    public Builder setCapacity(long capacityValue) {
+      this.capacity = capacityValue;
       return this;
     }
     /**
      * Sets the scmUsed Value.
      *
-     * @param scmUsed storage space used by scm
+     * @param scmUsedValue storage space used by scm
      * @return StorageLocationReport.Builder
      */
-    public Builder setScmUsed(long scmUsed) {
-      this.scmUsed = scmUsed;
+    public Builder setScmUsed(long scmUsedValue) {
+      this.scmUsed = scmUsedValue;
       return this;
     }
 
     /**
      * Sets the remaining free space value.
      *
-     * @param remaining remaining free space
+     * @param remainingValue remaining free space
      * @return StorageLocationReport.Builder
      */
-    public Builder setRemaining(long remaining) {
-      this.remaining = remaining;
+    public Builder setRemaining(long remainingValue) {
+      this.remaining = remainingValue;
       return this;
     }
 
     /**
      * Sets the storageType.
      *
-     * @param storageType type of the storage used
+     * @param storageTypeValue type of the storage used
      * @return StorageLocationReport.Builder
      */
-    public Builder setStorageType(StorageType storageType) {
-      this.storageType = storageType;
+    public Builder setStorageType(StorageType storageTypeValue) {
+      this.storageType = storageTypeValue;
       return this;
     }
 
     /**
      * Sets the storageLocation.
      *
-     * @param storageLocation location of the volume
+     * @param storageLocationValue location of the volume
      * @return StorageLocationReport.Builder
      */
-    public Builder setStorageLocation(String storageLocation) {
-      this.storageLocation = storageLocation;
+    public Builder setStorageLocation(String storageLocationValue) {
+      this.storageLocation = storageLocationValue;
       return this;
     }
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/24169062/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/interfaces/ContainerLocationManagerMXBean.java
----------------------------------------------------------------------
diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/interfaces/ContainerLocationManagerMXBean.java
b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/interfaces/ContainerLocationManagerMXBean.java
index 88e6148..97d2dc3 100644
--- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/interfaces/ContainerLocationManagerMXBean.java
+++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/interfaces/ContainerLocationManagerMXBean.java
@@ -17,8 +17,6 @@
  */
 package org.apache.hadoop.ozone.container.common.interfaces;
 
-import org.apache.hadoop.ozone.container.common.impl.StorageLocationReport;
-
 import java.io.IOException;
 
 /**
@@ -31,6 +29,6 @@ public interface ContainerLocationManagerMXBean {
    *
    * @return storage location usage report.
    */
-  StorageLocationReport[] getLocationReport() throws IOException;
+  StorageLocationReportMXBean[] getLocationReport() throws IOException;
 
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/24169062/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/interfaces/StorageLocationReportMXBean.java
----------------------------------------------------------------------
diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/interfaces/StorageLocationReportMXBean.java
b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/interfaces/StorageLocationReportMXBean.java
new file mode 100644
index 0000000..fd06367
--- /dev/null
+++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/interfaces/StorageLocationReportMXBean.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.ozone.container.common.interfaces;
+
+/**
+ * Contract to define properties available on the JMX interface.
+ */
+public interface StorageLocationReportMXBean {
+
+  String getId();
+
+  boolean isFailed();
+
+  long getCapacity();
+
+  long getScmUsed();
+
+  long getRemaining();
+
+  String getStorageLocation();
+
+  String getStorageTypeName();
+
+}


---------------------------------------------------------------------
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