public final class DriverLauncher extends Object implements AutoCloseable
It can be instantiated using a configuration that can create a REEF instance. For example, the local resource manager and the YARN resource manager can do this.
See org.apache.reef.examples.hello
package for a demo use case.
Modifier and Type | Class and Description |
---|---|
class |
DriverLauncher.CompletedJobHandler
Job driver notifies us that the job had completed successfully.
|
class |
DriverLauncher.FailedJobHandler
Job driver notifies us that the job had failed.
|
class |
DriverLauncher.RunningJobHandler
Job driver notifies us that the job is running.
|
class |
DriverLauncher.RuntimeErrorHandler
Handler an error in the job driver.
|
class |
DriverLauncher.SubmittedJobHandler
Job driver notifies us that the job has been submitted to the Resource Manager.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Kills the running job.
|
static DriverLauncher |
getLauncher(Configuration runtimeConfiguration)
Instantiate a launcher for the given Configuration.
|
LauncherStatus |
getStatus() |
UserCredentials |
getUser() |
LauncherStatus |
run(Configuration driverConfig)
Run a job.
|
LauncherStatus |
run(Configuration driverConfig,
long timeOut)
Run a job with a waiting timeout after which it will be killed, if it did not complete yet.
|
void |
setStatusAndNotify(LauncherStatus newStatus)
Update job status and notify the waiting thread.
|
String |
submit(Configuration driverConfig,
long waitTime)
Submit REEF job asynchronously and do not wait for its completion.
|
String |
toString() |
LauncherStatus |
waitForStatus(long waitTime,
LauncherStatus... statuses)
Wait for one of the specified statuses of the REEF job.
|
public UserCredentials getUser()
public static DriverLauncher getLauncher(Configuration runtimeConfiguration) throws InjectionException
runtimeConfiguration
- the resourcemanager configuration to be usedInjectionException
- on configuration errorspublic void close()
close
in interface AutoCloseable
public LauncherStatus run(Configuration driverConfig)
driverConfig
- the configuration for the driver. See DriverConfiguration for details.public String submit(Configuration driverConfig, long waitTime)
driverConfig
- configuration of hte driver to submit to the RM.public LauncherStatus waitForStatus(long waitTime, LauncherStatus... statuses)
waitTime
- wait time in milliseconds.statuses
- array of statuses to wait for.public LauncherStatus run(Configuration driverConfig, long timeOut)
driverConfig
- the configuration for the driver. See DriverConfiguration for details.timeOut
- timeout on the job.public LauncherStatus getStatus()
public void setStatusAndNotify(LauncherStatus newStatus)
Copyright © 2017 The Apache Software Foundation. All rights reserved.