keith-turner commented on a change in pull request #1083: [WIP] POC for Command
module with centralized Command Pattern logic
URL: https://github.com/apache/fluo/pull/1083#discussion_r357775872
##########
File path:
modules/command/src/main/java/org/apache/fluo/command/FluoConfig.java
##########
@@ -17,22 +17,28 @@
import java.util.Map;
+import com.beust.jcommander.Parameters;
import org.apache.fluo.api.client.FluoAdmin;
import org.apache.fluo.api.client.FluoFactory;
import org.apache.fluo.api.config.FluoConfiguration;
-public class FluoConfig {
+@Parameters(commandDescription = "Prints application configuration stored in
Zookeeper for <app>")
+public class FluoConfig extends CommonCommand {
- public static void main(String[] args) {
- CommonOpts opts = CommonOpts.parse("fluo config", args);
+ public void config() {
FluoConfiguration config = CommandUtil.resolveFluoConfig();
- config.setApplicationName(opts.getApplicationName());
- opts.overrideFluoConfig(config);
+ config.setApplicationName(getApplicationName());
+ overrideFluoConfig(config);
CommandUtil.verifyAppInitialized(config);
try (FluoAdmin admin = FluoFactory.newAdmin(config)) {
for (Map.Entry<String, String> entry :
admin.getApplicationConfig().toMap().entrySet()) {
System.out.println(entry.getKey() + " = " + entry.getValue());
}
}
}
+
+ @Override
+ public void execute() throws FluoCommandException {
+ config();
Review comment:
Could the be inlined?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services