kv_list() = [{any(), any()}]
get_pid/1 |
Returns the PID associated to the Name . |
iterator/1 |
Returns a sequence of integers that starts with 0 and contains the
successive results of adding +1 to the previous element, until
NumShards is reached or passed (in the latter case, NumShards
is not an element of the sequence). |
keyfind/2 | Equivalent to keyfind(Key, KVList, undefined). |
keyfind/3 |
Returns the value to the given Key or Default if it doesn't exist. |
keyupdate/3 | Equivalent to keyupdate(Fun, Keys, undefined, TupleList). |
keyupdate/4 |
Updates the given Keys by the result of calling Fun(OldValue) . |
list_shards/2 |
Returns the list of shard names associated to the given TabName . |
pick/3 |
Pick/computes the shard where the Key will be handled. |
read_tabfile/1 | Reads the file info related to a tabfile saved previously. |
reduce_while/3 |
Reduces the List until fun returns {halt, any()} '. |
shard_name/2 |
Builds a shard name ShardName . |
to_string/1 | Converts the input data to a string. |
write_tabfile/2 | Writes to a file a content related to a table. |
get_pid(Name::atom()) -> pid() | no_return()
Returns the PID associated to the Name
.
Name
: Process name.iterator(StateOrNumShards) -> Iterator
Returns a sequence of integers that starts with 0
and contains the
successive results of adding +1
to the previous element, until
NumShards
is reached or passed (in the latter case, NumShards
is not an element of the sequence).
StateOrNumShards
: A valid shards state or number of shards.keyfind(Key, KVList) -> any()
Equivalent to keyfind(Key, KVList, undefined).
keyfind(Key::term(), KVList::kv_list(), Default::term()) -> term()
Returns the value to the given Key
or Default
if it doesn't exist.
keyupdate(Fun, Keys, TupleList) -> any()
Equivalent to keyupdate(Fun, Keys, undefined, TupleList).
keyupdate(Fun, Keys, Init, KVList1) -> KVList2
Updates the given Keys
by the result of calling Fun(OldValue)
.
If Key
doesn't exist, then Init
is set.
list_shards(Tab, NumShards) -> ShardNames
Returns the list of shard names associated to the given TabName
.
The shard names that were created in the shards:new/2,3
fun.
TabName
: Table name.NumShards
: Number of shards.pick(Key, Range, Op) -> Result
Pick/computes the shard where the Key
will be handled.
Key
: The key to be hashed to calculate the shard.Range
: Range/set – number of shards/nodes.Op
: Operation type: r | w | d
.Result
: Returns a number between 0..Range-1
.read_tabfile(Filename::shards_local:filename()) -> term() | no_return()
Reads the file info related to a tabfile saved previously.
reduce_while(Fun, AccIn, List) -> Result
Reduces the List
until fun returns {halt, any()}
'.
Fun
: Function invoked for each element in List
.AccIn
: Initial accumulator.List
: List (enumerable) to be reduced.Result
: Accumulator.shard_name(Tab, Shard) -> ShardName
Builds a shard name ShardName
.
TabName
: Table name from which the shard name is generated.Shard
: Shard number – from 0
to (NumShards - 1)
to_string(Data) -> Result
Converts the input data to a string.
write_tabfile(Filename::shards_local:filename(), Content::term()) -> ok | {error, term()}
Writes to a file a content related to a table.
Generated by EDoc, Jul 11 2017, 14:57:01.