Package ml.dmlc.xgboost4j.java
Class RabitTracker
java.lang.Object
ml.dmlc.xgboost4j.java.RabitTracker
- All Implemented Interfaces:
Thread.UncaughtExceptionHandler
,IRabitTracker
Java implementation of the Rabit tracker to coordinate distributed workers.
As a wrapper of the Python Rabit tracker, this implementation does not handle timeout for both
start() and waitFor() methods (i.e., the timeout is infinite.)
For systems lacking Python environment, or for timeout functionality, consider using the Scala
Rabit tracker (ml.dmlc.xgboost4j.scala.rabit.RabitTracker) which does not depend on Python, and
provides timeout support.
The tracker must be started on driver node before running distributed jobs.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
Tracker logger that logs output from tracker.Nested classes/interfaces inherited from interface ml.dmlc.xgboost4j.java.IRabitTracker
IRabitTracker.TrackerStatus
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.apache.commons.logging.Log
private int
private static String
private AtomicReference<Process>
private static TrackerProperties
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate String
addTrackerProperties
(String trackerExecString) Get environments that can be used to pass to worker.private static void
private void
loadEnvs
(InputStream ins) boolean
start
(long timeout) private boolean
void
stop()
void
uncaughtException
(Thread t, Throwable e) int
waitFor
(long timeout)
-
Field Details
-
logger
private static final org.apache.commons.logging.Log logger -
tracker_py
-
trackerProperties
-
envs
-
numWorkers
private int numWorkers -
trackerProcess
-
-
Constructor Details
-
RabitTracker
- Throws:
XGBoostError
-
-
Method Details
-
initTrackerPy
- Throws:
IOException
-
uncaughtException
- Specified by:
uncaughtException
in interfaceThread.UncaughtExceptionHandler
-
getWorkerEnvs
Get environments that can be used to pass to worker.- Specified by:
getWorkerEnvs
in interfaceIRabitTracker
- Returns:
- The environment settings.
-
loadEnvs
- Throws:
IOException
-
startTrackerProcess
private boolean startTrackerProcess() -
addTrackerProperties
-
stop
public void stop()- Specified by:
stop
in interfaceIRabitTracker
-
start
public boolean start(long timeout) - Specified by:
start
in interfaceIRabitTracker
-
waitFor
public int waitFor(long timeout) - Specified by:
waitFor
in interfaceIRabitTracker
-