Return-Path: X-Original-To: apmail-gora-commits-archive@www.apache.org Delivered-To: apmail-gora-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D10D4110F0 for ; Wed, 2 Jul 2014 06:22:23 +0000 (UTC) Received: (qmail 10531 invoked by uid 500); 2 Jul 2014 06:22:23 -0000 Delivered-To: apmail-gora-commits-archive@gora.apache.org Received: (qmail 10494 invoked by uid 500); 2 Jul 2014 06:22:23 -0000 Mailing-List: contact commits-help@gora.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@gora.apache.org Delivered-To: mailing list commits@gora.apache.org Received: (qmail 10481 invoked by uid 99); 2 Jul 2014 06:22:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jul 2014 06:22:23 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jul 2014 06:22:22 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id F12E02388AC8 for ; Wed, 2 Jul 2014 06:22:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r914722 - in /websites/staging/gora/trunk/content: ./ current/gora-cassandra.html Date: Wed, 02 Jul 2014 06:22:01 -0000 To: commits@gora.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140702062201.F12E02388AC8@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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.

This is the main documentation for the gora-cassandra module which enables Apache Cassandra backend support for Gora.

gora.properties

-
    -
  • gora.datastore.default=org.apache.gora.cassandra.store.CassandraStore - Implementation of the storage class
  • -
  • gora.cassandra.mapping.file=/path/to/gora-cassandra-mapping.xml - The XML mapping file to be used
  • -
  • gora.cassandra.servers=localhost:9160 - 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.
  • -
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Property KeyProperty ValueRequiredDescription
gora.datastore.default=org.apache.gora.cassandra.store.CassandraStoreYesImplementation of the persistent Java storage class
gora.cassandra.mapping.file=/path/to/gora-cassandra-mapping.xmlNoThe XML mapping file to be used. If no value is used this defaults to gora-cassandra-mapping.xml
gora.cassandra.servers=localhost:9160YesThis 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 host matches that specified in gora-cassandra-mapping.xml

Gora Cassandra mappings

Say we wished to map some Employee data and store it into the CassandraStore.

<gora-otd>
-  <keyspace name="Employee" host="localhost" cluster="Gora Cassandra Test Cluster">
-    <family name="p"/>
-    <family name="f"/>
+  <keyspace name="Employee" host="localhost" placement_strategy="org.apache.cassandra.locator.SimpleStrategy"
+  replication_factor="1" cluster="Gora Cassandra Test Cluster">
+    <family name="p" gc_grace_seconds="5"/>
+    <family name="f" gc_grace_seconds="5"/>
     <family name="sc" type="super" />
   </keyspace>
 
   <class name="org.apache.gora.examples.generated.Employee" keyClass="java.lang.String" keyspace="Employee">
-    <field name="name"  family="p" qualifier="info:nm"/>
-    <field name="dateOfBirth"  family="p" qualifier="info:db"/>
-    <field name="ssn"  family="p" qualifier="info:sn"/>
-    <field name="salary"  family="p" qualifier="info:sl"/>
+    <field name="name"  family="p" qualifier="info:nm" ttl="10"/>
+    <field name="dateOfBirth"  family="p" qualifier="info:db" ttl="10"/>
+    <field name="ssn"  family="p" qualifier="info:sn" ttl="10"/>
+    <field name="salary"  family="p" qualifier="info:sl" ttl="10"/>
   </class>
 </gora-otd>
 
@@ -191,13 +217,36 @@ enables here

  • a parameter containing the Cassandra cluster name e.g. Gora Cassandra Test Cluster,

  • -

    A nested element containing the name and type of column families we wish to create within Cassandra. In this case we create three columns; p, f and sc the last of which contains an optional type attribute which further defines this as a super column.

    +

    a parameter containing a placement_strategy: 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: + org.apache.cassandra.locator.SimpleStrategy and + org.apache.cassandra.locator.NetworkTopologyStrategy. + 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 + here.

    +
  • +
  • +

    a parameter containing a replication_factor 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'. N.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.

    +
  • +
  • +

    A child element family containing the name, type and gc_grace_seconds parameters for column families we wish to create within Cassandra. In this case we create three columns; p, f and sc the last of which contains an optional type attribute which further defines this as a super column. + Additonally, column families p and f assign a value of 5 to gc_grace_seconds. 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 cluster configuration. + Columns marked with a gc_grace_seconds exist for a configured time period. More information can be found here

  • The class element specifying persistent fields which values should map to. This element contains;

    @@ -216,6 +265,11 @@ enables