Package org.apache.hadoop.hbase.master
Class WorkerAssigner
java.lang.Object
org.apache.hadoop.hbase.master.WorkerAssigner
- All Implemented Interfaces:
ServerListener
help assign and release a worker for each remote task. For each worker, concurrent running task
should be no more than maxTasks. If a task failed to acquire a worker, it will suspend and wait
for workers available.
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Map<ServerName,
Integer> private final ProcedureEvent<?>
private final MasterServices
private final int
-
Constructor Summary
ConstructorDescriptionWorkerAssigner
(MasterServices master, int maxTasks, ProcedureEvent<?> event) -
Method Summary
Modifier and TypeMethodDescriptionacquire()
void
addUsedWorker
(ServerName worker) getAvailableWorker
(ServerName serverName) void
release
(ServerName serverName) void
serverAdded
(ServerName worker) The server has joined the cluster.void
void
wake
(MasterProcedureScheduler scheduler) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.hadoop.hbase.master.ServerListener
serverRemoved, waiting
-
Field Details
-
currentWorkers
-
master
-
event
-
maxTasks
-
-
Constructor Details
-
WorkerAssigner
-
-
Method Details
-
acquire
-
release
-
suspend
-
wake
-
serverAdded
Description copied from interface:ServerListener
The server has joined the cluster.- Specified by:
serverAdded
in interfaceServerListener
- Parameters:
worker
- The remote servers name.
-
addUsedWorker
-
getAvailableWorker
-