Package me.ahoo.cosid.mongo.reactive
Class MongoReactiveMachineCollection
java.lang.Object
me.ahoo.cosid.mongo.reactive.MongoReactiveMachineCollection
- All Implemented Interfaces:
MachineCollection
-
Field Summary
Fields inherited from interface me.ahoo.cosid.mongo.MachineCollection
COLLECTION_NAME
-
Constructor Summary
ConstructorDescriptionMongoReactiveMachineCollection
(com.mongodb.reactivestreams.client.MongoCollection<org.bson.Document> machineCollection) -
Method Summary
Modifier and TypeMethodDescriptiondistribute
(String namespace, int machineBit, InstanceId instanceId) distributeByRevert
(String namespace, InstanceId instanceId, Duration safeGuardDuration) distributeBySelf
(String namespace, InstanceId instanceId, Duration safeGuardDuration) void
guard
(String namespace, InstanceId instanceId, MachineState machineState, Duration safeGuardDuration) int
nextMachineId
(String namespace) void
revert
(String namespace, InstanceId instanceId, MachineState machineState)
-
Constructor Details
-
MongoReactiveMachineCollection
public MongoReactiveMachineCollection(com.mongodb.reactivestreams.client.MongoCollection<org.bson.Document> machineCollection)
-
-
Method Details
-
nextMachineId
- Specified by:
nextMachineId
in interfaceMachineCollection
-
distribute
- Specified by:
distribute
in interfaceMachineCollection
-
distributeByRevert
public MachineState distributeByRevert(String namespace, InstanceId instanceId, Duration safeGuardDuration) - Specified by:
distributeByRevert
in interfaceMachineCollection
-
distributeBySelf
public MachineState distributeBySelf(String namespace, InstanceId instanceId, Duration safeGuardDuration) - Specified by:
distributeBySelf
in interfaceMachineCollection
-
revert
public void revert(String namespace, InstanceId instanceId, MachineState machineState) throws MachineIdLostException - Specified by:
revert
in interfaceMachineCollection
- Throws:
MachineIdLostException
-
guard
public void guard(String namespace, InstanceId instanceId, MachineState machineState, Duration safeGuardDuration) throws MachineIdLostException - Specified by:
guard
in interfaceMachineCollection
- Throws:
MachineIdLostException
-