diff options
author | WangTaoTheTonic <wangtao111@huawei.com> | 2015-05-30 08:04:27 -0400 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2015-05-30 08:04:27 -0400 |
commit | 9d8aadb72bbc86595e253fe30201cda6a8db877e (patch) | |
tree | fbf850bb1f1f2b8ce227d8fe940d7890d4b2923b /launcher/src | |
parent | 8c8de3ed863985554e84fd07d1cdcaeca7e3375c (diff) | |
download | spark-9d8aadb72bbc86595e253fe30201cda6a8db877e.tar.gz spark-9d8aadb72bbc86595e253fe30201cda6a8db877e.tar.bz2 spark-9d8aadb72bbc86595e253fe30201cda6a8db877e.zip |
[SPARK-7945] [CORE] Do trim to values in properties file
https://issues.apache.org/jira/browse/SPARK-7945
Now applications submited by org.apache.spark.launcher.Main read properties file without doing trim to values in it.
If user left a space after a value(say spark.driver.extraClassPath) then it probably affect global functions(like some jar could not be included in the classpath), so we should do it like Utils.getPropertiesFromFile.
Author: WangTaoTheTonic <wangtao111@huawei.com>
Author: Tao Wang <wangtao111@huawei.com>
Closes #6496 from WangTaoTheTonic/SPARK-7945 and squashes the following commits:
bb41b4b [Tao Wang] indent 4 to 2
6dd1cf2 [WangTaoTheTonic] use a simpler way
2c053a1 [WangTaoTheTonic] Do trim to values in properties file
Diffstat (limited to 'launcher/src')
-rw-r--r-- | launcher/src/main/java/org/apache/spark/launcher/AbstractCommandBuilder.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/launcher/src/main/java/org/apache/spark/launcher/AbstractCommandBuilder.java b/launcher/src/main/java/org/apache/spark/launcher/AbstractCommandBuilder.java index 33fd813f7a..33d65d13f0 100644 --- a/launcher/src/main/java/org/apache/spark/launcher/AbstractCommandBuilder.java +++ b/launcher/src/main/java/org/apache/spark/launcher/AbstractCommandBuilder.java @@ -296,6 +296,9 @@ abstract class AbstractCommandBuilder { try { fd = new FileInputStream(propsFile); props.load(new InputStreamReader(fd, "UTF-8")); + for (Map.Entry<Object, Object> e : props.entrySet()) { + e.setValue(e.getValue().toString().trim()); + } } finally { if (fd != null) { try { |