hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject hadoop git commit: HDFS-10361. Support starting StorageContainerManager as a daemon. (Contributed by Arpit Agarwal)
Date Thu, 05 May 2016 22:10:27 GMT
Repository: hadoop
Updated Branches:
  refs/heads/HDFS-7240 78bd1b2ab -> 63a6a1d73


HDFS-10361. Support starting StorageContainerManager as a daemon. (Contributed by Arpit Agarwal)


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

Branch: refs/heads/HDFS-7240
Commit: 63a6a1d73294fda3a4410cc434d9ba54b1c7f329
Parents: 78bd1b2
Author: Arpit Agarwal <arp@apache.org>
Authored: Thu May 5 15:09:59 2016 -0700
Committer: Arpit Agarwal <arp@apache.org>
Committed: Thu May 5 15:09:59 2016 -0700

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs     |  7 +++++++
 .../hadoop/ozone/storage/StorageContainerManager.java | 14 ++++++++++----
 2 files changed, 17 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/63a6a1d7/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs b/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs
index 284da7e..d0e665d 100755
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs
@@ -52,6 +52,7 @@ function hadoop_usage
   hadoop_add_subcommand "oiv_legacy" "apply the offline fsimage viewer to a legacy fsimage"
   hadoop_add_subcommand "oz" "command line interface for ozone"
   hadoop_add_subcommand "portmap" "run a portmap service"
+  hadoop_add_subcommand "scm" "run the Storage Container Manager service"
   hadoop_add_subcommand "secondarynamenode" "run the DFS secondary namenode"
   hadoop_add_subcommand "snapshotDiff" "diff two snapshots of a directory or diff the current
directory contents with a snapshot"
   hadoop_add_subcommand "storagepolicies" "list/get/set block storage policies"
@@ -234,6 +235,12 @@ case ${COMMAND} in
     hadoop_debug "Appending HADOOP_PORTMAP_OPTS onto HADOOP_OPTS"
     HADOOP_OPTS="${HADOOP_OPTS} ${HADOOP_PORTMAP_OPTS}"
   ;;
+  scm)
+    supportdaemonization="true"
+    CLASS='org.apache.hadoop.ozone.storage.StorageContainerManager'
+    hadoop_debug "Appending HADOOP_SCM_OPTS onto HADOOP_OPTS"
+    HADOOP_OPTS="${HADOOP_OPTS} ${HADOOP_SCM_OPTS}"
+  ;;
   secondarynamenode)
     supportdaemonization="true"
     CLASS='org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode'

http://git-wip-us.apache.org/repos/asf/hadoop/blob/63a6a1d7/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/storage/StorageContainerManager.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/storage/StorageContainerManager.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/storage/StorageContainerManager.java
index e89ebfc..f79f49b 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/storage/StorageContainerManager.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/storage/StorageContainerManager.java
@@ -34,6 +34,7 @@ import static org.apache.hadoop.ozone.OzoneConfigKeys.DFS_CONTAINER_LOCATION_HAN
 import static org.apache.hadoop.ozone.OzoneConfigKeys.DFS_CONTAINER_LOCATION_RPC_ADDRESS_DEFAULT;
 import static org.apache.hadoop.ozone.OzoneConfigKeys.DFS_CONTAINER_LOCATION_RPC_ADDRESS_KEY;
 import static org.apache.hadoop.ozone.OzoneConfigKeys.DFS_CONTAINER_LOCATION_RPC_BIND_HOST_KEY;
+import static org.apache.hadoop.util.ExitUtil.terminate;
 
 import java.io.IOException;
 import java.net.InetSocketAddress;
@@ -591,9 +592,14 @@ public class StorageContainerManager
   public static void main(String[] argv) throws IOException {
     StringUtils.startupShutdownMessage(
         StorageContainerManager.class, argv, LOG);
-    StorageContainerManager scm = new StorageContainerManager(
-        new OzoneConfiguration());
-    scm.start();
-    scm.join();
+    try {
+      StorageContainerManager scm = new StorageContainerManager(
+          new OzoneConfiguration());
+      scm.start();
+      scm.join();
+    } catch (Throwable t) {
+      LOG.error("Failed to start the StorageContainerManager.", t);
+      terminate(1, t);
+    }
   }
 }


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