public interface ClusterController extends RegistryHandler
Dispatcher
. Methods here are either designed to be
called before the event threads start or after they complete. The remainder
synchronized to coordinate between event threads.Modifier and Type | Method and Description |
---|---|
boolean |
cancelTask(int id)
Cancels the given task, reducing the target task count.
|
void |
containersAllocated(List<org.apache.hadoop.yarn.api.records.Container> containers)
The RM has allocated one or more containers in response to container
requests submitted to the RM.
|
void |
containersCompleted(List<org.apache.hadoop.yarn.api.records.ContainerStatus> statuses)
The Resource Manager reports that containers have completed with the given
statuses.
|
void |
containerStarted(org.apache.hadoop.yarn.api.records.ContainerId containerId)
The NM reports that a container has successfully started.
|
void |
containerStopped(org.apache.hadoop.yarn.api.records.ContainerId containerId)
The Node Manager reports that a container has stopped.
|
void |
enableFailureCheck(boolean flag) |
int |
getFreeNodeCount() |
float |
getProgress() |
Object |
getProperty(String key) |
int |
getTargetCount()
Return the target number of tasks that the controller seeks to maintain.
|
boolean |
isTaskLive(int id) |
void |
registerLifecycleListener(TaskLifecycleListener listener) |
void |
registerScheduler(Scheduler resourceGroup) |
void |
resizeDelta(int delta)
Request to resize the Drill cluster by a relative amount.
|
int |
resizeTo(int n)
Request to resize the Drill cluster to the given size.
|
void |
setMaxRetries(int value) |
void |
setProperty(String key,
Object value) |
void |
shutDown()
Indicates a request to gracefully shut down the cluster.
|
void |
started()
Called after the dispatcher has started YARN and other server
components.
|
void |
stopTaskFailed(org.apache.hadoop.yarn.api.records.ContainerId containerId,
Throwable t)
The Node Manager API reports that a request sent to the NM to stop a task
has failed.
|
boolean |
supportsDiskResource()
Whether this distribution of YARN supports disk resources.
|
void |
taskStartFailed(org.apache.hadoop.yarn.api.records.ContainerId containerId,
Throwable t)
The RM API reports that an attempt to start a container has failed locally.
|
void |
tick(long curTime)
Called by the timer ("pulse") thread to trigger time-based events.
|
void |
updateRMStatus() |
void |
visit(ControllerVisitor visitor)
Allow an observer to see a consistent view of the controller's
state by performing the visit in a synchronized block.
|
void |
visitTasks(TaskVisitor visitor)
Allow an observer to see a consistent view of the controller's
task state by performing the visit in a synchronized block.
|
boolean |
waitForCompletion()
Called by the main thread to wait for the normal shutdown of the
controller.
|
completionAck, registryDown, releaseHost, reserveHost, startAck
void enableFailureCheck(boolean flag)
void registerLifecycleListener(TaskLifecycleListener listener)
void registerScheduler(Scheduler resourceGroup)
void started() throws YarnFacadeException, AMException
YarnFacadeException
AMException
void tick(long curTime)
curTime
- void containersAllocated(List<org.apache.hadoop.yarn.api.records.Container> containers)
containers
- the set of containers provided by YARNvoid containerStarted(org.apache.hadoop.yarn.api.records.ContainerId containerId)
containerId
- the container which startedvoid taskStartFailed(org.apache.hadoop.yarn.api.records.ContainerId containerId, Throwable t)
containerId
- the container that failed to launcht
- the error that occurredvoid containerStopped(org.apache.hadoop.yarn.api.records.ContainerId containerId)
containerId
- void containersCompleted(List<org.apache.hadoop.yarn.api.records.ContainerStatus> statuses)
statuses
- float getProgress()
void stopTaskFailed(org.apache.hadoop.yarn.api.records.ContainerId containerId, Throwable t)
containerId
- the container that failed to stopt
- the reason that the stop request failedvoid resizeDelta(int delta)
delta
- the amount of change. Can be positive (to grow) or negative (to
shrink the cluster)int resizeTo(int n)
n
- the desired cluster sizevoid shutDown()
boolean waitForCompletion()
void updateRMStatus()
void setMaxRetries(int value)
void visit(ControllerVisitor visitor)
visitor
- void visitTasks(TaskVisitor visitor)
visitor
- int getTargetCount()
boolean isTaskLive(int id)
boolean cancelTask(int id)
id
- boolean supportsDiskResource()
int getFreeNodeCount()
Copyright © 1970 The Apache Software Foundation. All rights reserved.