gora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lewi...@apache.org
Subject svn commit: r1380874 - in /gora/branches/goraamazon: ./ docs/src/content/xdocs/ gora-accumulo/ gora-cassandra/ gora-cassandra/src/main/java/org/apache/gora/cassandra/query/ gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/ gora-cassan...
Date Tue, 04 Sep 2012 20:44:56 GMT
Author: lewismc
Date: Tue Sep  4 20:44:54 2012
New Revision: 1380874

URL: http://svn.apache.org/viewvc?rev=1380874&view=rev
Log:
batch backportof trunk issues to goraamazon branch

Added:
    gora/branches/goraamazon/eclipse-codeformat.xml
      - copied unchanged from r1380844, gora/trunk/eclipse-codeformat.xml
    gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/
      - copied from r1380844, gora/trunk/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/
    gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/GenericArraySerializer.java
      - copied unchanged from r1380844, gora/trunk/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/GenericArraySerializer.java
    gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/GoraSerializerTypeInferer.java
      - copied unchanged from r1380844, gora/trunk/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/GoraSerializerTypeInferer.java
    gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/SpecificFixedSerializer.java
      - copied unchanged from r1380844, gora/trunk/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/SpecificFixedSerializer.java
    gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/StatefulHashMapSerializer.java
      - copied unchanged from r1380844, gora/trunk/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/StatefulHashMapSerializer.java
    gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/TypeUtils.java
      - copied unchanged from r1380844, gora/trunk/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/TypeUtils.java
    gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/Utf8Serializer.java
      - copied unchanged from r1380844, gora/trunk/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/Utf8Serializer.java
    gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraMappingManager.java
      - copied unchanged from r1380844, gora/trunk/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraMappingManager.java
    gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/HectorUtils.java
      - copied unchanged from r1380844, gora/trunk/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/HectorUtils.java
    gora/branches/goraamazon/gora-cassandra/src/test/conf/cassandra.yaml
      - copied unchanged from r1380844, gora/trunk/gora-cassandra/src/test/conf/cassandra.yaml
    gora/branches/goraamazon/gora-cassandra/src/test/conf/log4j-server.properties
      - copied unchanged from r1380844, gora/trunk/gora-cassandra/src/test/conf/log4j-server.properties
    gora/branches/goraamazon/gora-cassandra/src/test/java/org/
      - copied from r1380844, gora/trunk/gora-cassandra/src/test/java/org/
    gora/branches/goraamazon/gora-cassandra/src/test/java/org/apache/
      - copied from r1380844, gora/trunk/gora-cassandra/src/test/java/org/apache/
    gora/branches/goraamazon/gora-cassandra/src/test/java/org/apache/gora/
      - copied from r1380844, gora/trunk/gora-cassandra/src/test/java/org/apache/gora/
    gora/branches/goraamazon/gora-cassandra/src/test/java/org/apache/gora/cassandra/
      - copied from r1380844, gora/trunk/gora-cassandra/src/test/java/org/apache/gora/cassandra/
    gora/branches/goraamazon/gora-cassandra/src/test/java/org/apache/gora/cassandra/GoraCassandraTestDriver.java
      - copied unchanged from r1380844, gora/trunk/gora-cassandra/src/test/java/org/apache/gora/cassandra/GoraCassandraTestDriver.java
    gora/branches/goraamazon/gora-cassandra/src/test/java/org/apache/gora/cassandra/store/
      - copied from r1380844, gora/trunk/gora-cassandra/src/test/java/org/apache/gora/cassandra/store/
    gora/branches/goraamazon/gora-cassandra/src/test/java/org/apache/gora/cassandra/store/TestCassandraStore.java
      - copied unchanged from r1380844, gora/trunk/gora-cassandra/src/test/java/org/apache/gora/cassandra/store/TestCassandraStore.java
Modified:
    gora/branches/goraamazon/   (props changed)
    gora/branches/goraamazon/CHANGES.txt
    gora/branches/goraamazon/docs/src/content/xdocs/site.xml
    gora/branches/goraamazon/gora-accumulo/pom.xml
    gora/branches/goraamazon/gora-cassandra/pom.xml
    gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraColumn.java
    gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraResult.java
    gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraSubColumn.java
    gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraSuperColumn.java
    gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java
    gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraMapping.java
    gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java
    gora/branches/goraamazon/gora-cassandra/src/test/conf/gora-cassandra-mapping.xml
    gora/branches/goraamazon/gora-cassandra/src/test/conf/gora.properties
    gora/branches/goraamazon/gora-core/pom.xml
    gora/branches/goraamazon/gora-core/src/main/java/org/apache/gora/compiler/GoraCompiler.java
    gora/branches/goraamazon/gora-core/src/main/java/org/apache/gora/store/impl/DataStoreBase.java
    gora/branches/goraamazon/gora-core/src/main/java/overview.html
    gora/branches/goraamazon/gora-core/src/test/java/org/apache/gora/GoraTestDriver.java
    gora/branches/goraamazon/gora-core/src/test/java/org/apache/gora/persistency/TestListGenericArray.java
    gora/branches/goraamazon/gora-core/src/test/java/org/apache/gora/store/DataStoreTestBase.java
    gora/branches/goraamazon/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java
    gora/branches/goraamazon/gora-hbase/pom.xml
    gora/branches/goraamazon/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java
    gora/branches/goraamazon/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseTableConnection.java
    gora/branches/goraamazon/gora-hbase/src/test/java/org/apache/gora/hbase/GoraHBaseTestDriver.java
    gora/branches/goraamazon/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java
    gora/branches/goraamazon/gora-sql/pom.xml
    gora/branches/goraamazon/gora-tutorial/pom.xml
    gora/branches/goraamazon/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogAnalytics.java
    gora/branches/goraamazon/pom.xml

Propchange: gora/branches/goraamazon/
------------------------------------------------------------------------------
    svn:mergeinfo = /gora/trunk:1348392-1380844

Modified: gora/branches/goraamazon/CHANGES.txt
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/CHANGES.txt?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/CHANGES.txt (original)
+++ gora/branches/goraamazon/CHANGES.txt Tue Sep  4 20:44:54 2012
@@ -4,9 +4,42 @@
 
 Gora Change Log
 
-0.3 (trunk) Current Development:
+trunk (current development)
 
-* GORA-103 Datastore for gora dynamodb - phase 1 (Renato Javier Marroquín Mogrovejo via lewismc)
+* GORA-160 Gora Fails to Import Into Recent Versions of Eclipse (Ed Kohlwey via lewismc)
+
+* GORA-85 Implement "Usage" messages for SpecificCompiler and LogAnalytics (lewismc)
+
+* GORA-164 Use <type> instead of <classifier> configuration for test dependencies (lewismc)
+
+* GORA-XX ensure directory cleanup succeeds in gora-* (Simone Tripodi via lewismc)
+
+0.2.1 release: 26/07/2012
+Release Report: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12311172&version=12322496
+
+* GORA-157 gora-cassandra test failure - proposal to skip 10 test cases for a while (kazk)
+
+* GORA-156 Properly implement getSchemaName in CassandraStore (lewismc)
+
+* GORA-153 gora-cassandra does not correctly handle DELETED State for MAP (kazk)
+
+* GORA-152 gora-core test incorrectly uses ByteBuffer's array() method to get its byte array (kazk)
+
+* GORA-151 CassandraStore's schemaExists() method always returns false (kazk)
+
+* GORA-150 Introduce Configuration property preferred.schema.name (ferdy)
+
+* GORA-142 Creates org.apache.gora.cassandra.serializers package in order to clean the code of store and query packages and to support additional types in future. (kazk)
+
+* GORA-148 CassandraMapping supports only (first) keyspace and class in gora-cassandra-mapping.xml (kazk)
+
+* GORA-143 GoraCompiler needs to add "import FixedSize" statement for FIXED type (kazk)
+
+* GORA-147 fix threading issue caused by multiple threads trying to flush (ferdy)
+
+* GORA-146 HBaseStore does not properly set endkey (ferdy)
+
+* GORA-140 Requires some adjustments on dependency at gora-cassandra (kazk, lewismc)
 
 * GORA-138 gora-cassandra array type support: Double fix for GORA-81 Replace CassandraStore#addOrUpdateField with TypeInferringSerializer to take advantage of when the value is already of type ByteBuffer. (Kazuomi Kashii via lewismc)
 

Modified: gora/branches/goraamazon/docs/src/content/xdocs/site.xml
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/docs/src/content/xdocs/site.xml?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/docs/src/content/xdocs/site.xml (original)
+++ gora/branches/goraamazon/docs/src/content/xdocs/site.xml Tue Sep  4 20:44:54 2012
@@ -48,7 +48,8 @@ See http://forrest.apache.org/docs/linki
     <gora-cassandra  label="gora-cassandra" href="gora-cassandra.html" />
     <gora-hbase label="gora-hbase"         href="gora-hbase.html" />
     <gora-sql   label="gora-sql"           href="gora-sql.html" />
-    <api        label="API docs"           href="ext:api/index" />
+    <nightly	label="Nightly API docs"   href="ext:nightly" />
+    <api        label="0.2.1 API docs"     href="ext:api/index" />
   </docs>
 
   <external-refs>
