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

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

                Author: ASF GitHub Bot
            Created on: 17/Apr/19 11:59
            Start Date: 17/Apr/19 11:59
    Worklog Time Spent: 10m 
      Work Description: elek commented on pull request #713: HDDS-1192. Support 
-conf command line argument in GenericCli
URL: https://github.com/apache/hadoop/pull/713#discussion_r276196228
 
 

 ##########
 File path: 
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/HddsDatanodeService.java
 ##########
 @@ -161,6 +157,8 @@ public void start(Object service) {
     OzoneConfiguration.activate();
     if (service instanceof Configurable) {
       conf = new OzoneConfiguration(((Configurable) service).getConf());
+    } else {
 
 Review comment:
   I think this part can be simplified (but fix me if I am wrong) with using 
two start method:
   
   ```
    /**
      * Starts HddsDatanode services.
      *
      * @param service The service instance invoking this method
      */
     @Override
     public void start(Object service) {
       if (service instanceof Configurable) {
         start(new OzoneConfiguration(((Configurable) service).getConf()));
       } else {
         start(new OzoneConfiguration());
       }
     }
   
     public void start(OzoneConfiguration conf) {
       this.conf = conf;
       DefaultMetricsSystem.initialize("HddsDatanode");
       OzoneConfiguration.activate();
       if (HddsUtils.isHddsEnabled(conf)) {
    ```
   
   In this case we don't need to add the additional method to the 
GenericParentCommand so it can be as simple as now.
   
   And from the new call() method we can use the createOzoneConfiguration()
   
   ```
     @Override
     public Void call() throws Exception {
       if (printBanner) {
         StringUtils
             .startupShutdownMessage(HddsDatanodeService.class, args, LOG);
       }
       start(createOzoneConfiguration());
       join();
       return null;
     }
   ```
   
   initConf also can be removed with this approach (IMHO)
   
 
----------------------------------------------------------------
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:
us...@infra.apache.org


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

    Worklog Id:     (was: 229047)
    Time Spent: 1h 20m  (was: 1h 10m)

> Support -conf command line argument in GenericCli
> -------------------------------------------------
>
>                 Key: HDDS-1192
>                 URL: https://issues.apache.org/jira/browse/HDDS-1192
>             Project: Hadoop Distributed Data Store
>          Issue Type: Improvement
>            Reporter: Elek, Marton
>            Assignee: Kitti Nanasi
>            Priority: Major
>              Labels: newbie, pull-request-available
>         Attachments: HDDS-1192.001.patch, HDDS-1192.002.patch, 
> HDDS-1192.003.patch, HDDS-1192.004.patch, HDDS-1192.005.patch
>
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> org.apache.hadoop.hdds.GenericCli is the based class for all the Ozone 
> related command line application. It supports to define custom configuration 
> variables (-D or --set) but doesn't support the '--conf ozone-site.xml' 
> argument to load an external xml file to the configuration.
> Configuration and OzoneConfiguration classes load the ozone-site.xml from the 
> classpath. But it makes very hard to start Ozone components in IDE as we 
> can't modify the classpath easily. 
> One option here is to support the --conf everywhere to make it possible to 
> start ozone cluster in the IDE. 
> Note: It's a nice to have for 0.4.0. I marked it as 0.5.0 but safe to commit 
> at anytime to 0.4.0



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

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

Reply via email to