2015-04-08 08:52:58 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
< html >
< head >
< meta http-equiv = "Content-Type" content = "text/html; charset=UTF-8" >
< title > Module machi_flu1_client< / title >
< link rel = "stylesheet" type = "text/css" href = "stylesheet.css" title = "EDoc" >
< / head >
< body bgcolor = "white" >
< div class = "navbar" > < a name = "#navbar_top" > < / a > < table width = "100%" border = "0" cellspacing = "0" cellpadding = "2" summary = "navigation bar" > < tr > < td > < a href = "overview-summary.html" target = "overviewFrame" > Overview< / a > < / td > < td > < a href = "http://www.erlang.org/" > < img src = "erlang.png" align = "right" border = "0" alt = "erlang logo" > < / a > < / td > < / tr > < / table > < / div >
< hr >
< h1 > Module machi_flu1_client< / h1 >
< ul class = "index" > < li > < a href = "#description" > Description< / a > < / li > < li > < a href = "#types" > Data Types< / a > < / li > < li > < a href = "#index" > Function Index< / a > < / li > < li > < a href = "#functions" > Function Details< / a > < / li > < / ul > Erlang API for the Machi FLU TCP protocol version 1.
2015-05-20 03:37:28 +00:00
< h2 > < a name = "description" > Description< / a > < / h2 > < p > Erlang API for the Machi FLU TCP protocol version 1.< / p >
< p > This client API handles low-level PDU serialization/deserialization
and low-level TCP session management, e.g. open, receive, write,
close. The API for higher-level session management and Machi state
management can be found in < a href = "machi_proxy_flu1_client.html" > < code > machi_proxy_flu1_client< / code > < / a > and
< a href = "machi_cr_client.html" > < code > machi_cr_client< / code > < / a > .< / p >
< p > TODO This EDoc was written first, and the EDoc and also < code > -type< / code > and
< code > -spec< / code > definitions for < a href = "machi_proxy_flu1_client.html" > < code > machi_proxy_flu1_client< / code > < / a > and < a href = "machi_cr_client.html" > < code > machi_cr_client< / code > < / a > must be improved.< / p >
< h4 > < a name = "Protocol_origins" > Protocol origins< / a > < / h4 >
< p > The protocol implemented here is an artisanal, hand-crafted, silly
thing that was very quick to put together for a "demo day" proof of
concept. It will almost certainly be replaced with something else,
both in terms of wire format and better code separation of
serialization/deserialization vs. network transport management,
etc.< / p >
For the moment, this module implements a rudimentary TCP-based
protocol as the sole supported access method to the server,
sequencer, and projection store. Conceptually, those three
services are independent and ought to have their own protocols. As
a practical matter, there is no need for wire protocol
compatibility. Furthermore, from the perspective of failure
detection, it is very convenient that all three FLU-related
services are accessed using the same single TCP port.
2015-04-08 08:52:58 +00:00
< h2 > < a name = "types" > Data Types< / a > < / h2 >
< h3 class = "typedecl" > < a name = "type-chunk" > chunk()< / a > < / h3 >
< p > < tt > chunk() = binary() | iolist()< / tt > < / p >
< p > client can use either< / p >
< h3 class = "typedecl" > < a name = "type-chunk_csum" > chunk_csum()< / a > < / h3 >
< p > < tt > chunk_csum() = {< a href = "#type-file_offset" > file_offset()< / a > , < a href = "#type-chunk_size" > chunk_size()< / a > , binary()}< / tt > < / p >
< h3 class = "typedecl" > < a name = "type-chunk_pos" > chunk_pos()< / a > < / h3 >
< p > < tt > chunk_pos() = {< a href = "#type-file_offset" > file_offset()< / a > , < a href = "#type-chunk_size" > chunk_size()< / a > , < a href = "#type-file_name_s" > file_name_s()< / a > }< / tt > < / p >
< h3 class = "typedecl" > < a name = "type-chunk_s" > chunk_s()< / a > < / h3 >
< p > < tt > chunk_s() = binary()< / tt > < / p >
< p > server always uses binary()< / p >
< h3 class = "typedecl" > < a name = "type-chunk_size" > chunk_size()< / a > < / h3 >
< p > < tt > chunk_size() = non_neg_integer()< / tt > < / p >
< h3 class = "typedecl" > < a name = "type-epoch_csum" > epoch_csum()< / a > < / h3 >
< p > < tt > epoch_csum() = binary()< / tt > < / p >
< h3 class = "typedecl" > < a name = "type-epoch_id" > epoch_id()< / a > < / h3 >
< p > < tt > epoch_id() = {< a href = "#type-epoch_num" > epoch_num()< / a > , < a href = "#type-epoch_csum" > epoch_csum()< / a > }< / tt > < / p >
< h3 class = "typedecl" > < a name = "type-epoch_num" > epoch_num()< / a > < / h3 >
< p > < tt > epoch_num() = -1 | non_neg_integer()< / tt > < / p >
2015-05-20 02:14:55 +00:00
< h3 class = "typedecl" > < a name = "type-error_general" > error_general()< / a > < / h3 >
< p > < tt > error_general() = bad_arg | wedged< / tt > < / p >
2015-04-08 08:52:58 +00:00
< h3 class = "typedecl" > < a name = "type-file_info" > file_info()< / a > < / h3 >
< p > < tt > file_info() = {< a href = "#type-file_size" > file_size()< / a > , < a href = "#type-file_name_s" > file_name_s()< / a > }< / tt > < / p >
< h3 class = "typedecl" > < a name = "type-file_name" > file_name()< / a > < / h3 >
< p > < tt > file_name() = binary() | list()< / tt > < / p >
< h3 class = "typedecl" > < a name = "type-file_name_s" > file_name_s()< / a > < / h3 >
< p > < tt > file_name_s() = binary()< / tt > < / p >
< p > server reply< / p >
< h3 class = "typedecl" > < a name = "type-file_offset" > file_offset()< / a > < / h3 >
< p > < tt > file_offset() = non_neg_integer()< / tt > < / p >
< h3 class = "typedecl" > < a name = "type-file_prefix" > file_prefix()< / a > < / h3 >
< p > < tt > file_prefix() = binary() | list()< / tt > < / p >
< h3 class = "typedecl" > < a name = "type-file_size" > file_size()< / a > < / h3 >
< p > < tt > file_size() = non_neg_integer()< / tt > < / p >
< h3 class = "typedecl" > < a name = "type-inet_host" > inet_host()< / a > < / h3 >
< p > < tt > inet_host() = < a href = "inet.html#type-ip_address" > inet:ip_address()< / a > | < a href = "inet.html#type-hostname" > inet:hostname()< / a > < / tt > < / p >
< h3 class = "typedecl" > < a name = "type-inet_port" > inet_port()< / a > < / h3 >
< p > < tt > inet_port() = < a href = "inet.html#type-port_number" > inet:port_number()< / a > < / tt > < / p >
2015-05-20 02:14:55 +00:00
< h3 class = "typedecl" > < a name = "type-port_wrap" > port_wrap()< / a > < / h3 >
< p > < tt > port_wrap() = {w, atom(), term()}< / tt > < / p >
2015-04-08 08:52:58 +00:00
< h3 class = "typedecl" > < a name = "type-projection" > projection()< / a > < / h3 >
< p > < tt > projection() = #projection_v1{}< / tt > < / p >
< h3 class = "typedecl" > < a name = "type-projection_type" > projection_type()< / a > < / h3 >
< p > < tt > projection_type() = public | private< / tt > < / p >
< h2 > < a name = "index" > Function Index< / a > < / h2 >
< table width = "100%" border = "1" cellspacing = "0" cellpadding = "2" summary = "function index" > < tr > < td valign = "top" > < a href = "#append_chunk-4" > append_chunk/4< / a > < / td > < td > Append a chunk (binary- or iolist-style) of data to a file
with < code > Prefix< / code > .< / td > < / tr >
< tr > < td valign = "top" > < a href = "#append_chunk-5" > append_chunk/5< / a > < / td > < td > Append a chunk (binary- or iolist-style) of data to a file
with < code > Prefix< / code > .< / td > < / tr >
2015-05-20 02:14:55 +00:00
< tr > < td valign = "top" > < a href = "#append_chunk_extra-5" > append_chunk_extra/5< / a > < / td > < td > Append a chunk (binary- or iolist-style) of data to a file
with < code > Prefix< / code > and also request an additional < code > Extra< / code > bytes.< / td > < / tr >
< tr > < td valign = "top" > < a href = "#append_chunk_extra-6" > append_chunk_extra/6< / a > < / td > < td > Append a chunk (binary- or iolist-style) of data to a file
with < code > Prefix< / code > and also request an additional < code > Extra< / code > bytes.< / td > < / tr >
2015-04-08 08:52:58 +00:00
< tr > < td valign = "top" > < a href = "#checksum_list-3" > checksum_list/3< / a > < / td > < td > Fetch the list of chunk checksums for < code > File< / code > .< / td > < / tr >
< tr > < td valign = "top" > < a href = "#checksum_list-4" > checksum_list/4< / a > < / td > < td > Fetch the list of chunk checksums for < code > File< / code > .< / td > < / tr >
2015-05-20 02:14:55 +00:00
< tr > < td valign = "top" > < a href = "#connect-1" > connect/1< / a > < / td > < td > < / td > < / tr >
< tr > < td valign = "top" > < a href = "#connected_p-1" > connected_p/1< / a > < / td > < td > < / td > < / tr >
2015-04-08 08:52:58 +00:00
< tr > < td valign = "top" > < a href = "#delete_migration-3" > delete_migration/3< / a > < / td > < td > Restricted API: Delete a file after it has been successfully
migrated.< / td > < / tr >
< tr > < td valign = "top" > < a href = "#delete_migration-4" > delete_migration/4< / a > < / td > < td > Restricted API: Delete a file after it has been successfully
migrated.< / td > < / tr >
2015-05-20 02:14:55 +00:00
< tr > < td valign = "top" > < a href = "#disconnect-1" > disconnect/1< / a > < / td > < td > < / td > < / tr >
2015-04-08 08:52:58 +00:00
< tr > < td valign = "top" > < a href = "#get_all_projections-2" > get_all_projections/2< / a > < / td > < td > Get all projections from the FLU's projection store.< / td > < / tr >
< tr > < td valign = "top" > < a href = "#get_all_projections-3" > get_all_projections/3< / a > < / td > < td > Get all projections from the FLU's projection store.< / td > < / tr >
2015-05-20 02:14:55 +00:00
< tr > < td valign = "top" > < a href = "#get_latest_epochid-2" > get_latest_epochid/2< / a > < / td > < td > Get the latest epoch number + checksum from the FLU's projection store.< / td > < / tr >
< tr > < td valign = "top" > < a href = "#get_latest_epochid-3" > get_latest_epochid/3< / a > < / td > < td > Get the latest epoch number + checksum from the FLU's projection store.< / td > < / tr >
2015-04-08 08:52:58 +00:00
< tr > < td valign = "top" > < a href = "#list_all_projections-2" > list_all_projections/2< / a > < / td > < td > Get all epoch numbers from the FLU's projection store.< / td > < / tr >
< tr > < td valign = "top" > < a href = "#list_all_projections-3" > list_all_projections/3< / a > < / td > < td > Get all epoch numbers from the FLU's projection store.< / td > < / tr >
< tr > < td valign = "top" > < a href = "#list_files-2" > list_files/2< / a > < / td > < td > Fetch the list of all files on the remote FLU.< / td > < / tr >
< tr > < td valign = "top" > < a href = "#list_files-3" > list_files/3< / a > < / td > < td > Fetch the list of all files on the remote FLU.< / td > < / tr >
< tr > < td valign = "top" > < a href = "#quit-1" > quit/1< / a > < / td > < td > Quit & close the connection to remote FLU.< / td > < / tr >
< tr > < td valign = "top" > < a href = "#read_chunk-5" > read_chunk/5< / a > < / td > < td > Read a chunk of data of size < code > Size< / code > from < code > File< / code > at < code > Offset< / code > .< / td > < / tr >
< tr > < td valign = "top" > < a href = "#read_chunk-6" > read_chunk/6< / a > < / td > < td > Read a chunk of data of size < code > Size< / code > from < code > File< / code > at < code > Offset< / code > .< / td > < / tr >
< tr > < td valign = "top" > < a href = "#read_latest_projection-2" > read_latest_projection/2< / a > < / td > < td > Get the latest projection from the FLU's projection store for < code > ProjType< / code > < / td > < / tr >
< tr > < td valign = "top" > < a href = "#read_latest_projection-3" > read_latest_projection/3< / a > < / td > < td > Get the latest projection from the FLU's projection store for < code > ProjType< / code > < / td > < / tr >
< tr > < td valign = "top" > < a href = "#read_projection-3" > read_projection/3< / a > < / td > < td > Read a projection < code > Proj< / code > of type < code > ProjType< / code > .< / td > < / tr >
< tr > < td valign = "top" > < a href = "#read_projection-4" > read_projection/4< / a > < / td > < td > Read a projection < code > Proj< / code > of type < code > ProjType< / code > .< / td > < / tr >
< tr > < td valign = "top" > < a href = "#trunc_hack-3" > trunc_hack/3< / a > < / td > < td > Restricted API: Truncate a file after it has been successfully
erasure coded.< / td > < / tr >
< tr > < td valign = "top" > < a href = "#trunc_hack-4" > trunc_hack/4< / a > < / td > < td > Restricted API: Truncate a file after it has been successfully
erasure coded.< / td > < / tr >
2015-05-20 02:14:55 +00:00
< tr > < td valign = "top" > < a href = "#wedge_status-1" > wedge_status/1< / a > < / td > < td > Fetch the wedge status from the remote FLU.< / td > < / tr >
< tr > < td valign = "top" > < a href = "#wedge_status-2" > wedge_status/2< / a > < / td > < td > Fetch the wedge status from the remote FLU.< / td > < / tr >
2015-04-08 08:52:58 +00:00
< tr > < td valign = "top" > < a href = "#write_chunk-5" > write_chunk/5< / a > < / td > < td > Restricted API: Write a chunk of already-sequenced data to
< code > File< / code > at < code > Offset< / code > .< / td > < / tr >
< tr > < td valign = "top" > < a href = "#write_chunk-6" > write_chunk/6< / a > < / td > < td > Restricted API: Write a chunk of already-sequenced data to
< code > File< / code > at < code > Offset< / code > .< / td > < / tr >
< tr > < td valign = "top" > < a href = "#write_projection-3" > write_projection/3< / a > < / td > < td > Write a projection < code > Proj< / code > of type < code > ProjType< / code > .< / td > < / tr >
< tr > < td valign = "top" > < a href = "#write_projection-4" > write_projection/4< / a > < / td > < td > Write a projection < code > Proj< / code > of type < code > ProjType< / code > .< / td > < / tr >
< / table >
< h2 > < a name = "functions" > Function Details< / a > < / h2 >
< h3 class = "function" > < a name = "append_chunk-4" > append_chunk/4< / a > < / h3 >
< div class = "spec" >
2015-05-20 02:14:55 +00:00
< p > < tt > append_chunk(Sock::< a href = "#type-port_wrap" > port_wrap()< / a > , EpochID::< a href = "#type-epoch_id" > epoch_id()< / a > , Prefix::< a href = "#type-file_prefix" > file_prefix()< / a > , Chunk::< a href = "#type-chunk" > chunk()< / a > ) -> {ok, < a href = "#type-chunk_pos" > chunk_pos()< / a > } | {error, < a href = "#type-error_general" > error_general()< / a > } | {error, term()}< / tt > < br > < / p >
2015-04-08 08:52:58 +00:00
< / div > < p > Append a chunk (binary- or iolist-style) of data to a file
with < code > Prefix< / code > .< / p >
< h3 class = "function" > < a name = "append_chunk-5" > append_chunk/5< / a > < / h3 >
< div class = "spec" >
2015-05-20 02:14:55 +00:00
< p > < tt > append_chunk(Host::< a href = "#type-inet_host" > inet_host()< / a > , TcpPort::< a href = "#type-inet_port" > inet_port()< / a > , EpochID::< a href = "#type-epoch_id" > epoch_id()< / a > , Prefix::< a href = "#type-file_prefix" > file_prefix()< / a > , Chunk::< a href = "#type-chunk" > chunk()< / a > ) -> {ok, < a href = "#type-chunk_pos" > chunk_pos()< / a > } | {error, < a href = "#type-error_general" > error_general()< / a > } | {error, term()}< / tt > < br > < / p >
2015-04-08 08:52:58 +00:00
< / div > < p > Append a chunk (binary- or iolist-style) of data to a file
with < code > Prefix< / code > .< / p >
2015-05-20 02:14:55 +00:00
< h3 class = "function" > < a name = "append_chunk_extra-5" > append_chunk_extra/5< / a > < / h3 >
< div class = "spec" >
< p > < tt > append_chunk_extra(Sock::< a href = "#type-port_wrap" > port_wrap()< / a > , EpochID::< a href = "#type-epoch_id" > epoch_id()< / a > , Prefix::< a href = "#type-file_prefix" > file_prefix()< / a > , Chunk::< a href = "#type-chunk" > chunk()< / a > , ChunkExtra::< a href = "#type-chunk_size" > chunk_size()< / a > ) -> {ok, < a href = "#type-chunk_pos" > chunk_pos()< / a > } | {error, < a href = "#type-error_general" > error_general()< / a > } | {error, term()}< / tt > < br > < / p >
< / div > < p > < p > Append a chunk (binary- or iolist-style) of data to a file
with < code > Prefix< / code > and also request an additional < code > Extra< / code > bytes.< / p >
For example, if the < code > Chunk< / code > size is 1 KByte and < code > Extra< / code > is 4K Bytes, then
the file offsets that follow < code > Chunk< / code > 's position for the following 4K will
be reserved by the file sequencer for later write(s) by the
< code > write_chunk()< / code > API.< / p >
< h3 class = "function" > < a name = "append_chunk_extra-6" > append_chunk_extra/6< / a > < / h3 >
< div class = "spec" >
< p > < tt > append_chunk_extra(Host::< a href = "#type-inet_host" > inet_host()< / a > , TcpPort::< a href = "#type-inet_port" > inet_port()< / a > , EpochID::< a href = "#type-epoch_id" > epoch_id()< / a > , Prefix::< a href = "#type-file_prefix" > file_prefix()< / a > , Chunk::< a href = "#type-chunk" > chunk()< / a > , ChunkExtra::< a href = "#type-chunk_size" > chunk_size()< / a > ) -> {ok, < a href = "#type-chunk_pos" > chunk_pos()< / a > } | {error, < a href = "#type-error_general" > error_general()< / a > } | {error, term()}< / tt > < br > < / p >
< / div > < p > < p > Append a chunk (binary- or iolist-style) of data to a file
with < code > Prefix< / code > and also request an additional < code > Extra< / code > bytes.< / p >
For example, if the < code > Chunk< / code > size is 1 KByte and < code > Extra< / code > is 4K Bytes, then
the file offsets that follow < code > Chunk< / code > 's position for the following 4K will
be reserved by the file sequencer for later write(s) by the
< code > write_chunk()< / code > API.< / p >
2015-04-08 08:52:58 +00:00
< h3 class = "function" > < a name = "checksum_list-3" > checksum_list/3< / a > < / h3 >
< div class = "spec" >
2015-05-20 02:14:55 +00:00
< p > < tt > checksum_list(Sock::< a href = "#type-port_wrap" > port_wrap()< / a > , EpochID::< a href = "#type-epoch_id" > epoch_id()< / a > , File::< a href = "#type-file_name" > file_name()< / a > ) -> {ok, [< a href = "#type-chunk_csum" > chunk_csum()< / a > ]} | {error, < a href = "#type-error_general" > error_general()< / a > | no_such_file | partial_read} | {error, term()}< / tt > < br > < / p >
2015-04-08 08:52:58 +00:00
< / div > < p > Fetch the list of chunk checksums for < code > File< / code > .< / p >
< h3 class = "function" > < a name = "checksum_list-4" > checksum_list/4< / a > < / h3 >
< div class = "spec" >
2015-05-20 02:14:55 +00:00
< p > < tt > checksum_list(Host::< a href = "#type-inet_host" > inet_host()< / a > , TcpPort::< a href = "#type-inet_port" > inet_port()< / a > , EpochID::< a href = "#type-epoch_id" > epoch_id()< / a > , File::< a href = "#type-file_name" > file_name()< / a > ) -> {ok, [< a href = "#type-chunk_csum" > chunk_csum()< / a > ]} | {error, < a href = "#type-error_general" > error_general()< / a > | no_such_file} | {error, term()}< / tt > < br > < / p >
2015-04-08 08:52:58 +00:00
< / div > < p > Fetch the list of chunk checksums for < code > File< / code > .< / p >
2015-05-20 02:14:55 +00:00
< h3 class = "function" > < a name = "connect-1" > connect/1< / a > < / h3 >
< div class = "spec" >
< p > < tt > connect(P_srvr) -> any()< / tt > < / p >
< / div >
< h3 class = "function" > < a name = "connected_p-1" > connected_p/1< / a > < / h3 >
< div class = "spec" >
< p > < tt > connected_p(X1) -> any()< / tt > < / p >
< / div >
2015-04-08 08:52:58 +00:00
< h3 class = "function" > < a name = "delete_migration-3" > delete_migration/3< / a > < / h3 >
< div class = "spec" >
2015-05-20 02:14:55 +00:00
< p > < tt > delete_migration(Sock::< a href = "#type-port_wrap" > port_wrap()< / a > , EpochID::< a href = "#type-epoch_id" > epoch_id()< / a > , File::< a href = "#type-file_name" > file_name()< / a > ) -> ok | {error, < a href = "#type-error_general" > error_general()< / a > | no_such_file} | {error, term()}< / tt > < br > < / p >
2015-04-08 08:52:58 +00:00
< / div > < p > Restricted API: Delete a file after it has been successfully
migrated.< / p >
< h3 class = "function" > < a name = "delete_migration-4" > delete_migration/4< / a > < / h3 >
< div class = "spec" >
2015-05-20 02:14:55 +00:00
< p > < tt > delete_migration(Host::< a href = "#type-inet_host" > inet_host()< / a > , TcpPort::< a href = "#type-inet_port" > inet_port()< / a > , EpochID::< a href = "#type-epoch_id" > epoch_id()< / a > , File::< a href = "#type-file_name" > file_name()< / a > ) -> ok | {error, < a href = "#type-error_general" > error_general()< / a > | no_such_file} | {error, term()}< / tt > < br > < / p >
2015-04-08 08:52:58 +00:00
< / div > < p > Restricted API: Delete a file after it has been successfully
migrated.< / p >
2015-05-20 02:14:55 +00:00
< h3 class = "function" > < a name = "disconnect-1" > disconnect/1< / a > < / h3 >
< div class = "spec" >
< p > < tt > disconnect(WS) -> any()< / tt > < / p >
< / div >
2015-04-08 08:52:58 +00:00
< h3 class = "function" > < a name = "get_all_projections-2" > get_all_projections/2< / a > < / h3 >
< div class = "spec" >
2015-05-20 02:14:55 +00:00
< p > < tt > get_all_projections(Sock::< a href = "#type-port_wrap" > port_wrap()< / a > , ProjType::< a href = "#type-projection_type" > projection_type()< / a > ) -> {ok, [< a href = "#type-projection" > projection()< / a > ]} | {error, term()}< / tt > < br > < / p >
2015-04-08 08:52:58 +00:00
< / div > < p > Get all projections from the FLU's projection store.< / p >
< h3 class = "function" > < a name = "get_all_projections-3" > get_all_projections/3< / a > < / h3 >
< div class = "spec" >
< p > < tt > get_all_projections(Host::< a href = "#type-inet_host" > inet_host()< / a > , TcpPort::< a href = "#type-inet_port" > inet_port()< / a > , ProjType::< a href = "#type-projection_type" > projection_type()< / a > ) -> {ok, [< a href = "#type-projection" > projection()< / a > ]} | {error, term()}< / tt > < br > < / p >
< / div > < p > Get all projections from the FLU's projection store.< / p >
2015-05-20 02:14:55 +00:00
< h3 class = "function" > < a name = "get_latest_epochid-2" > get_latest_epochid/2< / a > < / h3 >
2015-04-08 08:52:58 +00:00
< div class = "spec" >
2015-05-20 02:14:55 +00:00
< p > < tt > get_latest_epochid(Sock::< a href = "#type-port_wrap" > port_wrap()< / a > , ProjType::< a href = "#type-projection_type" > projection_type()< / a > ) -> {ok, < a href = "#type-epoch_id" > epoch_id()< / a > } | {error, term()}< / tt > < br > < / p >
2015-04-08 08:52:58 +00:00
< / div > < p > Get the latest epoch number + checksum from the FLU's projection store.< / p >
2015-05-20 02:14:55 +00:00
< h3 class = "function" > < a name = "get_latest_epochid-3" > get_latest_epochid/3< / a > < / h3 >
2015-04-08 08:52:58 +00:00
< div class = "spec" >
2015-05-20 02:14:55 +00:00
< p > < tt > get_latest_epochid(Host::< a href = "#type-inet_host" > inet_host()< / a > , TcpPort::< a href = "#type-inet_port" > inet_port()< / a > , ProjType::< a href = "#type-projection_type" > projection_type()< / a > ) -> {ok, < a href = "#type-epoch_id" > epoch_id()< / a > } | {error, term()}< / tt > < br > < / p >
2015-04-08 08:52:58 +00:00
< / div > < p > Get the latest epoch number + checksum from the FLU's projection store.< / p >
< h3 class = "function" > < a name = "list_all_projections-2" > list_all_projections/2< / a > < / h3 >
< div class = "spec" >
2015-05-20 02:14:55 +00:00
< p > < tt > list_all_projections(Sock::< a href = "#type-port_wrap" > port_wrap()< / a > , ProjType::< a href = "#type-projection_type" > projection_type()< / a > ) -> {ok, [non_neg_integer()]} | {error, term()}< / tt > < br > < / p >
2015-04-08 08:52:58 +00:00
< / div > < p > Get all epoch numbers from the FLU's projection store.< / p >
< h3 class = "function" > < a name = "list_all_projections-3" > list_all_projections/3< / a > < / h3 >
< div class = "spec" >
< p > < tt > list_all_projections(Host::< a href = "#type-inet_host" > inet_host()< / a > , TcpPort::< a href = "#type-inet_port" > inet_port()< / a > , ProjType::< a href = "#type-projection_type" > projection_type()< / a > ) -> {ok, [non_neg_integer()]} | {error, term()}< / tt > < br > < / p >
< / div > < p > Get all epoch numbers from the FLU's projection store.< / p >
< h3 class = "function" > < a name = "list_files-2" > list_files/2< / a > < / h3 >
< div class = "spec" >
2015-05-20 02:14:55 +00:00
< p > < tt > list_files(Sock::< a href = "#type-port_wrap" > port_wrap()< / a > , EpochID::< a href = "#type-epoch_id" > epoch_id()< / a > ) -> {ok, [< a href = "#type-file_info" > file_info()< / a > ]} | {error, term()}< / tt > < br > < / p >
2015-04-08 08:52:58 +00:00
< / div > < p > Fetch the list of all files on the remote FLU.< / p >
< h3 class = "function" > < a name = "list_files-3" > list_files/3< / a > < / h3 >
< div class = "spec" >
< p > < tt > list_files(Host::< a href = "#type-inet_host" > inet_host()< / a > , TcpPort::< a href = "#type-inet_port" > inet_port()< / a > , EpochID::< a href = "#type-epoch_id" > epoch_id()< / a > ) -> {ok, [< a href = "#type-file_info" > file_info()< / a > ]} | {error, term()}< / tt > < br > < / p >
< / div > < p > Fetch the list of all files on the remote FLU.< / p >
< h3 class = "function" > < a name = "quit-1" > quit/1< / a > < / h3 >
< div class = "spec" >
2015-05-20 02:14:55 +00:00
< p > < tt > quit(Sock::< a href = "#type-port_wrap" > port_wrap()< / a > ) -> ok< / tt > < br > < / p >
2015-04-08 08:52:58 +00:00
< / div > < p > Quit & close the connection to remote FLU.< / p >
< h3 class = "function" > < a name = "read_chunk-5" > read_chunk/5< / a > < / h3 >
< div class = "spec" >
2015-05-20 02:14:55 +00:00
< p > < tt > read_chunk(Sock::< a href = "#type-port_wrap" > port_wrap()< / a > , EpochID::< a href = "#type-epoch_id" > epoch_id()< / a > , File::< a href = "#type-file_name" > file_name()< / a > , Offset::< a href = "#type-file_offset" > file_offset()< / a > , Size::< a href = "#type-chunk_size" > chunk_size()< / a > ) -> {ok, < a href = "#type-chunk_s" > chunk_s()< / a > } | {error, < a href = "#type-error_general" > error_general()< / a > | not_written | partial_read} | {error, term()}< / tt > < br > < / p >
2015-04-08 08:52:58 +00:00
< / div > < p > Read a chunk of data of size < code > Size< / code > from < code > File< / code > at < code > Offset< / code > .< / p >
< h3 class = "function" > < a name = "read_chunk-6" > read_chunk/6< / a > < / h3 >
< div class = "spec" >
2015-05-20 02:14:55 +00:00
< p > < tt > read_chunk(Host::< a href = "#type-inet_host" > inet_host()< / a > , TcpPort::< a href = "#type-inet_port" > inet_port()< / a > , EpochID::< a href = "#type-epoch_id" > epoch_id()< / a > , File::< a href = "#type-file_name" > file_name()< / a > , Offset::< a href = "#type-file_offset" > file_offset()< / a > , Size::< a href = "#type-chunk_size" > chunk_size()< / a > ) -> {ok, < a href = "#type-chunk_s" > chunk_s()< / a > } | {error, < a href = "#type-error_general" > error_general()< / a > | not_written | partial_read} | {error, term()}< / tt > < br > < / p >
2015-04-08 08:52:58 +00:00
< / div > < p > Read a chunk of data of size < code > Size< / code > from < code > File< / code > at < code > Offset< / code > .< / p >
< h3 class = "function" > < a name = "read_latest_projection-2" > read_latest_projection/2< / a > < / h3 >
< div class = "spec" >
2015-05-20 02:14:55 +00:00
< p > < tt > read_latest_projection(Sock::< a href = "#type-port_wrap" > port_wrap()< / a > , ProjType::< a href = "#type-projection_type" > projection_type()< / a > ) -> {ok, < a href = "#type-projection" > projection()< / a > } | {error, not_written} | {error, term()}< / tt > < br > < / p >
2015-04-08 08:52:58 +00:00
< / div > < p > Get the latest projection from the FLU's projection store for < code > ProjType< / code > < / p >
< h3 class = "function" > < a name = "read_latest_projection-3" > read_latest_projection/3< / a > < / h3 >
< div class = "spec" >
< p > < tt > read_latest_projection(Host::< a href = "#type-inet_host" > inet_host()< / a > , TcpPort::< a href = "#type-inet_port" > inet_port()< / a > , ProjType::< a href = "#type-projection_type" > projection_type()< / a > ) -> {ok, < a href = "#type-projection" > projection()< / a > } | {error, not_written} | {error, term()}< / tt > < br > < / p >
< / div > < p > Get the latest projection from the FLU's projection store for < code > ProjType< / code > < / p >
< h3 class = "function" > < a name = "read_projection-3" > read_projection/3< / a > < / h3 >
< div class = "spec" >
2015-05-20 02:14:55 +00:00
< p > < tt > read_projection(Sock::< a href = "#type-port_wrap" > port_wrap()< / a > , ProjType::< a href = "#type-projection_type" > projection_type()< / a > , Epoch::< a href = "#type-epoch_num" > epoch_num()< / a > ) -> {ok, < a href = "#type-projection" > projection()< / a > } | {error, not_written} | {error, term()}< / tt > < br > < / p >
2015-04-08 08:52:58 +00:00
< / div > < p > Read a projection < code > Proj< / code > of type < code > ProjType< / code > .< / p >
< h3 class = "function" > < a name = "read_projection-4" > read_projection/4< / a > < / h3 >
< div class = "spec" >
2015-05-20 02:14:55 +00:00
< p > < tt > read_projection(Host::< a href = "#type-inet_host" > inet_host()< / a > , TcpPort::< a href = "#type-inet_port" > inet_port()< / a > , ProjType::< a href = "#type-projection_type" > projection_type()< / a > , Epoch::< a href = "#type-epoch_num" > epoch_num()< / a > ) -> {ok, < a href = "#type-projection" > projection()< / a > } | {error, not_written} | {error, term()}< / tt > < br > < / p >
2015-04-08 08:52:58 +00:00
< / div > < p > Read a projection < code > Proj< / code > of type < code > ProjType< / code > .< / p >
< h3 class = "function" > < a name = "trunc_hack-3" > trunc_hack/3< / a > < / h3 >
< div class = "spec" >
2015-05-20 02:14:55 +00:00
< p > < tt > trunc_hack(Sock::< a href = "#type-port_wrap" > port_wrap()< / a > , EpochID::< a href = "#type-epoch_id" > epoch_id()< / a > , File::< a href = "#type-file_name" > file_name()< / a > ) -> ok | {error, < a href = "#type-error_general" > error_general()< / a > | no_such_file} | {error, term()}< / tt > < br > < / p >
2015-04-08 08:52:58 +00:00
< / div > < p > Restricted API: Truncate a file after it has been successfully
erasure coded.< / p >
< h3 class = "function" > < a name = "trunc_hack-4" > trunc_hack/4< / a > < / h3 >
< div class = "spec" >
2015-05-20 02:14:55 +00:00
< p > < tt > trunc_hack(Host::< a href = "#type-inet_host" > inet_host()< / a > , TcpPort::< a href = "#type-inet_port" > inet_port()< / a > , EpochID::< a href = "#type-epoch_id" > epoch_id()< / a > , File::< a href = "#type-file_name" > file_name()< / a > ) -> ok | {error, < a href = "#type-error_general" > error_general()< / a > | no_such_file} | {error, term()}< / tt > < br > < / p >
2015-04-08 08:52:58 +00:00
< / div > < p > Restricted API: Truncate a file after it has been successfully
erasure coded.< / p >
2015-05-20 02:14:55 +00:00
< h3 class = "function" > < a name = "wedge_status-1" > wedge_status/1< / a > < / h3 >
< div class = "spec" >
< p > < tt > wedge_status(Sock::< a href = "#type-port_wrap" > port_wrap()< / a > ) -> {ok, {boolean(), < a href = "#type-pv1_epoch" > pv1_epoch()< / a > }} | {error, term()}< / tt > < br > < / p >
< / div > < p > Fetch the wedge status from the remote FLU.< / p >
< h3 class = "function" > < a name = "wedge_status-2" > wedge_status/2< / a > < / h3 >
< div class = "spec" >
< p > < tt > wedge_status(Host::< a href = "#type-inet_host" > inet_host()< / a > , TcpPort::< a href = "#type-inet_port" > inet_port()< / a > ) -> {ok, {boolean(), < a href = "#type-pv1_epoch" > pv1_epoch()< / a > }} | {error, term()}< / tt > < br > < / p >
< / div > < p > Fetch the wedge status from the remote FLU.< / p >
2015-04-08 08:52:58 +00:00
< h3 class = "function" > < a name = "write_chunk-5" > write_chunk/5< / a > < / h3 >
< div class = "spec" >
2015-05-20 02:14:55 +00:00
< p > < tt > write_chunk(Sock::< a href = "#type-port_wrap" > port_wrap()< / a > , EpochID::< a href = "#type-epoch_id" > epoch_id()< / a > , File::< a href = "#type-file_name" > file_name()< / a > , Offset::< a href = "#type-file_offset" > file_offset()< / a > , Chunk::< a href = "#type-chunk" > chunk()< / a > ) -> ok | {error, < a href = "#type-error_general" > error_general()< / a > } | {error, term()}< / tt > < br > < / p >
2015-04-08 08:52:58 +00:00
< / div > < p > Restricted API: Write a chunk of already-sequenced data to
< code > File< / code > at < code > Offset< / code > .< / p >
< h3 class = "function" > < a name = "write_chunk-6" > write_chunk/6< / a > < / h3 >
< div class = "spec" >
2015-05-20 02:14:55 +00:00
< p > < tt > write_chunk(Host::< a href = "#type-inet_host" > inet_host()< / a > , TcpPort::< a href = "#type-inet_port" > inet_port()< / a > , EpochID::< a href = "#type-epoch_id" > epoch_id()< / a > , File::< a href = "#type-file_name" > file_name()< / a > , Offset::< a href = "#type-file_offset" > file_offset()< / a > , Chunk::< a href = "#type-chunk" > chunk()< / a > ) -> ok | {error, < a href = "#type-error_general" > error_general()< / a > } | {error, term()}< / tt > < br > < / p >
2015-04-08 08:52:58 +00:00
< / div > < p > Restricted API: Write a chunk of already-sequenced data to
< code > File< / code > at < code > Offset< / code > .< / p >
< h3 class = "function" > < a name = "write_projection-3" > write_projection/3< / a > < / h3 >
< div class = "spec" >
2015-05-20 02:14:55 +00:00
< p > < tt > write_projection(Sock::< a href = "#type-port_wrap" > port_wrap()< / a > , ProjType::< a href = "#type-projection_type" > projection_type()< / a > , Proj::< a href = "#type-projection" > projection()< / a > ) -> ok | {error, written} | {error, term()}< / tt > < br > < / p >
2015-04-08 08:52:58 +00:00
< / div > < p > Write a projection < code > Proj< / code > of type < code > ProjType< / code > .< / p >
< h3 class = "function" > < a name = "write_projection-4" > write_projection/4< / a > < / h3 >
< div class = "spec" >
< p > < tt > write_projection(Host::< a href = "#type-inet_host" > inet_host()< / a > , TcpPort::< a href = "#type-inet_port" > inet_port()< / a > , ProjType::< a href = "#type-projection_type" > projection_type()< / a > , Proj::< a href = "#type-projection" > projection()< / a > ) -> ok | {error, written} | {error, term()}< / tt > < br > < / p >
< / div > < p > Write a projection < code > Proj< / code > of type < code > ProjType< / code > .< / p >
< hr >
< div class = "navbar" > < a name = "#navbar_bottom" > < / a > < table width = "100%" border = "0" cellspacing = "0" cellpadding = "2" summary = "navigation bar" > < tr > < td > < a href = "overview-summary.html" target = "overviewFrame" > Overview< / a > < / td > < td > < a href = "http://www.erlang.org/" > < img src = "erlang.png" align = "right" border = "0" alt = "erlang logo" > < / a > < / td > < / tr > < / table > < / div >
2015-05-20 03:37:28 +00:00
< p > < i > Generated by EDoc, May 20 2015, 12:36:35.< / i > < / p >
2015-04-08 08:52:58 +00:00
< / body >
< / html >