Class | Description |
---|---|
ZKContext | |
ZKJobMasterFinder |
this class is used to discover the Job Master ip address and port number through ZooKeeper
JobMaster creates a znode at the ZooKeeper server
this class queries this node and retrieves the job master address from the content of that znode
When that znode can not be retrieved immediately,
it creates a NodeCache object and gets the value from this cache,
instead of querying continually
|
ZKJobMasterRegistrar |
it is a single node controller
A single node registers, others discover that node
In our case, Job Master registers, workers discover the job master
Job Master creates an ephemeral, persistent znode
Job Master IP and port number is put as the payload to this node in the form of:
|
ZKUtil |
this class provides methods to construct znode path names for jobs and workers
in addition, it provides methods to cleanup znodes on zookeeper server
|
ZKWorkerController |
gets unique workerID's for each client by using DistributedAtomicInteger
gets the current list of all workers from PathChildrenCache
it does not keep the list of worker nodes, it is already kept in PathChildrenCache
If a worker joins after failure, it gets its previous ID
There is no gap in id sequence.
|