Skip to content

Commit

Permalink
Merge pull request #101 from itesla/fix_local_computation_config
Browse files Browse the repository at this point in the history
gets DEFAULT_LOCAL_DIR from property java.io.tmpdir
  • Loading branch information
mathbagu committed Oct 20, 2016
2 parents 77b716e + 64bfd6b commit 48ba95d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class LocalComputationConfig {

private static final String CONFIG_MODULE_NAME = "computation-local";

private static final Path DEFAULT_LOCAL_DIR = Paths.get("/tmp");
private static final Path DEFAULT_LOCAL_DIR = Paths.get(System.getProperty("java.io.tmpdir"));

private static final int DEFAULT_AVAILABLE_CORE = 1;

Expand All @@ -35,7 +35,7 @@ public static LocalComputationConfig load() {
localDir = config.getPathProperty("tmpDir", DEFAULT_LOCAL_DIR);
availableCore = config.getIntProperty("availableCore", DEFAULT_AVAILABLE_CORE);
}
if (availableCore == -1) {
if (availableCore <= 0) {
availableCore = Runtime.getRuntime().availableProcessors();
}
return new LocalComputationConfig(localDir, availableCore);
Expand Down

0 comments on commit 48ba95d

Please sign in to comment.