Module riak_ensemble_basic_backend

Implementation of the riak_ensemble_backend behavior that that stores simple key/value objects in an in-process orddict that is synchronously written to disk on each put.

Behaviours: riak_ensemble_backend.

Description

Implementation of the riak_ensemble_backend behavior that that stores simple key/value objects in an in-process orddict that is synchronously written to disk on each put.

Note: this is used as the peer type for the built-in root ensemble that stores system-wide metadata, bootstraps additional ensembles, etc.

Data Types

ensemble_id()

ensemble_id() = term()

epoch()

epoch() = integer()

key()

key() = any()

obj()

obj() = #obj{epoch = epoch(), seq = seq(), key = term(), value = term()}

peer_id()

peer_id() = {term(), node()}

seq()

seq() = integer()

state()

state() = #state{savefile = file:filename(), id = peer_id(), data = orddict:orddict()}

value()

value() = any()

views()

views() = [[peer_id()]]

Function Index

get/3
handle_down/4
init/3
new_obj/4
obj_epoch/1
obj_key/1
obj_seq/1
obj_value/1
ping/2
put/4
ready_to_start/0
set_obj_epoch/2
set_obj_seq/2
set_obj_value/2
synctree_path/2
tick/5

Function Details

get/3

get(Key::key(), From::riak_ensemble_backend:from(), State::state()) -> state()

handle_down/4

handle_down(Ref::reference(), Pid::pid(), Reason::term(), State::state()) -> false

init/3

init(Ensemble::ensemble_id(), Id::peer_id(), X3::[]) -> state()

new_obj/4

new_obj(Epoch::epoch(), Seq::seq(), Key::key(), Value::value()) -> obj()

obj_epoch/1

obj_epoch(Obj::obj()) -> epoch()

obj_key/1

obj_key(Obj::obj()) -> key()

obj_seq/1

obj_seq(Obj::obj()) -> seq()

obj_value/1

obj_value(Obj::obj()) -> value()

ping/2

ping(From::pid(), State::state()) -> {ok, state()}

put/4

put(Key::key(), Obj::obj(), From::riak_ensemble_backend:from(), State::state()) -> state()

ready_to_start/0

ready_to_start() -> any()

set_obj_epoch/2

set_obj_epoch(Epoch::epoch(), Obj::obj()) -> obj()

set_obj_seq/2

set_obj_seq(Seq::seq(), Obj::obj()) -> obj()

set_obj_value/2

set_obj_value(Value::value(), Obj::obj()) -> obj()

synctree_path/2

synctree_path(Ensemble, Id) -> any()

tick/5

tick(Epoch::epoch(), Seq::seq(), Leader::peer_id(), Views::views(), State::state()) -> state()


Generated by EDoc