chstate() = riak_core_ring()
member_status() = joining | valid | invalid | leaving | exiting | down
partition_id() = non_neg_integer()
pending_change() = {Owner::node(), NextOwner::node(), awaiting | complete} | {undefined, undefined, undefined}
riak_core_dict() = dict()
riak_core_ring() = #chstate_v2{nodename = term(), vclock = vclock:vclock() | undefined, chring = chash:chash(), meta = riak_core_dict() | undefined, clustername = {term(), term()}, next = [{integer(), term(), term(), [module()], awaiting | complete}], members = [{node(), {member_status(), vclock:vclock(), [{atom(), term()}]}}], claimant = term(), seen = [{term(), vclock:vclock()}], rvsn = vclock:vclock()}
ring_size() = non_neg_integer()
| active_members/1 | Produce a list of all active (not marked as down) cluster members. |
| add_member/3 | |
| all_member_status/1 | Returns the current membership status for all nodes in the cluster. |
| all_members/1 | Produce a list of all nodes that are members of the cluster. |
| all_next_owners/1 | |
| all_owners/1 | Provide all ownership information in the form of {Index,Node} pairs. |
| all_preflists/2 | Provide every preflist in the ring, truncated at N. |
| awaiting_resize_transfer/3 | returns the first awaiting resize_transfer for a {SourceIdx, SourceNode} pair. |
| cancel_transfers/1 | Return a ring with all transfers cancelled - for claim sim. |
| chash/1 | Return the CHash of the ring. |
| check_tainted/2 | |
| claimant/1 | Return the current claimant. |
| claiming_members/1 | Return a list of all members of the cluster that are eligible to claim partitions. |
| clear_member_meta/3 | |
| cluster_name/1 | Returns the unique identifer for this cluster. |
| complete_resize_transfers/3 | |
| completed_next_owners/2 | |
| deletion_complete/3 | |
| diff_nodes/2 | For two rings, return the list of owners that have differing ownership. |
| disowning_indices/2 | Return all indices that a node is scheduled to give to another. |
| down_member/3 | |
| down_members/1 | Return a list of all members of the cluster that are marked as down. |
| downgrade/2 | Downgrade the latest ring structure to a specified version. |
| equal_rings/2 | |
| exit_member/3 | |
| fresh/0 | This is used only when this node is creating a brand new cluster. |
| fresh/1 | Equivalent to fresh/0 but allows specification of the local node name. |
| fresh/2 | Equivalent to fresh/1 but allows specification of the ring size. |
| future_index/3 | Given a key and an index in the current ring, determine which index will own the key in the future ring. |
| future_index/4 | |
| future_index/5 | |
| future_indices/2 | Return all partition indices that will be owned by a node after all pending ownership transfers have completed. |
| future_num_partitions/1 | |
| future_owner/2 | Return the node that will own this index after transtions have completed this function will error if the ring is shrinking and Idx no longer exists in it. |
| future_ring/1 | Return the ring that will exist after all pending ownership transfers have completed. |
| get_buckets/1 | return the names of all the custom buckets stored in the ring. |
| get_member_meta/3 | |
| get_meta/2 | Return a value from the cluster metadata dict. |
| handoff_complete/3 | Marks a pending transfer as completed. |
| increment_ring_version/2 | |
| increment_vclock/2 | |
| index_owner/2 | Return the node that owns the given index. |
| indices/2 | Return all partition indices owned by a node. |
| is_future_index/4 | |
| is_post_resize/1 | |
| is_primary/2 | Determine if a given Index/Node IdxNode combination is a
primary. |
| is_resize_complete/1 | |
| is_resizing/1 | |
| leave_member/3 | |
| legacy_reconcile/2 | Incorporate another node's state into our view of the Riak world. |
| maybe_abort_resize/1 | |
| member_status/2 | Returns the current membership status for a node in the cluster. |
| members/2 | |
| my_indices/1 | Return all partition indices owned by the node executing this function. |
| nearly_equal/2 | Verify that the two rings are identical expect that metadata can differ and RingB's vclock is allowed to be equal or a direct descendant of RingA's vclock. |
| next_owner/2 | Return details for a pending partition ownership change. |
| next_owner/3 | Return details for a pending partition ownership change. |
| num_partitions/1 | Return the number of partitions in this Riak ring. |
| owner_node/1 | Return the node that is responsible for a given chstate. |
| pending_changes/1 | Returns a list of all pending ownership transfers. |
| preflist/2 | For a given object key, produce the ordered list of {partition,node} pairs that could be responsible for that object. |
| pretty_print/2 | |
| random_node/1 | Return a randomly-chosen node from amongst the owners. |
| random_other_active_node/1 | Return a randomly-chosen active node other than this one. |
| random_other_index/1 | Return a partition index not owned by the node executing this function. |
| random_other_index/2 | |
| random_other_node/1 | Return a randomly-chosen node from amongst the owners other than this one. |
| ready_members/1 | Returns a list of members guaranteed safe for requests. |
| reconcile/2 | Incorporate another node's state into our view of the Riak world. |
| reconcile_names/2 | |
| remove_member/3 | |
| remove_meta/2 | Logical delete of a key in the cluster metadata dict. |
| rename_node/3 | Rename OldNode to NewNode in a Riak ring. |
| reschedule_resize_transfers/3 | reassign all outbound and inbound resize transfers from Node to NewNode |
| resize/2 | change the size of the ring to NewRingSize. |
| resize_transfer_complete/4 | mark a resize_transfer from Source to Target for Mod complete. |
| resize_transfer_status/4 | return the status of a resize_transfer for Source (an index-node pair). |
| resized_ring/1 | |
| responsible_index/2 | Determine the integer ring index responsible for a chash key. |
| ring_changed/2 | |
| ring_ready/0 | |
| ring_ready/1 | Returns true if all cluster members have seen the current ring. |
| ring_ready_info/1 | |
| ring_version/1 | |
| schedule_resize_transfer/3 | |
| set_chash/2 | |
| set_claimant/2 | |
| set_cluster_name/2 | Sets the unique identifer for this cluster. |
| set_member/4 | |
| set_member/5 | |
| set_owner/2 | Set the node that is responsible for a given chstate. |
| set_pending_changes/2 | |
| set_pending_resize/2 | Given a ring, Resizing, that has been resized (and presumably rebalanced)
schedule a resize transition for Orig. |
| set_pending_resize_abort/1 | |
| set_resized_ring/2 | |
| set_tainted/1 | |
| transfer_node/3 | |
| update_member_meta/5 | Set a key in the member metadata orddict. |
| update_meta/3 | Set a key in the cluster metadata dict. |
| upgrade/1 | Upgrade old ring structures to the latest format. |
| vnode_type/2 |
active_members(Chstate_v2) -> any()
Produce a list of all active (not marked as down) cluster members
add_member(PNode, State, Node) -> any()
all_member_status(State::chstate()) -> [{node(), member_status()}]
Returns the current membership status for all nodes in the cluster.
all_members(State::chstate()) -> [Node::term()]
Produce a list of all nodes that are members of the cluster
all_next_owners(CState::chstate()) -> [{integer(), term()}]
all_owners(State::chstate()) -> [{Index::integer(), Node::term()}]
Provide all ownership information in the form of {Index,Node} pairs.
all_preflists(State::chstate(), N::integer()) -> [[{Index::integer(), Node::term()}]]
Provide every preflist in the ring, truncated at N.
awaiting_resize_transfer(State::chstate(), Source::{integer(), term()}, Mod::atom()) -> {integer(), term()} | undefined
returns the first awaiting resize_transfer for a {SourceIdx, SourceNode} pair. If all transfers for the pair are complete, undefined is returned
cancel_transfers(Ring) -> any()
Return a ring with all transfers cancelled - for claim sim
chash(Chstate_v2::chstate()) -> CHash::chash:chash()
Return the CHash of the ring.
check_tainted(Ring, Msg) -> any()
claimant(State::chstate()) -> node()
Return the current claimant.
claiming_members(State::chstate()) -> [Node::node()]
Return a list of all members of the cluster that are eligible to claim partitions.
clear_member_meta(Node, State, Member) -> any()
cluster_name(State::chstate()) -> term()
Returns the unique identifer for this cluster.
complete_resize_transfers(State::chstate(), Source::{integer(), term()}, Mod::atom()) -> [{integer(), term()}]
completed_next_owners(Mod, Chstate_v2) -> any()
For two rings, return the list of owners that have differing ownership.
disowning_indices(State, Node) -> any()
Return all indices that a node is scheduled to give to another.
down_member(PNode, State, Node) -> any()
down_members(State::chstate()) -> [Node::node()]
Return a list of all members of the cluster that are marked as down.
downgrade(X1, Chstate_v2) -> any()
Downgrade the latest ring structure to a specified version.
exit_member(PNode, State, Node) -> any()
fresh() -> chstate()
This is used only when this node is creating a brand new cluster.
fresh(NodeName::term()) -> chstate()
Equivalent to fresh/0 but allows specification of the local node name. Called by fresh/0, and otherwise only intended for testing purposes.
fresh(RingSize::ring_size(), NodeName::term()) -> chstate()
Equivalent to fresh/1 but allows specification of the ring size. Called by fresh/1, and otherwise only intended for testing purposes.
future_index(CHashKey::chash:index(), OrigIdx::integer(), State::chstate()) -> integer() | undefined
Given a key and an index in the current ring, determine
which index will own the key in the future ring. OrigIdx
may or may not be the responsible index for that key
(OrigIdx may not be the first index in CHashKey's preflist).
The returned index will be in the same position in the preflist
for CHashKey in the future ring. For regular transitions
the returned index will always be OrigIdx. If the ring is
resizing the index may be different
future_index(CHashKey::chash:index(), OrigIdx::integer(), NValCheck::undefined | integer(), State::chstate()) -> integer() | undefined
future_index(CHashKey, OrigIdx, NValCheck, OrigCount, NextCount) -> any()
future_indices(State::chstate(), Node::node()) -> [integer()]
Return all partition indices that will be owned by a node after all pending ownership transfers have completed.
future_num_partitions(State::chstate()) -> pos_integer()
future_owner(State::chstate(), Idx::chash:index_as_int()) -> term()
Return the node that will own this index after transtions have completed this function will error if the ring is shrinking and Idx no longer exists in it
Return the ring that will exist after all pending ownership transfers have completed.
get_buckets(State::chstate()) -> [term()]
return the names of all the custom buckets stored in the ring.
get_member_meta(State, Member, Key) -> any()
get_meta(Key::term(), State::chstate()) -> {ok, term()} | undefined
Return a value from the cluster metadata dict
Marks a pending transfer as completed.
increment_ring_version(Node, State) -> any()
increment_vclock(Node, State) -> any()
index_owner(State::chstate(), Idx::chash:index_as_int()) -> Node::term()
Return the node that owns the given index.
indices(State::chstate(), Node::node()) -> [integer()]
Return all partition indices owned by a node.
is_future_index(CHashKey::chash:index(), OrigIdx::integer(), TargetIdx::integer(), State::chstate()) -> boolean()
See also: future_index/4.
is_post_resize(State::chstate()) -> boolean()
is_primary(Ring::chstate(), IdxNode::{chash:index_as_int(), node()}) -> boolean()
Determine if a given Index/Node IdxNode combination is a
primary.
is_resize_complete(Chstate_v2::chstate()) -> boolean()
is_resizing(State::chstate()) -> boolean()
leave_member(PNode, State, Node) -> any()
legacy_reconcile(ExternState, MyState) -> any()
Incorporate another node's state into our view of the Riak world.
member_status(Chstate_v2::chstate() | [node()], Node::node()) -> member_status()
Returns the current membership status for a node in the cluster.
members(Chstate_v2, Types) -> any()
my_indices(State::chstate()) -> [chash:index_as_int()]
Return all partition indices owned by the node executing this function.
Verify that the two rings are identical expect that metadata can differ and RingB's vclock is allowed to be equal or a direct descendant of RingA's vclock. This matches the changes that the fix-up logic may make to a ring.
next_owner(State::chstate(), Idx::integer()) -> pending_change()
Return details for a pending partition ownership change.
next_owner(State::chstate(), Idx::integer(), Mod::module()) -> pending_change()
Return details for a pending partition ownership change.
num_partitions(State::chstate()) -> pos_integer()
Return the number of partitions in this Riak ring.
owner_node(State::chstate()) -> Node::term()
Return the node that is responsible for a given chstate.
pending_changes(State) -> any()
Returns a list of all pending ownership transfers.
preflist(Key::binary(), State::chstate()) -> [{Index::chash:index_as_int(), Node::term()}]
For a given object key, produce the ordered list of {partition,node} pairs that could be responsible for that object.
pretty_print(Ring, Opts) -> any()
random_node(State::chstate()) -> Node::term()
Return a randomly-chosen node from amongst the owners.
random_other_active_node(State::chstate()) -> Node::term() | no_node
Return a randomly-chosen active node other than this one.
random_other_index(State::chstate()) -> chash:index_as_int()
Return a partition index not owned by the node executing this function. If this node owns all partitions, return any index.
random_other_index(State::chstate(), Exclude::[term()]) -> chash:index_as_int() | no_indices
random_other_node(State::chstate()) -> Node::term() | no_node
Return a randomly-chosen node from amongst the owners other than this one.
ready_members(Chstate_v2) -> any()
Returns a list of members guaranteed safe for requests
Incorporate another node's state into our view of the Riak world.
reconcile_names(RingA, RingB) -> any()
remove_member(PNode, State, Node) -> any()
Logical delete of a key in the cluster metadata dict
Rename OldNode to NewNode in a Riak ring.
reassign all outbound and inbound resize transfers from Node to NewNode
resize(State::chstate(), NewRingSize::ring_size()) -> chstate()
change the size of the ring to NewRingSize. If the ring
is larger than the current ring any new indexes will be owned
by a dummy host
resize_transfer_complete(State::chstate(), Source::{integer(), term()}, Target::{integer(), term()}, Mod::atom()) -> chstate()
mark a resize_transfer from Source to Target for Mod complete.
if all transfers for Source are complete, the corresponding entry
in next is marked complete. This requires any other resize_transfers
for Source that need to be started to be scheduled before calling
this fuction
resize_transfer_status(State::chstate(), Source::{integer(), term()}, Target::{integer(), term()}, Mod::atom()) -> awaiting | complete | undefined
return the status of a resize_transfer for Source (an index-node pair). undefined
is returned if no such transfer is scheduled. complete is returned if the transfer
is marked as such or Mod is contained in the completed modules set. awaiting is
returned otherwise
resized_ring(State::chstate()) -> {ok, chash:chash()} | undefined
responsible_index(ChashKey::binary(), Chstate_v2::chstate()) -> integer()
Determine the integer ring index responsible for a chash key.
ring_changed(Node, State) -> any()
ring_ready() -> any()
ring_ready(State::chstate()) -> boolean()
Returns true if all cluster members have seen the current ring.
ring_ready_info(State0) -> any()
ring_version(Chstate_v2) -> any()
schedule_resize_transfer(State::chstate(), Source::{integer(), term()}, TargetIdx::integer() | {integer(), term()}) -> chstate()
set_chash(State, CHash) -> any()
set_claimant(State, Claimant) -> any()
set_cluster_name(State, Name) -> any()
Sets the unique identifer for this cluster.
set_member(Node, CState, Member, Status) -> any()
set_member(Node, CState, Member, Status, X5) -> any()
Set the node that is responsible for a given chstate.
set_pending_changes(State, Transfers) -> any()
Given a ring, Resizing, that has been resized (and presumably rebalanced)
schedule a resize transition for Orig.
set_resized_ring(State::chstate(), FutureCHash::chash:chash()) -> chstate()
set_tainted(Ring) -> any()
update_member_meta(Node, State, Member, Key, Val) -> any()
Set a key in the member metadata orddict
Set a key in the cluster metadata dict
upgrade(Old) -> any()
Upgrade old ring structures to the latest format.
vnode_type(State::chstate(), Idx::integer()) -> primary | {fallback, term()} | future_primary | resized_primary
Generated by EDoc