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_r358460719
##########
File path: modules/command/src/main/java/org/apache/fluo/command/FluoList.java
##########
@@ -54,17 +54,37 @@ public static void main(String[] args) throws Exception {
System.out.println("----------- ------ ---------");
for (String path : children) {
- FluoConfiguration appConfig = new FluoConfiguration(config);
- appConfig.setApplicationName(path);
- try (FluoAdminImpl admin = new FluoAdminImpl(appConfig)) {
- String state = "STOPPED";
- if (admin.applicationRunning()) {
- state = "RUNNING";
- }
- int numWorkers = admin.numWorkers();
- System.out.format("%-15s %-11s %4d\n", path, state, numWorkers);
- }
+ listApp(config, path);
+ }
+ }
+ }
+
+ private boolean checkCuratorExists(CuratorFramework curator) {
+ try {
+ return curator.checkExists().forPath("/") != null;
+ } catch (Exception e) {
+ throw new RuntimeException("Error checking if curator exists", e);
Review comment:
this seems ok to me. Could add a comment saying why this was done. Also
its possible that Exception could be a RuntimeException. Could do.
```java
try {
 return curator.checkExists().forPath("/") != null;
} catch (RuntimeException e) {
throw e;
 } catch (Exception e) {
// want stack trace for this exception to show up on command line
 throw new RuntimeException("Error checking if curator exists", e);
}
```
----------------------------------------------------------------
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