Copyright © (C) 2011 - 2015, Jim Rosenblum
Version: Sep 7 2016 09:32:12
Authors: Jim Rosenblum.
This module wraps the mnesia-interacting, lower-level functions implemented in jc_store to provide a public, DIRTY, set of opperations. jc_s provides functions that take a sequence parameter to better support serilization (consistency) without. resorting to transactions.
JC can be called directly by Erlang clients; or, Java node -> JInterface -> jc_bridge -> jc; or, Application -> TPC/IP -> jc_protocol -> jckey() = any()
map_name() = any()
rec_ref() = reference()
seconds() = non_neg_integer()
ttl() = seconds()
value() = any()
cache_nodes/0 | Return all 'up' JC nodes and all configured JC nodes. |
cache_size/0 | Returns table size information, in records and words, for all tables used by jc. |
clear/1 | Evict all data associated with the supplied Map. |
contains_key/2 | Return true if the Key is in the map_name() ,
else false. |
delete_record_by_ref/1 | Delete the cache element by its record reference. |
evict/2 | Evict Map, Key. |
evict_all_match/1 | Call evict_match/2 on all Maps. |
evict_map_since/2 | Evict all items in the map_name() whose create_tm is older
than Age seconds. |
evict_match/2 | Evict Map, Key from the cache for Key's whose value matches the criteria. |
flush/0 | Remove all existing items from the cache sending subscription messages to subscribers. |
flush/1 | Remove all existing items from the cache without triggering notifications. |
fun_match/3 | Convert the criteria,
"a.2.d=1" to {Paths, Test}={{<<"a">>,2,<<"d">>},1}and then ask jc_store to to apply the supplied function for the cache items whose JSON value at the path equals the Test. |
get/2 | Retrieve the data associated with Key. |
get_all/2 | Return a list of {K, V} for each supplied key that was found in the chache, and a list of Ks that were misses. |
key_set/1 | Return all the keys for a given map. |
map_size/1 | Returns the number of objects in the map. |
maps/0 | Return a sorted list of all maps currently in the cache. |
put/3 | Put the entry into the cache with a TTL of infinity. |
put/4 | Put the entry into the cache with the supplied TTL. |
put_all/2 | Put all the {K,V} tuples contained in the list. |
put_all/3 | Put all the {K,V} pairs contained in the list. |
remove_items/2 | Evict all K's, return all {K, V} pairs that were found. |
stop/0 | Stop the cache at this node. |
up/0 | Returns current datetime, datetime of cluster creation and elapsed uptime. |
values/1 | Return all values in the given map. |
values_match/2 | Return the Values where the value matches the supplied criteria. |
cache_nodes() -> {{active, [node()]}, {configured, [node()]}}
Return all 'up' JC nodes and all configured JC nodes. A node is considered up if Mnesia and jc_bridge are both up.
cache_size() -> {size, [{TableNm::atom(), {records, non_neg_integer()}, {bytes, non_neg_integer()}}]}
Returns table size information, in records and words, for all tables used by jc. Notice that 'cached' Key Value data are stored in the key_to_value table.
clear(Map::map_name()) -> ok
Evict all data associated with the supplied Map.
contains_key(Map::map_name(), Key::key()) -> true | false
Return true if the Key is in the map_name()
,
else false.
delete_record_by_ref(RecRef::rec_ref()) -> ok | {error, mnesia_abort}
Delete the cache element by its record reference. Used by jc_eviction_manager.
evict(Map::map_name(), Key::key()) -> ok
evict_all_match(Criteria::string()) -> ok
Call evict_match/2
on all Maps.
Assumes the the criteria is a string in the form of
"a.b.c=true", where a.b.c is a dot-path consisting of dot-searated JSON
object-keys or JSON array indexes: "bed.id=10" or
"bed.id.2.type.something=\"stringvalue\"".
evict_map_since(Map::map_name(), AgeSecs::seconds()) -> ok
Evict all items in the map_name()
whose create_tm is older
than Age seconds.
evict_match(Map::map_name(), Criteria::string()) -> ok
Evict Map, Key from the cache for Key's whose value matches the criteria. Assumes the the criteria is a string in the form of "a.b.c=true", where a.b.c is a dot-path consisting of dot-separated JSON object-keys or JSON array indexes: "bed.id=10" or "bed.id.2.type.something=\"stringvalue\"".
flush() -> ok
Remove all existing items from the cache sending subscription messages to subscribers.
flush(X1::silent) -> ok
Remove all existing items from the cache without triggering notifications.
fun_match(Map::#{}, Criteria::string(), Fun::function()) -> {ok, term()}
Convert the criteria,
"a.2.d=1" to {Paths, Test}={{<<"a">>,2,<<"d">>},1}and then ask jc_store to to apply the supplied function for the cache items whose JSON value at the path equals the Test.
get(Map::map_name(), Key::key()) -> {ok, value()} | miss
Retrieve the data associated with Key. %
Return a list of {K, V} for each supplied key that was found in the chache, and a list of Ks that were misses.
key_set(Map::map_name()) -> {ok, Result::[key()]}
Return all the keys for a given map.
map_size(Map::map_name()) -> {records, non_neg_integer()}
Returns the number of objects in the map.
maps() -> {maps, map_name()}
Return a sorted list of all maps currently in the cache.
put(Map::map_name(), Key::key(), Value::value()) -> {ok, key()} | {error, badarg}
Put the entry into the cache with a TTL of infinity.
put(Map::map_name(), Key::key(), Value::value(), TTL::ttl()) -> {ok, key()} | {error, badarg}
Put the entry into the cache with the supplied TTL.
put_all(Map::map_name(), KVList::[tuple()]) -> {ok, non_neg_integer()} | {error, badarg}
Put all the {K,V} tuples contained in the list. Return the number of successes. Use infinity for the ttl.
put_all(Map::map_name(), KVList::[tuple()], TTL::ttl()) -> {ok, non_neg_integer()} | {error, badarg}
Put all the {K,V} pairs contained in the list. Return the number of successes. Use the supplied ttl.
remove_items(Map::map_name(), Keys::[key()]) -> {ok, [{key(), value()}]}
Evict all K's, return all {K, V} pairs that were found.
stop() -> ok
Stop the cache at this node.
up() -> {uptime, [{now, term()} | {up_at, term()} | {up_time, {term(), term()}}, ...]}
Returns current datetime, datetime of cluster creation and elapsed uptime.
values(Map::map_name()) -> {ok, [value()]}
Return all values in the given map.
values_match(Map::map_name(), Criteria::string()) -> {ok, [{key(), value()}]}
Return the Values where the value matches the supplied criteria. 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\"".
Generated by EDoc, Sep 7 2016, 09:32:12.