From de3764b2bc4f129f0573a0cc16bc95c595d7a295 Mon Sep 17 00:00:00 2001 From: Scott Lystig Fritchie Date: Tue, 8 Dec 2015 21:38:34 +0900 Subject: [PATCH] Intermittent update to EDoc in gh-pages --- edoc/machi_admin_util.html | 2 +- edoc/machi_app.html | 2 +- edoc/machi_basho_bench_driver.html | 2 +- edoc/machi_chain_manager1.html | 2 +- edoc/machi_chain_repair.html | 2 +- edoc/machi_chash.html | 2 +- edoc/machi_cinfo.html | 82 ++++++++++ edoc/machi_config.html | 44 +++++ edoc/machi_cr_client.html | 2 +- edoc/machi_csum_table.html | 186 ++++++++++++++++++++++ edoc/machi_dt.html | 2 +- edoc/machi_file_proxy.html | 118 ++++++++++++++ edoc/machi_file_proxy_sup.html | 51 ++++++ edoc/machi_fitness.html | 120 ++++++++++++++ edoc/machi_flu1.html | 2 +- edoc/machi_flu1_client.html | 2 +- edoc/machi_flu_filename_mgr.html | 119 ++++++++++++++ edoc/machi_flu_metadata_mgr.html | 123 ++++++++++++++ edoc/machi_flu_metadata_mgr_sup.html | 49 ++++++ edoc/machi_flu_psup.html | 2 +- edoc/machi_flu_sup.html | 2 +- edoc/machi_lifecycle_mgr.html | 229 +++++++++++++++++++++++++++ edoc/machi_merkle_tree.html | 69 ++++++++ edoc/machi_pb_high_client.html | 2 +- edoc/machi_pb_translate.html | 55 +++++++ edoc/machi_plist.html | 61 +++++++ edoc/machi_projection.html | 2 +- edoc/machi_projection_store.html | 2 +- edoc/machi_proxy_flu1_client.html | 2 +- edoc/machi_sup.html | 2 +- edoc/machi_util.html | 2 +- edoc/machi_yessir_client.html | 2 +- edoc/overview-summary.html | 2 +- 33 files changed, 1326 insertions(+), 20 deletions(-) create mode 100644 edoc/machi_cinfo.html create mode 100644 edoc/machi_config.html create mode 100644 edoc/machi_csum_table.html create mode 100644 edoc/machi_file_proxy.html create mode 100644 edoc/machi_file_proxy_sup.html create mode 100644 edoc/machi_fitness.html create mode 100644 edoc/machi_flu_filename_mgr.html create mode 100644 edoc/machi_flu_metadata_mgr.html create mode 100644 edoc/machi_flu_metadata_mgr_sup.html create mode 100644 edoc/machi_lifecycle_mgr.html create mode 100644 edoc/machi_merkle_tree.html create mode 100644 edoc/machi_pb_translate.html create mode 100644 edoc/machi_plist.html diff --git a/edoc/machi_admin_util.html b/edoc/machi_admin_util.html index bcd8dd7..ca12a2f 100644 --- a/edoc/machi_admin_util.html +++ b/edoc/machi_admin_util.html @@ -45,6 +45,6 @@
-

Generated by EDoc, Dec 8 2015, 21:33:07.

+

Generated by EDoc, Dec 8 2015, 21:37:38.

diff --git a/edoc/machi_app.html b/edoc/machi_app.html index 0b62c16..be1758b 100644 --- a/edoc/machi_app.html +++ b/edoc/machi_app.html @@ -37,6 +37,6 @@
-

Generated by EDoc, Dec 8 2015, 21:33:07.

+

Generated by EDoc, Dec 8 2015, 21:37:38.

diff --git a/edoc/machi_basho_bench_driver.html b/edoc/machi_basho_bench_driver.html index 71f16e9..60c9f8f 100644 --- a/edoc/machi_basho_bench_driver.html +++ b/edoc/machi_basho_bench_driver.html @@ -59,6 +59,6 @@ could add new entries to this ETS table.


-

Generated by EDoc, Dec 8 2015, 21:33:07.

+

Generated by EDoc, Dec 8 2015, 21:37:38.

diff --git a/edoc/machi_chain_manager1.html b/edoc/machi_chain_manager1.html index f23b2d8..c455ae6 100644 --- a/edoc/machi_chain_manager1.html +++ b/edoc/machi_chain_manager1.html @@ -284,6 +284,6 @@ that the caller has checked basic projection data structure contents.


-

Generated by EDoc, Dec 8 2015, 21:33:07.

+

Generated by EDoc, Dec 8 2015, 21:37:38.

diff --git a/edoc/machi_chain_repair.html b/edoc/machi_chain_repair.html index fbefa8a..bbba1bf 100644 --- a/edoc/machi_chain_repair.html +++ b/edoc/machi_chain_repair.html @@ -86,6 +86,6 @@ in sync. In theory, that's lower overhead than the procedure used here.


-

Generated by EDoc, Dec 8 2015, 21:33:07.

+

Generated by EDoc, Dec 8 2015, 21:37:38.

diff --git a/edoc/machi_chash.html b/edoc/machi_chash.html index 9c4a40c..a2cba62 100644 --- a/edoc/machi_chash.html +++ b/edoc/machi_chash.html @@ -166,6 +166,6 @@ list.


-

Generated by EDoc, Dec 8 2015, 21:33:07.

+

Generated by EDoc, Dec 8 2015, 21:37:38.

