Module jc_s

This module wraps the mnesia-interacting, lower-level functions implemented in jc_store to provide a public, DIRTY, set of opperations.

Copyright © (C) 2011 - 2015, Jim Rosenblum

Version: Sep 7 2016 09:32:13

Authors: Jim Rosenblum.

Description

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_S

Data Types

key()

key() = any()

map_name()

map_name() = any()

seconds()

seconds() = non_neg_integer()

trx_ret_error()

trx_ret_error() = {error, badarg | out_of_seq | term()}

ttl()

ttl() = seconds()

value()

value() = any()

Function Index

evict/3Evict Map, Key if sequence is greater than or equal to the last seen sequence.
evict_all_match/2Call evict_match/2 for each Map with the given sequence number.
evict_match/3Evict Map/Key from the cache for Key's whose value matches the criteria if not out of sequence.
put/4Put the entry into the cache with a TTL of infinity using the sequence number to ensure serialized operations.
put/5Put the entry into the cache with the TTL using the sequence number to ensure serialized operations.
put_all/3Put all the {K,V} tuples contained in the list with a TTL of infinity.
put_all/4Put all the {K,V} pairs contained in the list using the supplied TTL.
remove_items/3Evict all K's, return all {K, V} pairs that were found.
sequence/0Return a sorted list of {map, sequence numbers} for each map.
sequence/1Return the sequence number associated with the given map.

Function Details

evict/3

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/2

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/3

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/4

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/5

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/3

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/4

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/3

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/0

sequence() -> [] | [{map_name(), non_neg_integer()}]

Return a sorted list of {map, sequence numbers} for each map.

sequence/1

sequence(Map::#{}) -> non_neg_integer()

Return the sequence number associated with the given map.


Generated by EDoc, Sep 7 2016, 09:32:13.