You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hivemall.apache.org by my...@apache.org on 2016/12/02 08:02:29 UTC
[39/50] [abbrv] incubator-hivemall git commit: Fix process of tdprop
Fix process of tdprop
Project: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/commit/144cb504
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/tree/144cb504
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/diff/144cb504
Branch: refs/heads/JIRA-22/pr-336
Commit: 144cb504d674d2509620ce0d315694be0f664f42
Parents: 3550fd3
Author: amaya <gi...@sapphire.in.net>
Authored: Fri Nov 18 01:58:31 2016 +0900
Committer: amaya <gi...@sapphire.in.net>
Committed: Fri Nov 18 01:58:31 2016 +0900
----------------------------------------------------------------------
.../systemtest/runner/TDSystemTestRunner.java | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/144cb504/systemtest/src/main/java/hivemall/systemtest/runner/TDSystemTestRunner.java
----------------------------------------------------------------------
diff --git a/systemtest/src/main/java/hivemall/systemtest/runner/TDSystemTestRunner.java b/systemtest/src/main/java/hivemall/systemtest/runner/TDSystemTestRunner.java
index 6d6c85b..87dd835 100644
--- a/systemtest/src/main/java/hivemall/systemtest/runner/TDSystemTestRunner.java
+++ b/systemtest/src/main/java/hivemall/systemtest/runner/TDSystemTestRunner.java
@@ -85,16 +85,20 @@ public class TDSystemTestRunner extends SystemTestRunner {
fileUploadCommitRetryLimit = Integer.valueOf(props.getProperty("fileUploadCommitRetryLimit"));
}
- final Properties TDPorps = System.getProperties();
+ boolean fromPropertiesFile = false;
for (Map.Entry<Object, Object> e : props.entrySet()) {
- if (e.getKey().toString().startsWith("td.client.")) {
- TDPorps.setProperty(e.getKey().toString(), e.getValue().toString());
+ final String key = e.getKey().toString();
+ if (key.startsWith("td.client.")) {
+ fromPropertiesFile = true;
+ System.setProperty(key, e.getValue().toString());
}
}
- System.setProperties(TDPorps);
- client = System.getProperties().size() == TDPorps.size() ? TDClient.newClient() // use $HOME/.td/td.conf
- : TDClient.newBuilder(false).build(); // use *.properties
+ if (fromPropertiesFile) {
+ client = TDClient.newBuilder(false).build(); // use *.properties
+ } else {
+ client = TDClient.newClient(); // use $HOME/.td/td.conf
+ }
}
@Override