Module rrepair

replica repair module Replica sets will be synchronized in two steps.

Copyright © 2011-2014 Zuse Institute Berlin

Version: $Id$

Behaviours: gen_component.

Authors: Maik Lange (malange@informatik.hu-berlin.de).

Description

replica repair module Replica sets will be synchronized in two steps. I) reconciliation - find set differences (rr_recon.erl) II) resolution - resolve found differences (rr_resolve.erl)

Examples: 1) remote node should get a single kvv-pair (Key, Value, Version) with Key mapped into first quadrant >>comm:send(RemoteRRepairPid, {request_resolve, {?key_upd, [{Key, Value, Version}], []}, []}).

Data Types

message()

message() = {request_sync, DestKey :: random | rt_chord:key()}
          | {request_sync,
             Method :: rr_recon:method(),
             DestKey :: random | rt_chord:key()}
          | {request_sync,
             Method :: rr_recon:method(),
             DestKey :: random | rt_chord:key(),
             Principal :: principal_id()}
          | {request_resolve,
             rr_resolve:operation(),
             rr_resolve:options()}
          | {get_state,
             Sender :: comm:mypid(),
             Keys :: state_field() | [state_field(), ...]}
          | {rr_trigger}
          | {rr_gc_trigger}
          | {start_sync,
             get_range,
             session_id(),
             rr_recon:method(),
             DestKey :: random | rt_chord:key(),
             {get_state_response, MyI :: intervals:interval()}}
          | {start_recon | continue_recon,
             SenderRRPid :: comm:mypid(),
             session_id() | null,
             ReqMsg :: rr_recon:request()}
          | {request_resolve | continue_resolve,
             session_id() | null,
             rr_resolve:operation(),
             rr_resolve:options()}
          | {continue_resolve,
             rr_resolve:operation(),
             rr_resolve:options()}
          | {web_debug_info, Requestor :: comm:erl_local_pid()}
          | {recon_progress_report,
             Sender :: comm:mypid(),
             Initiator :: boolean(),
             DestRR :: comm:mypid(),
             DestRC :: comm:mypid() | undefined,
             Stats :: rr_recon_stats:stats()}
          | {resolve_progress_report,
             Sender :: comm:erl_local_pid(),
             Stats :: rr_resolve:stats()}

principal_id()

principal_id() = comm:mypid() | none

round()

round() = non_neg_integer()

session()

session() = 
    #session{id = session_id(),
             principal = principal_id(),
             rc_method = rr_recon:method(),
             rc_stats = rr_recon_stats:stats() | none,
             rs_stats = rr_resolve:stats() | none,
             rs_called = non_neg_integer(),
             rs_finish = non_neg_integer(),
             ttl = pos_integer()}

session_id()

session_id() = {round(), comm:mypid()}

state()

state() = 
    #rrepair_state{round = round(),
                   open_recon = non_neg_integer(),
                   open_resolve = non_neg_integer(),
                   open_sessions = [session()]}

state_field()

state_field() = round
              | open_recon
              | open_resolve
              | open_sessions

Function Index

check_config/0Checks whether config parameters exist and are valid.
init/1Initialises the module and starts the trigger.
on/2session contains only data of the sync request initiator thus rs_stats:regen_count represents only number of regenerated db items on the initator.
select_sync_node/2Selects a random key in the given (continuous) interval and returns one of its replicas which is not in the interval (if ExcludeInterval is true).
start_link/1Starts the replica update process, registers it with the process dictionary and returns its pid for use by a supervisor.

Function Details

on/2

on(Msg :: message(), State :: state()) -> state()

session contains only data of the sync request initiator thus rs_stats:regen_count represents only number of regenerated db items on the initator

select_sync_node/2

select_sync_node(Interval :: intervals:continuous_interval(),
                 ExcludeInterval :: false) ->
                    rt_chord:key()

Selects a random key in the given (continuous) interval and returns one of its replicas which is not in the interval (if ExcludeInterval is true). If ExcludeInterval is false, any of its replica keys is returned.

start_link/1

start_link(DHTNodeGroup :: pid_groups:groupname()) -> {ok, pid()}

Starts the replica update process, registers it with the process dictionary and returns its pid for use by a supervisor.

init/1

init(X1 :: []) -> state()

Initialises the module and starts the trigger

check_config/0

check_config() -> boolean()

Checks whether config parameters exist and are valid.


Generated by EDoc, Jul 23 2015, 22:20:30.