Behaviours: gen_fsm.
drain_param() = {exchange_fsm_pid, pid()} | {yz_index_hashtree_update_params, {tree(), p(), short_preflist()}} | {drain_partition, n()}
drain_params() = [drain_param()]
n() = pos_integer()
p() = non_neg_integer()
tree() = pid()
| cancel/2 | Cancel a drain. |
| code_change/4 | |
| drain_already_in_progress/2 | Notify the drain FSM identified by DPid that the solrq associated with the specified Token has an existing drain request in progress and cannot perform another drain at this time. |
| drain_complete/2 | Notify the drain FSM identified by DPid that the solrq associated with the specified Token has completed draining. |
| handle_event/3 | |
| handle_info/3 | |
| handle_sync_event/4 | |
| init/1 | |
| prepare/2 | We receive a start message in the prepare state when start_prepare/0 is called. |
| resume_workers/1 | |
| start_link/0 | Start the drain FSM process. |
| start_link/1 | Creates a gen_fsm process which calls Module:init/1 to initialize. |
| start_prepare/1 | Start draining. |
| terminate/3 | |
| wait_for_drain_complete/2 | While in the wait state, we wait for drain_complete messages with accompanying tokens. |
| wait_for_snapshot_complete/2 | |
| wait_for_yz_hashtree_updated/2 |
cancel(DPid::pid(), Timeout::non_neg_integer()) -> ok | no_proc | timeout
Cancel a drain. This operation will result in sending a cancel message to each of the solrqs, putting them back into a batching state.
code_change(OldVsn, StateName, State, Extra) -> any()
drain_already_in_progress(DPid, Token) -> any()
Notify the drain FSM identified by DPid that the solrq associated with the specified Token has an existing drain request in progress and cannot perform another drain at this time.
NB. This function is typically called from each solrq.drain_complete(DPid::pid(), Token::reference()) -> ok
Notify the drain FSM identified by DPid that the solrq associated with the specified Token has completed draining. Note that the solrq will remain in the wait_for_drain_complete state until it receives a drain_complete message back from the specified FSM.
NB. This function is typically called from each solrq.handle_event(Event, StateName, State) -> any()
handle_info(Info, StateName, State) -> any()
handle_sync_event(Event, From, StateName, State) -> any()
init(Params) -> any()
prepare(X1, State) -> any()
We receive a start message in the prepare state when start_prepare/0 is called. This will initiate a drain on all the solrqs. This gives us a list of references (tokens) we wait for while in the wait state, the state in which we immediate move into.
resume_workers(Pid) -> any()
start_link() -> {ok, pid()} | ignore | {error, Reason::term()}
Start the drain FSM process. Note that the drain FSM will immediately go into the prepare state, but it will not start draining until start_prepate/0 is called.
start_link(Params::drain_params()) -> {ok, pid()} | ignore | {error, Reason::term()}
Creates a gen_fsm process which calls Module:init/1 to initialize. To ensure a synchronized start-up procedure, this function does not return until Module:init/1 has returned.
start_prepare(DPid::pid()) -> no_proc | timeout | term()
Start draining. This operation will send a start message to this FSM with a start message, which in turn will initiate drains on all of the solrqs.
NB. This function is typically called from the drain manager.terminate(Reason, StateName, State) -> any()
wait_for_drain_complete(X1, State) -> any()
While in the wait state, we wait for drain_complete messages with accompanying tokens. When we have received all of the tokens, we are done, and the FSM terminates normally. Otherwise, we keep waiting.
wait_for_snapshot_complete(X1, State) -> any()
wait_for_yz_hashtree_updated(X1, State) -> any()
Generated by EDoc