gora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r914722 - in /websites/staging/gora/trunk/content: ./ current/gora-cassandra.html
Date Wed, 02 Jul 2014 06:22:01 GMT
Author: buildbot
Date: Wed Jul  2 06:22:01 2014
New Revision: 914722

Log:
Staging update by buildbot for gora

Modified:
    websites/staging/gora/trunk/content/   (props changed)
    websites/staging/gora/trunk/content/current/gora-cassandra.html

Propchange: websites/staging/gora/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Wed Jul  2 06:22:01 2014
@@ -1 +1 @@
-1607206
+1607251

Modified: websites/staging/gora/trunk/content/current/gora-cassandra.html
==============================================================================
--- websites/staging/gora/trunk/content/current/gora-cassandra.html (original)
+++ websites/staging/gora/trunk/content/current/gora-cassandra.html Wed Jul  2 06:22:01 2014
@@ -159,25 +159,51 @@ under the License. 
 <p>This is the main documentation for the gora-cassandra module which
 enables <a href="http://cassandra.apache.org">Apache Cassandra</a> backend support
for Gora. </p>
 <h2 id="goraproperties">gora.properties</h2>
-<ul>
-<li><code>gora.datastore.default=org.apache.gora.cassandra.store.CassandraStore</code>
- Implementation of the storage class </li>
-<li><code>gora.cassandra.mapping.file=/path/to/gora-cassandra-mapping.xml</code>
- The XML mapping file to be used </li>
-<li><code>gora.cassandra.servers=localhost:9160</code> - This value should
specify the host:port for a running Cassandra server or node. In this case the server happens
to be running on localhost at port 9160 which is the default Cassandra server configuration.</li>
-</ul>
+<p><table class="table">
+  <thead>
+   <tr>
+    <th align="left">Property Key</th>
+    <th align="left">Property Value</th> 
+    <th align="left">Required</th>
+    <th align="left">Description</th>
+   </tr>
+  </thead>
+  <tbody>
+   <tr>
+    <td>gora.datastore.default=</td>
+    <td>org.apache.gora.cassandra.store.CassandraStore</td>
+    <td>Yes</td>
+    <td>Implementation of the persistent Java storage class</td>
+   </tr>
+   <tr>
+    <td>gora.cassandra.mapping.file=</td>
+    <td>/path/to/gora-cassandra-mapping.xml</td>
+    <td>No</td>
+    <td>The XML mapping file to be used. If no value is used this defaults to <code>gora-cassandra-mapping.xml</code></td>
+   </tr>
+   <tr>
+    <td>gora.cassandra.servers=</td>
+    <td>localhost:9160</td>
+    <td>Yes</td>
+    <td>This value should specify the host:port for a running Cassandra server or node.
In this case the server happens to be running on localhost at port 9160 which is the default
Cassandra server configuration. It is important that the <b>host</b> matches that
specified in <code>gora-cassandra-mapping.xml</code></td>
+   </tr>
+  </tboday>
+</table></p>
 <h2 id="gora-cassandra-mappings">Gora Cassandra mappings</h2>
 <p>Say we wished to map some Employee data and store it into the CassandraStore.</p>
 <div class="codehilite"><pre><span class="nt">&lt;gora-otd&gt;</span>
-  <span class="nt">&lt;keyspace</span> <span class="na">name=</span><span
class="s">&quot;Employee&quot;</span> <span class="na">host=</span><span
class="s">&quot;localhost&quot;</span> <span class="na">cluster=</span><span
class="s">&quot;Gora Cassandra Test Cluster&quot;</span><span class="nt">&gt;</span>
-    <span class="nt">&lt;family</span> <span class="na">name=</span><span
class="s">&quot;p&quot;</span><span class="nt">/&gt;</span>
-    <span class="nt">&lt;family</span> <span class="na">name=</span><span
class="s">&quot;f&quot;</span><span class="nt">/&gt;</span>
+  <span class="nt">&lt;keyspace</span> <span class="na">name=</span><span
class="s">&quot;Employee&quot;</span> <span class="na">host=</span><span
class="s">&quot;localhost&quot;</span> <span class="na">placement_strategy=</span><span
class="s">&quot;org.apache.cassandra.locator.SimpleStrategy&quot;</span>
+  <span class="na">replication_factor=</span><span class="s">&quot;1&quot;</span>
<span class="na">cluster=</span><span class="s">&quot;Gora Cassandra
Test Cluster&quot;</span><span class="nt">&gt;</span>
+    <span class="nt">&lt;family</span> <span class="na">name=</span><span
class="s">&quot;p&quot;</span> <span class="na">gc_grace_seconds=</span><span
class="s">&quot;5&quot;</span><span class="nt">/&gt;</span>
+    <span class="nt">&lt;family</span> <span class="na">name=</span><span
class="s">&quot;f&quot;</span> <span class="na">gc_grace_seconds=</span><span
class="s">&quot;5&quot;</span><span class="nt">/&gt;</span>
     <span class="nt">&lt;family</span> <span class="na">name=</span><span
