leo_cache_server_mcerl

The memory-cache server.

Behaviours: `leo_cache_behaviour <leo_cache_behaviour.html>`__.

References

Description

The memory-cache server

Function Index

delete/2 Remove an object from the momory storage.
get/2 Retrieve an object from cache-server.
get/3 Retrieve an object from cache-server (for large-object).
get_filepath/2 Retrieve a meta data of cached object (for large-object).
get_ref/2 Retrieve a reference of cached object (for large-object).
put/3 Insert an object into the momory storage.
put/4 Insert an object into the cache-server (for large-object).
put_begin_tran/2 Start put-transaction for large-object (for large-object).
put_end_tran/5 End put-transaction for large-object (for large-object).
start/2 Launch cache-server(s).
stats/0 Retrieve status of this application.
stop/0 Stop cache-server(s).

Function Details

delete/2

delete(Id, Key) -> ok | {error, any()}

  • Id = integer()
  • Key = binary() | any()

Remove an object from the momory storage

get/2

get(Id, Key) -> not_found | {ok, binary()} | {error, any()}

  • Id = integer()
  • Key = binary() | any()

Retrieve an object from cache-server

get/3

get(Id, Ref, Key) -> not_found | {ok, binary()} | {error, any()}

  • Id = integer()
  • Ref = reference()
  • Key = binary() | any()

Retrieve an object from cache-server (for large-object)

get_filepath/2

get_filepath(Id, Key) -> {ok, #cache_meta{}} | {error, undefined}

  • Id = integer()
  • Key = binary() | any()

Retrieve a meta data of cached object (for large-object)

get_ref/2

get_ref(Id, Key) -> {ok, reference()} | {error, undefined}

  • Id = integer()
  • Key = binary() | any()

Retrieve a reference of cached object (for large-object)

put/3

put(Id, Key, Value) -> ok | {error, any()}

  • Id = integer()
  • Key = binary() | any()
  • Value = binary() | any()

Insert an object into the momory storage

put/4

put(Id, Ref, Key, Value) -> ok | {error, any()}

  • Id = integer()
  • Ref = reference()
  • Key = binary() | any()
  • Value = binary() | any()

Insert an object into the cache-server (for large-object)

put_begin_tran/2

put_begin_tran(Id, Key) -> ok | {error, any()}

  • Id = integer()
  • Key = binary() | any()

Start put-transaction for large-object (for large-object)

put_end_tran/5

put_end_tran(Id, Ref, Key, Meta, IsCommit) -> ok | {error, any()}

  • Id = integer()
  • Ref = reference()
  • Key = binary() | any()
  • Meta = #cache_meta{}
  • IsCommit = boolean()

End put-transaction for large-object (for large-object)

start/2

start(Workers, Options) -> ok | {error, any()}

  • Workers = integer()
  • Options = [{atom(), any()}]

Launch cache-server(s)

stats/0

stats() -> {ok, any()}

Retrieve status of this application

stop/0

stop() -> ok

Stop cache-server(s)