keith-turner commented on a change in pull request #1052: Issue 1003 - Refactor
remove and init apis to check if running
URL: https://github.com/apache/fluo/pull/1052#discussion_r222990531
##########
File path: modules/command/src/main/java/org/apache/fluo/command/FluoInit.java
##########
@@ -134,65 +135,60 @@ public static void main(String[] args) {
try (FluoAdminImpl admin = new FluoAdminImpl(config)) {
- if (admin.applicationRunning()) {
- System.err.println("Error - The Fluo '" + config.getApplicationName()
+ "' application"
- + " is already running and must be stopped before running 'fluo
init'. "
- + " Aborted initialization.");
- System.exit(-1);
- }
-
FluoAdmin.InitializationOptions initOpts = new
FluoAdmin.InitializationOptions();
if (opts.getUpdate()) {
System.out.println("Updating configuration for the Fluo '" +
config.getApplicationName()
+ "' application in Zookeeper using " + opts.getAppPropsPath());
- admin.updateSharedConfig();
- System.out.println("Update is complete.");
- System.exit(0);
- }
-
- if (opts.getForce()) {
- initOpts.setClearZookeeper(true).setClearTable(true);
+ initOpts.setUpdateWithoutInitializing(true);
Review comment:
If ` admin.updateSharedConfig()` fails when the application is running, then
this code can still call `updateSharedConfig()`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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