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_r264929316
 
 

 ##########
 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 would be fine with this idea as well.
   
   The easiest way would be to keep the already existing constructor 
CrailConfiguration(), but move
   the call of loadProperties into a public function, which can optionally be 
called by the user,
   if hte wants to read the configuration file.
   
   If the user choses not to load the configuration file, he could just use the 
existing set() method.
   
   If this is fine with everyone, I will change it accordingly.

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

Reply via email to