diff --git a/edoc/machi_cinfo.html b/edoc/machi_cinfo.html new file mode 100644 index 0000000..e440910 --- /dev/null +++ b/edoc/machi_cinfo.html @@ -0,0 +1,82 @@ + + + + +Module machi_cinfo + + + + +
+ +

Module machi_cinfo

+cluster_info callback module for machi specific information + gathering. + + +

Description

cluster_info callback module for machi specific information + gathering. +

Function Index

+ + + + + + + + + +
chain_manager/1
cluster_info_generator_funs/0
cluster_info_init/0
dump/0
fitness/1
flu1/1
private_projection/1
public_projection/1
register/0
+ +

Function Details

+ +

chain_manager/1

+
+

chain_manager(FluName::atom()) -> term()

+
+ +

cluster_info_generator_funs/0

+
+

cluster_info_generator_funs() -> [{string(), fun((pid()) -> ok)}]

+
+ +

cluster_info_init/0

+
+

cluster_info_init() -> ok

+
+ +

dump/0

+
+

dump() -> any()

+
+ +

fitness/1

+
+

fitness(FluName::atom()) -> term()

+
+ +

flu1/1

+
+

flu1(FluName::atom()) -> [{atom(), term()}]

+
+ +

private_projection/1

+
+

private_projection(FluName::atom()) -> [{atom(), term()}]

+
+ +

public_projection/1

+
+

public_projection(FluName::atom()) -> [{atom(), term()}]

+
+ +

register/0

+
+

register() -> ok

+
+
+ + +

Generated by EDoc, Dec 8 2015, 21:37:38.

+ + diff --git a/edoc/machi_config.html b/edoc/machi_config.html new file mode 100644 index 0000000..f5dceed --- /dev/null +++ b/edoc/machi_config.html @@ -0,0 +1,44 @@ + + + + +Module machi_config + + + + +
+ +

Module machi_config

+Configuration consulting utilities. + + +

Description

Configuration consulting utilities. Some conventions: + - The function name should match with exact configuration + name in app.config or advanced.config of machi section. + - The default value of that configuration is expected to be in + cuttlefish schema file. Otherwise some macro in headers may + be chosen. + - Documentation of the configuration is supposed to be written + in cuttlefish schema file, rather than @doc section of the function. + - spec of the function should be written. + - Returning undefined is strongly discouraged. Return some default + value instead. + - application:get_env/3 is recommended. See max_file_size/0 for + example. +

Function Index

+ +
max_file_size/0
+ +

Function Details

+ +

max_file_size/0

+
+

max_file_size() -> pos_integer()

+
+
+ + +

Generated by EDoc, Dec 8 2015, 21:37:38.

+ + diff --git a/edoc/machi_cr_client.html b/edoc/machi_cr_client.html index 861afbd..a11a1b1 100644 --- a/edoc/machi_cr_client.html +++ b/edoc/machi_cr_client.html @@ -258,6 +258,6 @@ function name.)


-

Generated by EDoc, Dec 8 2015, 21:33:07.

+

Generated by EDoc, Dec 8 2015, 21:37:38.

diff --git a/edoc/machi_csum_table.html b/edoc/machi_csum_table.html new file mode 100644 index 0000000..60f82ee --- /dev/null +++ b/edoc/machi_csum_table.html @@ -0,0 +1,186 @@ + + + + +Module machi_csum_table + + + + +
+ +

Module machi_csum_table

+ + + +

Data Types

+ +

byte_sequence()

+

byte_sequence() = {Offset::non_neg_integer(), Size::pos_integer() | infinity}

+ + +

table()

+

table() = #machi_csum_table{}

+ + +

Function Index

+ + + + + + + + + + + + + + + + + + + + + +
all/1
all_trimmed/2
all_trimmed/3
any_trimmed/3
calc_unwritten_bytes/1
close/1
decode_csum_file_entry/1Decode a single binary() blob into an + {Offset,Size,TaggedCSum} tuple.
delete/1
encode_csum_file_entry/3Encode Offset + Size + TaggedCSum into an iolist() type for + internal storage by the FLU.
encode_csum_file_entry_bin/3Encode Offset + Size + TaggedCSum into an binary() type for + internal storage by the FLU.
find/3
find_leftneighbor/2
find_rightneighbor/2
foldl_chunks/3
open/2
split_checksum_list_blob_decode/1Split a binary() blob of checksum_list data into a list of + {Offset,Size,TaggedCSum} tuples.
sync/1
trim/3
trim/5
write/4
write/6
+ +

Function Details

+ +

all/1

+
+

all(Machi_csum_table) -> any()

+
+ +

all_trimmed/2

+
+

all_trimmed(Machi_csum_table::table(), Pos::non_neg_integer()) -> boolean()

+
+ +

all_trimmed/3

+
+

all_trimmed(Machi_csum_table::table(), Left::non_neg_integer(), Right::non_neg_integer()) -> boolean()

+
+ +

any_trimmed/3

+
+

any_trimmed(CsumT::table(), Offset::pos_integer(), Size::machi_dt:chunk_size()) -> boolean()

+
+ +

calc_unwritten_bytes/1

+
+

calc_unwritten_bytes(Machi_csum_table::table()) -> [byte_sequence()]

+
+ +

close/1

+
+

close(Machi_csum_table::table()) -> ok

+
+ +

decode_csum_file_entry/1

+
+

decode_csum_file_entry(Else::binary()) -> error | {machi_dt:file_offset(), machi_dt:chunk_size(), machi_dt:chunk_s()}

+

Decode a single binary() blob into an + {Offset,Size,TaggedCSum} tuple.

