From 446cb8301ebd651879dfd403d5fa342b4dfaf6e3 Mon Sep 17 00:00:00 2001 From: Jitendra Pandey Date: Fri, 14 Sep 2018 11:38:50 -0700 Subject: [PATCH] HDDS-452. 'ozone scm' with incorrect argument first logs all the STARTUP_MSG. Contributed by Namit Maheshwari. --- .../hadoop/hdds/scm/server/StorageContainerManager.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/StorageContainerManager.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/StorageContainerManager.java index 28a4983f80b..b3408a4be91 100644 --- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/StorageContainerManager.java +++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/StorageContainerManager.java @@ -361,8 +361,6 @@ public final class StorageContainerManager extends ServiceRuntimeInfoImpl hParser.printGenericCommandUsage(System.err); System.exit(1); } - StringUtils.startupShutdownMessage(StorageContainerManager.class, argv, - LOG); StorageContainerManager scm = createSCM(hParser.getRemainingArgs(), conf); if (scm != null) { scm.start(); @@ -395,9 +393,13 @@ public final class StorageContainerManager extends ServiceRuntimeInfoImpl } switch (startOpt) { case INIT: + StringUtils.startupShutdownMessage(StorageContainerManager.class, argv, + LOG); terminate(scmInit(conf) ? 0 : 1); return null; case GENCLUSTERID: + StringUtils.startupShutdownMessage(StorageContainerManager.class, argv, + LOG); System.out.println("Generating new cluster id:"); System.out.println(StorageInfo.newClusterID()); terminate(0); @@ -407,6 +409,8 @@ public final class StorageContainerManager extends ServiceRuntimeInfoImpl terminate(0); return null; default: + StringUtils.startupShutdownMessage(StorageContainerManager.class, argv, + LOG); return new StorageContainerManager(conf); } }