@@ -70,8 +71,9 @@ See http://forrest.apache.org/docs/linki
     <cassandra    href="http://cassandra.apache.org/"/>
     <nutch     href="http://nutch.apache.org/"/>
     <sponsors href="http://www.apache.org/foundation/thanks.html"/>
+    <nightly  href="https://builds.apache.org/job/gora-trunk/javadoc" />
 
-    <api href="api/">
+    <api href="apidocs-0.2.1/">
       <index href="index.html" />
       <org href="org/">
         <apache href="apache/">

Modified: gora/branches/goraamazon/gora-accumulo/pom.xml
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-accumulo/pom.xml?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-accumulo/pom.xml (original)
+++ gora/branches/goraamazon/gora-accumulo/pom.xml Tue Sep  4 20:44:54 2012
@@ -93,24 +93,6 @@
                     </execution>
                 </executions>
             </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <version>${maven-jar-plugin.version}</version>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>jar</goal>
-                            <goal>test-jar</goal>
-                        </goals>
-                        <configuration>
-                        <archive>
-                            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
-                        </archive>
-                    </configuration>
-                    </execution>
-                </executions>
-            </plugin>
         </plugins>
     </build>
 

Modified: gora/branches/goraamazon/gora-cassandra/pom.xml
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-cassandra/pom.xml?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-cassandra/pom.xml (original)
+++ gora/branches/goraamazon/gora-cassandra/pom.xml Tue Sep  4 20:44:54 2012
@@ -61,9 +61,18 @@
         <directory>target</directory>
         <outputDirectory>target/classes</outputDirectory>
         <finalName>${project.artifactId}-${project.version}</finalName>
-    <!--<testOutputDirectory>target/test-classes</testOutputDirectory>-->
-    <!--<testSourceDirectory>src/test/java</testSourceDirectory>-->
+        <testOutputDirectory>target/test-classes</testOutputDirectory>
+        <testSourceDirectory>src/test/java</testSourceDirectory>
         <sourceDirectory>src/main/java</sourceDirectory>
