- 
                Notifications
    You must be signed in to change notification settings 
- Fork 9.1k
HDDS-1192. Support -conf command line argument in GenericCli #713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| /label ozone | 
| /retest | 
| 💔 -1 overall 
 
 
 This message was automatically generated. | 
| 💔 -1 overall 
 
 
 This message was automatically generated. | 
| 💔 -1 overall 
 
 
 This message was automatically generated. | 
335811f    to
    38e5b23      
    Compare
  
    | 💔 -1 overall 
 
 This message was automatically generated. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot the patch @kittinanasi This is a big step forward to start full Ozone cluster from any IDE. I tested and worked well (without adding ozone-site.xml to the classpath!)
Overall it looks good to me. I like it. I have one minor proposal to simplify the change (I think we can do exactly the same without adding the new method GenericParentCommand. Which is not a big deal but we need to add the new method to all the subcommands).
With that approach initConf also can be removed and all the HddsDatanodeService.createHddsDatanodeService can be simplified...
The failure of TestAuditParser.testHelp() seems to be related (the output of the --help is asserted but now it contains the --conf. Maybe we can simplify the assertion).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good idea, I simplified this part, but I introduced a setConfiguration method here as well so that I don't have to modify MiniOzoneCluster that much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LIKE. Thanks to fix this part (and the similar items). It's better to use the included CommandLine.ParameterException...
| 💔 -1 overall 
 
 
 This message was automatically generated. | 
| TestOzoneAtRestEncryption test failure does not seem related. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1. Thanks @kittinanasi the update.
I will commit it soon (there is one checkstyle violation, I am fixing it during the commit).
Neither the acceptance tests nor the unit tests are related. All the unit tests are related to RAFT ring.
| Thanks @elek for committing and for fixing the remaining checkstyle issue! | 
Author: Jagadish <[email protected]> Reviewers: Jagadish<[email protected]> Closes apache#713 from vjagadish1989/website-reorg11
No description provided.