leo_redundant_manager_worker¶
The redundant manager’s worker process.
Behaviours: `gen_server <gen_server.html>`__.
References
Description¶
The redundant manager’s worker process
Function Index¶
checksum/0 | Retrieve the checksums. |
code_change/3 | Convert process state when code is changed. |
dump/0 | Dump the current ring-info. |
first/1 | Retrieve the first record of the redundant-nodes. |
force_sync/1 | Force RING to synchronize with the manager-node. |
handle_call/3 | gen_server callback - Module:handle_call(Request, From, State) -> Result. |
handle_cast/2 | Handling cast message. |
handle_info/2 | Handling all non call/cast messages. |
init/1 | Initiates the server. |
last/1 | Retrieve the last record of the redundant-nodes. |
lookup/2 | Look up the redundant-nodes by address-id. |
redundancies/3 | Retrieve redundancies. |
start_link/0 | Start the server. |
stop/0 | Stop the server. |
terminate/2 | This function is called by a gen_server when it is about to terminate. |
Function Details¶
checksum/0¶
checksum() -> {ok, {PrevChecksum, CurChecksum}}
- PrevChecksum = integer()
- CurChecksum = integer()
Retrieve the checksums
code_change/3¶
code_change(OldVsn, State, Extra) -> any()
Convert process state when code is changed
first/1¶
first(Table) -> {ok, #redundancies{}} | not_found
- Table = atom()
Retrieve the first record of the redundant-nodes
force_sync/1¶
force_sync(Table) -> ok | {error, invalid_table}
- Table = atom()
Force RING to synchronize with the manager-node
handle_call/3¶
handle_call(Handle, From, State) -> any()
gen_server callback - Module:handle_call(Request, From, State) -> Result
handle_cast/2¶
handle_cast(Msg, State) -> any()
Handling cast message
gen_server callback - Module:handle_cast(Request, State) -> Result.
handle_info/2¶
handle_info(Info, State) -> any()
Handling all non call/cast messages
gen_server callback - Module:handle_info(Info, State) -> Result.
last/1¶
last(Table) -> {ok, #redundancies{}} | not_found
- Table = atom()
Retrieve the last record of the redundant-nodes
lookup/2¶
lookup(Table, AddrId) -> {ok, #redundancies{}} | not_found
- Table = atom()
- AddrId = non_neg_integer()
Look up the redundant-nodes by address-id
redundancies/3¶
redundancies(TableInfo, AddrId, Members) -> {ok, #redundancies{}} | not_found
- TableInfo = ring_table_info()
- AddrId = non_neg_integer()
- Members = [#member{}]
Retrieve redundancies
terminate/2¶
terminate(Reason, State) -> any()
This function is called by a gen_server when it is about to terminate. It should be the opposite of Module:init/1 and do any necessary cleaning up. When it returns, the gen_server terminates with Reason.