316 lines
28 KiB
HTML
316 lines
28 KiB
HTML
<!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.
|
|
|
|
|
|
<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>For the moment, this module implements a Protocol Buffers-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.</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.
|
|
<h2><a name="types">Data Types</a></h2>
|
|
|
|
<h3 class="typedecl"><a name="type-port_wrap">port_wrap()</a></h3>
|
|
<p><tt>port_wrap() = {w, atom(), term()}</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>
|
|
<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>
|
|
<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>
|
|
<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>
|
|
<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>
|
|
<tr><td valign="top"><a href="#disconnect-1">disconnect/1</a></td><td></td></tr>
|
|
<tr><td valign="top"><a href="#echo-2">echo/2</a></td><td>Echo -- test protocol round-trip.</td></tr>
|
|
<tr><td valign="top"><a href="#echo-3">echo/3</a></td><td>Get all epoch numbers from the FLU's projection store.</td></tr>
|
|
<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>
|
|
<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>
|
|
<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>
|
|
<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>
|
|
<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">
|
|
<p><tt>append_chunk(Sock::<a href="#type-port_wrap">port_wrap()</a>, EpochID::<a href="machi_dt.html#type-epoch_id">machi_dt:epoch_id()</a>, Prefix::<a href="machi_dt.html#type-file_prefix">machi_dt:file_prefix()</a>, Chunk::<a href="machi_dt.html#type-chunk">machi_dt:chunk()</a>) -> {ok, <a href="machi_dt.html#type-chunk_pos">machi_dt:chunk_pos()</a>} | {error, <a href="machi_dt.html#type-error_general">machi_dt:error_general()</a>} | {error, term()}</tt><br></p>
|
|
</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">
|
|
<p><tt>append_chunk(Host::<a href="machi_dt.html#type-inet_host">machi_dt:inet_host()</a>, TcpPort::<a href="machi_dt.html#type-inet_port">machi_dt:inet_port()</a>, EpochID::<a href="machi_dt.html#type-epoch_id">machi_dt:epoch_id()</a>, Prefix::<a href="machi_dt.html#type-file_prefix">machi_dt:file_prefix()</a>, Chunk::<a href="machi_dt.html#type-chunk">machi_dt:chunk()</a>) -> {ok, <a href="machi_dt.html#type-chunk_pos">machi_dt:chunk_pos()</a>} | {error, <a href="machi_dt.html#type-error_general">machi_dt:error_general()</a>} | {error, term()}</tt><br></p>
|
|
</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_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="machi_dt.html#type-epoch_id">machi_dt:epoch_id()</a>, Prefix::<a href="machi_dt.html#type-file_prefix">machi_dt:file_prefix()</a>, Chunk::<a href="machi_dt.html#type-chunk">machi_dt:chunk()</a>, ChunkExtra::<a href="machi_dt.html#type-chunk_size">machi_dt:chunk_size()</a>) -> {ok, <a href="machi_dt.html#type-chunk_pos">machi_dt:chunk_pos()</a>} | {error, <a href="machi_dt.html#type-error_general">machi_dt: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="machi_dt.html#type-inet_host">machi_dt:inet_host()</a>, TcpPort::<a href="machi_dt.html#type-inet_port">machi_dt:inet_port()</a>, EpochID::<a href="machi_dt.html#type-epoch_id">machi_dt:epoch_id()</a>, Prefix::<a href="machi_dt.html#type-file_prefix">machi_dt:file_prefix()</a>, Chunk::<a href="machi_dt.html#type-chunk">machi_dt:chunk()</a>, ChunkExtra::<a href="machi_dt.html#type-chunk_size">machi_dt:chunk_size()</a>) -> {ok, <a href="machi_dt.html#type-chunk_pos">machi_dt:chunk_pos()</a>} | {error, <a href="machi_dt.html#type-error_general">machi_dt: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="checksum_list-3">checksum_list/3</a></h3>
|
|
<div class="spec">
|
|
<p><tt>checksum_list(Sock::<a href="#type-port_wrap">port_wrap()</a>, EpochID::<a href="machi_dt.html#type-epoch_id">machi_dt:epoch_id()</a>, File::<a href="machi_dt.html#type-file_name">machi_dt:file_name()</a>) -> {ok, binary()} | {error, <a href="machi_dt.html#type-error_general">machi_dt:error_general()</a> | no_such_file | partial_read} | {error, term()}</tt><br></p>
|
|
</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">
|
|
<p><tt>checksum_list(Host::<a href="machi_dt.html#type-inet_host">machi_dt:inet_host()</a>, TcpPort::<a href="machi_dt.html#type-inet_port">machi_dt:inet_port()</a>, EpochID::<a href="machi_dt.html#type-epoch_id">machi_dt:epoch_id()</a>, File::<a href="machi_dt.html#type-file_name">machi_dt:file_name()</a>) -> {ok, binary()} | {error, <a href="machi_dt.html#type-error_general">machi_dt:error_general()</a> | no_such_file} | {error, term()}</tt><br></p>
|
|
</div><p><p>Fetch the list of chunk checksums for <code>File</code>.</p>
|
|
|
|
Why return a simple <code>binary()</code> type rather than
|
|
<code>[machi_dt:chunk_summary()]</code>? The two reasons are:
|
|
<ol>
|
|
<li> Server overhead: the CPU required to chop up the implementation-
|
|
specific store into zillions of very small terms is very high.
|
|
</li>
|
|
<li> Protocol encoding and decoding overhead: the cost is non-zero,
|
|
and the sum of cost of encoding and decoding a zillion small terms
|
|
is substantial.
|
|
</li>
|
|
</ol>
|
|
|
|
<p>For both reasons, the server's protocol response is absurdly simple
|
|
and very fast: send back a <code>binary()</code> blob to the client. Then it
|
|
is the client's responsibility to spend the CPU time to parse the
|
|
blob.</p>
|
|
|
|
Details of the encoding used inside the <code>binary()</code> blog can be found
|
|
in the EDoc comments for <a href="machi_flu1.html#decode_csum_file_entry-1"><code>machi_flu1:decode_csum_file_entry/1</code></a>.</p>
|
|
|
|
<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>
|
|
|
|
<h3 class="function"><a name="delete_migration-3">delete_migration/3</a></h3>
|
|
<div class="spec">
|
|
<p><tt>delete_migration(Sock::<a href="#type-port_wrap">port_wrap()</a>, EpochID::<a href="machi_dt.html#type-epoch_id">machi_dt:epoch_id()</a>, File::<a href="machi_dt.html#type-file_name">machi_dt:file_name()</a>) -> ok | {error, <a href="machi_dt.html#type-error_general">machi_dt:error_general()</a> | no_such_file} | {error, term()}</tt><br></p>
|
|
</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">
|
|
<p><tt>delete_migration(Host::<a href="machi_dt.html#type-inet_host">machi_dt:inet_host()</a>, TcpPort::<a href="machi_dt.html#type-inet_port">machi_dt:inet_port()</a>, EpochID::<a href="machi_dt.html#type-epoch_id">machi_dt:epoch_id()</a>, File::<a href="machi_dt.html#type-file_name">machi_dt:file_name()</a>) -> ok | {error, <a href="machi_dt.html#type-error_general">machi_dt:error_general()</a> | no_such_file} | {error, term()}</tt><br></p>
|
|
</div><p>Restricted API: Delete a file after it has been successfully
|
|
migrated.</p>
|
|
|
|
<h3 class="function"><a name="disconnect-1">disconnect/1</a></h3>
|
|
<div class="spec">
|
|
<p><tt>disconnect(WS) -> any()</tt></p>
|
|
</div>
|
|
|
|
<h3 class="function"><a name="echo-2">echo/2</a></h3>
|
|
<div class="spec">
|
|
<p><tt>echo(Sock::<a href="#type-port_wrap">port_wrap()</a>, String::string()) -> string() | {error, term()}</tt><br></p>
|
|
</div><p>Echo -- test protocol round-trip.</p>
|
|
|
|
<h3 class="function"><a name="echo-3">echo/3</a></h3>
|
|
<div class="spec">
|
|
<p><tt>echo(Host::<a href="machi_dt.html#type-inet_host">machi_dt:inet_host()</a>, TcpPort::<a href="machi_dt.html#type-inet_port">machi_dt:inet_port()</a>, String::string()) -> string() | {error, term()}</tt><br></p>
|
|
</div><p>Get all epoch numbers from the FLU's projection store.</p>
|
|
|
|
<h3 class="function"><a name="get_all_projections-2">get_all_projections/2</a></h3>
|
|
<div class="spec">
|
|
<p><tt>get_all_projections(Sock::<a href="#type-port_wrap">port_wrap()</a>, ProjType::<a href="machi_dt.html#type-projection_type">machi_dt:projection_type()</a>) -> {ok, [<a href="machi_dt.html#type-projection">machi_dt:projection()</a>]} | {error, term()}</tt><br></p>
|
|
</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="machi_dt.html#type-inet_host">machi_dt:inet_host()</a>, TcpPort::<a href="machi_dt.html#type-inet_port">machi_dt:inet_port()</a>, ProjType::<a href="machi_dt.html#type-projection_type">machi_dt:projection_type()</a>) -> {ok, [<a href="machi_dt.html#type-projection">machi_dt:projection()</a>]} | {error, term()}</tt><br></p>
|
|
</div><p>Get all projections from the FLU's projection store.</p>
|
|
|
|
<h3 class="function"><a name="get_latest_epochid-2">get_latest_epochid/2</a></h3>
|
|
<div class="spec">
|
|
<p><tt>get_latest_epochid(Sock::<a href="#type-port_wrap">port_wrap()</a>, ProjType::<a href="machi_dt.html#type-projection_type">machi_dt:projection_type()</a>) -> {ok, <a href="machi_dt.html#type-epoch_id">machi_dt:epoch_id()</a>} | {error, term()}</tt><br></p>
|
|
</div><p>Get the latest epoch number + checksum from the FLU's projection store.</p>
|
|
|
|
<h3 class="function"><a name="get_latest_epochid-3">get_latest_epochid/3</a></h3>
|
|
<div class="spec">
|
|
<p><tt>get_latest_epochid(Host::<a href="machi_dt.html#type-inet_host">machi_dt:inet_host()</a>, TcpPort::<a href="machi_dt.html#type-inet_port">machi_dt:inet_port()</a>, ProjType::<a href="machi_dt.html#type-projection_type">machi_dt:projection_type()</a>) -> {ok, <a href="machi_dt.html#type-epoch_id">machi_dt:epoch_id()</a>} | {error, term()}</tt><br></p>
|
|
</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">
|
|
<p><tt>list_all_projections(Sock::<a href="#type-port_wrap">port_wrap()</a>, ProjType::<a href="machi_dt.html#type-projection_type">machi_dt: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_all_projections-3">list_all_projections/3</a></h3>
|
|
<div class="spec">
|
|
<p><tt>list_all_projections(Host::<a href="machi_dt.html#type-inet_host">machi_dt:inet_host()</a>, TcpPort::<a href="machi_dt.html#type-inet_port">machi_dt:inet_port()</a>, ProjType::<a href="machi_dt.html#type-projection_type">machi_dt: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">
|
|
<p><tt>list_files(Sock::<a href="#type-port_wrap">port_wrap()</a>, EpochID::<a href="machi_dt.html#type-epoch_id">machi_dt:epoch_id()</a>) -> {ok, [<a href="machi_dt.html#type-file_info">machi_dt: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="list_files-3">list_files/3</a></h3>
|
|
<div class="spec">
|
|
<p><tt>list_files(Host::<a href="machi_dt.html#type-inet_host">machi_dt:inet_host()</a>, TcpPort::<a href="machi_dt.html#type-inet_port">machi_dt:inet_port()</a>, EpochID::<a href="machi_dt.html#type-epoch_id">machi_dt:epoch_id()</a>) -> {ok, [<a href="machi_dt.html#type-file_info">machi_dt: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">
|
|
<p><tt>quit(Sock::<a href="#type-port_wrap">port_wrap()</a>) -> ok</tt><br></p>
|
|
</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">
|
|
<p><tt>read_chunk(Sock::<a href="#type-port_wrap">port_wrap()</a>, EpochID::<a href="machi_dt.html#type-epoch_id">machi_dt:epoch_id()</a>, File::<a href="machi_dt.html#type-file_name">machi_dt:file_name()</a>, Offset::<a href="machi_dt.html#type-file_offset">machi_dt:file_offset()</a>, Size::<a href="machi_dt.html#type-chunk_size">machi_dt:chunk_size()</a>) -> {ok, <a href="machi_dt.html#type-chunk_s">machi_dt:chunk_s()</a>} | {error, <a href="machi_dt.html#type-error_general">machi_dt:error_general()</a> | not_written | partial_read} | {error, term()}</tt><br></p>
|
|
</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">
|
|
<p><tt>read_chunk(Host::<a href="machi_dt.html#type-inet_host">machi_dt:inet_host()</a>, TcpPort::<a href="machi_dt.html#type-inet_port">machi_dt:inet_port()</a>, EpochID::<a href="machi_dt.html#type-epoch_id">machi_dt:epoch_id()</a>, File::<a href="machi_dt.html#type-file_name">machi_dt:file_name()</a>, Offset::<a href="machi_dt.html#type-file_offset">machi_dt:file_offset()</a>, Size::<a href="machi_dt.html#type-chunk_size">machi_dt:chunk_size()</a>) -> {ok, <a href="machi_dt.html#type-chunk_s">machi_dt:chunk_s()</a>} | {error, <a href="machi_dt.html#type-error_general">machi_dt:error_general()</a> | not_written | partial_read} | {error, term()}</tt><br></p>
|
|
</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">
|
|
<p><tt>read_latest_projection(Sock::<a href="#type-port_wrap">port_wrap()</a>, ProjType::<a href="machi_dt.html#type-projection_type">machi_dt:projection_type()</a>) -> {ok, <a href="machi_dt.html#type-projection">machi_dt: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_latest_projection-3">read_latest_projection/3</a></h3>
|
|
<div class="spec">
|
|
<p><tt>read_latest_projection(Host::<a href="machi_dt.html#type-inet_host">machi_dt:inet_host()</a>, TcpPort::<a href="machi_dt.html#type-inet_port">machi_dt:inet_port()</a>, ProjType::<a href="machi_dt.html#type-projection_type">machi_dt:projection_type()</a>) -> {ok, <a href="machi_dt.html#type-projection">machi_dt: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">
|
|
<p><tt>read_projection(Sock::<a href="#type-port_wrap">port_wrap()</a>, ProjType::<a href="machi_dt.html#type-projection_type">machi_dt:projection_type()</a>, Epoch::<a href="machi_dt.html#type-epoch_num">machi_dt:epoch_num()</a>) -> {ok, <a href="machi_dt.html#type-projection">machi_dt:projection()</a>} | {error, not_written} | {error, term()}</tt><br></p>
|
|
</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">
|
|
<p><tt>read_projection(Host::<a href="machi_dt.html#type-inet_host">machi_dt:inet_host()</a>, TcpPort::<a href="machi_dt.html#type-inet_port">machi_dt:inet_port()</a>, ProjType::<a href="machi_dt.html#type-projection_type">machi_dt:projection_type()</a>, Epoch::<a href="machi_dt.html#type-epoch_num">machi_dt:epoch_num()</a>) -> {ok, <a href="machi_dt.html#type-projection">machi_dt:projection()</a>} | {error, not_written} | {error, term()}</tt><br></p>
|
|
</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">
|
|
<p><tt>trunc_hack(Sock::<a href="#type-port_wrap">port_wrap()</a>, EpochID::<a href="machi_dt.html#type-epoch_id">machi_dt:epoch_id()</a>, File::<a href="machi_dt.html#type-file_name">machi_dt:file_name()</a>) -> ok | {error, <a href="machi_dt.html#type-error_general">machi_dt:error_general()</a> | no_such_file} | {error, term()}</tt><br></p>
|
|
</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">
|
|
<p><tt>trunc_hack(Host::<a href="machi_dt.html#type-inet_host">machi_dt:inet_host()</a>, TcpPort::<a href="machi_dt.html#type-inet_port">machi_dt:inet_port()</a>, EpochID::<a href="machi_dt.html#type-epoch_id">machi_dt:epoch_id()</a>, File::<a href="machi_dt.html#type-file_name">machi_dt:file_name()</a>) -> ok | {error, <a href="machi_dt.html#type-error_general">machi_dt:error_general()</a> | no_such_file} | {error, term()}</tt><br></p>
|
|
</div><p>Restricted API: Truncate a file after it has been successfully
|
|
erasure coded.</p>
|
|
|
|
<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="machi_dt.html#type-epoch_id">machi_dt:epoch_id()</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="machi_dt.html#type-inet_host">machi_dt:inet_host()</a>, TcpPort::<a href="machi_dt.html#type-inet_port">machi_dt:inet_port()</a>) -> {ok, {boolean(), <a href="machi_dt.html#type-epoch_id">machi_dt:epoch_id()</a>}} | {error, term()}</tt><br></p>
|
|
</div><p>Fetch the wedge status from the remote FLU.</p>
|
|
|
|
<h3 class="function"><a name="write_chunk-5">write_chunk/5</a></h3>
|
|
<div class="spec">
|
|
<p><tt>write_chunk(Sock::<a href="#type-port_wrap">port_wrap()</a>, EpochID::<a href="machi_dt.html#type-epoch_id">machi_dt:epoch_id()</a>, File::<a href="machi_dt.html#type-file_name">machi_dt:file_name()</a>, Offset::<a href="machi_dt.html#type-file_offset">machi_dt:file_offset()</a>, Chunk::<a href="machi_dt.html#type-chunk">machi_dt:chunk()</a>) -> ok | {error, <a href="machi_dt.html#type-error_general">machi_dt:error_general()</a>} | {error, term()}</tt><br></p>
|
|
</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">
|
|
<p><tt>write_chunk(Host::<a href="machi_dt.html#type-inet_host">machi_dt:inet_host()</a>, TcpPort::<a href="machi_dt.html#type-inet_port">machi_dt:inet_port()</a>, EpochID::<a href="machi_dt.html#type-epoch_id">machi_dt:epoch_id()</a>, File::<a href="machi_dt.html#type-file_name">machi_dt:file_name()</a>, Offset::<a href="machi_dt.html#type-file_offset">machi_dt:file_offset()</a>, Chunk::<a href="machi_dt.html#type-chunk">machi_dt:chunk()</a>) -> ok | {error, <a href="machi_dt.html#type-error_general">machi_dt:error_general()</a>} | {error, term()}</tt><br></p>
|
|
</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">
|
|
<p><tt>write_projection(Sock::<a href="#type-port_wrap">port_wrap()</a>, ProjType::<a href="machi_dt.html#type-projection_type">machi_dt:projection_type()</a>, Proj::<a href="machi_dt.html#type-projection">machi_dt:projection()</a>) -> ok | {error, written} | {error, term()}</tt><br></p>
|
|
</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="machi_dt.html#type-inet_host">machi_dt:inet_host()</a>, TcpPort::<a href="machi_dt.html#type-inet_port">machi_dt:inet_port()</a>, ProjType::<a href="machi_dt.html#type-projection_type">machi_dt:projection_type()</a>, Proj::<a href="machi_dt.html#type-projection">machi_dt: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>
|
|
<p><i>Generated by EDoc, Jul 1 2015, 18:32:19.</i></p>
|
|
</body>
|
|
</html>
|