keith-turner commented on a change in pull request #883: Fixes #842 Support multiple ways for running Fluo applications URL: https://github.com/apache/incubator-fluo/pull/883#discussion_r130763353
########## File path: modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java ########## @@ -525,31 +714,41 @@ public void print() { } } - private boolean verifyStringPropSet(String key) { - if (containsKey(key) && !getString(key).isEmpty()) { - return true; + private boolean verifyStringPropSet(String... keys) { + for (String key : keys) { + if (containsKey(key) && !getString(key).isEmpty()) { + return true; + } } - log.info(key + " is not set"); + log.info(keys[0] + " is not set"); return false; } - private boolean verifyStringPropNotSet(String key) { - if (containsKey(key) && !getString(key).isEmpty()) { - log.info(key + " should not be set"); - return false; + private boolean verifyStringPropNotSet(String... keys) { + for (String key : keys) { + if (containsKey(key) && !getString(key).isEmpty()) { + log.info(key + " should not be set"); + return false; + } } return true; } + public boolean hasRequiredConnectionProps() { + boolean valid = true; + valid &= verifyStringPropSet(CONNECTION_APPLICATION_NAME_PROP, CLIENT_APPLICATION_NAME_PROP); + return valid; + } + /** * Returns true if required properties for FluoClient are set */ public boolean hasRequiredClientProps() { boolean valid = true; - valid &= verifyStringPropSet(CLIENT_APPLICATION_NAME_PROP); - valid &= verifyStringPropSet(CLIENT_ACCUMULO_USER_PROP); - valid &= verifyStringPropSet(CLIENT_ACCUMULO_PASSWORD_PROP); - valid &= verifyStringPropSet(CLIENT_ACCUMULO_INSTANCE_PROP); + valid &= verifyStringPropSet(CONNECTION_APPLICATION_NAME_PROP, CLIENT_APPLICATION_NAME_PROP); + valid &= verifyStringPropSet(ACCUMULO_USER_PROP, CLIENT_ACCUMULO_USER_PROP); Review comment: It seems like this prop is no longer required for a client. Maybe only check for old accumulo props if `CLIENT_APPLICATION_NAME_PROP ` is present? ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services