Interface ProcedureCoordinatorRpcs
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
ZKProcedureCoordinator
RPCs for the coordinator to run a barriered procedure with subprocedures executed at distributed
members.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
resetMembers
(Procedure procName) Notify Members to reset the distributed state for procedurevoid
sendAbortToMembers
(Procedure procName, ForeignException cause) Notify the members that the coordinator has aborted the procedure and that it should release barrier resources.void
sendGlobalBarrierAcquire
(Procedure procName, byte[] info, List<String> members) Notify the members to acquire barrier for the procedurevoid
sendGlobalBarrierReached
(Procedure procName, List<String> members) Notify members that all members have acquired their parts of the barrier and that they can now execute under the global barrier.boolean
start
(ProcedureCoordinator listener) Initialize and start threads necessary to connect an implementation's rpc mechanisms.
-
Method Details
-
start
Initialize and start threads necessary to connect an implementation's rpc mechanisms.- Returns:
- true if succeed, false if encountered initialization errors.
-
sendAbortToMembers
Notify the members that the coordinator has aborted the procedure and that it should release barrier resources.- Parameters:
procName
- name of the procedure that was abortedcause
- the reason why the procedure needs to be aborted- Throws:
IOException
- if the rpcs can't reach the other members of the procedure (and can't recover).
-
sendGlobalBarrierAcquire
void sendGlobalBarrierAcquire(Procedure procName, byte[] info, List<String> members) throws IOException, IllegalArgumentException Notify the members to acquire barrier for the procedure- Parameters:
procName
- name of the procedure to startinfo
- information that should be passed to all membersmembers
- names of the members requested to reach the acquired phase- Throws:
IllegalArgumentException
- if the procedure was already marked as failedIOException
- if we can't reach the remote notification mechanism
-
sendGlobalBarrierReached
Notify members that all members have acquired their parts of the barrier and that they can now execute under the global barrier. Must come after callingsendGlobalBarrierAcquire(Procedure, byte[], List)
- Parameters:
procName
- name of the procedure to startmembers
- members to tell we have reached in-barrier phase- Throws:
IOException
- if we can't reach the remote notification mechanism
-
resetMembers
Notify Members to reset the distributed state for procedure- Parameters:
procName
- name of the procedure to reset- Throws:
IOException
- if the remote notification mechanism cannot be reached
-