Enable environment variable expansion in crail-site.conf #7
Conversation
Sometimes it is easier to set dynamic configuration options through environment variables. This allows reusing the same Crail configuration file for similar deployments where only non-Crail specific parameters are different (such as the user name, HADOOP/SPARK/CRAIL deployment directories, hostnames). |
Hey Radu, can you please open a JIRA (http://crail.incubator.apache.org/community/) for this pull request for discussion. We just do code review on github. Also, what happens if a environment variable is not set? Is it possible to do some sort of sanity checks and throw an exception? Because if the variable is not set then probably it is bug (?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small comment, otherwise looks fine with me.
while (m.find()) { | ||
String envVar; | ||
if (m.group(1) != null) | ||
envVar = m.group(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add braces to the if-else like every where else in the file?
@asqasq |
…is not set. 2) Code formating changes.
Looks OK to me too. @raduioanstoica yes, all of those issue need improvement in Crail code, specially unused or obsolete parameter names. I think we can have a look at other project and see how they do it. I am not sure what you mean by (3) update automatically [...]? |
At 3) I mean to extract the options directly from the code (from the CrailConstants-style classes) and update the crail-site.conf.template file in /conf. The options would be ideally commented out and include the default values and comments (if any). It would be much easier for a user to see all configuration options in one place. There are many ways to do this. I guess we could start by having a look at Hadoop / Spark to see if they do something similar. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
Looks good to me. See discussion https://issues.apache.org/jira/browse/CRAIL-11 |
No description provided.