public class ZKMasterController extends java.lang.Object implements IWorkerEventSender
Modifier and Type | Field and Description |
---|---|
protected CuratorFramework |
client |
protected Config |
config |
protected PathChildrenCache |
ephemChildrenCache |
protected java.lang.String |
ephemDir |
protected java.lang.String |
jobID |
static java.util.logging.Logger |
LOG |
protected int |
numberOfWorkers |
protected PathChildrenCache |
persChildrenCache |
protected java.lang.String |
persDir |
protected java.lang.String |
rootPath |
Constructor and Description |
---|
ZKMasterController(Config config,
java.lang.String jobID,
int numberOfWorkers,
java.lang.String jmAddress,
WorkerMonitor workerMonitor) |
Modifier and Type | Method and Description |
---|---|
void |
allJoined()
all workers joined the job
|
void |
close()
close all local entities.
|
void |
initialize(JobMasterState initialState)
initialize ZKMasterController,
create znode children caches for job master to watch proper events
|
void |
jmRestarted() |
void |
jobScaled(int change,
int numberOfWorkers1)
job scaled up or down
|
void |
workerFailed(int workerID)
the worker with the provided workerID failed
|
void |
workerRestarted(JobMasterAPI.WorkerInfo workerInfo)
the worker with the provided workerInfo restarted
|
public static final java.util.logging.Logger LOG
protected int numberOfWorkers
protected java.lang.String jobID
protected Config config
protected java.lang.String rootPath
protected java.lang.String persDir
protected java.lang.String ephemDir
protected CuratorFramework client
protected PathChildrenCache ephemChildrenCache
protected PathChildrenCache persChildrenCache
public ZKMasterController(Config config, java.lang.String jobID, int numberOfWorkers, java.lang.String jmAddress, WorkerMonitor workerMonitor)
public void initialize(JobMasterState initialState) throws Twister2Exception
Twister2Exception
public void workerFailed(int workerID)
IWorkerEventSender
workerFailed
in interface IWorkerEventSender
public void workerRestarted(JobMasterAPI.WorkerInfo workerInfo)
IWorkerEventSender
workerRestarted
in interface IWorkerEventSender
public void allJoined()
IWorkerEventSender
allJoined
in interface IWorkerEventSender
public void jobScaled(int change, int numberOfWorkers1)
IWorkerEventSender
jobScaled
in interface IWorkerEventSender
public void jmRestarted()
public void close()