Module cloudi_write_ahead_logging

CloudI Write Ahead Logging (WAL)

File storage for transaction logging done by cloudi_service_queue.

Copyright © 2014-2016 Michael Truog

Version: 1.5.2 Sep 14 2016 21:54:32 ------------------------------------------------------------------------

Authors: Michael Truog (mjtruog [at] gmail (dot) com).

Description

CloudI Write Ahead Logging (WAL)

File storage for transaction logging done by cloudi_service_queue. No disk index is maintained, but an in-memory index is kept.

Data Types

dict_proxy()

dict_proxy(Key, Value) = dict:dict(Key, Value)

non_neg_integer_64bit()

non_neg_integer_64bit() = 0..18446744073709551615

pos_integer_64bit()

pos_integer_64bit() = 1..18446744073709551615

state()

state() = #state{file = undefined | binary() | string(), compression = undefined | 0..9, position = undefined | non_neg_integer(), chunks = dict_proxy(cloudi_service:trans_id(), #chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}), chunks_free = [#chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}]}

Function Index

erase/2
erase_retry/4
fetch_keys/1
new/3
size/1
size_free/1
store_end/3
store_fail/2
store_start/2
update/3

Function Details

erase/2

erase(ChunkId::cloudi_service:trans_id(), State::#state{file = undefined | binary() | string(), compression = undefined | 0..9, position = undefined | non_neg_integer(), chunks = dict_proxy(cloudi_service:trans_id(), #chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}), chunks_free = [#chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}]}) -> {cloudi_service_queue:request(), #state{file = undefined | binary() | string(), compression = undefined | 0..9, position = undefined | non_neg_integer(), chunks = dict_proxy(cloudi_service:trans_id(), #chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}), chunks_free = [#chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}]}}

erase_retry/4

erase_retry(ChunkId::cloudi_service:trans_id(), RetryMax::non_neg_integer(), RetryF::fun((cloudi_service_queue:request()) -> {ok, cloudi_service:trans_id()} | {error, any()}), State::#state{file = undefined | binary() | string(), compression = undefined | 0..9, position = undefined | non_neg_integer(), chunks = dict_proxy(cloudi_service:trans_id(), #chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}), chunks_free = [#chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}]}) -> #state{file = undefined | binary() | string(), compression = undefined | 0..9, position = undefined | non_neg_integer(), chunks = dict_proxy(cloudi_service:trans_id(), #chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}), chunks_free = [#chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}]}

fetch_keys/1

fetch_keys(State::#state{file = undefined | binary() | string(), compression = undefined | 0..9, position = undefined | non_neg_integer(), chunks = dict_proxy(cloudi_service:trans_id(), #chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}), chunks_free = [#chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}]}) -> [cloudi_service:trans_id()]

new/3

new(FilePath::string() | binary(), Compression::0..9, RetryF::fun((cloudi_service_queue:request()) -> {ok, cloudi_service:trans_id()} | {error, any()})) -> #state{file = undefined | binary() | string(), compression = undefined | 0..9, position = undefined | non_neg_integer(), chunks = dict_proxy(cloudi_service:trans_id(), #chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}), chunks_free = [#chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}]}

size/1

size(State::#state{file = undefined | binary() | string(), compression = undefined | 0..9, position = undefined | non_neg_integer(), chunks = dict_proxy(cloudi_service:trans_id(), #chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}), chunks_free = [#chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}]}) -> non_neg_integer()

size_free/1

size_free(State::#state{file = undefined | binary() | string(), compression = undefined | 0..9, position = undefined | non_neg_integer(), chunks = dict_proxy(cloudi_service:trans_id(), #chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}), chunks_free = [#chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}]}) -> non_neg_integer()

store_end/3

store_end(ChunkId::cloudi_service:trans_id(), Chunk::#chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}, State::#state{file = undefined | binary() | string(), compression = undefined | 0..9, position = undefined | non_neg_integer(), chunks = dict_proxy(cloudi_service:trans_id(), #chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}), chunks_free = [#chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}]}) -> #state{file = undefined | binary() | string(), compression = undefined | 0..9, position = undefined | non_neg_integer(), chunks = dict_proxy(cloudi_service:trans_id(), #chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}), chunks_free = [#chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}]}

store_fail/2

store_fail(Chunk::#chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}, State::#state{file = undefined | binary() | string(), compression = undefined | 0..9, position = undefined | non_neg_integer(), chunks = dict_proxy(cloudi_service:trans_id(), #chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}), chunks_free = [#chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}]}) -> #state{file = undefined | binary() | string(), compression = undefined | 0..9, position = undefined | non_neg_integer(), chunks = dict_proxy(cloudi_service:trans_id(), #chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}), chunks_free = [#chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}]}

store_start/2

store_start(ChunkRequest::cloudi_service_queue:request(), State::#state{file = undefined | binary() | string(), compression = undefined | 0..9, position = undefined | non_neg_integer(), chunks = dict_proxy(cloudi_service:trans_id(), #chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}), chunks_free = [#chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}]}) -> {#chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}, #state{file = undefined | binary() | string(), compression = undefined | 0..9, position = undefined | non_neg_integer(), chunks = dict_proxy(cloudi_service:trans_id(), #chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}), chunks_free = [#chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}]}}

update/3

update(ChunkId::cloudi_service:trans_id(), UpdateF::fun((cloudi_service_queue:request()) -> {cloudi_service:trans_id(), cloudi_service_queue:request()} | undefined), State::#state{file = undefined | binary() | string(), compression = undefined | 0..9, position = undefined | non_neg_integer(), chunks = dict_proxy(cloudi_service:trans_id(), #chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}), chunks_free = [#chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}]}) -> {cloudi_service_queue:request() | undefined, #state{file = undefined | binary() | string(), compression = undefined | 0..9, position = undefined | non_neg_integer(), chunks = dict_proxy(cloudi_service:trans_id(), #chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}), chunks_free = [#chunk{size = pos_integer_64bit(), position = non_neg_integer_64bit(), request = cloudi_service_queue:request() | undefined, retries = non_neg_integer()}]}}


Generated by EDoc, Sep 14 2016, 21:54:32.