leo_dcerl

The disc cache API.

References

Description

The disc cache API

Function Index

delete/1 Delete all of key-value pairs from the specified leo_dcerl erlang process.
get/2 Get a value corresponding with the specified key from the specified leo_dcerl erlang process.
get_chunk/2 Get a chunk corresponding with the specified file descriptor from the specified leo_dcerl erlang process.
get_filepath/2 Get a metadata AND status corresponding with the specified key from the specified leo_dcerl erlang process.
put/3 Put a key-value pair into the specified leo_dcerl erlang process.
put_begin/2 Begin a transaction to put a large key-value pair into the specified leo_dcerl erlang process.
put_chunk/3 Put a chunk into the specified leo_dcerl erlang process while doing transaction.
put_end/4 End a transaction to put a large key-value pair into the specified leo_dcerl erlang process.
remove/2 Remove a key-value pair from the specified leo_dcerl erlang process.
start/4 Start a leo_dcerl erlang process with specified settings.
stats/1 Get a status from the specified leo_dcerl erlang process.
stop/1 Stop the specified leo_dcerl erlang process.

Function Details

delete/1

delete(State) -> {ok, #dcerl_state{}} | {error, any()}

  • State = #dcerl_state{}

Delete all of key-value pairs from the specified leo_dcerl erlang process

get/2

get(State, Key) -> {ok, #dcerl_state{}, binary()} | {ok, #dcerl_state{}, #dcerl_fd{}} | {error, any()}

  • State = #dcerl_state{}
  • Key = binary()

Get a value corresponding with the specified key from the specified leo_dcerl erlang process

get_chunk/2

get_chunk(State, Fd) -> {ok, #dcerl_state{}, #dcerl_fd{}, Chunk::binary(), Tail::boolean()} | {error, any()}

  • State = #dcerl_state{}
  • Fd = #dcerl_fd{}

Get a chunk corresponding with the specified file descriptor from the specified leo_dcerl erlang process

get_filepath/2

get_filepath(State, Key) -> {ok, #dcerl_state{}, #cache_meta{}} | {error, any()}

  • State = #dcerl_state{}
  • Key = binary()

Get a metadata AND status corresponding with the specified key from the specified leo_dcerl erlang process

put/3

put(State, Key, Val) -> {ok, #dcerl_state{}} | {error, any()}

  • State = #dcerl_state{}
  • Key = binary()
  • Val = binary()

Put a key-value pair into the specified leo_dcerl erlang process

put_begin/2

put_begin(State, Key) -> {ok, #dcerl_state{}, #dcerl_fd{}} | {error, any()}

  • State = #dcerl_state{}
  • Key = binary()

Begin a transaction to put a large key-value pair into the specified leo_dcerl erlang process

put_chunk/3

put_chunk(State, Fd, Chunk) -> ok | {error, any()}

  • State = #dcerl_state{}
  • Fd = #dcerl_fd{}
  • Chunk = binary()

Put a chunk into the specified leo_dcerl erlang process while doing transaction

put_end/4

put_end(State, Fd, CM, Commit) -> {ok, #dcerl_state{}} | {error, any()}

  • State = #dcerl_state{}
  • Fd = #dcerl_fd{}
  • CM = #cache_meta{}
  • Commit = boolean()

End a transaction to put a large key-value pair into the specified leo_dcerl erlang process

remove/2

remove(State, Key) -> {ok, #dcerl_state{}} | {error, any()}

  • State = #dcerl_state{}
  • Key = binary()

Remove a key-value pair from the specified leo_dcerl erlang process

start/4

start(DataDir, JournalDir, MaxSize, ChunkSize) -> {ok, #dcerl_state{}} | {error, any()}

  • DataDir = string()
  • JournalDir = string()
  • MaxSize = integer()
  • ChunkSize = integer()

Start a leo_dcerl erlang process with specified settings

stats/1

stats(State) -> {ok, #cache_stats{}}

  • State = #dcerl_state{}

Get a status from the specified leo_dcerl erlang process

stop/1

stop(State) -> {ok, #dcerl_state{}} | {error, any()}

  • State = #dcerl_state{}

Stop the specified leo_dcerl erlang process