machi/edoc/machi_projection_store.html

170 lines
9.8 KiB
HTML
Raw Normal View History

<!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_projection_store</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_projection_store</h1>
<ul class="index"><li><a href="#description">Description</a></li><li><a href="#index">Function Index</a></li><li><a href="#functions">Function Details</a></li></ul>The Machi write-once projection store service.
<h2><a name="description">Description</a></h2><p>The Machi write-once projection store service.</p>
<p>This API is gen_server-style message passing, intended for use
within a single Erlang node to glue together the projection store
2015-05-20 03:58:44 +00:00
server with the node-local process that implements Machi's FLU
client access protocol (on the "server side" of the TCP connection).</p>
2015-05-20 03:58:44 +00:00
<p>All Machi client access to the projection store SHOULD NOT use this
module's API. Instead, clients should access indirectly via <a href="machi_cr_client.html"><code>machi_cr_client</code></a>, <a href="machi_proxy_flu1_client.html"><code>machi_proxy_flu1_client</code></a>, or <a href="machi_flu1_client.html"><code>machi_flu1_client</code></a>.</p>
The projection store is implemented by an Erlang/OTP <code>gen_server</code>
process that is associated with each FLU. Conceptually, the
projection store is an array of write-once registers. For each
projection store register, the key is a 2-tuple of an epoch number
(<code>non_neg_integer()</code> type) and a projection type (<code>public</code> or
<code>private</code> type); the value is a projection data structure
(<code>projection_v1()</code> type).
<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="#code_change-3">code_change/3</a></td><td></td></tr>
<tr><td valign="top"><a href="#get_all_projections-2">get_all_projections/2</a></td><td>Fetch all projection records of type <code>ProjType</code>.</td></tr>
<tr><td valign="top"><a href="#get_all_projections-3">get_all_projections/3</a></td><td>Fetch all projection records of type <code>ProjType</code>.</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>Fetch the latest epoch number + checksum for type <code>ProjType</code>.</td></tr>
<tr><td valign="top"><a href="#get_latest_epochid-3">get_latest_epochid/3</a></td><td>Fetch the latest epoch number + checksum for type <code>ProjType</code>.</td></tr>
<tr><td valign="top"><a href="#handle_call-3">handle_call/3</a></td><td></td></tr>
<tr><td valign="top"><a href="#handle_cast-2">handle_cast/2</a></td><td></td></tr>
<tr><td valign="top"><a href="#handle_info-2">handle_info/2</a></td><td></td></tr>
<tr><td valign="top"><a href="#init-1">init/1</a></td><td></td></tr>
<tr><td valign="top"><a href="#list_all_projections-2">list_all_projections/2</a></td><td>Fetch all projection epoch numbers of type <code>ProjType</code>.</td></tr>
<tr><td valign="top"><a href="#list_all_projections-3">list_all_projections/3</a></td><td>Fetch all projection epoch numbers of type <code>ProjType</code>.</td></tr>
<tr><td valign="top"><a href="#read-3">read/3</a></td><td>Fetch the projection record type <code>ProjType</code> for epoch number <code>Epoch</code> .</td></tr>
<tr><td valign="top"><a href="#read-4">read/4</a></td><td>Fetch the projection record type <code>ProjType</code> for epoch number <code>Epoch</code> .</td></tr>
<tr><td valign="top"><a href="#read_latest_projection-2">read_latest_projection/2</a></td><td>Fetch the latest projection record for type <code>ProjType</code>.</td></tr>
<tr><td valign="top"><a href="#read_latest_projection-3">read_latest_projection/3</a></td><td>Fetch the latest projection record for type <code>ProjType</code>.</td></tr>
2015-05-20 02:14:55 +00:00
<tr><td valign="top"><a href="#set_wedge_notify_pid-2">set_wedge_notify_pid/2</a></td><td></td></tr>
<tr><td valign="top"><a href="#start_link-3">start_link/3</a></td><td>Start a new projection store server.</td></tr>
<tr><td valign="top"><a href="#terminate-2">terminate/2</a></td><td></td></tr>
<tr><td valign="top"><a href="#write-3">write/3</a></td><td>Write the projection record type <code>ProjType</code> for epoch number <code>Epoch</code> .</td></tr>
<tr><td valign="top"><a href="#write-4">write/4</a></td><td>Write the projection record type <code>ProjType</code> for epoch number <code>Epoch</code> .</td></tr>
</table>
<h2><a name="functions">Function Details</a></h2>
<h3 class="function"><a name="code_change-3">code_change/3</a></h3>
<div class="spec">
<p><tt>code_change(OldVsn, S, Extra) -&gt; any()</tt></p>
</div>
<h3 class="function"><a name="get_all_projections-2">get_all_projections/2</a></h3>
<div class="spec">
<p><tt>get_all_projections(PidSpec, ProjType) -&gt; any()</tt></p>
</div><p>Fetch all projection records of type <code>ProjType</code>.</p>
<h3 class="function"><a name="get_all_projections-3">get_all_projections/3</a></h3>
<div class="spec">
<p><tt>get_all_projections(PidSpec, ProjType, Timeout) -&gt; any()</tt></p>
</div><p>Fetch all projection records of type <code>ProjType</code>.</p>
2015-05-20 02:14:55 +00:00
<h3 class="function"><a name="get_latest_epochid-2">get_latest_epochid/2</a></h3>
<div class="spec">
2015-05-20 02:14:55 +00:00
<p><tt>get_latest_epochid(PidSpec, ProjType) -&gt; any()</tt></p>
</div><p>Fetch the latest epoch number + checksum for type <code>ProjType</code>.</p>
2015-05-20 02:14:55 +00:00
<h3 class="function"><a name="get_latest_epochid-3">get_latest_epochid/3</a></h3>
<div class="spec">
2015-05-20 02:14:55 +00:00
<p><tt>get_latest_epochid(PidSpec, ProjType, Timeout) -&gt; any()</tt></p>
</div><p>Fetch the latest epoch number + checksum for type <code>ProjType</code>.
projection.</p>
<h3 class="function"><a name="handle_call-3">handle_call/3</a></h3>
<div class="spec">
<p><tt>handle_call(Request, From, S) -&gt; any()</tt></p>
</div>
<h3 class="function"><a name="handle_cast-2">handle_cast/2</a></h3>
<div class="spec">
<p><tt>handle_cast(Msg, S) -&gt; any()</tt></p>
</div>
<h3 class="function"><a name="handle_info-2">handle_info/2</a></h3>
<div class="spec">
<p><tt>handle_info(Info, S) -&gt; any()</tt></p>
</div>
<h3 class="function"><a name="init-1">init/1</a></h3>
<div class="spec">
<p><tt>init(X1) -&gt; any()</tt></p>
</div>
<h3 class="function"><a name="list_all_projections-2">list_all_projections/2</a></h3>
<div class="spec">
<p><tt>list_all_projections(PidSpec, ProjType) -&gt; any()</tt></p>
</div><p>Fetch all projection epoch numbers of type <code>ProjType</code>.</p>
<h3 class="function"><a name="list_all_projections-3">list_all_projections/3</a></h3>
<div class="spec">
<p><tt>list_all_projections(PidSpec, ProjType, Timeout) -&gt; any()</tt></p>
</div><p>Fetch all projection epoch numbers of type <code>ProjType</code>.</p>
<h3 class="function"><a name="read-3">read/3</a></h3>
<div class="spec">
<p><tt>read(PidSpec, ProjType, Epoch) -&gt; any()</tt></p>
</div><p>Fetch the projection record type <code>ProjType</code> for epoch number <code>Epoch</code> .</p>
<h3 class="function"><a name="read-4">read/4</a></h3>
<div class="spec">
<p><tt>read(PidSpec, ProjType, Epoch, Timeout) -&gt; any()</tt></p>
</div><p>Fetch the projection record type <code>ProjType</code> for epoch number <code>Epoch</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(PidSpec, ProjType) -&gt; any()</tt></p>
</div><p>Fetch the latest projection record for type <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(PidSpec, ProjType, Timeout) -&gt; any()</tt></p>
</div><p>Fetch the latest projection record for type <code>ProjType</code>.</p>
2015-05-20 02:14:55 +00:00
<h3 class="function"><a name="set_wedge_notify_pid-2">set_wedge_notify_pid/2</a></h3>
<div class="spec">
<p><tt>set_wedge_notify_pid(PidSpec, NotifyWedgeStateChanges) -&gt; any()</tt></p>
</div>
<h3 class="function"><a name="start_link-3">start_link/3</a></h3>
<div class="spec">
<p><tt>start_link(RegName, DataDir, NotifyWedgeStateChanges) -&gt; any()</tt></p>
</div><p><p>Start a new projection store server.</p>
The <code>DataDir</code> argument should be the same directory as specified
for use by our companion FLU data server -- all file system paths
used by this server are intended to be stored underneath a common
file system parent directory as the FLU data server &amp; sequencer
servers.</p>
<h3 class="function"><a name="terminate-2">terminate/2</a></h3>
<div class="spec">
<p><tt>terminate(Reason, S) -&gt; any()</tt></p>
</div>
<h3 class="function"><a name="write-3">write/3</a></h3>
<div class="spec">
<p><tt>write(PidSpec, ProjType, Proj) -&gt; any()</tt></p>
</div><p>Write the projection record type <code>ProjType</code> for epoch number <code>Epoch</code> .</p>
<h3 class="function"><a name="write-4">write/4</a></h3>
<div class="spec">
<p><tt>write(PidSpec, ProjType, Proj, Timeout) -&gt; any()</tt></p>
</div><p>Write the projection record type <code>ProjType</code> for epoch number <code>Epoch</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:58:44 +00:00
<p><i>Generated by EDoc, May 20 2015, 12:58:33.</i></p>
</body>
</html>