/
extension-es-riak.html
192 lines (157 loc) · 11.6 KB
/
extension-es-riak.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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!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/html; charset=UTF-8" /><title>Riak EntityStore</title><link rel="stylesheet" type="text/css" href="css/style.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.76.1" /><link rel="home" href="index.html" title="" /><link rel="up" href="extensions.html" title="Extensions" /><link rel="prev" href="extension-es-redis.html" title="Redis EntityStore" /><link rel="next" href="extension-es-sql.html" title="SQL EntityStore" />
<!-- favicon -->
<link rel="shortcut icon" href="http://qi4j.org/favicon.ico" type="image/vnd.microsoft.icon" />
<link rel="icon" href="http://qi4j.org/favicon.ico" type="image/x-icon" />
<!-- style -->
<link href="css/shCore.css" rel="stylesheet" type="text/css" />
<link href="css/shCoreEclipse.css" rel="stylesheet" type="text/css" />
<link href="css/shThemeEclipse.css" rel="stylesheet" type="text/css" />
<link href="css/qi4j.css" rel="stylesheet" type="text/css" />
<!-- Syntax Highlighter -->
<script type="text/javascript" src="js/shCore.js"></script>
<script type="text/javascript" src="js/shBrushJava.js"></script>
<script type="text/javascript" src="js/shBrushScala.js"></script>
<script type="text/javascript" src="js/shBrushJScript.js"></script>
<script type="text/javascript" src="js/shBrushBash.js"></script>
<script type="text/javascript" src="js/shBrushPlain.js"></script>
<script type="text/javascript" src="js/shBrushXml.js"></script>
<script type="text/javascript" src="js/shBrushGroovy.js"></script>
<script type="text/javascript" src="js/shBrushPython.js"></script>
<script type="text/javascript" src="js/shBrushRuby.js"></script>
<script type="text/javascript" src="js/shBrushCSharp.js"></script>
<script type="text/javascript">
SyntaxHighlighter.defaults['tab-size'] = 4;
SyntaxHighlighter.defaults['gutter'] = false;
SyntaxHighlighter.defaults['toolbar'] = false;
SyntaxHighlighter.all()
</script>
<!-- JQuery -->
<script type="text/javascript" src="js/jquery-1.6.4.min.js"></script>
<!-- Image Scaler -->
<script type="text/javascript" src="js/imagescaler.js"></script>
<!-- Table Styler -->
<script type="text/javascript" src="js/tablestyler.js"></script>
<!-- Qi4j WebSite Progressive Enhancement -->
<link href="css/progressive-enhancement.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.scrollTo-1.4.2.js"></script>
<script type="text/javascript" src="js/progressive-enhancement.js"></script>
<!-- Analytics -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-3118496-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head><body><div xmlns="" xmlns:exsl="http://exslt.org/common" class="logo"><a href="index.html"><img src="images/logo-standard.png" /></a></div><div xmlns="" xmlns:exsl="http://exslt.org/common" class="top-nav"><div xmlns="http://www.w3.org/1999/xhtml" class="toc"><dl><dt><span class="section"><a href="index.html#home">Qi4j</a></span></dt><dt><span class="section"><a href="intro.html">Introduction</a></span></dt><dt><span class="section"><a href="tutorials.html">Tutorials</a></span></dt><dt><span class="section"><a href="javadocs.html">Javadoc</a></span></dt><dt><span class="section"><a href="samples.html">Samples</a></span></dt><dt><span class="section"><a href="core.html">Core</a></span></dt><dt><span class="section"><a href="libraries.html">Libraries</a></span></dt><dt><span class="section"><span xmlns="" href="extensions.html">Extensions</span></span></dt><dt><span class="section"><a href="tools.html">Tools</a></span></dt><dt><span class="section"><a href="glossary.html">Glossary </a></span></dt></dl></div></div><div xmlns="" xmlns:exsl="http://exslt.org/common" class="sub-nav"><div xmlns="http://www.w3.org/1999/xhtml" class="toc"><dl><dt><span class="section"><a href="extensions.html#_overview_7">Overview</a></span></dt><dt><span class="section"><a href="extension-vs-orgjson.html">org.json ValueSerialization</a></span></dt><dt><span class="section"><a href="extension-vs-jackson.html">Jackson ValueSerialization</a></span></dt><dt><span class="section"><a href="extension-vs-stax.html">StAX ValueSerialization</a></span></dt><dt><span class="section"><a href="extension-cache-ehcache.html">Ehcache Cache</a></span></dt><dt><span class="section"><a href="extension-cache-memcache.html">Memcache Cache</a></span></dt><dt><span class="section"><a href="extension-es-memory.html">Memory EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-file.html">File EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-gae.html">Google AppEngine EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-hazelcast.html">Hazelcast EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-jclouds.html">JClouds EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-jdbm.html">JDBM EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-leveldb.html">LevelDB EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-mongodb.html">MongoDB EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-neo4j.html">Neo4j EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-preferences.html">Preferences EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-redis.html">Redis EntityStore</a></span></dt><dt><span class="section"><span xmlns="" href="extension-es-riak.html">Riak EntityStore</span></span></dt><dt><span class="section"><a href="extension-es-sql.html">SQL EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-voldemort.html">Voldemort EntityStore</a></span></dt><dt><span class="section"><a href="extension-index-elasticsearch.html">ElasticSearch Index/Query</a></span></dt><dt><span class="section"><a href="extension-index-rdf.html">OpenRDF Index/Query</a></span></dt><dt><span class="section"><a href="extension-index-solr.html">Apache Solr Index/Query</a></span></dt><dt><span class="section"><a href="extension-indexing-sql.html">SQL Index/Query</a></span></dt><dt><span class="section"><a href="extension-metrics-yammer.html">Yammer Metrics</a></span></dt><dt><span class="section"><a href="extension-migration.html">Migration</a></span></dt><dt><span class="section"><a href="extension-reindexer.html">Reindexer</a></span></dt></dl></div></div><div class="section" title="Riak EntityStore"><div class="titlepage"><div><div><h3 class="title"><a id="extension-es-riak"></a>Riak EntityStore</h3></div></div></div><p class="remark"><em><span class="comment"></span></em></p><p class="devstatus-code-beta">code</p><p class="devstatus-docs-good">docs</p><p class="devstatus-tests-good">tests</p><p>EntityStore service backed by a <a class="ulink" href="http://basho.com/" target="_top">Riak</a> bucket.</p><p>The EntityStore comes in two flavours: HTTP or ProtocolBuffer based. See the Riak documentation.</p><div class="table"><a id="idm151910523728"></a><p class="title"><strong>Table 78. Artifact</strong></p><div class="table-contents"><table summary="Artifact" border="1"><colgroup><col class="col_1" /><col class="col_2" /><col class="col_3" /></colgroup><thead><tr><th align="left" valign="top">Group ID</th><th align="left" valign="top">Artifact ID</th><th align="left" valign="top">Version</th></tr></thead><tbody><tr><td align="left" valign="top"><p>org.qi4j.extension</p></td><td align="left" valign="top"><p>org.qi4j.extension.entitystore-riak</p></td><td align="left" valign="top"><p>0</p></td></tr></tbody></table></div></div><br class="table-break" /><div class="section" title="Assembly"><div class="titlepage"><div><div><h4 class="title"><a id="_assembly_21"></a>Assembly</h4></div></div></div><p>Assembly is done using the provided Assemblers.</p><p>For HTTP based Riak client:</p><pre class="programlisting brush: java">public void assemble( ModuleAssembly module )
throws AssemblyException
{
[...snip...]
new RiakHttpMapEntityStoreAssembler().withConfig( config, Visibility.layer ).assemble( module );
}
</pre><p>For ProtocolBuffer based Riak client:</p><pre class="programlisting brush: java">public void assemble( ModuleAssembly module )
throws AssemblyException
{
[...snip...]
new RiakProtobufMapEntityStoreAssembler().withConfig( config, Visibility.layer ).assemble( module );
}
</pre></div><div class="section" title="Configuration"><div class="titlepage"><div><div><h4 class="title"><a id="_configuration_14"></a>Configuration</h4></div></div></div><p>Here are the configuration properties for the HTTP based Riak client:</p><pre class="programlisting brush: java">public interface RiakHttpEntityStoreConfiguration
extends ConfigurationComposite
{
/**
* List of Riak URLs.
*
* Defaulted to http://127.0.0.1:8098/riak if empty.
*/
@UseDefaults
Property<List<String>> urls();
/**
* Riak Bucket where Entities state will be stored.
*
* Defaulted to "qi4j:entities".
*/
@Optional
Property<String> bucket();
/**
* Maximum total connections.
*
* Defaulted to 50. Use 0 for infinite number of connections.
*/
@Optional
Property<Integer> maxConnections();
/**
* The connection, socket read and pooled connection acquisition timeout in milliseconds.
*
* Defaulted to 0 (infinite).
*/
@UseDefaults
Property<Integer> timeout();
}
</pre><p>Here are the configuration properties for the ProtocolBuffer based Riak client:</p><pre class="programlisting brush: java">public interface RiakProtobufEntityStoreConfiguration
extends ConfigurationComposite
{
/**
* List of Riak Protocol Buffer hosts.
*
* Each entry can contain either an IP address / hostname
* or an IP address / hostname followed by a column and the host's port.
*
* Defaulted to 127.0.0.1 if empty.
*/
@UseDefaults
Property<List<String>> hosts();
/**
* Riak Bucket where Entities state will be stored.
*
* Defaulted to "qi4j:entities".
*/
@Optional
Property<String> bucket();
/**
* Maximum total connections.
*
* Defaulted to 50. Use 0 for infinite number of connections.
*/
@Optional
Property<Integer> maxConnections();
/**
* The connection timeout in milliseconds.
*
* Defaulted to 1000.
*/
@Optional
Property<Integer> connectionTimeout();
/**
* Idle connection time to live in milliseconds.
*
* Defaulted to 1000.
*/
@Optional
Property<Integer> idleConnectionTTL();
/**
* Max pool size.
*
* Defaulted to 0 (unlimited).
*/
@UseDefaults
Property<Integer> maxPoolSize();
/**
* Initial pool size.
*
* Defaulted to 0.
*/
@UseDefaults
Property<Integer> initialPoolSize();
/**
* Socket buffer size in KB.
*
* Defaulted to 16.
*/
@Optional
Property<Integer> socketBufferSizeKb();
}
</pre></div></div><div xmlns="" xmlns:exsl="http://exslt.org/common" class="footer">(c) 2012 The Qi4j Community</div></body></html>