hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Work logged] (HDDS-1622) Use picocli for StorageContainerManager
Date Thu, 06 Jun 2019 16:23:00 GMT

     [ https://issues.apache.org/jira/browse/HDDS-1622?focusedWorklogId=255232&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-255232
]

ASF GitHub Bot logged work on HDDS-1622:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 06/Jun/19 16:22
            Start Date: 06/Jun/19 16:22
    Worklog Time Spent: 10m 
      Work Description: arp7 commented on pull request #918: HDDS-1622 Use picocli for StorageContainerManager
URL: https://github.com/apache/hadoop/pull/918#discussion_r291265151
 
 

 ##########
 File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/StorageContainerManagerStarter.java
 ##########
 @@ -0,0 +1,155 @@
+/**
+ * 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
+ *
+ * <p>http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * <p>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.hdds.scm.server;
+
+import org.apache.hadoop.hdds.cli.GenericCli;
+import org.apache.hadoop.hdds.cli.HddsVersionProvider;
+import org.apache.hadoop.hdds.conf.OzoneConfiguration;
+import org.apache.hadoop.hdds.tracing.TracingUtil;
+import org.apache.hadoop.ozone.common.StorageInfo;
+import org.apache.hadoop.util.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import picocli.CommandLine;
+import picocli.CommandLine.Command;
+
+import java.io.IOException;
+
+import static org.apache.hadoop.util.ExitUtil.terminate;
+
+/**
+ * This class provides a command line interface to start the SCM
+ * using Picocli.
+ */
+
+@Command(name = "ozone scm",
+    hidden = true, description = "Start or initialize the scm server.",
+    versionProvider = HddsVersionProvider.class,
+    mixinStandardHelpOptions = true)
+public class StorageContainerManagerStarter extends GenericCli {
+
+  private OzoneConfiguration conf;
+  private SCMStarterInterface receiver;
+  private static final Logger LOG =
+      LoggerFactory.getLogger(StorageContainerManagerStarter.class);
+
+  public static void main(String[] args) throws Exception {
+    TracingUtil.initTracing("StorageContainerManager");
+    new StorageContainerManagerStarter(
+        new StorageContainerManagerStarter.SCMStarterHelper()).run(args);
+  }
+
+  public StorageContainerManagerStarter(SCMStarterInterface receiverObj) {
+    super();
+    receiver = receiverObj;
+  }
+
+  @Override
+  public Void call() throws Exception {
+    commonInit();
+    startScm();
+    return null;
+  }
+
+  /**
+   * This function implements a sub-command to generate a new
+   * cluster ID from the command line.
+   */
+  @CommandLine.Command(name = "--genclusterid",
 
 Review comment:
   @sodonnel, this may be confusing feedback for you. My apologies about that. in the HDFS/Ozone
team we often have lively discussions about minor things. 😄 
   
   I think there was consensus that we will not change the command syntax for now. We can
have a separate proposal to do that and Anu will write it up. That will have impact not just
on om startup options but also the _ozone_ script. @anuengineer correct me if I am wrong.
   
   So I am +1 on your patch Stephen. 
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 255232)
    Time Spent: 2h  (was: 1h 50m)

> Use picocli for StorageContainerManager
> ---------------------------------------
>
>                 Key: HDDS-1622
>                 URL: https://issues.apache.org/jira/browse/HDDS-1622
>             Project: Hadoop Distributed Data Store
>          Issue Type: Improvement
>            Reporter: Elek, Marton
>            Assignee: Stephen O'Donnell
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
> Recently we switched to use PicoCli with (almost) all of our daemons (eg. s3 Gateway,
Freon, etc.)
> PicoCli has better output, it can generate nice help, and easier to use as it's enough
to put a few annotations and we don't need to add all the boilerplate code to print out help,
etc.
> StorageContainerManager and OzoneManager is not yet  supported. The previous issue was
closed HDDS-453 but since then we improved the GenericCli parser (eg. in HDDS-1192), so I
think we are ready to move.
> The main idea is to create a starter java similar to org.apache.hadoop.ozone.s3.Gateway
and we can start StorageContainerManager from there.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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


Mime
View raw message