+ +

The internal encoding (which is currently exposed to the outside world +via this function and related ones) is:

+ + + + See machi.hrl for the tagged checksum types, e.g., + ?CSUM_TAG_NONE.

+ +

delete/1

+
+

delete(Machi_csum_table::table()) -> ok

+
+ +

encode_csum_file_entry/3

+
+

encode_csum_file_entry(Offset::machi_dt:file_offset(), Size::machi_dt:chunk_size(), TaggedCSum::machi_dt:chunk_s()) -> iolist()

+

Encode Offset + Size + TaggedCSum into an iolist() type for + internal storage by the FLU.

+ +

encode_csum_file_entry_bin/3

+
+

encode_csum_file_entry_bin(Offset::machi_dt:file_offset(), Size::machi_dt:chunk_size(), TaggedCSum::machi_dt:chunk_s()) -> binary()

+

Encode Offset + Size + TaggedCSum into an binary() type for + internal storage by the FLU.

+ +

find/3

+
+

find(Machi_csum_table::table(), Offset::machi_dt:file_offset(), Size::machi_dt:file_size()) -> [{machi_dt:file_offset(), machi_dt:file_size(), machi_dt:chunk_csum() | trimmed}]

+
+ +

find_leftneighbor/2

+
+

find_leftneighbor(CsumT::table(), Offset::non_neg_integer()) -> undefined | {non_neg_integer(), machi_dt:chunk_size(), trimmed | machi_dt:chunk_csum()}

+
+ +

find_rightneighbor/2

+
+

find_rightneighbor(CsumT::table(), Offset::non_neg_integer()) -> undefined | {non_neg_integer(), machi_dt:chunk_size(), trimmed | machi_dt:chunk_csum()}

+
+ +

foldl_chunks/3

+
+

foldl_chunks(Fun::fun(({non_neg_integer(), non_neg_integer(), term()}, Acc0::term()) -> Acc::term()), Acc0::term(), Machi_csum_table::table()) -> Acc::term()

+
+ +

open/2

+
+

open(CSumFilename::string(), Opts::proplists:proplist()) -> {ok, table()} | {error, file:posix()}

+
+ +

split_checksum_list_blob_decode/1

+
+

split_checksum_list_blob_decode(Bin::binary()) -> {[{machi_dt:file_offset(), machi_dt:chunk_size(), machi_dt:chunk_s()}], TrailingJunk::binary()}

+

Split a binary() blob of checksum_list data into a list of + {Offset,Size,TaggedCSum} tuples.

+ +

sync/1

+
+

sync(Machi_csum_table::table()) -> ok | {error, file:posix()}

+
+ +

trim/3

+
+

trim(Machi_csum_table::table(), Offset::machi_dt:file_offset(), Size::machi_dt:file_size()) -> ok | {error, file:posix()}

+
+ +

trim/5

+
+

trim(CsumT, Offset, Size, LeftUpdate, RightUpdate) -> any()

+
+ +

write/4

+
+

write(CsumT::table(), Offset::machi_dt:file_offset(), Size::machi_dt:file_size(), CSum::machi_dt:chunk_csum() | trimmed) -> ok | {error, trimmed | file:posix()}

+
+ +

write/6

+
+

write(Machi_csum_table, Offset, Size, CSum, LeftUpdate, RightUpdate) -> any()

+
+
+ + +

Generated by EDoc, Dec 8 2015, 21:37:38.

+ + diff --git a/edoc/machi_dt.html b/edoc/machi_dt.html index 7f334c6..f86ef02 100644 --- a/edoc/machi_dt.html +++ b/edoc/machi_dt.html @@ -105,6 +105,6 @@
-

Generated by EDoc, Dec 8 2015, 21:33:07.

+

Generated by EDoc, Dec 8 2015, 21:37:38.

diff --git a/edoc/machi_file_proxy.html b/edoc/machi_file_proxy.html new file mode 100644 index 0000000..186f516 --- /dev/null +++ b/edoc/machi_file_proxy.html @@ -0,0 +1,118 @@ + + + + +Module machi_file_proxy + + + + +
+ +

Module machi_file_proxy

+This is a proxy process which mediates access to Machi FLU +controlled files. + +

Behaviours: gen_server.

+ +

Description

This is a proxy process which mediates access to Machi FLU +controlled files. In particular, it manages the "write-once register" +conceit at the heart of Machi's design.

+ +

Read, write and append requests for a single file will be managed +through this proxy. Clients can also request syncs for specific +types of filehandles.

+ + As operations are requested, the proxy keeps track of how many + operations it has performed (and how many errors were generated.) + After a sufficient number of inactivity, the server terminates + itself. + +

Function Index

+ + + + + + + + + + + +
append/2Append data.
append/4Append data to file, supplying client metadata and (if desired) a + reservation for additional space.
read/3Read file at offset for length.
read/4
start_link/3Start a new instance of the file proxy service.
stop/1Request to stop an instance of the file proxy service.
sync/1Force a sync of all filehandles.
sync/2Force a sync of a specific filehandle type.
trim/4
write/3Write data at offset.
write/4Write data at offset, including the client metadata.
+ +

Function Details

+ +

append/2

+
+

append(Pid::pid(), Data::binary()) -> {ok, File::string(), Offset::non_neg_integer()} | {error, term()}

+

Append data

+ +

append/4

+
+

append(Pid::pid(), ClientMeta::proplists:proplist(), Extra::non_neg_integer(), Data::binary()) -> {ok, File::string(), Offset::non_neg_integer()} | {error, term()}