class="s">&quot;sc&quot;</span> <span class="na">type=</span><span
class="s">&quot;super&quot;</span> <span class="nt">/&gt;</span>
   <span class="nt">&lt;/keyspace&gt;</span>
 
   <span class="nt">&lt;class</span> <span class="na">name=</span><span
class="s">&quot;org.apache.gora.examples.generated.Employee&quot;</span>
<span class="na">keyClass=</span><span class="s">&quot;java.lang.String&quot;</span>
<span class="na">keyspace=</span><span class="s">&quot;Employee&quot;</span><span
class="nt">&gt;</span>
-    <span class="nt">&lt;field</span> <span class="na">name=</span><span
class="s">&quot;name&quot;</span>  <span class="na">family=</span><span
class="s">&quot;p&quot;</span> <span class="na">qualifier=</span><span
class="s">&quot;info:nm&quot;</span><span class="nt">/&gt;</span>
-    <span class="nt">&lt;field</span> <span class="na">name=</span><span
class="s">&quot;dateOfBirth&quot;</span>  <span class="na">family=</span><span
class="s">&quot;p&quot;</span> <span class="na">qualifier=</span><span
class="s">&quot;info:db&quot;</span><span class="nt">/&gt;</span>
-    <span class="nt">&lt;field</span> <span class="na">name=</span><span
class="s">&quot;ssn&quot;</span>  <span class="na">family=</span><span
class="s">&quot;p&quot;</span> <span class="na">qualifier=</span><span
class="s">&quot;info:sn&quot;</span><span class="nt">/&gt;</span>
-    <span class="nt">&lt;field</span> <span class="na">name=</span><span
class="s">&quot;salary&quot;</span>  <span class="na">family=</span><span
class="s">&quot;p&quot;</span> <span class="na">qualifier=</span><span
class="s">&quot;info:sl&quot;</span><span class="nt">/&gt;</span>
+    <span class="nt">&lt;field</span> <span class="na">name=</span><span
class="s">&quot;name&quot;</span>  <span class="na">family=</span><span
class="s">&quot;p&quot;</span> <span class="na">qualifier=</span><span
class="s">&quot;info:nm&quot;</span> <span class="na">ttl=</span><span
class="s">&quot;10&quot;</span><span class="nt">/&gt;</span>
+    <span class="nt">&lt;field</span> <span class="na">name=</span><span
class="s">&quot;dateOfBirth&quot;</span>  <span class="na">family=</span><span
class="s">&quot;p&quot;</span> <span class="na">qualifier=</span><span
class="s">&quot;info:db&quot;</span> <span class="na">ttl=</span><span
class="s">&quot;10&quot;</span><span class="nt">/&gt;</span>
+    <span class="nt">&lt;field</span> <span class="na">name=</span><span
class="s">&quot;ssn&quot;</span>  <span class="na">family=</span><span
class="s">&quot;p&quot;</span> <span class="na">qualifier=</span><span
class="s">&quot;info:sn&quot;</span> <span class="na">ttl=</span><span
class="s">&quot;10&quot;</span><span class="nt">/&gt;</span>
+    <span class="nt">&lt;field</span> <span class="na">name=</span><span
class="s">&quot;salary&quot;</span>  <span class="na">family=</span><span
class="s">&quot;p&quot;</span> <span class="na">qualifier=</span><span
class="s">&quot;info:sl&quot;</span> <span class="na">ttl=</span><span
class="s">&quot;10&quot;</span><span class="nt">/&gt;</span>
   <span class="nt">&lt;/class&gt;</span>
 <span class="nt">&lt;/gora-otd&gt;</span>
 </pre></div>