+        <testResources>
+          <testResource>
+            <directory>${project.basedir}/src/test/conf</directory>
+            <includes>
+              <include>**/*</include>
+            </includes>
+            <!--targetPath>${project.basedir}/target/classes/</targetPath-->
+          </testResource>
+        </testResources>
         <plugins>
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
@@ -83,24 +92,6 @@
                     </execution>
                 </executions>
             </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <version>${maven-jar-plugin.version}</version>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>jar</goal>
-                            <goal>test-jar</goal>
-                        </goals>
-                        <configuration>
-                        <archive>
-                            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
-                        </archive>
-                    </configuration>
-                    </execution>
-                </executions>
-            </plugin>
         </plugins>
     </build>
 
@@ -122,19 +113,31 @@
         <dependency>
             <groupId>org.apache.cassandra</groupId>
             <artifactId>cassandra-all</artifactId>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.cassandra.deps</groupId>
+    		    <artifactId>avro</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
-
+        
         <dependency>
             <groupId>org.apache.cassandra</groupId>
             <artifactId>cassandra-thrift</artifactId>
         </dependency>
 
         <dependency>
-            <groupId>me.prettyprint</groupId>
+            <groupId>org.hectorclient</groupId>
             <artifactId>hector-core</artifactId>
+                <exclusions>
+                    <exclusion>
+                        <groupId>org.apache.cassandra</groupId>
+    		        <artifactId>cassandra-all</artifactId>
+                    </exclusion>
+            </exclusions>
         </dependency>
-
-
+        
         <!-- Misc Dependencies -->
         <dependency>
             <groupId>com.google.guava</groupId>
@@ -148,13 +151,17 @@
 
         <!-- Logging Dependencies -->
         <dependency>
+            <groupId>org.apache.hadoop</groupId>
+            <artifactId>avro</artifactId>
+        </dependency>
+        <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
         </dependency>
 
         <dependency>
             <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-jdk14</artifactId>
+            <artifactId>slf4j-log4j12</artifactId>
         </dependency>
 
         <dependency>
@@ -172,7 +179,7 @@
             <groupId>org.apache.hadoop</groupId>
             <artifactId>hadoop-test</artifactId>
         </dependency>
-
+        
     </dependencies>
 
 </project>

Modified: gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraColumn.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraColumn.java?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraColumn.java (original)
+++ gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraColumn.java Tue Sep  4 20:44:54 2012
@@ -20,18 +20,12 @@ package org.apache.gora.cassandra.query;
 
 import java.nio.ByteBuffer;
 
-import me.prettyprint.cassandra.serializers.FloatSerializer;
-import me.prettyprint.cassandra.serializers.DoubleSerializer;
-import me.prettyprint.cassandra.serializers.IntegerSerializer;
-import me.prettyprint.cassandra.serializers.LongSerializer;
-import me.prettyprint.cassandra.serializers.StringSerializer;
+import me.prettyprint.hector.api.Serializer;
 
 import org.apache.avro.Schema;
 import org.apache.avro.Schema.Field;
-import org.apache.avro.Schema.Field;
 import org.apache.avro.Schema.Type;
-import org.apache.avro.generic.GenericArray;
-import org.apache.avro.util.Utf8;
+import org.apache.gora.cassandra.serializers.GoraSerializerTypeInferer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -71,32 +65,13 @@ public abstract class CassandraColumn {
   public abstract ByteBuffer getName();
   public abstract Object getValue();
   
-
-  protected Object fromByteBuffer(Type type, ByteBuffer byteBuffer) {
+  protected Object fromByteBuffer(Schema schema, ByteBuffer byteBuffer) {
     Object value = null;
-    switch (type) {
-      case STRING:
-        value = new Utf8(StringSerializer.get().fromByteBuffer(byteBuffer));
-        break;
-      case BYTES:
-        value = byteBuffer;
-        break;
-      case INT:
-        value = IntegerSerializer.get().fromByteBuffer(byteBuffer);
-        break;
-      case LONG:
-        value = LongSerializer.get().fromByteBuffer(byteBuffer);
-        break;
-      case FLOAT:
-        value = FloatSerializer.get().fromByteBuffer(byteBuffer);
-        break;
-      case DOUBLE:
-        value = DoubleSerializer.get().fromByteBuffer(byteBuffer);
-        break;
-
-      default:
-        LOG.info("Type is not supported: " + type);
-
+    Serializer serializer = GoraSerializerTypeInferer.getSerializer(schema);
+    if (serializer == null) {
+      LOG.info("Schema is not supported: " + schema.toString());
+    } else {
+      value = serializer.fromByteBuffer(byteBuffer);
     }
     return value;
   }

Modified: gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraResult.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraResult.java?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraResult.java (original)
+++ gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraResult.java Tue Sep  4 20:44:54 2012
@@ -26,6 +26,7 @@ import me.prettyprint.cassandra.serializ
 
 import org.apache.avro.Schema;
 import org.apache.avro.Schema.Field;
+import org.apache.avro.specific.SpecificFixed;
 import org.apache.gora.persistency.Persistent;
 import org.apache.gora.persistency.impl.PersistentBase;
 import org.apache.gora.query.Query;

Modified: gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraSubColumn.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraSubColumn.java?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraSubColumn.java (original)
+++ gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraSubColumn.java Tue Sep  4 20:44:54 2012
@@ -37,6 +37,10 @@ import org.apache.avro.Schema.Type;
 import org.apache.avro.generic.GenericArray;
 import org.apache.avro.generic.GenericData;
 import org.apache.avro.util.Utf8;
+import org.apache.gora.cassandra.serializers.GenericArraySerializer;
+import org.apache.gora.cassandra.serializers.StatefulHashMapSerializer;
+import org.apache.gora.cassandra.serializers.TypeUtils;
+import org.apache.gora.persistency.StatefulHashMap;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -66,28 +70,20 @@ public class CassandraSubColumn extends 
     Schema fieldSchema = field.schema();
     Type type = fieldSchema.getType();
     ByteBuffer byteBuffer = hColumn.getValue();
+    if (byteBuffer == null) {
+      return null;
+    }
     Object value = null;
     if (type == Type.ARRAY) {
-      // convert string to array
-      String valueString = StringSerializer.get().fromByteBuffer(byteBuffer);
-      valueString = valueString.substring(1, valueString.length()-1);
-      String[] elements = valueString.split(", ");
-
-      Type elementType = fieldSchema.getElementType().getType();
-      if (elementType == Schema.Type.STRING) {
-        // the array type is String
-        GenericArray<String> genericArray = new GenericData.Array<String>(elements.length, Schema.createArray(Schema.create(Schema.Type.STRING)));
-        for (String element: elements) {
-          genericArray.add(element);
-        }
-
-        value = genericArray;
-      } else {
-        LOG.info("Element type not supported: " + elementType);
-      }
-    }
-    else {
-      value = fromByteBuffer(type, byteBuffer);
+      GenericArraySerializer serializer = GenericArraySerializer.get(fieldSchema.getElementType());
+      GenericArray genericArray = serializer.fromByteBuffer(byteBuffer);
+      value = genericArray;
+    } else if (type == Type.MAP) {
+      StatefulHashMapSerializer serializer = StatefulHashMapSerializer.get(fieldSchema.getValueType());
+      StatefulHashMap map = serializer.fromByteBuffer(byteBuffer);
+      value = map;
+    } else {
+      value = fromByteBuffer(fieldSchema, byteBuffer);
     }
 
     return value;

Modified: gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraSuperColumn.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraSuperColumn.java?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraSuperColumn.java (original)
+++ gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraSuperColumn.java Tue Sep  4 20:44:54 2012
@@ -31,6 +31,7 @@ import org.apache.avro.Schema.Field;
 import org.apache.avro.Schema.Type;
 import org.apache.avro.generic.GenericArray;
 import org.apache.avro.util.Utf8;
+import org.apache.gora.cassandra.serializers.Utf8Serializer;
 import org.apache.gora.persistency.ListGenericArray;
 import org.apache.gora.persistency.StatefulHashMap;
 import org.apache.gora.persistency.impl.PersistentBase;
@@ -55,12 +56,11 @@ public class CassandraSuperColumn extend
     
     switch (type) {
       case ARRAY:
-        Type elementType = fieldSchema.getElementType().getType();
-        GenericArray array = new ListGenericArray(Schema.create(elementType));
+        ListGenericArray array = new ListGenericArray(fieldSchema.getElementType());
         
         for (HColumn<ByteBuffer, ByteBuffer> hColumn : this.hSuperColumn.getColumns()) {
           ByteBuffer memberByteBuffer = hColumn.getValue();
-          Object memberValue = fromByteBuffer(elementType, hColumn.getValue());
+          Object memberValue = fromByteBuffer(fieldSchema.getElementType(), hColumn.getValue());
           // int i = IntegerSerializer().get().fromByteBuffer(hColumn.getName());
           array.add(memberValue);      
         }
@@ -69,12 +69,12 @@ public class CassandraSuperColumn extend
         break;
       case MAP:
         Map<Utf8, Object> map = new StatefulHashMap<Utf8, Object>();
-        Type valueType = fieldSchema.getValueType().getType();
         
         for (HColumn<ByteBuffer, ByteBuffer> hColumn : this.hSuperColumn.getColumns()) {
           ByteBuffer memberByteBuffer = hColumn.getValue();
-          Object memberValue = fromByteBuffer(valueType, hColumn.getValue());
-          map.put(new Utf8(StringSerializer.get().fromByteBuffer(hColumn.getName())), memberValue);      
+          Object memberValue = null;
+          memberValue = fromByteBuffer(fieldSchema.getValueType(), hColumn.getValue());
+          map.put(Utf8Serializer.get().fromByteBuffer(hColumn.getName()), memberValue);      
         }
         value = map;
         
@@ -106,6 +106,10 @@ public class CassandraSuperColumn extend
 
           for (HColumn<ByteBuffer, ByteBuffer> hColumn : this.hSuperColumn.getColumns()) {
             String memberName = StringSerializer.get().fromByteBuffer(hColumn.getName());
+            if (memberName == null || memberName.length() == 0) {
+              LOG.warn("member name is null or empty.");
+              continue;
+            }
             Field memberField = fieldSchema.getField(memberName);
             CassandraSubColumn cassandraColumn = new CassandraSubColumn();
             cassandraColumn.setField(memberField);

Modified: gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java (original)
+++ gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java Tue Sep  4 20:44:54 2012
@@ -25,12 +25,10 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import me.prettyprint.cassandra.model.ConfigurableConsistencyLevel;
 import me.prettyprint.cassandra.serializers.ByteBufferSerializer;
-import me.prettyprint.cassandra.serializers.FloatSerializer;
 import me.prettyprint.cassandra.serializers.IntegerSerializer;
-import me.prettyprint.cassandra.serializers.DoubleSerializer;
 import me.prettyprint.cassandra.serializers.StringSerializer;
-import me.prettyprint.cassandra.serializers.SerializerTypeInferer;
 import me.prettyprint.cassandra.service.CassandraHostConfigurator;
 import me.prettyprint.hector.api.Cluster;
 import me.prettyprint.hector.api.Keyspace;
@@ -45,15 +43,22 @@ import me.prettyprint.hector.api.mutatio
 import me.prettyprint.hector.api.query.QueryResult;
 import me.prettyprint.hector.api.query.RangeSlicesQuery;
 import me.prettyprint.hector.api.query.RangeSuperSlicesQuery;
-import me.prettyprint.cassandra.model.ConfigurableConsistencyLevel;
 import me.prettyprint.hector.api.HConsistencyLevel;
 import me.prettyprint.hector.api.Serializer;
 
+import org.apache.avro.Schema;
+import org.apache.avro.Schema.Type;
+import org.apache.avro.generic.GenericArray;
 import org.apache.avro.util.Utf8;
 import org.apache.gora.cassandra.query.CassandraQuery;
+import org.apache.gora.cassandra.serializers.GenericArraySerializer;
+import org.apache.gora.cassandra.serializers.GoraSerializerTypeInferer;
+import org.apache.gora.cassandra.serializers.TypeUtils;
 import org.apache.gora.mapreduce.GoraRecordReader;
 import org.apache.gora.persistency.Persistent;
 import org.apache.gora.persistency.impl.PersistentBase;
+import org.apache.gora.persistency.State;
+import org.apache.gora.persistency.StatefulHashMap;
 import org.apache.gora.query.Query;
 import org.apache.gora.util.ByteUtils;
 import org.slf4j.Logger;
@@ -66,14 +71,19 @@ public class CassandraClient<K, T extend
   private Keyspace keyspace;
   private Mutator<K> mutator;
   private Class<K> keyClass;
+  private Class<T> persistentClass;
   
-  private CassandraMapping cassandraMapping = new CassandraMapping();
+  private CassandraMapping cassandraMapping = null;
 
   private Serializer<K> keySerializer;
   
-  public void initialize(Class<K> keyClass) throws Exception {
+  public void initialize(Class<K> keyClass, Class<T> persistentClass) throws Exception {
     this.keyClass = keyClass;
-    this.cassandraMapping.loadConfiguration();
+
+    // get cassandra mapping with persistent class
+    this.persistentClass = persistentClass;
+    this.cassandraMapping = CassandraMappingManager.getManager().get(persistentClass);
+
     this.cluster = HFactory.getOrCreateCluster(this.cassandraMapping.getClusterName(), new CassandraHostConfigurator(this.cassandraMapping.getHostName()));
     
     // add keyspace to cluster
@@ -82,9 +92,17 @@ public class CassandraClient<K, T extend
     // Just create a Keyspace object on the client side, corresponding to an already existing keyspace with already created column families.
     this.keyspace = HFactory.createKeyspace(this.cassandraMapping.getKeyspaceName(), this.cluster);
     
-    this.keySerializer = SerializerTypeInferer.getSerializer(keyClass);
+    this.keySerializer = GoraSerializerTypeInferer.getSerializer(keyClass);
     this.mutator = HFactory.createMutator(this.keyspace, this.keySerializer);
   }
+
+  /**
+   * Check if keyspace already exists.
+   */
+  public boolean keyspaceExists() {
+    KeyspaceDefinition keyspaceDefinition = this.cluster.describeKeyspace(this.cassandraMapping.getKeyspaceName());
+    return (keyspaceDefinition != null);
+  }
   
   /**
    * Check if keyspace already exists. If not, create it.
@@ -100,7 +118,7 @@ public class CassandraClient<K, T extend
       List<ColumnFamilyDefinition> columnFamilyDefinitions = this.cassandraMapping.getColumnFamilyDefinitions();      
       keyspaceDefinition = HFactory.createKeyspaceDefinition(this.cassandraMapping.getKeyspaceName(), "org.apache.cassandra.locator.SimpleStrategy", 1, columnFamilyDefinitions);      
       this.cluster.addKeyspace(keyspaceDefinition, true);
-      LOG.info("Keyspace '" + this.cassandraMapping.getKeyspaceName() + "' in cluster '" + this.cassandraMapping.getClusterName() + "' was created on host '" + this.cassandraMapping.getHostName() + "'");
+      // LOG.info("Keyspace '" + this.cassandraMapping.getKeyspaceName() + "' in cluster '" + this.cassandraMapping.getClusterName() + "' was created on host '" + this.cassandraMapping.getHostName() + "'");
       
       // Create a customized Consistency Level
       ConfigurableConsistencyLevel configurableConsistencyLevel = new ConfigurableConsistencyLevel();
@@ -144,8 +162,12 @@ public class CassandraClient<K, T extend
     
     String columnFamily = this.cassandraMapping.getFamily(fieldName);
     String columnName = this.cassandraMapping.getColumn(fieldName);
+    if (columnName == null) {
+      LOG.warn("Column name is null for field=" + fieldName + " with value=" + value.toString());
+      return;
+    }
     
-    this.mutator.insert(key, columnFamily, HFactory.createColumn(columnName, byteBuffer, StringSerializer.get(), ByteBufferSerializer.get()));
+    HectorUtils.insertColumn(mutator, key, columnFamily, columnName, byteBuffer);
   }
 
   /**
@@ -160,14 +182,97 @@ public class CassandraClient<K, T extend
     if (value == null) {
       return;
     }
-    
+
     ByteBuffer byteBuffer = toByteBuffer(value);
     
     String columnFamily = this.cassandraMapping.getFamily(fieldName);
     String superColumnName = this.cassandraMapping.getColumn(fieldName);
     
-    this.mutator.insert(key, columnFamily, HFactory.createSuperColumn(superColumnName, Arrays.asList(HFactory.createColumn(columnName, byteBuffer, ByteBufferSerializer.get(), ByteBufferSerializer.get())), StringSerializer.get(), ByteBufferSerializer.get(), ByteBufferSerializer.get()));
+    HectorUtils.insertSubColumn(mutator, key, columnFamily, superColumnName, columnName, byteBuffer);
+  }
+
+  public void addSubColumn(K key, String fieldName, String columnName, Object value) {
+    addSubColumn(key, fieldName, StringSerializer.get().toByteBuffer(columnName), value);
+  }
+
+  public void addSubColumn(K key, String fieldName, Integer columnName, Object value) {
+    addSubColumn(key, fieldName, IntegerSerializer.get().toByteBuffer(columnName), value);
+  }
+
+
+  /**
+   * Delete a member in a super column. This is used for map and record Avro types.
+   * @param key the row key
+   * @param fieldName the field name
+   * @param columnName the column name (the member name, or the index of array)
+   */
+  @SuppressWarnings("unchecked")
+  public void deleteSubColumn(K key, String fieldName, ByteBuffer columnName) {
+
+    String columnFamily = this.cassandraMapping.getFamily(fieldName);
+    String superColumnName = this.cassandraMapping.getColumn(fieldName);
     
+    HectorUtils.deleteSubColumn(mutator, key, columnFamily, superColumnName, columnName);
+  }
+
+  public void deleteSubColumn(K key, String fieldName, String columnName) {
+    deleteSubColumn(key, fieldName, StringSerializer.get().toByteBuffer(columnName));
+  }
+
+
+  @SuppressWarnings("unchecked")
+  public void addGenericArray(K key, String fieldName, GenericArray array) {
+    if (isSuper( cassandraMapping.getFamily(fieldName) )) {
+      int i= 0;
+      for (Object itemValue: array) {
+
+        // TODO: hack, do not store empty arrays
+        if (itemValue instanceof GenericArray<?>) {
+          if (((GenericArray)itemValue).size() == 0) {
+            continue;
+          }
+        } else if (itemValue instanceof StatefulHashMap<?,?>) {
+          if (((StatefulHashMap)itemValue).size() == 0) {
+            continue;
+          }
+        }
+
+        addSubColumn(key, fieldName, i++, itemValue);
+      }
+    }
+    else {
+      addColumn(key, fieldName, array);
+    }
+  }
+
+  @SuppressWarnings("unchecked")
+  public void addStatefulHashMap(K key, String fieldName, StatefulHashMap<Utf8,Object> map) {
+    if (isSuper( cassandraMapping.getFamily(fieldName) )) {
+      int i= 0;
+      for (Utf8 mapKey: map.keySet()) {
+        if (map.getState(mapKey) == State.DELETED) {
+          deleteSubColumn(key, fieldName, mapKey.toString());
+          continue;
+        }
+
+        // TODO: hack, do not store empty arrays
+        Object mapValue = map.get(mapKey);
+        if (mapValue instanceof GenericArray<?>) {
+          if (((GenericArray)mapValue).size() == 0) {
+            continue;
+          }
+        } else if (mapValue instanceof StatefulHashMap<?,?>) {
+          if (((StatefulHashMap)mapValue).size() == 0) {
+            continue;
+          }
+        }
+
+        addSubColumn(key, fieldName, mapKey.toString(), mapValue);
+      }
+    }
+    else {
+      addColumn(key, fieldName, map);
+    }
   }
 
   /**
@@ -177,29 +282,17 @@ public class CassandraClient<K, T extend
    */
   @SuppressWarnings("unchecked")
   public ByteBuffer toByteBuffer(Object value) {
-    if (value == null) {
-      return null;
-    }
-    
     ByteBuffer byteBuffer = null;
-    if (value instanceof ByteBuffer) {
-      byteBuffer = (ByteBuffer) value;
-    }
-    else if (value instanceof Utf8) {
-      byteBuffer = StringSerializer.get().toByteBuffer(((Utf8)value).toString());
-    }
-    else if (value instanceof Float) {
-      // workaround for hector-core-1.0-1.jar
-      // because SerializerTypeInferer.getSerializer(Float ) returns ObjectSerializer !?
-      byteBuffer = FloatSerializer.get().toByteBuffer((Float)value);
-    }
-    else if (value instanceof Double) {
-      // workaround for hector-core-1.0-1.jar
-      // because SerializerTypeInferer.getSerializer(Double ) returns ObjectSerializer !?
-      byteBuffer = DoubleSerializer.get().toByteBuffer((Double)value);
+    Serializer serializer = GoraSerializerTypeInferer.getSerializer(value);
+    if (serializer == null) {
+      LOG.info("Serializer not found for: " + value.toString());
     }
     else {
-      byteBuffer = SerializerTypeInferer.getSerializer(value).toByteBuffer(value);
+      byteBuffer = serializer.toByteBuffer(value);
+    }
+
+    if (byteBuffer == null) {
+      LOG.info("value class=" + value.getClass().getName() + " value=" + value + " -> null");
     }
     
     return byteBuffer;
@@ -313,4 +406,12 @@ public class CassandraClient<K, T extend
 
 
   }
+
+  /**
+   * Obtain Schema/Keyspace name
+   * @return Keyspace
+   */
+  public String getKeyspaceName() {
+	return this.cassandraMapping.getKeyspaceName();
+  }
 }