+

Append data to file, supplying client metadata and (if desired) a + reservation for additional space. ClientMeta is a proplist and expects the + same keys as write/4.

+ +

read/3

+
+

read(Pid::pid(), Offset::non_neg_integer(), Length::non_neg_integer()) -> {ok, [{Filename::string(), Offset::non_neg_integer(), Data::binary(), Checksum::binary()}]} | {error, Reason::term()}

+

Read file at offset for length. This returns a sequence of all + written and trimmed (optional) bytes that overlaps with requested + offset and length. Borders are not aligned.

+ +

read/4

+
+

read(Pid::pid(), Offset::non_neg_integer(), Length::non_neg_integer(), Opts::[{no_checksum | no_chunk | needs_trimmed, boolean()}]) -> {ok, [{Filename::string(), Offset::non_neg_integer(), Data::binary(), Checksum::binary()}]} | {error, Reason::term()}

+
+ +

start_link/3

+
+

start_link(FluName::atom(), Filename::string(), DataDir::string()) -> any()

+

Start a new instance of the file proxy service. Takes the filename + and data directory as arguments. This function is typically called by the + machi_file_proxy_sup:start_proxy/2 function.

+ +

stop/1

+
+

stop(Pid::pid()) -> ok

+

Request to stop an instance of the file proxy service.

+ +

sync/1

+
+

sync(Pid::pid()) -> ok | {error, term()}

+

Force a sync of all filehandles

+ +

sync/2

+
+

sync(Pid::pid(), Type::all | data | csum) -> ok | {error, term()}

+

Force a sync of a specific filehandle type. Valid types are all, csum and data.

+ +

trim/4

+
+

trim(Pid, Offset, Size, TriggerGC) -> any()

+
+ +

write/3

+
+

write(Pid::pid(), Offset::non_neg_integer(), Data::binary()) -> ok | {error, term()}

+

Write data at offset

+ +

write/4

+
+

write(Pid::pid(), Offset::non_neg_integer(), ClientMeta::proplists:proplist(), Data::binary()) -> ok | {error, term()}

+

Write data at offset, including the client metadata. ClientMeta is a proplist + that expects the following keys and values: +

+
+ + +

Generated by EDoc, Dec 8 2015, 21:37:38.

+ + diff --git a/edoc/machi_file_proxy_sup.html b/edoc/machi_file_proxy_sup.html new file mode 100644 index 0000000..e096a11 --- /dev/null +++ b/edoc/machi_file_proxy_sup.html @@ -0,0 +1,51 @@ + + + + +Module machi_file_proxy_sup + + + + +
+ +

Module machi_file_proxy_sup

+This is the main supervisor for the file proxies. + +

Behaviours: supervisor.

+ +

Description

This is the main supervisor for the file proxies. +

Function Index

+ + + + +
child_spec/1
init/1
start_link/1
start_proxy/3
+ +

Function Details

+ +

child_spec/1

+
+

child_spec(FluName) -> any()

+
+ +

init/1

+
+

init(X1) -> any()

+
+ +

start_link/1

+
+

start_link(FluName) -> any()

+
+ +

start_proxy/3

+
+

start_proxy(FluName, DataDir, Filename) -> any()

+
+
+ + +

Generated by EDoc, Dec 8 2015, 21:37:38.

+ + diff --git a/edoc/machi_fitness.html b/edoc/machi_fitness.html new file mode 100644 index 0000000..2d6c88f --- /dev/null +++ b/edoc/machi_fitness.html @@ -0,0 +1,120 @@ + + + + +Module machi_fitness + + + + +
+ +

Module machi_fitness

+ + +

Behaviours: gen_server.

+ +

Function Index

+ + + + + + + + + + + + + + + +
add_admin_down/3
code_change/3
delete_admin_down/2
format_status/2
get_unfit_list/1
handle_call/3
handle_cast/2
handle_info/2
init/1
send_fitness_update_spam/3
send_spam_to_everyone/1
start_link/1
terminate/2
trigger_early_adjustment/2For testing purposes, we don't want a test to wait for + wall-clock time to elapse before the fitness server makes a + down->up status decision.
update_local_down_list/3
+ +

Function Details

+ +

add_admin_down/3

+
+

add_admin_down(PidSpec, DownFLU, DownProps) -> any()

+
+ +

code_change/3

+
+

code_change(OldVsn, S, Extra) -> any()

+
+ +

delete_admin_down/2

+
+

delete_admin_down(PidSpec, DownFLU) -> any()

+
+ +

format_status/2

+
+

format_status(Opt, X2) -> any()

+
+ +

get_unfit_list/1

+
+

get_unfit_list(PidSpec) -> any()

+
+ +

handle_call/3

+
+

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

+
+ +

handle_cast/2

+
+

handle_cast(Msg, S) -> any()

+
+ +

handle_info/2

+
+

handle_info(Info, State) -> any()

+
+ +

init/1

+
+

init(Args) -> any()

+
+ +

send_fitness_update_spam/3

+
+

send_fitness_update_spam(Pid, FromName, Dict) -> any()

+
+ +

send_spam_to_everyone/1

+
+

send_spam_to_everyone(Pid) -> any()

+
+ +

start_link/1

+
+

start_link(Args) -> any()

+
+ +

terminate/2

+
+

terminate(Reason, S) -> any()

+
+ +

trigger_early_adjustment/2

+
+

trigger_early_adjustment(Pid, FLU) -> any()

+

