View Source filezcache (filezcache v2.2.0)
Summary
Functions
Save access time as a information in the datastore.
Append to existed stream.
Return checksum.
Return the directory for the storage of the cached files.
Delete data item for the storage.
Finish existed stream.
Equivalent to insert(Key, Bin, []).
Insert binary value and options.
Equivalent to insert_file(Key, FilePath, []).
Insert file and options.
Equivalent to insert_stream(Key, undefined, []).
Insert stream.
Insert stream.
Equivalent to insert_tmpfile(Key, FilePath, []).
Insert temporary file and options.
Return the directory for the storage of the
log/journal
files.Try to find monitor by Key.
Lookup datastore element by Key. Either returns the file in the filecache or a device pid to read from. The file is returned if the cache entry is complete, the device is returned if the cache entry is being written to. Read the device using file:read(Pid, Length).
Lookup datastore element by Pid or Key and options.
Lookup File by Key.
Lookup Pid and options.
Return data storade information.
Check existence of Key in the data storage.
Functions
-spec access(Key) -> Result when Key :: term(), Result :: ok.
-spec checksum(Filename) -> Result when Filename :: file:filename_all(), Result :: binary().
-spec data_dir() -> Result when Result :: file:filename_all().
-spec delete(Key) -> Result when Key :: term(), Result :: ok | {error, Reason}, Reason :: lockedlog_a | writing | active.
-spec finish_stream(Pid) -> Result when Pid :: pid(), Result :: ok.
-spec insert(Key, Bin) -> Result when Key :: term(), Bin :: binary(), Result :: {ok, Pid} | {error, Reason}, Pid :: pid(), Reason :: term().
Equivalent to insert(Key, Bin, []).
Insert binary value.-spec insert_file(Key, FilePath) -> Result when Key :: term(), FilePath :: file:filename_all(), Result :: {ok, Pid} | {error, Reason}, Pid :: pid(), Reason :: term().
Equivalent to insert_file(Key, FilePath, []).
Insert file.-spec insert_file(Key, FilePath, Opts) -> Result when Key :: term(), FilePath :: file:filename_all(), Opts :: list(), Result :: {ok, Pid} | {error, Reason}, Pid :: pid(), Reason :: term().
-spec insert_stream(Key) -> Result when Key :: term(), Result :: {ok, Pid} | {error, Reason}, Pid :: pid(), Reason :: term().
Equivalent to insert_stream(Key, undefined, []).
Insert stream.-spec insert_stream(Key, FinalSize, Opts) -> Result when Key :: term(), FinalSize :: non_neg_integer() | undefined, Opts :: list(), Result :: {ok, Pid} | {error, Reason}, Pid :: pid(), Reason :: term().
-spec insert_tmpfile(Key, FilePath) -> Result when Key :: term(), FilePath :: file:filename_all(), Result :: {ok, Pid} | {error, Reason}, Pid :: pid(), Reason :: term().
Equivalent to insert_tmpfile(Key, FilePath, []).
Insert temporary file.-spec insert_tmpfile(Key, FilePath, Opts) -> Result when Key :: term(), FilePath :: file:filename_all(), Opts :: list(), Result :: {ok, Pid} | {error, Reason}, Pid :: pid(), Reason :: term().
-spec journal_dir() -> Result when Result :: file:filename_all().
log/journal
files.
-spec locate_monitor(Key) -> Result when Key :: term(), Result :: {ok, {file, FileSize, Filename}} | {ok, {pid, pid()}} | {error, Reason}, FileSize :: non_neg_integer(), Filename :: file:filename_all(), Reason :: enoent.
-spec lookup(Key) -> Result when Key :: term(), Result :: {ok, {file, FileSize, Filename}} | {ok, {device, Pid}} | {error, term()}, FileSize :: non_neg_integer(), Filename :: file:filename_all(), Pid :: file:io_device().
-spec lookup_file(Key) -> Result when Key :: term(), Result :: {ok, {file, FileSize, Filename}} | {error, Reason}, FileSize :: non_neg_integer(), Filename :: file:filename_all(), Reason :: enoent.
-spec lookup_file(PidOrKey, Opts) -> Result when PidOrKey :: pid() | term(), Opts :: list(), Result :: {ok, {file, FileSize, Filename}} | {error, Reason}, FileSize :: non_neg_integer(), Filename :: file:filename_all(), Reason :: enoent.
-spec stats() -> Stats when Stats :: #{bytes := non_neg_integer(), max_bytes := non_neg_integer(), processes := non_neg_integer(), entries := non_neg_integer(), referrers := non_neg_integer(), gc_candidate_pool := list(), insert_count := non_neg_integer(), delete_count := non_neg_integer(), hit_count := non_neg_integer(), miss_count := non_neg_integer(), evict_count := non_neg_integer()}.