|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectml.shifu.guagua.BasicCoordinator<MASTER_RESULT,WORKER_RESULT>
MASTER_RESULT - master result for computation in each iteration.WORKER_RESULT - worker result for computation in each iteration.public class BasicCoordinator<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable>
BasicCoordinator is a basic implementation for both SyncWorkerCoordinator and SyncMasterCoordinator:
Watcher to monitor zookeeper znodes.
| 嵌套类摘要 | |
|---|---|
protected static class |
BasicCoordinator.BasicCoordinatorCommand
BasicCoordinator.BasicCoordinatorCommand is to process exceptions for zookeeper operations. |
protected static interface |
BasicCoordinator.CoordinatorCommand
BasicCoordinator.CoordinatorCommand is used for consistent process of zookeeper coordination. |
protected static class |
BasicCoordinator.RetryCoordinatorCommand
BasicCoordinator.RetryCoordinatorCommand is used to wrap retry logic. |
| 从接口 org.apache.zookeeper.Watcher 继承的嵌套类/接口 |
|---|
org.apache.zookeeper.Watcher.Event |
| 字段摘要 | |
|---|---|
protected static int |
WAIT_SLOT_MILLS
Default waiting time to check master or worker progress from zookeeper servers. |
| 构造方法摘要 | |
|---|---|
BasicCoordinator()
|
|
| 方法摘要 | |
|---|---|
protected void |
checkAndSetZooKeeper(Properties props)
Set up connection with given zookeeper settings. |
protected void |
closeZooKeeper()
|
protected StringBuilder |
getAppNode(String appId)
|
protected StringBuilder |
getBaseMasterElectionNode(String appId)
|
protected byte[] |
getBytesFromZNode(String znode,
String splitZnode)
This is reverse method to setBytesToZNode(String, String, byte[], CreateMode). |
protected StringBuilder |
getCurrentMasterNode(String appId,
int iteration)
|
protected StringBuilder |
getCurrentMasterSplitNode(String appId,
int iteration)
|
protected StringBuilder |
getCurrentWorkerNode(String appId,
String containerId,
int iteration)
|
protected StringBuilder |
getCurrentWorkerSplitNode(String appId,
String containerId,
int iteration)
|
protected StringBuilder |
getLastMasterNode(String appId,
int iteration)
|
protected StringBuilder |
getLastWorkerNode(String appId,
String containerId,
int iteration)
|
protected StringBuilder |
getMasterBaseNode(String appId)
|
protected StringBuilder |
getMasterElectionNode(String appId,
long sessionId)
|
protected StringBuilder |
getMasterNode(String appId,
int iteration)
|
Serializer<MASTER_RESULT> |
getMasterSerializer()
|
protected StringBuilder |
getRootNode()
|
long |
getSleepTime()
|
protected StringBuilder |
getWorkerBaseNode(String appId)
|
protected StringBuilder |
getWorkerBaseNode(String appId,
int iteration)
|
protected StringBuilder |
getWorkerNode(String appId,
String containerId,
int iteration)
|
Serializer<WORKER_RESULT> |
getWorkerSerializer()
|
CountDownLatch |
getZkConnLatch()
|
GuaguaZooKeeper |
getZooKeeper()
|
protected void |
initialize(Properties props)
Coordinator initialization. |
boolean |
isFixedTime()
|
void |
process(org.apache.zookeeper.WatchedEvent event)
|
protected boolean |
setBytesToZNode(String znode,
String splitZnode,
byte[] bytes,
org.apache.zookeeper.CreateMode createNode)
Set bytes to znode, if bytes is over zookeeper data limit(1MB), use children znodes to store each part. |
void |
setFixedTime(boolean isFixedTime)
|
void |
setMasterSerializer(Serializer<MASTER_RESULT> masterSerializer)
|
void |
setSleepTime(long sleepTime)
|
void |
setWorkerSerializer(Serializer<WORKER_RESULT> workerSerializer)
|
void |
setZooKeeper(GuaguaZooKeeper zooKeeper)
|
protected void |
startHeartbeat()
|
protected void |
stopHeartBeat()
|
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 字段详细信息 |
|---|
protected static final int WAIT_SLOT_MILLS
| 构造方法详细信息 |
|---|
public BasicCoordinator()
| 方法详细信息 |
|---|
protected StringBuilder getMasterBaseNode(String appId)
protected StringBuilder getMasterNode(String appId,
int iteration)
protected StringBuilder getCurrentMasterNode(String appId,
int iteration)
protected StringBuilder getCurrentMasterSplitNode(String appId,
int iteration)
protected StringBuilder getLastMasterNode(String appId,
int iteration)
protected StringBuilder getRootNode()
protected StringBuilder getBaseMasterElectionNode(String appId)
protected StringBuilder getMasterElectionNode(String appId,
long sessionId)
protected StringBuilder getAppNode(String appId)
protected StringBuilder getWorkerBaseNode(String appId)
protected StringBuilder getWorkerBaseNode(String appId,
int iteration)
protected StringBuilder getWorkerNode(String appId,
String containerId,
int iteration)
protected StringBuilder getCurrentWorkerNode(String appId,
String containerId,
int iteration)
protected StringBuilder getCurrentWorkerSplitNode(String appId,
String containerId,
int iteration)
protected StringBuilder getLastWorkerNode(String appId,
String containerId,
int iteration)
protected void initialize(Properties props)
protected void checkAndSetZooKeeper(Properties props)
protected void closeZooKeeper()
throws InterruptedException
InterruptedExceptionprotected void startHeartbeat()
protected void stopHeartBeat()
throws InterruptedException
InterruptedExceptionpublic void process(org.apache.zookeeper.WatchedEvent event)
org.apache.zookeeper.Watcher 中的 process
protected boolean setBytesToZNode(String znode,
String splitZnode,
byte[] bytes,
org.apache.zookeeper.CreateMode createNode)
throws org.apache.zookeeper.KeeperException,
InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
protected byte[] getBytesFromZNode(String znode,
String splitZnode)
throws org.apache.zookeeper.KeeperException,
InterruptedException
setBytesToZNode(String, String, byte[], CreateMode). Firstly get data from
znode. If data is empty, get data from its children.
org.apache.zookeeper.KeeperException
InterruptedExceptionpublic GuaguaZooKeeper getZooKeeper()
public void setZooKeeper(GuaguaZooKeeper zooKeeper)
public long getSleepTime()
public void setSleepTime(long sleepTime)
public boolean isFixedTime()
public void setFixedTime(boolean isFixedTime)
public Serializer<WORKER_RESULT> getWorkerSerializer()
public void setWorkerSerializer(Serializer<WORKER_RESULT> workerSerializer)
public Serializer<MASTER_RESULT> getMasterSerializer()
public void setMasterSerializer(Serializer<MASTER_RESULT> masterSerializer)
public CountDownLatch getZkConnLatch()
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||