For testing purposes, we don't want a test to wait for + wall-clock time to elapse before the fitness server makes a + down->up status decision.

+ +

update_local_down_list/3

+
+

update_local_down_list(PidSpec, Down, MembersDict) -> any()

+
+
+ + +

Generated by EDoc, Dec 8 2015, 21:37:38.

+ + diff --git a/edoc/machi_flu1.html b/edoc/machi_flu1.html index 5ecd5a0..c2d1d7e 100644 --- a/edoc/machi_flu1.html +++ b/edoc/machi_flu1.html @@ -109,6 +109,6 @@ as a sequencer + file server + chain manager group of processes.


-

Generated by EDoc, Dec 8 2015, 21:33:07.

+

Generated by EDoc, Dec 8 2015, 21:37:38.

diff --git a/edoc/machi_flu1_client.html b/edoc/machi_flu1_client.html index 5beaa41..3717c76 100644 --- a/edoc/machi_flu1_client.html +++ b/edoc/machi_flu1_client.html @@ -335,6 +335,6 @@ blob.


-

Generated by EDoc, Dec 8 2015, 21:33:07.

+

Generated by EDoc, Dec 8 2015, 21:37:38.

diff --git a/edoc/machi_flu_filename_mgr.html b/edoc/machi_flu_filename_mgr.html new file mode 100644 index 0000000..249206e --- /dev/null +++ b/edoc/machi_flu_filename_mgr.html @@ -0,0 +1,119 @@ + + + + +Module machi_flu_filename_mgr + + + + +
+ +

Module machi_flu_filename_mgr

+This process is responsible for managing filenames assigned to + prefixes. + + +

Description

This process is responsible for managing filenames assigned to + prefixes. It's started out of machi_flu_psup.

+ +

Supported operations include finding the "current" filename assigned to +a prefix. Incrementing the sequence number and returning a new file name +and listing all data files assigned to a given prefix.

+ +

All prefixes should have the form of {prefix, P}. Single filename + return values have the form of {file, F}.

+ +

Finding the current file associated with a sequence

+First it looks up the sequence number from the prefix name. If +no sequence file is found, it uses 0 as the sequence number and searches +for a matching file with the prefix and 0 as the sequence number. +If no file is found, the it generates a new filename by incorporating +the given prefix, a randomly generated (v4) UUID and 0 as the +sequence number.

+ + If the sequence number is > 0, then the process scans the filesystem + looking for a filename which matches the prefix and given sequence number and + returns that. +

Function Index

+ + + + + + + + + + + +
child_spec/2
code_change/3
find_or_make_filename_from_prefix/3Find the latest available or make a filename from a prefix.
handle_call/3
handle_cast/2
handle_info/2
increment_prefix_sequence/2Increment the sequence counter for a given prefix.
init/1
list_files_by_prefix/2Given a prefix in the form of {prefix, P} return + all the data files associated with that prefix.
start_link/2
terminate/2
+ +

Function Details

+ +

child_spec/2

+
+

child_spec(FluName, DataDir) -> any()

+
+ +

code_change/3

+
+

code_change(OldVsn, State, Extra) -> any()

+
+ +

find_or_make_filename_from_prefix/3

+
+

find_or_make_filename_from_prefix(FluName::atom(), EpochId::pv1_epoch_n(), Prefix::{prefix, string()}) -> {file, Filename::string()} | {error, Reason::term()} | timeout

+

Find the latest available or make a filename from a prefix. A prefix + should be in the form of a tagged tuple {prefix, P}. Returns a tagged + tuple in the form of {file, F} or an {error, Reason}

+ +

handle_call/3

+
+

handle_call(Req, From, S) -> any()

+
+ +

handle_cast/2

+
+

handle_cast(Req, State) -> any()

+
+ +

handle_info/2

+
+

handle_info(Info, State) -> any()

+
+ +

increment_prefix_sequence/2

+
+

increment_prefix_sequence(FluName::atom(), Prefix::{prefix, string()}) -> ok | {error, Reason::term()} | timeout

+

Increment the sequence counter for a given prefix. Prefix should + be in the form of {prefix, P}.

+ +

init/1

+
+

init(X1) -> any()

+
+ +

list_files_by_prefix/2

+
+

list_files_by_prefix(FluName::atom(), Prefix::{prefix, string()}) -> [file:name()] | timeout | {error, Reason::term()}

+

Given a prefix in the form of {prefix, P} return + all the data files associated with that prefix. Returns + a list.

+ +

start_link/2

+
+

start_link(FluName, DataDir) -> any()

+
+ +

terminate/2

+
+

terminate(Reason, State) -> any()

+
+
+ + +

Generated by EDoc, Dec 8 2015, 21:37:38.

+ + diff --git a/edoc/machi_flu_metadata_mgr.html b/edoc/machi_flu_metadata_mgr.html new file mode 100644 index 0000000..7fe38dc --- /dev/null +++ b/edoc/machi_flu_metadata_mgr.html @@ -0,0 +1,123 @@ + + + + +Module machi_flu_metadata_mgr + + + + +
+ +

Module machi_flu_metadata_mgr

+This is a metadata service for the machi FLU which currently +tracks the mappings between filenames and file proxies. + +

Behaviours: gen_server.

+ +

Description

This is a metadata service for the machi FLU which currently +tracks the mappings between filenames and file proxies.

+ +

The service takes a given hash space and spreads it out over a +pool of N processes which are responsible for 1/Nth the hash +space. When a user requests an operation on a particular file +the filename is hashed into the hash space and the request +forwarded to a particular manager responsible for that slice +of the hash space.