Modified: gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraMapping.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraMapping.java?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraMapping.java (original)
+++ gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraMapping.java Tue Sep  4 20:44:54 2012
@@ -107,42 +107,30 @@ public class CassandraMapping {
 
   /**
    * Primary class for loading Cassandra configuration from the 'MAPPING_FILE'.
-   * 
-   * @throws JDOMException
-   * @throws IOException
    */
-  @SuppressWarnings("unchecked")
-  public void loadConfiguration() throws JDOMException, IOException {
-    SAXBuilder saxBuilder = new SAXBuilder();
-    Document document = saxBuilder.build(getClass().getClassLoader().getResourceAsStream(MAPPING_FILE));
-    if (document == null) {
-      LOG.warn("Mapping file '" + MAPPING_FILE + "' could not be found!");
-    }
-    Element root = document.getRootElement();
-    
-    Element keyspace = root.getChild(KEYSPACE_ELEMENT);
+  public CassandraMapping(Element keyspace, Element mapping) {
     if (keyspace == null) {
     	LOG.warn("Error locating Cassandra Keyspace element!");
     } else {
-    	LOG.info("Located Cassandra Keyspace: '" + KEYSPACE_ELEMENT + "'");
+    	// LOG.info("Located Cassandra Keyspace: '" + KEYSPACE_ELEMENT + "'");
     }
     this.keyspaceName = keyspace.getAttributeValue(NAME_ATTRIBUTE);
     if (this.keyspaceName == null) {
     	LOG.warn("Error locating Cassandra Keyspace name attribute!");
     } else {
-    	LOG.info("Located Cassandra Keyspace name: '" + NAME_ATTRIBUTE + "'");
+    	// LOG.info("Located Cassandra Keyspace name: '" + NAME_ATTRIBUTE + "'");
     }
     this.clusterName = keyspace.getAttributeValue(CLUSTER_ATTRIBUTE);
     if (this.clusterName == null) {
     	LOG.warn("Error locating Cassandra Keyspace cluster attribute!");
     } else {
-    	LOG.info("Located Cassandra Keyspace cluster: '" + CLUSTER_ATTRIBUTE + "'");
+    	// LOG.info("Located Cassandra Keyspace cluster: '" + CLUSTER_ATTRIBUTE + "'");
     }
     this.hostName = keyspace.getAttributeValue(HOST_ATTRIBUTE);
     if (this.hostName == null) {
     	LOG.warn("Error locating Cassandra Keyspace host attribute!");
     } else {
-    	LOG.info("Located Cassandra Keyspace host: '" + HOST_ATTRIBUTE + "'");
+    	// LOG.info("Located Cassandra Keyspace host: '" + HOST_ATTRIBUTE + "'");
     }
     
     // load column family definitions
@@ -154,13 +142,13 @@ public class CassandraMapping {
       if (familyName == null) {
       	LOG.warn("Error locating column family name attribute!");
       } else {
-      	LOG.info("Located column family name: '" + NAME_ATTRIBUTE + "'");
+      	// LOG.info("Located column family name: '" + NAME_ATTRIBUTE + "'");
       }
       String superAttribute = element.getAttributeValue(SUPER_ATTRIBUTE);
       if (superAttribute != null) {
-    	LOG.info("Located super column family");
+    	// LOG.info("Located super column family");
         this.superFamilies.add(familyName);
-        LOG.info("Added super column family: '" + familyName + "'");
+        // LOG.info("Added super column family: '" + familyName + "'");
         cfDef.setColumnType(ColumnType.SUPER);
         cfDef.setSubComparatorType(ComparatorType.BYTESTYPE);
       }
@@ -175,7 +163,6 @@ public class CassandraMapping {
     }
     
     // load column definitions    
-    Element mapping = root.getChild(MAPPING_ELEMENT);
     elements = mapping.getChildren();
     for (Element element: elements) {
       String fieldName = element.getAttributeValue(NAME_ATTRIBUTE);

Modified: gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java (original)
+++ gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java Tue Sep  4 20:44:54 2012
@@ -41,6 +41,7 @@ import org.apache.avro.Schema;
 import org.apache.avro.Schema.Field;
 import org.apache.avro.Schema.Type;
 import org.apache.avro.generic.GenericArray;
+import org.apache.avro.specific.SpecificFixed;
 import org.apache.avro.util.Utf8;
 import org.apache.gora.cassandra.query.CassandraQuery;
 import org.apache.gora.cassandra.query.CassandraResult;
@@ -63,7 +64,7 @@ import org.slf4j.LoggerFactory;
 
 public class CassandraStore<K, T extends PersistentBase> extends DataStoreBase<K, T> {
   public static final Logger LOG = LoggerFactory.getLogger(CassandraStore.class);
-  
+
   private CassandraClient<K, T>  cassandraClient = new CassandraClient<K, T>();
 
   /**
@@ -81,7 +82,7 @@ public class CassandraStore<K, T extends
   public void initialize(Class<K> keyClass, Class<T> persistent, Properties properties) throws IOException {
     super.initialize(keyClass, persistent, properties);
     try {
-      this.cassandraClient.initialize(keyClass);
+      this.cassandraClient.initialize(keyClass, persistent);
     }
     catch (Exception e) {
       throw new IOException(e.getMessage(), e);
@@ -96,7 +97,7 @@ public class CassandraStore<K, T extends
 
   @Override
   public void createSchema() {
-    LOG.debug("create schema");
+    LOG.debug("creating Cassandra keyspace");
     this.cassandraClient.checkKeyspace();
   }
 
@@ -255,10 +256,14 @@ public class CassandraStore<K, T extends
     partitions.add(new PartitionQueryImpl<K,T>(query));
     return partitions;
   }
-
+  
+  /**
+   * In Cassandra Schemas are referred to as Keyspaces
+   * @return Keyspace
+   */
   @Override
   public String getSchemaName() {
-    return null;
+	return this.cassandraClient.getKeyspaceName();
   }
 
   @Override
@@ -277,8 +282,9 @@ public class CassandraStore<K, T extends
     T p = (T) value.newInstance(new StateManagerImpl());
     Schema schema = value.getSchema();
     for (Field field: schema.getFields()) {
-      if (value.isDirty(field.pos())) {
-        Object fieldValue = value.get(field.pos());
+      int fieldPos = field.pos();
+      if (value.isDirty(fieldPos)) {
+        Object fieldValue = value.get(fieldPos);
         
         // check if field has a nested structure (array, map, or record)
         Schema fieldSchema = field.schema();
@@ -293,14 +299,11 @@ public class CassandraStore<K, T extends
             fieldValue = newRecord;
             break;
           case MAP:
-            StatefulHashMap<?, ?> map = (StatefulHashMap<?, ?>) fieldValue;
-            StatefulHashMap<?, ?> newMap = new StatefulHashMap(map);
-            fieldValue = newMap;
+            // needs to keep State.DELETED.
             break;
           case ARRAY:
             GenericArray array = (GenericArray) fieldValue;
-            Type elementType = fieldSchema.getElementType().getType();
-            GenericArray newArray = new ListGenericArray(Schema.create(elementType));
+            ListGenericArray newArray = new ListGenericArray(fieldSchema.getElementType());
             Iterator iter = array.iterator();
             while (iter.hasNext()) {
               newArray.add(iter.next());
@@ -309,7 +312,7 @@ public class CassandraStore<K, T extends
             break;
         }
         
-        p.put(field.pos(), fieldValue);
+        p.put(fieldPos, fieldValue);
       }
     }
     
@@ -328,11 +331,13 @@ public class CassandraStore<K, T extends
     Type type = schema.getType();
     switch (type) {
       case STRING:
+      case BOOLEAN:
       case INT:
       case LONG:
       case BYTES:
       case FLOAT:
       case DOUBLE:
+      case FIXED:
         this.cassandraClient.addColumn(key, field.name(), value);
         break;
       case RECORD:
@@ -344,16 +349,16 @@ public class CassandraStore<K, T extends
               // TODO: hack, do not store empty arrays
               Object memberValue = persistentBase.get(member.pos());
               if (memberValue instanceof GenericArray<?>) {
-                GenericArray<String> array = (GenericArray<String>) memberValue;
-                if (array.size() == 0) {
+                if (((GenericArray)memberValue).size() == 0) {
+                  continue;
+                }
+              } else if (memberValue instanceof StatefulHashMap<?,?>) {
+                if (((StatefulHashMap)memberValue).size() == 0) {
                   continue;
                 }
               }
-              
-              if (memberValue instanceof Utf8) {
-                memberValue = memberValue.toString();
-              }
-              this.cassandraClient.addSubColumn(key, field.name(), StringSerializer.get().toByteBuffer(member.name()), memberValue);
+
+              this.cassandraClient.addSubColumn(key, field.name(), member.name(), memberValue);
             }
           } else {
             LOG.info("Record not supported: " + value.toString());
@@ -364,24 +369,7 @@ public class CassandraStore<K, T extends
       case MAP:
         if (value != null) {
           if (value instanceof StatefulHashMap<?, ?>) {
-            //TODO cast to stateful map and only write dirty keys
-            Map<Utf8, Object> map = (Map<Utf8, Object>) value;
-            for (Utf8 mapKey: map.keySet()) {
-              
-              // TODO: hack, do not store empty arrays
-              Object keyValue = map.get(mapKey);
-              if (keyValue instanceof GenericArray<?>) {
-                GenericArray<String> array = (GenericArray<String>) keyValue;
-                if (array.size() == 0) {
-                  continue;
-                }
-              }
-              
-              if (keyValue instanceof Utf8) {
-                keyValue = keyValue.toString();
-              }
-              this.cassandraClient.addSubColumn(key, field.name(), StringSerializer.get().toByteBuffer(mapKey.toString()), keyValue);              
-            }
+            this.cassandraClient.addStatefulHashMap(key, field.name(), (StatefulHashMap<Utf8,Object>)value);
           } else {
             LOG.info("Map not supported: " + value.toString());
           }
@@ -390,14 +378,7 @@ public class CassandraStore<K, T extends
       case ARRAY:
         if (value != null) {
           if (value instanceof GenericArray<?>) {
-            GenericArray<Object> array = (GenericArray<Object>) value;
-            int i= 0;
-            for (Object itemValue: array) {
-              if (itemValue instanceof Utf8) {
-                itemValue = itemValue.toString();
-              }
-              this.cassandraClient.addSubColumn(key, field.name(), IntegerSerializer.get().toByteBuffer(i++), itemValue);              
-            }
+            this.cassandraClient.addGenericArray(key, field.name(), (GenericArray)value);
           } else {
             LOG.info("Array not supported: " + value.toString());
           }
@@ -411,7 +392,7 @@ public class CassandraStore<K, T extends
   @Override
   public boolean schemaExists() throws IOException {
     LOG.info("schema exists");
-    return false;
+    return cassandraClient.keyspaceExists();
   }
 
 }

Modified: gora/branches/goraamazon/gora-cassandra/src/test/conf/gora-cassandra-mapping.xml
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-cassandra/src/test/conf/gora-cassandra-mapping.xml?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-cassandra/src/test/conf/gora-cassandra-mapping.xml (original)
+++ gora/branches/goraamazon/gora-cassandra/src/test/conf/gora-cassandra-mapping.xml Tue Sep  4 20:44:54 2012
@@ -18,24 +18,41 @@
 -->
 
 <gora-orm>
+  <keyspace name="Employee" host="localhost" cluster="Gora Cassandra Test Cluster">
+    <family name="p"/>
+    <family name="f"/>
+     <family name="sc" type="super" />
+  </keyspace>
+
+  <keyspace name="WebPage" host="localhost" cluster="Gora Cassandra Test Cluster">
+    <family name="p"/>
+    <family name="f"/>
+    <family name="sc" type="super"/>
+  </keyspace>
+
+  <keyspace name="TokenDatum" host="localhost" cluster="Gora Cassandra Test Cluster">
+    <family name="p"/>
+    <family name="f"/>
+    <family name="sc" type="super"/>
+  </keyspace>
 
   <class name="org.apache.gora.examples.generated.Employee" keyClass="java.lang.String" keyspace="Employee">
-    <field name="name" path="info:nm"/>
-    <field name="dateOfBirth" path="info:db"/>
-    <field name="ssn" path="info:sn"/>
-    <field name="salary" path="info:sl"/>
+    <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"/>
   </class>
 
   <class name="org.apache.gora.examples.generated.WebPage" keyClass="java.lang.String" keyspace="WebPage">
-    <field name="url" path="c:u"/>
-    <field name="content" path="p:cnt:c"/>
-    <field name="parsedContent" path="p:parsedContent"/>
-    <field name="outlinks" path="p:outlinks"/>
-    <field name="metadata" path="c:mt"/>
+    <field name="url" family="p" qualifier="c:u"/>
+    <field name="content" family="p" qualifier="p:cnt:c"/>
+    <field name="parsedContent" family="sc" qualifier="p:parsedContent"/>
+    <field name="outlinks" family="sc" qualifier="p:outlinks"/>
+    <field name="metadata" family="sc" qualifier="c:mt"/>
   </class>
 
   <class name="org.apache.gora.examples.generated.TokenDatum" keyClass="java.lang.String" keyspace="TokenDatum">
-    <field name="count" path="common:count"/>
+    <field name="count"  family="p" qualifier="common:count"/>
   </class>
 
 </gora-orm>

Modified: gora/branches/goraamazon/gora-cassandra/src/test/conf/gora.properties
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-cassandra/src/test/conf/gora.properties?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-cassandra/src/test/conf/gora.properties (original)
+++ gora/branches/goraamazon/gora-cassandra/src/test/conf/gora.properties Tue Sep  4 20:44:54 2012
@@ -13,4 +13,17 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-gora.cassandrastore.servers=localhost:9160
+gora.datastore.default=org.apache.gora.cassandra.CassandraStore
+gora.cassandrastore.keyspace=
+gora.cassandrastore.name=
+gora.cassandrastore.class=
+gora.cassandrastore.qualifier=
+gora.cassandrastore.family=
+gora.cassandrastore.type=
+gora.cassandraStore.cluster=Test Cluster
+gora.cassandraStore.host=localhost
+
+
+
+
+

Modified: gora/branches/goraamazon/gora-core/pom.xml
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-core/pom.xml?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-core/pom.xml (original)
+++ gora/branches/goraamazon/gora-core/pom.xml Tue Sep  4 20:44:54 2012
@@ -91,24 +91,6 @@
                     </execution>
                 </executions>
             </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <version>${maven-jar-plugin.version}</version>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>jar</goal>
-                            <goal>test-jar</goal>
-                        </goals>
-                        <configuration>
-                        <archive>
-                            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
-                        </archive>
-                    </configuration>
-                    </execution>
-                </executions>
-            </plugin>
         </plugins>
     </build>
 

Modified: gora/branches/goraamazon/gora-core/src/main/java/org/apache/gora/compiler/GoraCompiler.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-core/src/main/java/org/apache/gora/compiler/GoraCompiler.java?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-core/src/main/java/org/apache/gora/compiler/GoraCompiler.java (original)
+++ gora/branches/goraamazon/gora-core/src/main/java/org/apache/gora/compiler/GoraCompiler.java Tue Sep  4 20:44:54 2012
@@ -171,6 +171,7 @@ public class GoraCompiler {
     line(0, "import org.apache.avro.util.Utf8;");
     line(0, "import org.apache.avro.ipc.AvroRemoteException;");
     line(0, "import org.apache.avro.generic.GenericArray;");
+    line(0, "import org.apache.avro.specific.FixedSize;");
     line(0, "import org.apache.avro.specific.SpecificExceptionBase;");
     line(0, "import org.apache.avro.specific.SpecificRecordBase;");
     line(0, "import org.apache.avro.specific.SpecificRecord;");
@@ -317,6 +318,7 @@ public class GoraCompiler {
           switch (fieldSchema.getType()) {
           case INT:case LONG:case FLOAT:case DOUBLE:
           case BOOLEAN:case BYTES:case STRING: case ENUM: case RECORD:
+          case FIXED:
             String unboxed = unbox(fieldSchema);
             String fieldType = type(fieldSchema);
             line(1, "public "+unboxed+" get" +camelKey+"() {");

Modified: gora/branches/goraamazon/gora-core/src/main/java/org/apache/gora/store/impl/DataStoreBase.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-core/src/main/java/org/apache/gora/store/impl/DataStoreBase.java?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-core/src/main/java/org/apache/gora/store/impl/DataStoreBase.java (original)
+++ gora/branches/goraamazon/gora-core/src/main/java/org/apache/gora/store/impl/DataStoreBase.java Tue Sep  4 20:44:54 2012
@@ -23,7 +23,6 @@ import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
 import java.util.Map;
-import java.util.Map.Entry;
 import java.util.Properties;
 
 import org.apache.avro.Schema;
@@ -198,7 +197,7 @@ implements DataStore<K, T>, Configurable
   public boolean equals(Object obj) {
     if(obj instanceof DataStoreBase) {
       @SuppressWarnings("rawtypes")
-	  DataStoreBase that = (DataStoreBase) obj;
+      DataStoreBase that = (DataStoreBase) obj;
       EqualsBuilder builder = new EqualsBuilder();
       builder.append(this.keyClass, that.keyClass);
       builder.append(this.persistentClass, that.persistentClass);
@@ -217,22 +216,25 @@ implements DataStore<K, T>, Configurable
   /**
    * Returns the name of the schema to use for the persistent class. 
    * 
-   * First the schema name in the defined properties is returned. If null then
+   * The schema name is prefixed with schema.prefix from {@link Configuration}.
+   * The schema name in the defined properties is returned. If null then
    * the provided mappingSchemaName is returned. If this is null too,
    * the class name, without the package, of the persistent class is returned.
    * @param mappingSchemaName the name of the schema as read from the mapping file
    * @param persistentClass persistent class
    */
   protected String getSchemaName(String mappingSchemaName, Class<?> persistentClass) {
+    String prefix = getOrCreateConf().get("schema.prefix","");
+    
     String schemaName = DataStoreFactory.getDefaultSchemaName(properties, this);
     if(schemaName != null) {
-      return schemaName;
+      return prefix+schemaName;
     }
 
     if(mappingSchemaName != null) {
-      return mappingSchemaName;
+      return prefix+mappingSchemaName;
     }
 
-    return StringUtils.getClassname(persistentClass);
+    return prefix+StringUtils.getClassname(persistentClass);
   }
 }

Modified: gora/branches/goraamazon/gora-core/src/main/java/overview.html
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-core/src/main/java/overview.html?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-core/src/main/java/overview.html (original)
+++ gora/branches/goraamazon/gora-core/src/main/java/overview.html Tue Sep  4 20:44:54 2012
@@ -51,10 +51,12 @@
 
   <h2> gora-sql </h2>
   <p> gora-sql module contains the source code for the SQL backends. Currently MySQL and HSQLDB is supported. </p>
-
+  
+  <h2> gora-accumulo </h2>
+  <p> gora-accumulo module contains the source code for the <a href="http://accumulo.apache.org/">Apache Accumulo</a> backend. </p>
 
   <h2> More information </h2> 
-  <p> Most of the documentation about the project is kept at the project <a href="http://incubator.apache.org/gora/">web site</a> or at the <a href="https://cwiki.apache.org/confluence/display/GORA/Index">wiki</a>. </p>
+  <p> Most of the documentation about the project is kept at the project <a href="http://gora.apache.org">web site</a> or at the <a href="https://cwiki.apache.org/confluence/display/GORA/Index">wiki</a>. </p>
   
 </body>
 </html>

Modified: gora/branches/goraamazon/gora-core/src/test/java/org/apache/gora/GoraTestDriver.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-core/src/test/java/org/apache/gora/GoraTestDriver.java?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-core/src/test/java/org/apache/gora/GoraTestDriver.java (original)
+++ gora/branches/goraamazon/gora-core/src/test/java/org/apache/gora/GoraTestDriver.java Tue Sep  4 20:44:54 2012
@@ -31,10 +31,10 @@ import org.apache.gora.util.GoraExceptio
 import org.apache.hadoop.conf.Configuration;
 
 /**
- * GoraTestDriver is a helper class for third party tests.
- * GoraTestDriver can be used to initialize and tear down mini clusters
- * (such as mini HBase cluster, local Hsqldb instance, etc) so that
- * these details are abstracted away.
+ * GoraTestDriver is a helper class for third party tests and should
+ * be used to initialize and tear down mini clusters (such as mini HBase 
+ * or Cassandra cluster, local Hsqldb instance, etc) so that these 
+ * details are abstracted away.
  */
 public class GoraTestDriver {
 
@@ -86,13 +86,13 @@ public class GoraTestDriver {
   public void tearDown() throws Exception {
     log.info("tearing down test");
     //delete everything
-    try {
-      for(DataStore store : dataStores) {
+    for(DataStore store : dataStores) {
+      try {
         //store.flush();
         store.deleteSchema();
         store.close();
+      }catch (Exception ignore) {
       }
-    }catch (IOException ignore) {
     }
     dataStores.clear();
   }

Modified: gora/branches/goraamazon/gora-core/src/test/java/org/apache/gora/persistency/TestListGenericArray.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-core/src/test/java/org/apache/gora/persistency/TestListGenericArray.java?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-core/src/test/java/org/apache/gora/persistency/TestListGenericArray.java (original)
+++ gora/branches/goraamazon/gora-core/src/test/java/org/apache/gora/persistency/TestListGenericArray.java Tue Sep  4 20:44:54 2012
@@ -19,6 +19,7 @@
 package org.apache.gora.persistency;
 
 import org.apache.avro.Schema; 
+import org.apache.avro.generic.GenericData;
 import org.apache.avro.util.Utf8;
 import org.apache.gora.persistency.ListGenericArray; 
 import org.junit.Assert;
@@ -42,4 +43,17 @@ public class TestListGenericArray {
     }
     Assert.assertFalse(stackOverflowError);
   }
+  
+  @Test
+  public void testCompareTo() {
+    ListGenericArray array = new ListGenericArray(Schema.create(Schema.Type.STRING));
+    boolean stackOverflowError = false;
+    array.add(new Utf8("array comparison test"));
+    try {
+      int compareTo = array.compareTo(array);
+    } catch (StackOverflowError e) {
+      stackOverflowError = true;
+    }
+    Assert.assertFalse(stackOverflowError);
+  }
 }

Modified: gora/branches/goraamazon/gora-core/src/test/java/org/apache/gora/store/DataStoreTestBase.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-core/src/test/java/org/apache/gora/store/DataStoreTestBase.java?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-core/src/test/java/org/apache/gora/store/DataStoreTestBase.java (original)
+++ gora/branches/goraamazon/gora-core/src/test/java/org/apache/gora/store/DataStoreTestBase.java Tue Sep  4 20:44:54 2012
@@ -90,7 +90,9 @@ public abstract class DataStoreTestBase 
     //There is an issue in JUnit 4 tests in Eclipse where TestSqlStore static
     //methods are not called BEFORE setUpClass. I think this is a bug in 
     //JUnitRunner in Eclipse. Below is a workaround for that problem.
-    if(!setUpClassCalled) setUpClass();  
+    if(!setUpClassCalled) {
+    	setUpClass();  
+    }
     
     log.info("setting up test");
     if(testDriver != null) {

Modified: gora/branches/goraamazon/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java (original)
+++ gora/branches/goraamazon/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java Tue Sep  4 20:44:54 2012
@@ -293,7 +293,7 @@ public class DataStoreTestUtil {
 
     for (int i = 0; i < urls.length; i++) {
       WebPage webPage = dataStore.get(urls[i]);
-      Assert.assertEquals(content + i, ByteUtils.toString(webPage.getContent().array()));
+      Assert.assertEquals(content + i, ByteUtils.toString( toByteArray(webPage.getContent()) ));
       Assert.assertEquals(10, webPage.getParsedContent().size());
       int j = 0;
       for (Utf8 pc : webPage.getParsedContent()) {
@@ -336,9 +336,9 @@ public class DataStoreTestUtil {
     Assert.assertNotNull(page);
 
     Assert.assertEquals(URLS[i], page.getUrl().toString());
-    Assert.assertTrue("content error:" + new String(page.getContent().array()) +
+    Assert.assertTrue("content error:" + new String( toByteArray(page.getContent()) ) +
         " actual=" + CONTENTS[i] + " i=" + i
-    , Arrays.equals(page.getContent().array()
+    , Arrays.equals( toByteArray(page.getContent() )
         , CONTENTS[i].getBytes()));
 
     GenericArray<Utf8> parsedContent = page.getParsedContent();
@@ -718,4 +718,15 @@ public class DataStoreTestUtil {
     }
 
   }
+
+  private static byte[] toByteArray(ByteBuffer buffer) {
+    int p = buffer.position();
+    int n = buffer.limit() - p;
+    byte[] bytes = new byte[n];
+    for (int i = 0; i < n; i++) {
+      bytes[i] = buffer.get(p++);
+    }
+    return bytes;
+  }
+
 }

Modified: gora/branches/goraamazon/gora-hbase/pom.xml
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-hbase/pom.xml?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-hbase/pom.xml (original)
+++ gora/branches/goraamazon/gora-hbase/pom.xml Tue Sep  4 20:44:54 2012
@@ -92,24 +92,6 @@
                     </execution>
                 </executions>
             </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <version>${maven-jar-plugin.version}</version>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>jar</goal>
-                            <goal>test-jar</goal>
-                        </goals>
-                        <configuration>
-                        <archive>
-                            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
-                        </archive>
-                    </configuration>
-                    </execution>
-                </executions>
-            </plugin>
         </plugins>
     </build>
 
@@ -136,7 +118,7 @@
         <dependency>
             <groupId>org.apache.hbase</groupId>
             <artifactId>hbase</artifactId>
-            <classifier>tests</classifier>
+            <type>test-jar</type>
         </dependency>
 
 

Modified: gora/branches/goraamazon/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java (original)
+++ gora/branches/goraamazon/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java Tue Sep  4 20:44:54 2012
@@ -326,13 +326,13 @@ implements Configurable {
           (stopRow.length == 0 ||
               Bytes.compareTo(stopRow, keys.getFirst()[i]) > 0)) {
 
-        byte[] splitStart = (startRow.length == 0 ||
-          Bytes.compareTo(keys.getFirst()[i], startRow) >= 0) ?
+        byte[] splitStart = startRow.length == 0 || 
+            Bytes.compareTo(keys.getFirst()[i], startRow) >= 0 ? 
             keys.getFirst()[i] : startRow;
 
-        byte[] splitStop = (stopRow.length == 0 ||
-            Bytes.compareTo(keys.getSecond()[i], stopRow) <= 0) ?
-            keys.getSecond()[i] : stopRow;
+        byte[] splitStop = (stopRow.length == 0 || 
+            Bytes.compareTo(keys.getSecond()[i], stopRow) <= 0) && 
+            keys.getSecond()[i].length > 0 ? keys.getSecond()[i] : stopRow;
 
         K startKey = Arrays.equals(HConstants.EMPTY_START_ROW, splitStart) ?
             null : HBaseByteInterface.fromBytes(keyClass, splitStart);

Modified: gora/branches/goraamazon/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseTableConnection.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseTableConnection.java?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseTableConnection.java (original)
+++ gora/branches/goraamazon/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseTableConnection.java Tue Sep  4 20:44:54 2012
@@ -78,7 +78,12 @@ public class HBaseTableConnection implem
   private HTable getTable() throws IOException {
     HTable table = tables.get();
     if (table == null) {
-      table = new HTable(conf, tableName);
+      table = new HTable(conf, tableName) {
+        @Override
+        public synchronized void flushCommits() throws IOException {
+          super.flushCommits();
+        }
+      };
       table.setAutoFlush(autoflush);
       pool.add(table); //keep track
       tables.set(table);

Modified: gora/branches/goraamazon/gora-hbase/src/test/java/org/apache/gora/hbase/GoraHBaseTestDriver.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-hbase/src/test/java/org/apache/gora/hbase/GoraHBaseTestDriver.java?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-hbase/src/test/java/org/apache/gora/hbase/GoraHBaseTestDriver.java (original)
+++ gora/branches/goraamazon/gora-hbase/src/test/java/org/apache/gora/hbase/GoraHBaseTestDriver.java Tue Sep  4 20:44:54 2012
@@ -21,6 +21,8 @@ package org.apache.gora.hbase;
 import org.apache.gora.GoraTestDriver;
 import org.apache.gora.hbase.store.HBaseStore;
 import org.apache.hadoop.conf.Configuration;
+
+//HBase imports
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
@@ -82,4 +84,4 @@ public class GoraHBaseTestDriver extends
     return hbaseUtil;
   }
   
-}
+}		

Modified: gora/branches/goraamazon/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java (original)
+++ gora/branches/goraamazon/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java Tue Sep  4 20:44:54 2012
@@ -53,6 +53,7 @@ public class TestHBaseStore extends Data
     conf = getTestDriver().getHbaseUtil().getConfiguration();
   }
     
+  @SuppressWarnings("unchecked")
   @Override
   protected DataStore<String, Employee> createEmployeeDataStore()
       throws IOException {
@@ -60,6 +61,7 @@ public class TestHBaseStore extends Data
         Employee.class, conf);
   }
 
+  @SuppressWarnings("unchecked")
   @Override
   protected DataStore<String, WebPage> createWebPageDataStore()
       throws IOException {

Modified: gora/branches/goraamazon/gora-sql/pom.xml
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-sql/pom.xml?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-sql/pom.xml (original)
+++ gora/branches/goraamazon/gora-sql/pom.xml Tue Sep  4 20:44:54 2012
@@ -66,12 +66,11 @@
         <sourceDirectory>src/main/java</sourceDirectory>
         <testResources>
             <testResource>
-                <directory>src/test/conf</directory>
+              <directory>src/test/conf</directory>
                 <includes>
-                    <include>
-                        **/*
-                    </include>
+                    <include>**/*</include>
                 </includes>
+            <!--targetPath>${project.basedir}/target/classes/</targetPath-->
             </testResource>
         </testResources>
         <plugins>
@@ -119,24 +118,6 @@
                     <testFailureIgnore>true</testFailureIgnore>
                 </configuration>
             </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <version>${maven-jar-plugin.version}</version>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>jar</goal>
-                            <goal>test-jar</goal>
-                        </goals>
-                        <configuration>
-                        <archive>
-                            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
-                        </archive>
-                    </configuration>
-                    </execution>
-                </executions>
-            </plugin>
         </plugins>
     </build>
 

Modified: gora/branches/goraamazon/gora-tutorial/pom.xml
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-tutorial/pom.xml?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-tutorial/pom.xml (original)
+++ gora/branches/goraamazon/gora-tutorial/pom.xml Tue Sep  4 20:44:54 2012
@@ -91,24 +91,6 @@
                     </execution>
                 </executions>
             </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <version>${maven-jar-plugin.version}</version>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>jar</goal>
-                            <!-- goal>test-jar</goal-->
-                        </goals>
-                        <configuration>
-                        <archive>
-                            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
-                        </archive>
-                    </configuration>
-                    </execution>
-                </executions>
-            </plugin>
         </plugins>
     </build>
 

Modified: gora/branches/goraamazon/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogAnalytics.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogAnalytics.java?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogAnalytics.java (original)
+++ gora/branches/goraamazon/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogAnalytics.java Tue Sep  4 20:44:54 2012
@@ -189,7 +189,13 @@ public class LogAnalytics extends Config
     return success ? 0 : 1;
   }
   
+  private static final String USAGE = "LogAnalytics <input_data_store> <output_data_store>";
+  
   public static void main(String[] args) throws Exception {
+    if(args.length < 2) {
+      System.err.println(USAGE);
+      System.exit(1);
+    }
     //run as any other MR job
     int ret = ToolRunner.run(new LogAnalytics(), args);
     System.exit(ret);

Modified: gora/branches/goraamazon/pom.xml
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/pom.xml?rev=1380874&r1=1380873&r2=1380874&view=diff
==============================================================================
--- gora/branches/goraamazon/pom.xml (original)
+++ gora/branches/goraamazon/pom.xml Tue Sep  4 20:44:54 2012
@@ -126,7 +126,7 @@
       <email>kturner [at] apache [dot] org</email>
       <roles>
         <role>Committer</role>
-        <role>PPMC Member</role>
+        <role>PMC Member</role>
       </roles>
     </developer>
     <developer>
@@ -167,6 +167,15 @@
         <role>PMC Member</role>
       </roles>
     </developer>
+    <developer>
+      <id>kazk</id>
+      <name>Kazuomi Kashii</name>
+      <email>kazk [at] apache [dot] org</email>
+      <roles>
+        <role>Committer</role>
+        <role>PMC Member</role>
+      </roles>
+    </developer>
   </developers>
 
   <mailingLists>
@@ -274,6 +283,23 @@
           </plugin>
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-clean-plugin</artifactId>
+            <version>${maven-clean-plugin.version}</version>
+            <configuration>
+             	<filesets>
+		    <fileset>
+			<directory>${basedir}/lib</directory>
+			<followSymlinks>false</followSymlinks>
+			<useDefaultExcludes>true</useDefaultExcludes>
+			<includes>
+			    <include>*.jar</include>
+			</includes>
+		    </fileset>
+		</filesets>
+            </configuration>
+          </plugin>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-release-plugin</artifactId>
             <version>${maven-release-plugin.version}</version>
             <configuration>
@@ -284,7 +310,45 @@
               <autoVersionSubmodules>true</autoVersionSubmodules>
             </configuration>
           </plugin>
-        </plugins>
+          <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+          <plugin>
+            <groupId>org.eclipse.m2e</groupId>
+            <artifactId>lifecycle-mapping</artifactId>
+            <version>1.0.0</version>
+            <configuration>
+              <lifecycleMappingMetadata>
+                <pluginExecutions>
+                  <pluginExecution>
+                    <pluginExecutionFilter>
+                      <groupId>org.apache.maven.plugins</groupId>
+                      <artifactId>maven-dependency-plugin</artifactId>
+                      <versionRange>[2.4,)</versionRange>
+                      <goals>
+                        <goal>copy-dependencies</goal>
+                      </goals>
+                    </pluginExecutionFilter>
+                    <action>
+                      <ignore></ignore>
+                    </action>
+                  </pluginExecution>
+                  <pluginExecution>
+                    <pluginExecutionFilter>
+                      <groupId>org.codehaus.mojo</groupId>
+                      <artifactId>build-helper-maven-plugin</artifactId>
+                      <versionRange>[1.7,)</versionRange>
+                      <goals>
+                        <goal>reserve-network-port</goal>
+                      </goals>
+                    </pluginExecutionFilter>
+                    <action>
+                      <ignore></ignore>
+                    </action>
+                  </pluginExecution>
+                </pluginExecutions>
+              </lifecycleMappingMetadata>
+            </configuration>
+          </plugin>
+	</plugins>
 	</pluginManagement>
         <plugins>
             <plugin>
@@ -293,7 +357,7 @@
                 <version>${maven-compiler-plugin.version}</version>
                 <inherited>true</inherited>
                 <configuration>
-                    <source>${javac.source.version}</source>
+                    <source>${javac.src.version}</source>
                     <target>${javac.target.version}</target>
                 </configuration>
             </plugin>
@@ -329,19 +393,6 @@
                     </execution>
                 </executions>
             </plugin>
-             <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <version>${maven-jar-plugin.version}</version>
-                <executions>
-                  <execution>
-                  <goals>
-                    <goal>jar</goal>
-                    <goal>test-jar</goal>
-                  </goals>
-                 </execution>
-               </executions>
-            </plugin>
             <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
@@ -366,15 +417,6 @@
                     </supportedProjectTypes>
                     <unpackBundle>true</unpackBundle>
                 </configuration>
-                <executions>
-                    <execution>
-                        <id>bundle-manifest</id>
-                        <phase>process-classes</phase>
-                        <goals>
-                            <goal>manifest</goal>
-                        </goals>
-                    </execution>
-                </executions>
             </plugin>
          </plugins>
     </build>
@@ -526,10 +568,9 @@
         <!-- Amazon Dependencies -->
         <amazon.version>1.3.12</amazon.version>
         <!-- Cassandra Dependencies -->
-        <cassandra.version>1.0.2</cassandra.version>
-        <cassandra.thrift.version>1.0.2</cassandra.thrift.version>
+        <cassandra.version>1.1.2</cassandra.version>
         <libthrift.version>0.7.0</libthrift.version>
-        <hector.version>1.0-1</hector.version>
+        <hector.version>1.1-0</hector.version>
         <!-- Misc Dependencies -->
         <guava.version>10.0.1</guava.version>
         <commons-lang.version>2.6</commons-lang.version>
@@ -538,7 +579,7 @@
         <mysql.version>5.1.18</mysql.version>
         <xerces.version>2.9.1</xerces.version>
         <!-- Logging Dependencies -->
-        <slf4j.version>1.5.8</slf4j.version>
+        <slf4j.version>1.6.1</slf4j.version>
         <log4j.version>1.2.16</log4j.version>
 
         <!-- Testing Dependencies -->
@@ -560,6 +601,7 @@
         <maven-assembly-plugin.version>2.2.2</maven-assembly-plugin.version>
         <maven-deploy-plugin.version>2.5</maven-deploy-plugin.version>
         <checksum-maven-plugin.version>1.0.1</checksum-maven-plugin.version>
+        <maven-clean-plugin.version>2.5</maven-clean-plugin.version>
         
         <!-- General Properties -->
         <implementation.build>${scmBranch}@r${buildNumber}</implementation.build>
@@ -591,7 +633,13 @@
             <artifactId>gora-cassandra</artifactId>
             <version>${project.version}</version>
           </dependency>
-
+          <dependency>
+            <groupId>org.apache.gora</groupId>
+            <artifactId>gora-cassandra</artifactId>
+            <version>${project.version}</version>
+            <type>test-jar</type>
+          </dependency>
+          
           <dependency>
             <groupId>org.apache.gora</groupId>
             <artifactId>gora-sql</artifactId>
@@ -707,7 +755,7 @@
                 <groupId>org.apache.hbase</groupId>
                 <artifactId>hbase</artifactId>
                 <version>${hbase.version}</version>
-                <classifier>tests</classifier>
+                <type>test-jar</type>
             </dependency>
 
             <!-- Cassandra Dependencies -->
@@ -715,27 +763,40 @@
                 <groupId>org.apache.cassandra</groupId>
                 <artifactId>cassandra-all</artifactId>
                 <version>${cassandra.version}</version>
+                <scope>test</scope>
+                <exclusions>
+                    <exclusion>
+                        <groupId>org.apache.cassandra.deps</groupId>
+    			<artifactId>avro</artifactId>
+                    </exclusion>
+                </exclusions>
             </dependency>
-
+            
             <dependency>
                 <groupId>org.apache.cassandra</groupId>
                 <artifactId>cassandra-thrift</artifactId>
-                <version>${cassandra.thrift.version}</version>
+                <version>${cassandra.version}</version>
             </dependency>
 
             <dependency>
-              <groupId>me.prettyprint</groupId>
+              <groupId>org.hectorclient</groupId>
               <artifactId>hector-core</artifactId>
               <version>${hector.version}</version>
+              <exclusions>
+	        <exclusion>
+		  <groupId>org.apache.cassandra</groupId>
+		  <artifactId>cassandra-all</artifactId>
+	        </exclusion>
+	      </exclusions>
             </dependency>
             
             <!-- Amazon Dependencies -->
             <dependency>
-       	      <groupId>com.amazonaws</groupId>
-	      <artifactId>aws-java-sdk</artifactId>
-	      <version>${amazon.version}</version>
+                <groupId>com.amazonaws</groupId>
+                <artifactId>aws-java-sdk</artifactId>
+                <version>${amazon.version}</version>
             </dependency>
-
+          
             <!-- Misc Dependencies -->
             <dependency>
                 <groupId>com.google.guava</groupId>
@@ -803,6 +864,12 @@
             </dependency>
 
             <dependency>
+                <groupId>org.slf4j</groupId>
+                <artifactId>slf4j-log4j12</artifactId>
+                <version>${slf4j.version}</version>
+            </dependency>
+
+            <dependency>
                 <groupId>log4j</groupId>
                 <artifactId>log4j</artifactId>
                 <version>${log4j.version}</version>
@@ -838,7 +905,7 @@
                 <artifactId>junit</artifactId>
                 <version>${junit.version}</version>
             </dependency>
-
+            
         </dependencies>
     </dependencyManagement>
 



Mime
View raw message