[Flink] Check

This commit is contained in:
tqchen
2016-03-05 09:38:43 -08:00
committed by CodingCat
parent 2cec10c46f
commit 81dbf564a4
4 changed files with 128 additions and 6 deletions

View File

@@ -21,7 +21,7 @@ public class RabitTracker {
// environment variable to be pased.
private Map<String, String> envs = new HashMap<String, String>();
// number of workers to be submitted.
private int num_workers;
private int numWorkers;
private AtomicReference<Process> trackerProcess = new AtomicReference<Process>();
static {
@@ -63,8 +63,12 @@ public class RabitTracker {
}
public RabitTracker(int num_workers) {
this.num_workers = num_workers;
public RabitTracker(int numWorkers)
throws XGBoostError {
if (numWorkers < 1) {
throw new XGBoostError("numWorkers must be greater equal to one");
}
this.numWorkers = numWorkers;
}
/**
@@ -100,7 +104,7 @@ public class RabitTracker {
private boolean startTrackerProcess() {
try {
trackerProcess.set(Runtime.getRuntime().exec("python " + tracker_py +
" --num-workers=" + String.valueOf(num_workers)));
" --log-level=DEBUG --num-workers=" + String.valueOf(numWorkers)));
loadEnvs(trackerProcess.get().getInputStream());
return true;
} catch (IOException ioe) {