+ + The current hash implementation is erlang:phash2/1 which has + a range between 0..2^27-1 or 134,217,727. +

Function Index

+ + + + + + + + + + + + + + +
build_metadata_mgr_name/2
child_spec/4
code_change/3
handle_call/3
handle_cast/2
handle_info/2
init/1
lookup_manager_pid/2
lookup_proxy_pid/2
start_link/4
start_proxy_pid/2
stop_proxy_pid/2
terminate/2
trim_file/2
+ +

Function Details

+ +

build_metadata_mgr_name/2

+
+

build_metadata_mgr_name(FluName, N) -> any()

+
+ +

child_spec/4

+
+

child_spec(FluName, C, DataDir, N) -> any()

+
+ +

code_change/3

+
+

code_change(OldVsn, State, Extra) -> any()

+
+ +

handle_call/3

+
+

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

+
+ +

handle_cast/2

+
+

handle_cast(Req, State) -> any()

+
+ +

handle_info/2

+
+

handle_info(Info, State) -> any()

+
+ +

init/1

+
+

init(X1) -> any()

+
+ +

lookup_manager_pid/2

+
+

lookup_manager_pid(FluName, X2) -> any()

+
+ +

lookup_proxy_pid/2

+
+

lookup_proxy_pid(FluName, X2) -> any()

+
+ +

start_link/4

+
+

start_link(FluName, Name, DataDir, Num) -> any()

+
+ +

start_proxy_pid/2

+
+

start_proxy_pid(FluName, X2) -> any()

+
+ +

stop_proxy_pid/2

+
+

stop_proxy_pid(FluName, X2) -> any()

+
+ +

terminate/2

+
+

terminate(Reason, State) -> any()

+
+ +

trim_file/2

+
+

trim_file(FluName, X2) -> any()

+
+
+ + +

Generated by EDoc, Dec 8 2015, 21:37:38.

+ + diff --git a/edoc/machi_flu_metadata_mgr_sup.html b/edoc/machi_flu_metadata_mgr_sup.html new file mode 100644 index 0000000..fa4443a --- /dev/null +++ b/edoc/machi_flu_metadata_mgr_sup.html @@ -0,0 +1,49 @@ + + + + +Module machi_flu_metadata_mgr_sup + + + + +
+ +

Module machi_flu_metadata_mgr_sup

+This is the supervisor for the collection of metadata + managers. + +

Behaviours: supervisor.

+ +

Description

This is the supervisor for the collection of metadata + managers. It's started out of machi_flu_psup. It reads an + application environment variable named metadata_manager_count + with a default of 10 if it is not set. +

Function Index

+ + + +
child_spec/3
init/1
start_link/3
+ +

Function Details

+ +

child_spec/3

+
+

child_spec(FluName, DataDir, N) -> any()

+
+ +

init/1

+
+

init(X1) -> any()

+
+ +

start_link/3

+
+

start_link(FluName, DataDir, N) -> any()

+
+
+ + +

Generated by EDoc, Dec 8 2015, 21:37:38.

+ + diff --git a/edoc/machi_flu_psup.html b/edoc/machi_flu_psup.html index 1a1c736..c5bef14 100644 --- a/edoc/machi_flu_psup.html +++ b/edoc/machi_flu_psup.html @@ -131,6 +131,6 @@ at this time.


-

Generated by EDoc, Dec 8 2015, 21:33:07.

+

Generated by EDoc, Dec 8 2015, 21:37:38.

diff --git a/edoc/machi_flu_sup.html b/edoc/machi_flu_sup.html index b35607c..b203803 100644 --- a/edoc/machi_flu_sup.html +++ b/edoc/machi_flu_sup.html @@ -48,6 +48,6 @@ servers.


-

Generated by EDoc, Dec 8 2015, 21:33:07.

+

Generated by EDoc, Dec 8 2015, 21:37:38.

diff --git a/edoc/machi_lifecycle_mgr.html b/edoc/machi_lifecycle_mgr.html new file mode 100644 index 0000000..0d23068 --- /dev/null +++ b/edoc/machi_lifecycle_mgr.html @@ -0,0 +1,229 @@ + + + + +Module machi_lifecycle_mgr + + + + +
+ +

Module machi_lifecycle_mgr

+Lifecycle manager for Machi FLUs and chains. + +

Behaviours: gen_server.

+ +

Description

Lifecycle manager for Machi FLUs and chains.

+ +

Over the lifetime of a Machi cluster, both the number and types of +FLUs and chains may change. The lifecycle manager is responsible +for implementing the lifecycle changes as expressed by "policy". +In our case, "policy" is created by an external administrative +entity that creates and deletes configuration files that define +FLUs and chains relative to this local machine.

+ +

The "master configuration" for deciding which FLUs should be + running on this machine was inspired by BSD UNIX's init(8) and the +"rc.d" scheme. FLU definitions are found in a single directory, +with one file per FLU. Chains are defined similarly, with one +definition file per chain.

+ +

If a definition file for a FLU (or chain) exists, then that + FLU/chain ought to be configured into being and running. If a + definition file for a FLU/chain is removed, then that FLU/chain + should be stopped gracefully. However, deleting of a file destroys + information that is stored inside of that file. Therefore, we will + not allow arbitrary unlinking of lifecycle config files. If + the administrator deletes these config files using unlink(8) +directly, then "the warranty has been broken".

+ +

We will rely on using an administrative command to inform the +running system to stop and/or delete lifecycle resources. If the +Machi application is not running, sorry, please start Machi first.

