Module hash_ring_node

An object which represents a node on a consistent hash ring.

Copyright © 2013-2016 Takeru Ohta <phjgt308@gmail.com>

Description

An object which represents a node on a consistent hash ring

Data Types

data()

data() = term()

The data of a ring_node().

It holds arbitrary user data.

key()

key() = term()

The key of a ring_node().

It is used to decide location of the node on a ring.

option()

option() = {weight, weight()}

weight:

options()

options() = [option()]

ring_node()

abstract datatype: ring_node()

A node on a ring.

weight()

weight() = number()

The non negative weight of a ring_node().

The more weight node occupies, the more space in a ring.

Function Index

get_data/1Gets the data of Node
get_key/1Gets the key of Node
get_weight/1Gets the weight of Node
is_node/1Returns true if X is a ring_node(), otherwise false
make/1Equivalent to make(Key, Key).
make/2Equivalent to make(Key, Data, []).
make/3Creates a new ring_node() object.

Function Details

get_data/1

get_data(Node::ring_node()) -> data()

Gets the data of Node

get_key/1

get_key(Node::ring_node()) -> key()

Gets the key of Node

get_weight/1

get_weight(Node::ring_node()) -> weight()

Gets the weight of Node

is_node/1

is_node(X::ring_node() | term()) -> boolean()

Returns true if X is a ring_node(), otherwise false

make/1

make(Key::key()) -> ring_node()

Equivalent to make(Key, Key).

make/2

make(Key::key(), Data::data()) -> ring_node()

Equivalent to make(Key, Data, []).

make/3

make(Key::key(), Data::data(), Options::options()) -> ring_node()

Creates a new ring_node() object


Generated by EDoc, Jul 8 2020, 21:51:52.