Behaviours: gen_server.
References
| close/1 | Close the database. |
| code_change/3 | Convert process state when code is changed. |
| count/1 | Count the number of records in database. |
| delete/2 | Delete an object from backend-db. |
| fetch/4 | Fetch records from backend-db. |
| finish_compaction/2 | Direct to end a compaction. |
| first/1 | Retrieve a first record from backend-db. |
| first_n/3 | Fetch first N records from backend-db. |
| get/2 | Retrieve an object from backend-db. |
| get_db_raw_filepath/1 | get database file path for calculating disk size. |
| handle_call/3 | gen_server callback - Module:handle_call(Request, From, State) -> Result. |
| handle_cast/2 | gen_server callback - Module:handle_cast(Request, State) -> Result. |
| handle_info/2 | gen_server callback - Module:handle_info(Info, State) -> Result. |
| init/1 | gen_server callback - Module:init(Args) -> Result. |
| put/3 | Insert an object into backend-db. |
| put_value_to_new_db/3 | Direct to put a record to a temporary new data file. |
| run_compaction/1 | Direct to start a compaction. |
| start_link/3 | Creates the gen_server process as part of a supervision tree. |
| start_link/4 | |
| status/1 | Retrieve the current status from the database. |
| status_compaction/1 | Retrieve the current compaction status from the database. |
| stop/1 | Close the process. |
| terminate/2 | This function is called by a gen_server when it is about to terminate. |
close(Id) -> ok
Id = atom()
Close the database
code_change(OldVsn, State, Extra) -> any()
Convert process state when code is changed
gen_server callback - Module:code_change(OldVsn, State, Extra) -> {ok, NewState} | {error, Reason}.
count(Id) -> ok
Id = atom()
Count the number of records in database
delete(Id::atom(), KeyBin::binary()) -> ok | {error, any()}
Delete an object from backend-db.
fetch(Id, KeyBin, Fun, MaxKeys) -> {ok, list()} | not_found | {error, any()}
Id = atom()KeyBin = binary()Fun = function()MaxKeys = integer()
Fetch records from backend-db.
finish_compaction(Id, Commit) -> ok | {error, any()}
Id = atom()Commit = boolean()
Direct to end a compaction.
first(Id) -> {ok, any(), any()} | {error, any()}
Id = atom()
Retrieve a first record from backend-db.
first_n(Id, N, Condition) -> {ok, list()} | not_found | {error, any()}
Id = atom()N = pos_integer()Condition = function()
Fetch first N records from backend-db.
get(Id, KeyBin) -> {ok, binary()} | not_found | {error, any()}
Id = atom()KeyBin = binary()
Retrieve an object from backend-db.
get_db_raw_filepath(Id) -> {ok, string()} | {error, any()}
Id = atom()
get database file path for calculating disk size.
handle_call(X1, From, State) -> any()
gen_server callback - Module:handle_call(Request, From, State) -> Result
handle_cast(Msg, State) -> any()
gen_server callback - Module:handle_cast(Request, State) -> Result
handle_info(Info, State) -> any()
gen_server callback - Module:handle_info(Info, State) -> Result
init(X1) -> any()
gen_server callback - Module:init(Args) -> Result
put(Id, KeyBin, ValueBin) -> ok | {error, any()}
Id = atom()KeyBin = binary()ValueBin = binary()
Insert an object into backend-db.
put_value_to_new_db(Id, KeyBin, ValueBin) -> ok | {error, any()}
Id = atom()KeyBin = binary()ValueBin = binary()
Direct to put a record to a temporary new data file.
run_compaction(Id) -> ok | {error, any()}
Id = atom()
Direct to start a compaction.
start_link(Id, DBModule, Path) -> {ok, pid()} | ignore | {error, any()}
Id = atom()DBModule = atom()Path = string()
Creates the gen_server process as part of a supervision tree
start_link(Id, DBModule, Path, IsStrictCheck) -> any()
status(Id) -> [{atom(), term()}]
Id = atom()
Retrieve the current status from the database
status_compaction(Id) -> any() | {error, any()}
Id = atom()
Retrieve the current compaction status from the database
stop(Id) -> any()
Close the process
terminate(Reason, State) -> any()
This function is called by a gen_server when it is about to terminate. It should be the opposite of Module:init/1 and do any necessary cleaning up. When it returns, the gen_server terminates with Reason. The return value is ignored.
gen_server callback - Module:terminate(Reason, State)
Generated by EDoc