+ +

Wheel reinvention

+ +

There's a whole mess of configuration management research & + libraries out there. I hope to ignore them all by doing something + quick & dirty & good enough here. If I fail, then I'll go +pay attention to That Other Stuff.

+ +

A note about policy

+ +

It is outside of the scope of this local lifecycle manager to make +decisions about policy or to distribute policy info/files/whatever +to other machines. This is our machine. There are many like it, +but this one is ours.

+ +

Machi Application Variables

+ +

All OTP application environment variables below are defined in the + machi application.

+ + + +

The FLU Lifecycle

+ +

FLUs on the local machine may be started and stopped, as defined by +administrative policy. In order to do any useful work, however, a +running FLU must also be configured to be a member of a replication +chain. Thus, as a practical matter, both a FLU and the chain that +the FLU participates in must both be managed by this manager.

+ +

When a new rc.d-style config file is written to the FLU +definition directory, a Machi server process will discover the file +within a certain period of time, e.g. 15 seconds. The FLU will be +started with the file's specified parameters. A FLU should be +defined and started before configuring its chain membership.

+ +

Usually a FLU is removed implicitly by removing that FLU from the a + newer definition file for the chain, or by deleting the entire + chain definition. If a FLU has been started but never been a chain + member, then the FLU can be stopped & removed explicitly.

+ +

When a FLU has been removed by policy, the FLU's data files are set +aside into a temporary area. An additional policy command may be +used to permanently delete such FLUs' data files, i.e. to reclaim +disk space.

+ +

Resources for the FLU are defined in machi_projection.hrl + in the p_srvr{} record. The major elements of this record are:

+ + + +

The Chain Lifecycle

+ +

If a FLU on the local machine is expected to participate in a + replication chain, then an rc.d-style chain definition file must +also be present on each machine that runs a FLU in the chain.

+ +

Machi's chains are self-managing, via Humming Consensus; see the + https://github.com/basho/machi/tree/master/doc/ directory for +much more detail about Humming Consensus. After FLUs have received +their initial chain configuration for Humming Consensus, the FLUs +will manage each other (and the chain) themselves.

+ +

However, Humming Consensus does not handle three chain management +problems: 1. specifying the very first chain configuration, +2. altering the membership of the chain (adding/removing FLUs from +the chain), or 3. stopping the chain permanently.

+ +

FLUs in a new chain should have definition files created on each +FLU's respective machine prior to defining their chain. Similarly, +on each machine that hosts a chain member, a chain definition file +created. External policy is responsible for creating each of these +files.

+ +

Resources for the chain are defined in machi_projection.hrl + in the chain_def_v1{} record. The major elements of this record are:

+ + + +

Conflicts with TCP ports, FLU & chain names, etc

+ + This manager is not responsible for managing conflicts in resource + namespaces, e.g., TCP port numbers, FLU names, chain names, etc. + Managing these namespaces is external policy's responsibility. +

Function Index

+ + + + + + + +
code_change/3
handle_call/3
handle_cast/2
handle_info/2
init/1
start_link/0
terminate/2
+ +

Function Details

+ +

code_change/3

+
+

code_change(OldVsn, State, Extra) -> any()

+
+ +

handle_call/3

+
+

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

+
+ +

handle_cast/2

+
+

handle_cast(Msg, State) -> any()

+
+ +

handle_info/2

+
+

handle_info(Info, State) -> any()

+
+ +

init/1

+
+

init(X1) -> any()

+
+ +

start_link/0

+
+

start_link() -> any()

+
+ +

terminate/2

+
+

terminate(Reason, State) -> any()

+
+
+ + +

Generated by EDoc, Dec 8 2015, 21:37:38.

+ + diff --git a/edoc/machi_merkle_tree.html b/edoc/machi_merkle_tree.html new file mode 100644 index 0000000..85e71a3 --- /dev/null +++ b/edoc/machi_merkle_tree.html @@ -0,0 +1,69 @@ + + + + +Module machi_merkle_tree + + + + +
+ +

Module machi_merkle_tree

+Creates a Merkle tree per file based on the checksum data for +a given data file. + + +

Description

Creates a Merkle tree per file based on the checksum data for +a given data file.

+ +

The naive implementation representation is:

+ +

<<Length:64, Offset:32, 0>> for unwritten bytes + <<Length:64, Offset:32, 1>> for trimmed bytes + <<Length:64, Offset:32, Csum/binary>> for written bytes

+ + The tree feeds these leaf nodes into hashes representing chunks of a minimum + size of at least 1024 KB (1 MB), but if the file size is larger, we will try + to get about 100 chunks for the first rollup "Level 1." We aim for around 10 + hashes at level 2, and then 2 hashes level 3 and finally the root. +

Function Index

+ + + + + +
diff/2
filename/1
open/2
open/3
tree/1
+ +

Function Details

+ +

diff/2

+
+

diff(Mt, X2) -> any()

+
+ +

filename/1

+
+

filename(Mt) -> any()

+
+ +

open/2

+
+

open(Filename, DataDir) -> any()

+
+ +

open/3

+
+

open(Filename, DataDir, Type) -> any()

+
+ +

tree/1

+
+

tree(Mt) -> any()

+
+
+ + +

Generated by EDoc, Dec 8 2015, 21:37:38.

+ + diff --git a/edoc/machi_pb_high_client.html b/edoc/machi_pb_high_client.html index 30bc44f..fcf697c 100644 --- a/edoc/machi_pb_high_client.html +++ b/edoc/machi_pb_high_client.html @@ -199,6 +199,6 @@
-

