Package me.ahoo.cosid.zookeeper
Class ZookeeperMachineIdDistributor
java.lang.Object
me.ahoo.cosid.machine.AbstractMachineIdDistributor
me.ahoo.cosid.zookeeper.ZookeeperMachineIdDistributor
- All Implemented Interfaces:
MachineIdDistributor
Zookeeper MachineIdDistributor.
-
Field Summary
Fields inherited from class me.ahoo.cosid.machine.AbstractMachineIdDistributor
NOT_FOUND_LAST_STAMP
Fields inherited from interface me.ahoo.cosid.machine.MachineIdDistributor
FOREVER_SAFE_GUARD_DURATION
-
Constructor Summary
ConstructorDescriptionZookeeperMachineIdDistributor
(org.apache.curator.framework.CuratorFramework curatorFramework, org.apache.curator.RetryPolicy retryPolicy, MachineStateStorage machineStateStorage, ClockBackwardsSynchronizer clockBackwardsSynchronizer) -
Method Summary
Modifier and TypeMethodDescriptionprotected MachineState
distributeByRecyclable
(String namespace, String instancePath, InstanceId instanceId, Duration safeGuardDuration) protected MachineState
distributeRemote
(String namespace, int machineBit, InstanceId instanceId, Duration safeGuardDuration) protected void
guardRemote
(String namespace, InstanceId instanceId, MachineState machineState, Duration safeGuardDuration) protected void
revertRemote
(String namespace, InstanceId instanceId, MachineState machineState) Methods inherited from class me.ahoo.cosid.machine.AbstractMachineIdDistributor
distribute, guard, revert
-
Constructor Details
-
ZookeeperMachineIdDistributor
public ZookeeperMachineIdDistributor(org.apache.curator.framework.CuratorFramework curatorFramework, org.apache.curator.RetryPolicy retryPolicy, MachineStateStorage machineStateStorage, ClockBackwardsSynchronizer clockBackwardsSynchronizer)
-
-
Method Details
-
distributeRemote
protected MachineState distributeRemote(String namespace, int machineBit, InstanceId instanceId, Duration safeGuardDuration) - Specified by:
distributeRemote
in classAbstractMachineIdDistributor
-
distributeByRecyclable
protected MachineState distributeByRecyclable(String namespace, String instancePath, InstanceId instanceId, Duration safeGuardDuration) throws Exception - Throws:
Exception
-
revertRemote
- Specified by:
revertRemote
in classAbstractMachineIdDistributor
-
guardRemote
protected void guardRemote(String namespace, InstanceId instanceId, MachineState machineState, Duration safeGuardDuration) - Specified by:
guardRemote
in classAbstractMachineIdDistributor
-