asqasq commented on a change in pull request #72: Allow namenode as parameter
instead of conf file.
URL: https://github.com/apache/incubator-crail/pull/72#discussion_r288099803
##########
File path: client/src/main/java/org/apache/crail/conf/CrailConfiguration.java
##########
@@ -33,9 +33,32 @@
private static final Logger LOG = CrailUtils.getLogger();
private ConcurrentHashMap<String, String> conf;
- public CrailConfiguration() throws IOException {
+ private CrailConfiguration() {
conf = new ConcurrentHashMap<>();
- Properties properties = loadProperties("crail-site.conf");
+ }
+
+ public static CrailConfiguration createEmptyConfiguration() {
+ return new CrailConfiguration();
+ }
+
+ public static CrailConfiguration createConfigurationFromFile() throws
IOException {
+ CrailConfiguration cconf = createEmptyConfiguration();
+ String base = System.getenv("CRAIL_HOME");
+ if (base == null || base.isEmpty()) {
+ throw new IllegalArgumentException("CRAIL_HOME
environment variable is not set or empty");
+ }
+ cconf.loadConfigurationFromFile(base + "/conf/crail-site.conf");
Review comment:
Good idea!
Done.
----------------------------------------------------------------
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