Class ZKProcedureMemberRpcs
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- ProcedureMemberRpcs
 There can only be one ZKProcedureMemberRpcs per procedure type per member, since each
 procedure type is bound to a single set of znodes. You can have multiple
 ZKProcedureMemberRpcs on the same server, each serving a different member name, but each
 individual rpcs is still bound to a single member name (and since they are used to determine
 global progress, its important to not get this wrong).
 
To make this slightly more confusing, you can run multiple, concurrent procedures at the same time (as long as they have different types), from the same controller, but the same node name must be used for each procedure (though there is no conflict between the two procedure as long as they have distinct names).
There is no real error recovery with this mechanism currently -- if any the coordinator fails, its re-initialization will delete the znodes and require all in progress subprocedures to start anew.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Loggerprotected ProcedureMemberprivate Stringprivate final ZKProcedureUtil
- 
Constructor SummaryConstructorsConstructorDescriptionZKProcedureMemberRpcs(ZKWatcher watcher, String procType) Must callstart(String, ProcedureMember)before this can be used.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidPass along the found abort notification to the listenervoidclose()Each subprocedure is being executed on a member.private voidPass along the procedure global barrier notification to any listenersvoidThis should be called by the member and should write a serialized root cause exception as to the abort znode.voidThis attempts to create an acquired state znode for the procedure (snapshot name).voidsendMemberCompleted(Subprocedure sub, byte[] data) This acts as the ack for a completed procedurevoidstart(String memberName, ProcedureMember listener) Initialize and start any threads or connections the member needs.private voidstartNewSubprocedure(String path) Kick off a new sub-procedure on the listener with the data stored in the passed znode.private voidprivate void
- 
Field Details- 
LOG
- 
zkController
- 
member
- 
memberName
 
- 
- 
Constructor Details- 
ZKProcedureMemberRpcspublic ZKProcedureMemberRpcs(ZKWatcher watcher, String procType) throws org.apache.zookeeper.KeeperException Must callstart(String, ProcedureMember)before this can be used.
 
- 
- 
Method Details- 
getZkController
- 
getMemberNameDescription copied from interface:ProcedureMemberRpcsEach subprocedure is being executed on a member. This is the identifier for the member.- Specified by:
- getMemberNamein interface- ProcedureMemberRpcs
- Returns:
- the member name
 
- 
receivedReachedGlobalBarrierPass along the procedure global barrier notification to any listeners- Parameters:
- path- full znode path that cause the notification
 
- 
watchForAbortedProcedures
- 
waitForNewProcedures
- 
startNewSubprocedureKick off a new sub-procedure on the listener with the data stored in the passed znode.Will attempt to create the same procedure multiple times if an procedure znode with the same name is created. It is left up the coordinator to ensure this doesn't occur. - Parameters:
- path- full path to the znode for the procedure to start
 
- 
sendMemberAcquiredThis attempts to create an acquired state znode for the procedure (snapshot name). It then looks for the reached znode to trigger in-barrier execution. If not present we have a watcher, if present then trigger the in-barrier action.- Specified by:
- sendMemberAcquiredin interface- ProcedureMemberRpcs
- Parameters:
- sub- the specified- Subprocedure
- Throws:
- IOException- if we can't reach the coordinator
 
- 
sendMemberCompletedThis acts as the ack for a completed procedure- Specified by:
- sendMemberCompletedin interface- ProcedureMemberRpcs
- Parameters:
- sub- the specified- Subprocedure
- data- the data the member returns to the coordinator along with the notification
- Throws:
- IOException- if we can't reach the coordinator
 
- 
sendMemberAbortedThis should be called by the member and should write a serialized root cause exception as to the abort znode.- Specified by:
- sendMemberAbortedin interface- ProcedureMemberRpcs
- Parameters:
- sub- the- Subprocedurewe are aborting
- ee- the reason why the member's subprocedure aborted
 
- 
abortPass along the found abort notification to the listener- Parameters:
- abortZNode- full znode path to the failed procedure information
 
- 
startDescription copied from interface:ProcedureMemberRpcsInitialize and start any threads or connections the member needs.- Specified by:
- startin interface- ProcedureMemberRpcs
 
- 
close- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Throws:
- IOException
 
 
-