Module leo_backend_db_server

The gen_server process for the process of database as part of a supervision tree.

Behaviours: gen_server.

References

Description

The gen_server process for the process of database as part of a supervision tree

Function Index

close/1Close the database.
code_change/3Convert process state when code is changed.
count/1Count the number of records in database.
delete/2Delete an object from backend-db.
fetch/4Fetch records from backend-db.
finish_compaction/2Direct to end a compaction.
first/1Retrieve a first record from backend-db.
first_n/3Fetch first N records from backend-db.
get/2Retrieve an object from backend-db.
get_db_raw_filepath/1get database file path for calculating disk size.
handle_call/3gen_server callback - Module:handle_call(Request, From, State) -> Result.
handle_cast/2gen_server callback - Module:handle_cast(Request, State) -> Result.
handle_info/2gen_server callback - Module:handle_info(Info, State) -> Result.
init/1gen_server callback - Module:init(Args) -> Result.
put/3Insert an object into backend-db.
put_value_to_new_db/3Direct to put a record to a temporary new data file.
run_compaction/1Direct to start a compaction.
start_link/3Creates the gen_server process as part of a supervision tree.
start_link/4
status/1Retrieve the current status from the database.
status_compaction/1Retrieve the current compaction status from the database.
stop/1Close the process.
terminate/2This function is called by a gen_server when it is about to terminate.

Function Details

close/1

close(Id) -> ok

Close the database

code_change/3

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

count(Id) -> ok

Count the number of records in database

delete/2

delete(Id::atom(), KeyBin::binary()) -> ok | {error, any()}

Delete an object from backend-db.

fetch/4

fetch(Id, KeyBin, Fun, MaxKeys) -> {ok, list()} | not_found | {error, any()}

Fetch records from backend-db.

finish_compaction/2

finish_compaction(Id, Commit) -> ok | {error, any()}

Direct to end a compaction.

first/1

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

Retrieve a first record from backend-db.

first_n/3

first_n(Id, N, Condition) -> {ok, list()} | not_found | {error, any()}

Fetch first N records from backend-db.

get/2

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

Retrieve an object from backend-db.

get_db_raw_filepath/1

get_db_raw_filepath(Id) -> {ok, string()} | {error, any()}

get database file path for calculating disk size.

handle_call/3

handle_call(X1, From, State) -> any()

gen_server callback - Module:handle_call(Request, From, State) -> Result

handle_cast/2

handle_cast(Msg, State) -> any()

gen_server callback - Module:handle_cast(Request, State) -> Result

handle_info/2

handle_info(Info, State) -> any()

gen_server callback - Module:handle_info(Info, State) -> Result

init/1

init(X1) -> any()

gen_server callback - Module:init(Args) -> Result

put/3

put(Id, KeyBin, ValueBin) -> ok | {error, any()}

Insert an object into backend-db.

put_value_to_new_db/3

put_value_to_new_db(Id, KeyBin, ValueBin) -> ok | {error, any()}

Direct to put a record to a temporary new data file.

run_compaction/1

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

Direct to start a compaction.

start_link/3

start_link(Id, DBModule, Path) -> {ok, pid()} | ignore | {error, any()}

Creates the gen_server process as part of a supervision tree

start_link/4

start_link(Id, DBModule, Path, IsStrictCheck) -> any()

status/1

status(Id) -> [{atom(), term()}]

Retrieve the current status from the database

status_compaction/1

status_compaction(Id) -> any() | {error, any()}

Retrieve the current compaction status from the database

stop/1

stop(Id) -> any()

Close the process

terminate/2

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