Copyright © (C) 2011 - 2015, Jim Rosenblum
Version: Sep 7 2016 09:32:13
Authors: Jim Rosenblum.
This module wraps the mnesia-interacting, lower-level functions
implemented in jc_store to provide a public, DIRTY,
set of opperations. It utilizes a singleton gen_server, jc_sequence
,
to provide support for serializing opperations.
A sequence parameter is used to disallow PUT, EVICT and REMOVE operations whose sequence parameter is less than the highest, map-specific, sequence number seen thus far.
s_jc can be called directly by Erlang clients; or, Java node -> JInterface -> jc_bridge -> jc_s; or, Application -> TPC/IP -> jc_protocol -> jc_Skey() = any()
map_name() = any()
seconds() = non_neg_integer()
trx_ret_error() = {error, badarg | out_of_seq | term()}
ttl() = seconds()
value() = any()
evict/3 | Evict Map, Key if sequence is greater than or equal to the last seen sequence. |
evict_all_match/2 | Call evict_match/2 for each Map with the given sequence number. |
evict_match/3 | Evict Map/Key from the cache for Key's whose value matches the criteria if not out of sequence. |
put/4 | Put the entry into the cache with a TTL of infinity using the sequence number to ensure serialized operations. |
put/5 | Put the entry into the cache with the TTL using the sequence number to ensure serialized operations. |
put_all/3 | Put all the {K,V} tuples contained in the list with a TTL of infinity. |
put_all/4 | Put all the {K,V} pairs contained in the list using the supplied TTL. |
remove_items/3 | Evict all K's, return all {K, V} pairs that were found. |
sequence/0 | Return a sorted list of {map, sequence numbers} for each map. |
sequence/1 | Return the sequence number associated with the given map. |
evict(Map::map_name(), Key::key(), Seq::jc_sequence:seq()) -> ok | trx_ret_error()
Evict Map, Key if sequence is greater than or equal to the last seen sequence.
evict_all_match(Criteria::string(), Seq::jc_sequence:seq()) -> ok | trx_ret_error()
Call evict_match/2
for each Map with the given sequence number.
Assumes the the criteria is a string in the form of "a.b.c=true", where
a.b.c is dot-path consisting of dot-separated JSON object-keys or JSON array
indexes: "bed.id=10" or "bed.id.2.type.something=\"stringvalue\"".
evict_match(Map::map_name(), Criteria::string(), Seq::jc_sequence:seq()) -> ok | trx_ret_error()
Evict Map/Key from the cache for Key's whose value matches the criteria if not out of sequence. Assumes the the criteria is a string in the form of "a.b.c=true", where a.b.c is dot-path consisting of dot-separated JSON object-keys or JSON array indexes: "bed.id=10" or "bed.id.2.type.something=\"stringvalue\"".
put(Map::map_name(), Key::key(), Value::value(), Seq::jc_sequence:seq()) -> {ok, key()} | trx_ret_error()
Put the entry into the cache with a TTL of infinity using the sequence number to ensure serialized operations.
put(Map::map_name(), Key::key(), Value::value(), TTL::ttl(), Seq::jc_sequence:seq()) -> {ok, key()} | trx_ret_error()
Put the entry into the cache with the TTL using the sequence number to ensure serialized operations.
put_all(Map::map_name(), KVList::[{key(), value()}], Seq::jc_sequence:seq()) -> {ok, non_neg_integer()} | trx_ret_error()
Put all the {K,V} tuples contained in the list with a TTL of infinity. Use the sequence number to ensure serialized operations. Return the number of successes.
put_all(Map::map_name(), KVList::[{key(), value()}], TTL::ttl(), Seq::jc_sequence:seq()) -> {ok, non_neg_integer()} | trx_ret_error()
Put all the {K,V} pairs contained in the list using the supplied TTL. Use the sequence number to ensure serialized operations. Return the number of successes.
remove_items(Map::map_name(), Keys::[key()], Seq::jc_sequence:seq()) -> {ok, [{key(), value()}]} | trx_ret_error()
Evict all K's, return all {K, V} pairs that were found. Enforces that the sequence number is greater than what has been seen.
sequence() -> [] | [{map_name(), non_neg_integer()}]
Return a sorted list of {map, sequence numbers} for each map.
sequence(Map::#{}) -> non_neg_integer()
Return the sequence number associated with the given map.
Generated by EDoc, Sep 7 2016, 09:32:13.