Module ra_kv

Behaviours: ra_machine.

Data Types

command()

command() = #put{key = key(), value = term(), meta = #{size := non_neg_integer(), hash := integer()}} | #delete{key = key()}

key()

key() = binary()

state()

abstract datatype: state()

value()

value() = term()

Function Index

add_member/3
apply/3
delete/3
get/3get performs a consistent query that returns the index, hash and member set then perform an aux query to actually get the data for a given index.
handle_aux/5
init/1
init_aux/1
live_indexes/1
member_overview/1
overview/1
put/4
read_entry/4
remove_member/3
start_cluster/3
take_snapshot/1

Function Details

add_member/3

add_member(System::atom(), NewMemberId::ra_server_id(), LeaderId::ra_server_id()) -> ok | {error, term()} | {timeout, ra_server_id()}

apply/3

apply(Meta, Put, State0) -> any()

delete/3

delete(ServerId::ra:server_id(), Key::key(), Timeout::non_neg_integer()) -> {ok, map()} | {error, not_found} | {error, term()} | {timeout, ra:server_id()}

get/3

get(ServerId::ra:server_id(), Key::key(), Timeout::non_neg_integer()) -> {ok, map(), value()} | {error, term()} | {timeout, ra:server_id()}

get performs a consistent query that returns the index, hash and member set then perform an aux query to actually get the data for a given index. if addressing a follower (say there is a local one) then the read may need to wait if the index isn't yet available locally (term also need to be checked) or check that the machien state has the right index for a given key before reading the value from the log

handle_aux/5

handle_aux(RaState, X2, X3, Aux, Internal) -> any()

init/1

init(X1) -> any()

init_aux/1

init_aux(X1) -> any()

live_indexes/1

live_indexes(X1) -> any()

member_overview/1

member_overview(ServerId) -> any()

overview/1

overview(State) -> any()

put/4

put(ServerId::ra:server_id(), Key::key(), Value::value(), Timeout::non_neg_integer()) -> {ok, map()} | {error, term()} | {timeout, ra:server_id()}

read_entry/4

read_entry(ServerId, Idx, Members, Timeout) -> any()

remove_member/3

remove_member(System::atom(), NewMemberId::ra_server_id(), LeaderId::ra_server_id()) -> ok | {error, term()} | {timeout, ra_server_id()}

start_cluster/3

start_cluster(System::atom(), ClusterName::atom(), Config::#{members := [ra_server_id()]}) -> {ok, [ra_server_id()], [ra_server_id()]} | {error, cluster_not_formed}

take_snapshot/1

take_snapshot(ServerId::ra_server_id()) -> ok


Generated by EDoc