-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmemrata.html
176 lines (176 loc) · 10.6 KB
/
memrata.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>WiredTiger: WiredTiger Memrata support</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="wiredtiger.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><a href="http://wiredtiger.com/"><img alt="Logo" src="LogoFinal-header.png" alt="WiredTiger" /></a></td>
<td style="padding-left: 0.5em;">
<div id="projectname">
 <span id="projectnumber">Version 2.0.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="banner">
<a href="https://github.com/wiredtiger/wiredtiger">Fork me on GitHub</a>
<a class="last" href="http://groups.google.com/group/wiredtiger-users">Join my user group</a>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li class="current"><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li><a href="community.html"><span>Community</span></a></li>
<li><a href="license.html"><span>License</span></a></li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('memrata.html','');});
</script>
<div id="doc-content">
<div class="header">
<div class="headertitle">
<div class="title">WiredTiger Memrata support </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>WiredTiger supports Memrata KVS devices as a data-source.</p>
<p>To configure one or more Memrata KVS devices as WiredTiger data sources, take the following steps.</p>
<h1><a class="anchor" id="memrata_build"></a>
Building the WiredTiger Memrata Support</h1>
<p>To build the Memrata support, add a link in the WiredTiger build directory to the installed location of the Memrata software. For example:</p>
<div class="fragment"><div class="line">% cd wiredtiger</div>
<div class="line">% ls /usr/local/memrata</div>
<div class="line">kvs.h libkvs.a libkvs.so</div>
<div class="line">kvs.h.4.2 libkvs.a.4.2 libkvs.so.4.2</div>
<div class="line">% ln -s /usr/local/memrata memrata</div>
<div class="line">% ./configure && make</div>
</div><!-- fragment --><h1><a class="anchor" id="memrata_load"></a>
Loading the WiredTiger Memrata Support</h1>
<p>Second, change your application to load the Memrata shared library. The following example loads the Memrata shared library, configuring and naming two separate Memrata device pools. The first device pool is named <code>dev1</code>, the second device pool is named <code>dev2</code>. Device pool <code>dev1</code> has two underlying Memrata devices, <code>/dev/ssd0</code> and <code>/dev/ssd1</code>. Device pool <code>dev2</code> has a single underlying Memrata device, <code>/dev/ssd2</code>.</p>
<div class="fragment"><div class="line"><span class="preprocessor">#define MEMRATA_LIBRARY_PATH "test/memrata/.libs/libwiredtiger_memrata.so""</span></div>
<div class="line"><span class="preprocessor"></span>ret = connection->load_extension(connection, MEMRATA_LIBRARY_PATH,</div>
<div class="line"> <span class="stringliteral">"config=["</span></div>
<div class="line"> <span class="stringliteral">"dev1=[kvs_devices=[/dev/ssd0,/dev/ssd1],kvs_open_o_truncate=1],"</span></div>
<div class="line"> <span class="stringliteral">"dev2=[kvs_devices=[/dev/ssd2],kvs_open_o_truncate=1]]"</span>);</div>
</div><!-- fragment --><p>The <code>kvs_devices</code> configuration string takes a WiredTiger configuration list, that is, a comma-separated list of Memrata devices.</p>
<p>In this example, both device pools are configured to be truncated (that is, all previously existing contents discarded), when they are configured.</p>
<p>When loading a Memrata device, the following additional configuration strings are supported:</p>
<table class="doxtable">
<tr>
<th>String</th><th>Type </th></tr>
<tr>
<td>kvs_devices</td><td>list of lists </td></tr>
<tr>
<td>kvs_parallelism</td><td>int </td></tr>
<tr>
<td>kvs_granularity</td><td>int </td></tr>
<tr>
<td>kvs_avg_key_len</td><td>int </td></tr>
<tr>
<td>kvs_avg_val_len</td><td>int </td></tr>
<tr>
<td>kvs_write_bufs</td><td>int </td></tr>
<tr>
<td>kvs_read_bufs</td><td>int </td></tr>
<tr>
<td>kvs_commit_timeout</td><td>int </td></tr>
<tr>
<td>kvs_reclaim_threshold</td><td>int </td></tr>
<tr>
<td>kvs_reclaim_period</td><td>int </td></tr>
<tr>
<td>kvs_open_o_debug</td><td>boolean </td></tr>
<tr>
<td>kvs_open_o_truncate</td><td>boolean </td></tr>
</table>
<p>With the exception of the configuration string <code>kvs_devices</code> (which is WiredTiger specific), see the Memrata device documentation for details on their use.</p>
<h1><a class="anchor" id="memrata_objects"></a>
Creating Memrata-backed objects</h1>
<p>The device pool names are used as part of the URI specified to WiredTiger methods such as <a class="el" href="struct_w_t___s_e_s_s_i_o_n.html#a358ca4141d59c345f401c58501276bbb" title="Create a table, column group, index or file.">WT_SESSION::create</a> or <a class="el" href="struct_w_t___s_e_s_s_i_o_n.html#a1d24b02549009f78b7c6463da0247614" title="Rename an object.">WT_SESSION::rename</a>, separated from the object name by a single slash character.</p>
<p>Additionally, the <code>memrata</code> <code>type</code> configuration string must be included.</p>
<p>The following example creates a Memrata table named <code>access</code> in the device pool <code>dev1</code>, and then opens a cursor on the table:</p>
<div class="fragment"><div class="line"><a class="code" href="struct_w_t___c_u_r_s_o_r.html" title="A WT_CURSOR handle is the interface to a cursor.">WT_CURSOR</a> *cursor;</div>
<div class="line"><a class="code" href="struct_w_t___s_e_s_s_i_o_n.html" title="All data operations are performed in the context of a WT_SESSION.">WT_SESSION</a> *session;</div>
<div class="line"></div>
<div class="line"><span class="comment">/* Create the access table. */</span></div>
<div class="line">ret = session-><a class="code" href="struct_w_t___s_e_s_s_i_o_n.html#a358ca4141d59c345f401c58501276bbb" title="Create a table, column group, index or file.">create</a>(</div>
<div class="line"> session, <span class="stringliteral">"table:dev1/access"</span>, <span class="stringliteral">"key_format=S,value_format=S,type=memrata"</span>);</div>
<div class="line"></div>
<div class="line"><span class="comment">/* Open a cursor on the access table. */</span></div>
<div class="line">ret = session-><a class="code" href="struct_w_t___s_e_s_s_i_o_n.html#afb5b4a69c2c5cafe411b2b04fdc1c75d" title="Open a new cursor on a data source or duplicate an existing cursor.">open_cursor</a>(session, <span class="stringliteral">"table:dev1/access"</span>, NULL, NULL, &cursor);</div>
</div><!-- fragment --><p>When creating a Memrata-backed object with the <a class="el" href="struct_w_t___s_e_s_s_i_o_n.html#a358ca4141d59c345f401c58501276bbb" title="Create a table, column group, index or file.">WT_SESSION::create</a> method, the following additional configuration strings are supported:</p>
<table class="doxtable">
<tr>
<th>String</th><th>Type </th></tr>
<tr>
<td>kvs_open_o_debug</td><td>boolean </td></tr>
<tr>
<td>kvs_open_o_truncate</td><td>boolean </td></tr>
</table>
<p>See the Memrata device documentation for details on their use.</p>
<p>For example, creating and truncating a table could be done as follows:</p>
<div class="fragment"><div class="line"><a class="code" href="struct_w_t___s_e_s_s_i_o_n.html" title="All data operations are performed in the context of a WT_SESSION.">WT_SESSION</a> *session;</div>
<div class="line"></div>
<div class="line"><span class="comment">/* Create and truncate the access table. */</span></div>
<div class="line">ret = session-><a class="code" href="struct_w_t___s_e_s_s_i_o_n.html#a358ca4141d59c345f401c58501276bbb" title="Create a table, column group, index or file.">create</a>(session, <span class="stringliteral">"table:dev1/access"</span>,</div>
<div class="line"> <span class="stringliteral">"key_format=S,value_format=S,type=memrata,kvs_open_o_truncate=1"</span>);</div>
</div><!-- fragment --><h1><a class="anchor" id="memrata_notes"></a>
Memrata notes</h1>
<ul>
<li>Memrata devices do not support named checkpoints.</li>
<li>Inserting a new record after the current maximum record in a fixed-length bit field column-store (that is, a store with an 'r' type key and 't' type value) does not implicitly create the missing records.</li>
<li>Memrata devices do not support bulk load as a special case, and configuring cursors for bulk load has no effect.</li>
<li>Memrata devices do not support compression of any kind.</li>
</ul>
<h1><a class="anchor" id="memrata_limitations"></a>
Memrata limitations</h1>
<ul>
<li>WiredTiger transactions cannot include operations on both Memrata devices and other stores. </li>
</ul>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="index.html">Reference Guide</a></li><li class="navelem"><a class="el" href="programming.html">Writing WiredTiger applications</a></li>
<li class="footer">Copyright (c) 2008-2013 WiredTiger, Inc. All rights reserved. Contact <a href="mailto:[email protected]">[email protected]</a> for more information.</li>
</ul>
</div>
</body>
</html>