You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@crail.apache.org by GitBox <gi...@apache.org> on 2019/03/07 15:44:46 UTC

[GitHub] [incubator-crail] patrickstuedi commented on a change in pull request #72: Allow namenode as parameter instead of conf file.

patrickstuedi 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_r263441028
 
 

 ##########
 File path: client/src/main/java/org/apache/crail/conf/CrailConfiguration.java
 ##########
 @@ -39,6 +39,17 @@ public CrailConfiguration() throws IOException {
 		mergeProperties(properties);
 	}
 
+  // This constructor is useful, when a client does
+  // not have access to a file system, but only needs the configuration
+  // of the namenode address. As an example, an OpenWHisk function
+  // does not have a filesystem associated and therefore cannot
+  // read the namenode address from any configuration file.
+  public CrailConfiguration(String nameNodeAddress) throws IOException {
+    conf = new ConcurrentHashMap<>();
+    conf.put("crail.namenode.address", nameNodeAddress);
 
 Review comment:
   I don't mind adding this line. But this really only addresses the namenode parameter (obviously a key parameter). Would be nice to have a more flexible solution where either we can load the config also from different sources, or allow the user to create a plain config and then set certain properties by hand in the case where CRAIL_HOME is not set and properties cannot be loaded. 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services