leo_object_storage_api¶
The object staorge’s API.
References
Description¶
The object staorge’s API
Function Index¶
add_incorrect_data/1 | Add incorrect datas on debug purpose. |
compact_data/0 | Execute data-compaction. |
compact_data/1 | |
compact_data/2 | |
compact_data/3 | |
delete/2 | Remove an object from the object-storage. |
diagnose_data/0 | Diagnode the data. |
diagnose_data/1 | |
fetch_by_addr_id/2 | Fetch objects by ring-address-id. |
fetch_by_addr_id/3 | |
fetch_by_key/2 | Fetch objects by key (object-name). |
fetch_by_key/3 | |
get/1 | Retrieve an object and a metadata from the object-storage. |
get/3 | |
get_object_storage_pid/1 | Retrieve the storage process-id. |
get_object_storage_pid_first/0 | Retrieve the first record of object-storage pids. |
head/1 | Retrieve a metadata from the object-storage. |
head_with_calc_md5/2 | Retrieve a metada/data from backend_db/object-storage AND calc MD5 based on the body data. |
put/2 | Insert an object into the object-storage. |
start/1 | Create object-storage processes. |
start_with_path/1 | |
stats/0 | Retrieve the storage stats. |
store/2 | Store metadata and data. |
Function Details¶
add_incorrect_data/1¶
Add incorrect datas on debug purpose
compact_data/2¶
compact_data(MaxConn, CallbackFun) -> term()
- MaxConn = integer()
- CallbackFun = function()
compact_data/3¶
compact_data(TargetPids, MaxConn, CallbackFun) -> term()
- TargetPids = [atom()]
- MaxConn = integer()
- CallbackFun = function()
delete/2¶
delete(AddrIdAndKey, Object) -> ok | {error, any()}
- AddrIdAndKey = addrid_and_key()
- Object = #'?OBJECT'{}
Remove an object from the object-storage
fetch_by_addr_id/2¶
fetch_by_addr_id(AddrId, Fun) -> {ok, []} | not_found
- AddrId = non_neg_integer()
- Fun = function() | undefined
Fetch objects by ring-address-id
fetch_by_addr_id/3¶
fetch_by_addr_id(AddrId, Fun, MaxKeys) -> {ok, []} | not_found
- AddrId = non_neg_integer()
- Fun = function() | undefined
- MaxKeys = non_neg_integer() | undefined
fetch_by_key/2¶
fetch_by_key(Key, Fun) -> {ok, list()} | not_found
- Key = binary()
- Fun = function()
Fetch objects by key (object-name)
fetch_by_key/3¶
fetch_by_key(Key, Fun, MaxKeys) -> {ok, list()} | not_found
- Key = binary()
- Fun = function()
- MaxKeys = non_neg_integer() | undefined
get/1¶
get(AddrIdAndKey) -> {ok, list()} | not_found | {error, any()}
- AddrIdAndKey = addrid_and_key()
Retrieve an object and a metadata from the object-storage
get/3¶
get(AddrIdAndKey, StartPos, EndPos) -> {ok, #'?METADATA'{}, #'?OBJECT'{}} | not_found | {error, any()}
- AddrIdAndKey = addrid_and_key()
- StartPos = non_neg_integer()
- EndPos = non_neg_integer()
get_object_storage_pid/1¶
get_object_storage_pid(Arg) -> [atom()]
- Arg = all | any()
Retrieve the storage process-id
get_object_storage_pid_first/0¶
get_object_storage_pid_first() -> Id
- Id = atom()
Retrieve the first record of object-storage pids
head/1¶
head(AddrIdAndKey) -> {ok, binary()} | not_found | {error, any()}
- AddrIdAndKey = addrid_and_key()
Retrieve a metadata from the object-storage
head_with_calc_md5/2¶
head_with_calc_md5(AddrIdAndKey, MD5Context) -> {ok, metadata, any()} | {error, any()}
- AddrIdAndKey = addrid_and_key()
- MD5Context = any()
Retrieve a metada/data from backend_db/object-storage AND calc MD5 based on the body data
put/2¶
put(AddrIdAndKey, Object) -> {ok, integer()} | {error, any()}
- AddrIdAndKey = addrid_and_key()
- Object = #'?OBJECT'{}
Insert an object into the object-storage
start/1¶
start(Option) -> ok | {error, any()}
- Option = [{pos_integer(), string()}]
Create object-storage processes
store/2¶
store(Metadata, Bin) -> ok | {error, any()}
- Metadata = #'?METADATA'{}
- Bin = binary()
Store metadata and data