ex_shards v0.2.1 ExShards
Shards API – This is the equivalent module to shards
.
To build match specs for select
functions, you can use Ex2ms
library – it is included in ExShards
.
Examples
# this is required to build match specs for select operations
iex> require Ex2ms
# create a table with default options
iex> ExShards.new :mytab
:mytab
iex> ExShards.insert :mytab, [k1: 1, k2: 2, k3: 3]
true
iex> for k <- [:k1, :k2, :k3] do
[{_, v}] = ExShards.lookup(:mytab, k)
v
end
[1, 2, 3]
iex> ms = Ex2ms.fun do {_, v} -> v end
[{{:_, :"$1"}, [], [:"$1"]}]
iex> ExShards.select :mytab, ms
[1, 2, 3]
iex> ExShards.delete :mytab, :k3
true
iex> ExShards.lookup :mytab, :k3
[]
# let's create another table
iex> ExShards.new :mytab2, [{:n_shards, 4}]
:mytab2
# start the observer so you can see how shards behaves
iex> :observer.start
:ok
Links:
- Shards
- API Reference
ExShards.Ext
– Extended API
Link to this section Summary
Link to this section Types
Link to this section Functions
Link to this function
all()
Link to this function
definitions()
Link to this function
delete(Elixir.arg1)
Link to this function
delete(Elixir.arg1, Elixir.arg2)
Link to this function
delete_all_objects(Elixir.arg1)
Link to this function
delete_object(Elixir.arg1, Elixir.arg2)
Link to this function
file2tab(Elixir.arg1)
Link to this function
file2tab(Elixir.arg1, Elixir.arg2)
Link to this function
first(Elixir.arg1)
Link to this function
foldl(Elixir.arg1, Elixir.arg2, Elixir.arg3)
Link to this function
foldr(Elixir.arg1, Elixir.arg2, Elixir.arg3)
Link to this function
get_and_update(tab, key, fun)
Link to this function
get_and_update!(tab, key, fun)
Link to this function
get_nodes(Elixir.arg1)
Link to this function
give_away(Elixir.arg1, Elixir.arg2, Elixir.arg3)
Link to this function
info(Elixir.arg1)
Link to this function
info(Elixir.arg1, Elixir.arg2)
Link to this function
info_shard(Elixir.arg1)
Link to this function
info_shard(Elixir.arg1, Elixir.arg2)
Link to this function
insert(Elixir.arg1, Elixir.arg2)
Link to this function
insert_new(Elixir.arg1, Elixir.arg2)
Link to this function
is_compiled_ms(Elixir.arg1)
Link to this function
join(Elixir.arg1, Elixir.arg2)
Link to this function
last(Elixir.arg1)
Link to this function
leave(Elixir.arg1, Elixir.arg2)
Link to this function
list(Elixir.arg1)
Link to this function
lookup(Elixir.arg1, Elixir.arg2)
Link to this function
lookup_element(Elixir.arg1, Elixir.arg2, Elixir.arg3)
Link to this function
match(Elixir.arg1)
Link to this function
match(Elixir.arg1, Elixir.arg2)
Link to this function
match(Elixir.arg1, Elixir.arg2, Elixir.arg3)
Link to this function
match_delete(Elixir.arg1, Elixir.arg2)
Link to this function
match_object(Elixir.arg1)
Link to this function
match_object(Elixir.arg1, Elixir.arg2)
Link to this function
match_object(Elixir.arg1, Elixir.arg2, Elixir.arg3)
Link to this function
match_spec_compile(Elixir.arg1)
Link to this function
match_spec_run(Elixir.arg1, Elixir.arg2)
Link to this function
member(Elixir.arg1, Elixir.arg2)
Link to this function
next(Elixir.arg1, Elixir.arg2)
Link to this function
prev(Elixir.arg1, Elixir.arg2)
Link to this function
rename(Elixir.arg1, Elixir.arg2)
Link to this function
safe_fixtable(Elixir.arg1, Elixir.arg2)
Link to this function
select(Elixir.arg1)
Link to this function
select(Elixir.arg1, Elixir.arg2)
Link to this function
select(Elixir.arg1, Elixir.arg2, Elixir.arg3)
Link to this function
select_count(Elixir.arg1, Elixir.arg2)
Link to this function
select_delete(Elixir.arg1, Elixir.arg2)
Link to this function
select_reverse(Elixir.arg1)
Link to this function
select_reverse(Elixir.arg1, Elixir.arg2)
Link to this function
select_reverse(Elixir.arg1, Elixir.arg2, Elixir.arg3)
Link to this function
setopts(Elixir.arg1, Elixir.arg2)
Link to this function
state(Elixir.arg1)
Link to this function
tab2file(Elixir.arg1, Elixir.arg2)
Link to this function
tab2file(Elixir.arg1, Elixir.arg2, Elixir.arg3)
Link to this function
tab2list(Elixir.arg1)
Link to this function
tabfile_info(Elixir.arg1)
Link to this function
table(Elixir.arg1)
Link to this function
table(Elixir.arg1, Elixir.arg2)
Link to this function
take(Elixir.arg1, Elixir.arg2)
Link to this function
test_ms(Elixir.arg1, Elixir.arg2)
Link to this function
update(tab, key, initial, fun)
Link to this function
update_counter(Elixir.arg1, Elixir.arg2, Elixir.arg3)
Link to this function
update_counter(Elixir.arg1, Elixir.arg2, Elixir.arg3, Elixir.arg4)
Link to this function
update_element(Elixir.arg1, Elixir.arg2, Elixir.arg3)