@@ -191,13 +217,36 @@ enables <a href="http://cassandra.apache
 <p>a parameter containing the Cassandra keyspace schema name e.g. <b>Employee</b>,
</p>
 </li>
 <li>
-<p>a parameter containing the host e.g. <b>localhost</b>, </p>
+<p>a parameter containing the host e.g. <b>localhost</b>. The value of
the host attribute of keyspace tag should match exactly what is in
+   gora.properties file. Essentially this means that if you are using port number, you should
+   use it everywhere regardless of whether it is the default port or not.
+   At runtime Gora will otherwise try to connect to localhost. For more information please
see <a href="https://issues.apache.org/jira/browse/GORA-269">here</a></p>
 </li>
 <li>
 <p>a parameter containing the Cassandra cluster name e.g. <b>Gora Cassandra Test
Cluster</b>,</p>
 </li>
 <li>
-<p>A nested element containing the name and type of column families we wish to create
within Cassandra. In this case we create three columns;  <b>p</b>, <b>f</b>
and <b>sc</b> the last of which contains an optional <b>type</b> attribute
which further defines this as a super column. </p>
+<p>a parameter containing a <b>placement_strategy</b>: The value of 'placement_strategy'
should be a fully qualifed class name that is known to
+   the cassansra cluster, not the application or Gora. As of this writing, the classes that
ship
+   with cassandra are:
+   <code>org.apache.cassandra.locator.SimpleStrategy</code> and 
+   <code>org.apache.cassandra.locator.NetworkTopologyStrategy</code>.
+   gora-cassandra will use SimpleStrategy by default if no value for this attribute is specified.
Finally 
+   it should be noted that the placement_strategy attribute of the keyspace tag
+   will only apply if Gora creates the Cassandra Keyspace. More about placement strategies
can be found
+   <a href="http://www.datastax.com/documentation/cassandra/1.2/cassandra/architecture/architectureDataDistributeReplication_c.html">here</a>.</p>
+</li>
+<li>
+<p>a parameter containing a <b>replication_factor</b> attribute with value
integer. Again the replacation_factor value associated with the Keyspace tag
+   will only apply if Gora creates the Keyspace and will have no effect if this is being
used against 
+   an existing keyspace. the default value for 'replication_factor' is '1'. <b>N.B.</b>In
Cassandra this property is required if the placement_strategy 
+   class is SimpleStrategy; otherwise, not used. This value essentially relates to the number
of replicas of data you want to reside on multiple nodes.</p>
+</li>
+<li>
+<p>A child element <b>family</b> containing the <b>name</b>,
<b>type</b> and <b>gc_grace_seconds</b> parameters for column families
we wish to create within Cassandra. In this case we create three columns;  <b>p</b>,
<b>f</b> and <b>sc</b> the last of which contains an optional <b>type</b>
attribute which further defines this as a super column. 
+   Additonally, column families <b>p</b> and <b>f</b> assign a value
of 5 to <b>gc_grace_seconds</b>. In Gora we define the default value of 'gc_grace_seconds'
as '0' which is ONLY VIABLE FOR A SINGLE NODE
+   CLUSTER. You should update this value according to your <a href="https://wiki.apache.org/cassandra/StorageConfiguration">cluster
configuration</a>. 
+   Columns marked with a gc_grace_seconds exist for a configured time period. More information
can be found <a href="http://www.datastax.com/documentation/cassandra/2.0/cassandra/dml/dml_about_deletes_c.html">here</a></p>
 </li>
 </ol>
 <p>The <b>class</b> element specifying persistent fields which values should
map to. This element contains; </p>
@@ -216,6 +265,11 @@ enables <a href="http://cassandra.apache
 <p>a parameter <b>name</b> e.g. (name, dateOfBirth, ssn and salary respectively),
</p>
 <p>a parameter containing the column <b>family</b> to which the field belongs
e.g. (all p in this case), </p>
 <p>an optional parameter <b>qualifier</b>, which enables more granular
control over the data to be persisted into Cassandra.</p>
+<p>an optional patameter <b>ttl</b> (time to live): the value of the 'ttl'
attribute should most likely always
+   be zero unless you want Cassandra to create Tombstones and delete portions of your
+   data once this period expires. Any positive value is read and bound to the number
+   of seconds after which the value for that field will disappear. The default value of ttl
+   is '0'.</p>
 </li>
 </ol>
 



Mime
View raw message