Generated by EDoc, Dec 8 2015, 21:33:07.

+

Generated by EDoc, Dec 8 2015, 21:37:38.

diff --git a/edoc/machi_pb_translate.html b/edoc/machi_pb_translate.html new file mode 100644 index 0000000..fc822fe --- /dev/null +++ b/edoc/machi_pb_translate.html @@ -0,0 +1,55 @@ + + + + +Module machi_pb_translate + + + + +
+ +

Module machi_pb_translate

+ + + +

Function Index

+ + + + + +
conv_to_csum_tag/1
from_pb_request/1Adapt impedence mismatches between Erlang and Protocol Buffers.
from_pb_response/1
to_pb_request/2
to_pb_response/3
+ +

Function Details

+ +

conv_to_csum_tag/1

+
+

conv_to_csum_tag(Type) -> any()

+
+ +

from_pb_request/1

+
+

from_pb_request(Mpb_ll_request) -> any()

+

Adapt impedence mismatches between Erlang and Protocol Buffers.

+ +

from_pb_response/1

+
+

from_pb_response(Mpb_ll_response) -> any()

+
+ +

to_pb_request/2

+
+

to_pb_request(ReqID, X2) -> any()

+
+ +

to_pb_response/3

+
+

to_pb_response(ReqID, X2, X) -> any()

+
+
+ + +

Generated by EDoc, Dec 8 2015, 21:37:38.

+ + diff --git a/edoc/machi_plist.html b/edoc/machi_plist.html new file mode 100644 index 0000000..23a5f60 --- /dev/null +++ b/edoc/machi_plist.html @@ -0,0 +1,61 @@ + + + + +Module machi_plist + + + + +
+ +

Module machi_plist

+ + + +

Data Types

+ +

plist()

+

plist() = #machi_plist{}

+ + +

Function Index

+ + + + + +
add/2
all/1
close/1
find/2
open/2persistent list of binaries.
+ +

Function Details

+ +

add/2

+
+

add(Plist::plist(), Name::string()) -> {ok, plist()} | {error, file:posix()}

+
+ +

all/1

+
+

all(Machi_plist::plist()) -> [file:filename()]

+
+ +

close/1

+
+

close(Machi_plist::plist()) -> ok

+
+ +

find/2

+
+

find(Machi_plist::plist(), Name::string()) -> boolean()

+
+ +

open/2

+
+

open(Filename::file:filename_all(), Opt::proplists:proplist()) -> {ok, plist()} | {error, file:posix()}

+

persistent list of binaries

+
+ + +

Generated by EDoc, Dec 8 2015, 21:37:38.

+ + diff --git a/edoc/machi_projection.html b/edoc/machi_projection.html index 2123c76..b013d77 100644 --- a/edoc/machi_projection.html +++ b/edoc/machi_projection.html @@ -101,6 +101,6 @@ correctly.


-

Generated by EDoc, Dec 8 2015, 21:33:07.

+

Generated by EDoc, Dec 8 2015, 21:37:38.

diff --git a/edoc/machi_projection_store.html b/edoc/machi_projection_store.html index 0d4c60d..d9de7fe 100644 --- a/edoc/machi_projection_store.html +++ b/edoc/machi_projection_store.html @@ -176,6 +176,6 @@ client access protocol (on the "server side" of the TCP connection).


-

Generated by EDoc, Dec 8 2015, 21:33:07.

+

Generated by EDoc, Dec 8 2015, 21:37:38.

diff --git a/edoc/machi_proxy_flu1_client.html b/edoc/machi_proxy_flu1_client.html index 7ef420a..9435ecb 100644 --- a/edoc/machi_proxy_flu1_client.html +++ b/edoc/machi_proxy_flu1_client.html @@ -318,6 +318,6 @@ TCP communication problems with the remote server.


-

Generated by EDoc, Dec 8 2015, 21:33:07.

+

Generated by EDoc, Dec 8 2015, 21:37:38.

diff --git a/edoc/machi_sup.html b/edoc/machi_sup.html index 6045888..bfb82f5 100644 --- a/edoc/machi_sup.html +++ b/edoc/machi_sup.html @@ -37,6 +37,6 @@
-

Generated by EDoc, Dec 8 2015, 21:33:07.

+

Generated by EDoc, Dec 8 2015, 21:37:38.

diff --git a/edoc/machi_util.html b/edoc/machi_util.html index b6ebd5e..d05c478 100644 --- a/edoc/machi_util.html +++ b/edoc/machi_util.html @@ -283,6 +283,6 @@
-

Generated by EDoc, Dec 8 2015, 21:33:07.

+

Generated by EDoc, Dec 8 2015, 21:37:38.

diff --git a/edoc/machi_yessir_client.html b/edoc/machi_yessir_client.html index 765372f..aba2a78 100644 --- a/edoc/machi_yessir_client.html +++ b/edoc/machi_yessir_client.html @@ -255,6 +255,6 @@
-

Generated by EDoc, Dec 8 2015, 21:33:07.

+

Generated by EDoc, Dec 8 2015, 21:37:38.

diff --git a/edoc/overview-summary.html b/edoc/overview-summary.html index 7be2763..867d7f8 100644 --- a/edoc/overview-summary.html +++ b/edoc/overview-summary.html @@ -180,6 +180,6 @@ the code, is a reminder signal of unfinished work.


-

Generated by EDoc, Dec 8 2015, 21:33:07.

+

Generated by EDoc, Dec 8 2015, 21:37:38.