gora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lewi...@apache.org
Subject svn commit: r1558333 - in /gora/branches/GORA_94: ./ gora-cassandra/ gora-cassandra/src/main/java/org/apache/gora/cassandra/query/ gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/ gora-cassandra/src/main/java/org/apache/gora/cassandr...
Date Wed, 15 Jan 2014 10:11:08 GMT
Author: lewismc
Date: Wed Jan 15 10:11:08 2014
New Revision: 1558333

URL: http://svn.apache.org/r1558333
Log:
GORA-245 Upgrade to Avro 1.7.X in gora-cassandra GORA-245v4.patch

Modified:
    gora/branches/GORA_94/gora-cassandra/pom.xml
    gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraResult.java
    gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraSubColumn.java
    gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraSuperColumn.java
    gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/CharSequenceSerializer.java
    gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/ListSerializer.java
    gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/MapSerializer.java
    gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/TypeUtils.java
    gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java
    gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraMapping.java
    gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraMappingManager.java
    gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java
    gora/branches/GORA_94/gora-cassandra/src/test/conf/cassandra.yaml
    gora/branches/GORA_94/gora-cassandra/src/test/java/org/apache/gora/cassandra/GoraCassandraTestDriver.java
    gora/branches/GORA_94/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java
    gora/branches/GORA_94/gora-hbase/pom.xml
    gora/branches/GORA_94/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java
    gora/branches/GORA_94/pom.xml

Modified: gora/branches/GORA_94/gora-cassandra/pom.xml
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-cassandra/pom.xml?rev=1558333&r1=1558332&r2=1558333&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-cassandra/pom.xml (original)
+++ gora/branches/GORA_94/gora-cassandra/pom.xml Wed Jan 15 10:11:08 2014
@@ -127,15 +127,15 @@
             <exclusions>
                 <exclusion>
                     <groupId>org.apache.cassandra.deps</groupId>
-    		    <artifactId>avro</artifactId>
+                    <artifactId>avro</artifactId>
                 </exclusion>
             </exclusions>
         </dependency>
         
-        <dependency>
+        <!-- dependency>
             <groupId>org.apache.cassandra</groupId>
             <artifactId>cassandra-thrift</artifactId>
-        </dependency>
+        </dependency-->
 
         <dependency>
             <groupId>org.hectorclient</groupId>
@@ -143,7 +143,7 @@
                 <exclusions>
                     <exclusion>
                         <groupId>org.apache.cassandra</groupId>
-    		        <artifactId>cassandra-all</artifactId>
+                        <artifactId>cassandra-all</artifactId>
                     </exclusion>
             </exclusions>
         </dependency>
@@ -159,11 +159,13 @@
             <artifactId>jdom</artifactId>
         </dependency>
 
-        <!-- Logging Dependencies -->
+        
         <dependency>
             <groupId>org.apache.avro</groupId>
             <artifactId>avro</artifactId>
         </dependency>
+        
+        <!-- Logging Dependencies -->
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>

Modified: gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraResult.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraResult.java?rev=1558333&r1=1558332&r2=1558333&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraResult.java (original)
+++ gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraResult.java Wed Jan 15 10:11:08 2014
@@ -98,18 +98,27 @@ public class CassandraResult<K, T extend
       
       // get field name
       String family = cassandraColumn.getFamily();
-      String fieldName = this.reverseMap.get(family + ":" + StringSerializer.get().fromByteBuffer(cassandraColumn.getName()));
+      String fieldName = this.reverseMap.get(family + ":" + 
+          StringSerializer.get().fromByteBuffer(cassandraColumn.getName()));
       
       if (fieldName != null ){
         // get field
-        int pos = this.persistent.getFieldIndex(fieldName);
+        int pos = this.persistent.getSchema().getField(fieldName).pos();
         Field field = fields.get(pos);
         Type fieldType = field.schema().getType();
-        System.out.println(StringSerializer.get().fromByteBuffer(cassandraColumn.getName()) + fieldName + " " + fieldType.name());
+        //LOG.info(StringSerializer.get().fromByteBuffer(cassandraColumn.getName()) + fieldName + " " + fieldType.name());
         if (fieldType == Type.UNION){
-          // TODO getting UNION stored type
-          // TODO get value of UNION stored type. This field does not need to be written back to the store
-          cassandraColumn.setUnionType(getNonNullTypePos(field.schema().getTypes()));
+          // getting UNION stored type
+          int posUnionType = this.persistent.getSchema().getField(fieldName + CassandraStore.UNION_COL_SUFIX).pos();
+          Field fieldUnionType = fields.get(posUnionType);
+          CassandraColumn cc = getUnionTypeColumn(fieldName + CassandraStore.UNION_COL_SUFIX, cassandraRow.toArray());
+          // get value of UNION stored type
+          cc.setField(fieldUnionType);
+          Object val = cc.getValue();
+          this.persistent.put(posUnionType, val);
+          // this field does not need to be written back to the store
+          this.persistent.clearDirty(posUnionType);
+          cassandraColumn.setUnionType(Integer.parseInt(val.toString()));
         }
 
         // get value

Modified: gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraSubColumn.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraSubColumn.java?rev=1558333&r1=1558332&r2=1558333&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraSubColumn.java (original)
+++ gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraSubColumn.java Wed Jan 15 10:11:08 2014
@@ -19,29 +19,19 @@
 package org.apache.gora.cassandra.query;
 
 import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.nio.charset.CharacterCodingException;
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetEncoder;
+import java.util.List;
+import java.util.Map;
 
-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.beans.HColumn;
 
 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.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.cassandra.serializers.ListSerializer;
+import org.apache.gora.cassandra.serializers.MapSerializer;
 import org.apache.gora.cassandra.store.CassandraStore;
-import org.apache.gora.persistency.StatefulHashMap;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -76,12 +66,12 @@ public class CassandraSubColumn extends 
     }
     Object value = null;
     if (type == Type.ARRAY) {
-      ListSerializer serializer = ListSerializer.get(fieldSchema.getElementType());
-      List genericArray = serializer.fromByteBuffer(byteBuffer);
+      ListSerializer<?> serializer = ListSerializer.get(fieldSchema.getElementType());
+      List<?> genericArray = serializer.fromByteBuffer(byteBuffer);
       value = genericArray;
     } else if (type == Type.MAP) {
-      MapSerializer serializer = MapSerializer.get(fieldSchema.getValueType());
-      Map map = serializer.fromByteBuffer(byteBuffer);
+      MapSerializer<?> serializer = MapSerializer.get(fieldSchema.getValueType());
+      Map<?, ?> map = serializer.fromByteBuffer(byteBuffer);
       value = map;
     } else if (type == Type.UNION){
       // the selected union schema is obtained

Modified: gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraSuperColumn.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraSuperColumn.java?rev=1558333&r1=1558332&r2=1558333&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraSuperColumn.java (original)
+++ gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraSuperColumn.java Wed Jan 15 10:11:08 2014
@@ -57,7 +57,6 @@ public class CassandraSuperColumn extend
         List<Object> array = new ArrayList<Object>();
         
         for (HColumn<ByteBuffer, ByteBuffer> hColumn : this.hSuperColumn.getColumns()) {
-          ByteBuffer memberByteBuffer = hColumn.getValue();
           Object memberValue = fromByteBuffer(fieldSchema.getElementType(), hColumn.getValue());
           // int i = IntegerSerializer().get().fromByteBuffer(hColumn.getName());
           array.add(memberValue);      
@@ -69,7 +68,6 @@ public class CassandraSuperColumn extend
         Map<CharSequence, Object> map = new HashMap<CharSequence, Object>();
         
         for (HColumn<ByteBuffer, ByteBuffer> hColumn : this.hSuperColumn.getColumns()) {
-          ByteBuffer memberByteBuffer = hColumn.getValue();
           Object memberValue = null;
           memberValue = fromByteBuffer(fieldSchema.getValueType(), hColumn.getValue());
           map.put(CharSequenceSerializer.get().fromByteBuffer(hColumn.getName()), memberValue);      

Modified: gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/CharSequenceSerializer.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/CharSequenceSerializer.java?rev=1558333&r1=1558332&r2=1558333&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/CharSequenceSerializer.java (original)
+++ gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/CharSequenceSerializer.java Wed Jan 15 10:11:08 2014
@@ -27,7 +27,7 @@ import me.prettyprint.cassandra.serializ
 import me.prettyprint.hector.api.ddl.ComparatorType;
 
 /**
- * A Utf8Serializer translates the byte[] to and from Utf8 object of Avro.
+ * A CharSequenceSerializer translates the byte[] to and from CharSequenceSerializer object of Avro.
  */
 public final class CharSequenceSerializer extends AbstractSerializer<CharSequence> {
 

Modified: gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/ListSerializer.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/ListSerializer.java?rev=1558333&r1=1558332&r2=1558333&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/ListSerializer.java (original)
+++ gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/ListSerializer.java Wed Jan 15 10:11:08 2014
@@ -37,7 +37,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * A ListSerializer translates the byte[] to and from List of Avro.
+ * A GenericArraySerializer translates the byte[] to and from GenericArray of Avro.
  */
 public class ListSerializer<T> extends AbstractSerializer<List<T>> {
 
@@ -93,12 +93,13 @@ public class ListSerializer<T> extends A
     elementSerializer = GoraSerializerTypeInferer.getSerializer(elementSchema);
   }
 
+  @SuppressWarnings("unchecked")
   public ListSerializer(Type elementType) {
     this.elementType = elementType;
     if (elementType != Type.FIXED) {
       elementSchema = Schema.create(elementType);
     }
-    clazz = TypeUtils.getClass(elementType);
+    clazz = (Class<T>) TypeUtils.getClass(elementType);
     size = TypeUtils.getFixedSize(elementType);
     elementSerializer = GoraSerializerTypeInferer.getSerializer(elementType);
   }
@@ -161,7 +162,6 @@ public class ListSerializer<T> extends A
       return null;
     }
     ArrayList<T> array = new ArrayList<T>();
-    int i = 0;
     while (true) {
       T element = null;
       try {

Modified: gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/MapSerializer.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/MapSerializer.java?rev=1558333&r1=1558332&r2=1558333&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/MapSerializer.java (original)
+++ gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/MapSerializer.java Wed Jan 15 10:11:08 2014
@@ -93,12 +93,13 @@ public class MapSerializer<T> extends Ab
     valueSerializer = GoraSerializerTypeInferer.getSerializer(valueSchema);
   }
 
+  @SuppressWarnings("unchecked")
   public MapSerializer(Type valueType) {
     this.valueType = valueType;
     if (valueType != Type.FIXED) {
       valueSchema = Schema.create(valueType);
     }
-    clazz = TypeUtils.getClass(valueType);
+    clazz = (Class<T>) TypeUtils.getClass(valueType);
     size = TypeUtils.getFixedSize(valueType);
     valueSerializer = GoraSerializerTypeInferer.getSerializer(valueType);
   }
@@ -182,7 +183,6 @@ public class MapSerializer<T> extends Ab
       return null;
     }
     Map<CharSequence, T> map = new HashMap<CharSequence, T>();
-    int i = 0;
     while (true) {
       CharSequence key = null;
       T value = null;

Modified: gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/TypeUtils.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/TypeUtils.java?rev=1558333&r1=1558332&r2=1558333&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/TypeUtils.java (original)
+++ gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/TypeUtils.java Wed Jan 15 10:11:08 2014
@@ -40,13 +40,13 @@ public class TypeUtils {
   public static final Logger LOG = LoggerFactory.getLogger(TypeUtils.class);
 
   // @SuppressWarnings({ "rawtypes", "unchecked" })
-  public static Class getClass(Object value) {
+  public static Class<? extends Object> getClass(Object value) {
     return value.getClass();
   }
 
   public static Schema getSchema(Object value) {
     if (value instanceof GenericArray) {
-      return Schema.createArray( getElementSchema((GenericArray)value) );
+      return Schema.createArray( getElementSchema((GenericArray<?>)value) );
     } else {
       return getSchema( getClass(value) );
     }
@@ -84,7 +84,7 @@ public class TypeUtils {
     }
   }
 
-  public static Class getClass(Type type) {
+  public static Class<?> getClass(Type type) {
     if (type == Type.STRING) {
       return Utf8.class;
     } else if (type == Type.BOOLEAN) {
@@ -113,7 +113,7 @@ public class TypeUtils {
     }
   }
 
-  public static Schema getSchema(Class clazz) {
+  public static Schema getSchema(Class<?> clazz) {
     Type type = getType(clazz);
     if (type == null) {
       return null;
@@ -156,7 +156,7 @@ public class TypeUtils {
     }
   }
 
-  public static Class getClass(Schema schema) {
+  public static Class<?> getClass(Schema schema) {
     Type type = schema.getType();
     if (type == null) {
       return null;
@@ -197,7 +197,7 @@ public class TypeUtils {
     }
   }
 
-  public static int getFixedSize(Class clazz) {
+  public static int getFixedSize(Class<?> clazz) {
     Type type = getType(clazz);
     if (type == Type.FIXED) {
       try {
@@ -214,11 +214,10 @@ public class TypeUtils {
     }
   }
 
-  public static Schema getElementSchema(GenericArray array) {
+  public static Schema getElementSchema(GenericArray<?> array) {
     Schema schema = array.getSchema();
     return (schema.getType() == Type.ARRAY) ? schema.getElementType() : schema;
   }
- 
 
   /*
   public static Schema getValueSchema(StatefulHashMap map) {

Modified: gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java?rev=1558333&r1=1558332&r2=1558333&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java (original)
+++ gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java Wed Jan 15 10:11:08 2014
@@ -20,7 +20,6 @@ package org.apache.gora.cassandra.store;
 
 import java.nio.ByteBuffer;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -47,21 +46,12 @@ import me.prettyprint.hector.api.query.R
 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;
 import org.slf4j.LoggerFactory;
 
@@ -84,7 +74,6 @@ public class CassandraClient<K, T extend
     // get cassandra mapping with persistent class
     this.persistentClass = persistentClass;
     this.cassandraMapping = CassandraMappingManager.getManager().get(persistentClass);
-    // LOG.info("persistentClass=" + persistentClass.getName() + " -> cassandraMapping=" + cassandraMapping);
 
     this.cluster = HFactory.getOrCreateCluster(this.cassandraMapping.getClusterName(), new CassandraHostConfigurator(this.cassandraMapping.getHostName()));
     
@@ -124,7 +113,8 @@ public class CassandraClient<K, T extend
         cfDef.setComparatorType(ComparatorType.BYTESTYPE);
       }
 
-      keyspaceDefinition = HFactory.createKeyspaceDefinition(this.cassandraMapping.getKeyspaceName(), "org.apache.cassandra.locator.SimpleStrategy", 1, columnFamilyDefinitions);      
+      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() + "'");
       
@@ -155,10 +145,11 @@ public class CassandraClient<K, T extend
           if (! comparatorType.equals(ComparatorType.BYTESTYPE)) {
             // GORA-197
             LOG.warn("The comparator type of " + cfDef.getName() + " column family is " + comparatorType.getTypeName()
-                   + ", not BytesType. It may cause a fatal error on column validation later.");
+              + ", not BytesType. It may cause a fatal error on column validation later.");
           }
           else {
-            // LOG.info("The comparator type of " + cfDef.getName() + " column family is " + comparatorType.getTypeName() + ".");
+            LOG.debug("The comparator type of " + cfDef.getName() + " column family is " 
+              + comparatorType.getTypeName() + ".");
           }
         }
       }
@@ -205,7 +196,6 @@ public class CassandraClient<K, T extend
    * @param columnName the column name (the member name, or the index of array)
    * @param value the member value
    */
-  @SuppressWarnings("unchecked")
   public void addSubColumn(K key, String fieldName, ByteBuffer columnName, Object value) {
     if (value == null) {
       return;
@@ -250,7 +240,6 @@ public class CassandraClient<K, T extend
    * @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);
@@ -266,19 +255,18 @@ public class CassandraClient<K, T extend
   }
 
 
-  @SuppressWarnings("unchecked")
-  public void addGenericArray(K key, String fieldName, GenericArray array) {
+  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 (((List)itemValue).size() == 0) {
+          if (((List<?>)itemValue).size() == 0) {
             continue;
           }
         } else if (itemValue instanceof Map<?,?>) {
-          if (((Map)itemValue).size() == 0) {
+          if (((Map<?, ?>)itemValue).size() == 0) {
             continue;
           }
         }
@@ -291,24 +279,18 @@ public class CassandraClient<K, T extend
     }
   }
 
-  @SuppressWarnings("unchecked")
-  public void addStatefulHashMap(K key, String fieldName, StatefulHashMap<Utf8,Object> map) {
+  public void addStatefulHashMap(K key, String fieldName, Map<CharSequence,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;
-        }
+      for (CharSequence mapKey: map.keySet()) {
 
         // TODO: hack, do not store empty arrays
         Object mapValue = map.get(mapKey);
         if (mapValue instanceof GenericArray<?>) {
-          if (((GenericArray)mapValue).size() == 0) {
+          if (((List<?>)mapValue).size() == 0) {
             continue;
           }
-        } else if (mapValue instanceof StatefulHashMap<?,?>) {
-          if (((StatefulHashMap)mapValue).size() == 0) {
+        } else if (mapValue instanceof Map<?,?>) {
+          if (((Map<?, ?>)mapValue).size() == 0) {
             continue;
           }
         }
@@ -322,25 +304,24 @@ public class CassandraClient<K, T extend
   }
 
   /**
-   * Serialize value to ByteBuffer.
-   * @param value the member value
+   * Serialize value to ByteBuffer using 
+   * {@link org.apache.gora.cassandra.serializers.GoraSerializerTypeInferer#getSerializer(Object)}.
+   * @param value the member value {@link java.lang.Object}.
    * @return ByteBuffer object
    */
-  @SuppressWarnings("unchecked")
   public ByteBuffer toByteBuffer(Object value) {
     ByteBuffer byteBuffer = null;
-    Serializer serializer = GoraSerializerTypeInferer.getSerializer(value);
+    Serializer<Object> serializer = GoraSerializerTypeInferer.getSerializer(value);
     if (serializer == null) {
-      LOG.info("Serializer not found for: " + value.toString());
+      LOG.warn("Serializer not found for: " + value.toString());
     }
     else {
+      LOG.debug(serializer.getClass() + " selected as appropriate Serializer.");
       byteBuffer = serializer.toByteBuffer(value);
     }
-
     if (byteBuffer == null) {
       LOG.info("value class=" + value.getClass().getName() + " value=" + value + " -> null");
     }
-    
     return byteBuffer;
   }
 
@@ -381,22 +362,28 @@ public class CassandraClient<K, T extend
   
   private String getMappingFamily(String pField){
     String family = null;
-    // TODO checking if it was a UNION field the one we are retrieving
+    // checking if it was a UNION field the one we are retrieving
+    if (pField.indexOf(CassandraStore.UNION_COL_SUFIX) > 0)
+      family = this.cassandraMapping.getFamily(pField.substring(0,pField.indexOf(CassandraStore.UNION_COL_SUFIX)));
+    else
       family = this.cassandraMapping.getFamily(pField);
-    return family;
-  }
-  
+     return family;
+   }
+ 
   private String getMappingColumn(String pField){
     String column = null;
-    // TODO checking if it was a UNION field the one we are retrieving e.g. column = pField;
+    if (pField.indexOf(CassandraStore.UNION_COL_SUFIX) > 0)
+      column = pField;
+    else
       column = this.cassandraMapping.getColumn(pField);
-    return column;
-  }
+      return column;
+    }
 
   /**
    * Select the families that contain at least one column mapped to a query field.
    * @param query indicates the columns to select
-   * @return a map which keys are the family names and values the corresponding column names required to get all the query fields.
+   * @return a map which keys are the family names and values the 
+   * corresponding column names required to get all the query fields.
    */
   public Map<String, List<String>> getFamilyMap(Query<K, T> query) {
     Map<String, List<String>> map = new HashMap<String, List<String>>();
@@ -421,17 +408,20 @@ public class CassandraClient<K, T extend
   }
 
   /**
-   * Retrieves the cassandraMapping which holds whatever was mapped from the gora-cassandra-mapping.xml
-   * @return
+   * Retrieves the cassandraMapping which holds whatever was mapped 
+   * from the gora-cassandra-mapping.xml
+   * @return 
    */
   public CassandraMapping getCassandraMapping(){
     return this.cassandraMapping;
   }
   
   /**
-   * Select the field names according to the column names, which format if fully qualified: "family:column"
+   * Select the field names according to the column names, which format 
+   * if fully qualified: "family:column"
    * @param query
-   * @return a map which keys are the fully qualified column names and values the query fields
+   * @return a map which keys are the fully qualified column 
+   * names and values the query fields
    */
   public Map<String, String> getReverseMap(Query<K, T> query) {
     Map<String, String> map = new HashMap<String, String>();

Modified: gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraMapping.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraMapping.java?rev=1558333&r1=1558332&r2=1558333&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraMapping.java (original)
+++ gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraMapping.java Wed Jan 15 10:11:08 2014
@@ -207,10 +207,10 @@ public class CassandraMapping {
   }
 
   /**
-   * Add new column to CassandraMapping using the self-explanatory parameters
-   * @param pFamilyName
-   * @param pFieldName
-   * @param pColumnName
+   * Add new column to the CassandraMapping using the the below parameters
+   * @param pFamilyName the column family name
+   * @param pFieldName the Avro field from the Schema
+   * @param pColumnName the column name within the column family.
    */
   public void addColumn(String pFamilyName, String pFieldName, String pColumnName){
     this.familyMap.put(pFieldName, pFamilyName);

Modified: gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraMappingManager.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraMappingManager.java?rev=1558333&r1=1558332&r2=1558333&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraMappingManager.java (original)
+++ gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraMappingManager.java Wed Jan 15 10:11:08 2014
@@ -49,7 +49,7 @@ public class CassandraMappingManager {
     return manager;
   }
 
-  /**
+ /**
   * Objects to maintain mapped keyspaces
   */
   private Map<String, Element> keyspaceMap = null;
@@ -78,7 +78,7 @@ public class CassandraMappingManager {
     }
     String keyspaceName = mappingElement.getAttributeValue(KEYSPACE_ELEMENT);
     if (LOG.isDebugEnabled()) {
-      LOG.debug("className=" + className + " -> keyspaceName=" + keyspaceName);
+      LOG.debug("persistentClassName=" + className + " -> keyspaceName=" + keyspaceName);
     }
     Element keyspaceElement = keyspaceMap.get(keyspaceName);
     if (keyspaceElement == null) {

Modified: gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java?rev=1558333&r1=1558332&r2=1558333&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java (original)
+++ gora/branches/GORA_94/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java Wed Jan 15 10:11:08 2014
@@ -40,17 +40,15 @@ 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.util.Utf8;
+import org.apache.avro.specific.SpecificData;
 import org.apache.gora.cassandra.query.CassandraQuery;
 import org.apache.gora.cassandra.query.CassandraResult;
 import org.apache.gora.cassandra.query.CassandraResultSet;
 import org.apache.gora.cassandra.query.CassandraRow;
 import org.apache.gora.cassandra.query.CassandraSubColumn;
 import org.apache.gora.cassandra.query.CassandraSuperColumn;
-import org.apache.gora.persistency.ListGenericArray;
-import org.apache.gora.persistency.StatefulHashMap;
+import org.apache.gora.persistency.Persistent;
 import org.apache.gora.persistency.impl.PersistentBase;
-import org.apache.gora.persistency.impl.StateManagerImpl;
 import org.apache.gora.query.PartitionQuery;
 import org.apache.gora.query.Query;
 import org.apache.gora.query.Result;
@@ -72,6 +70,12 @@ public class CassandraStore<K, T extends
 
   private CassandraClient<K, T>  cassandraClient = new CassandraClient<K, T>();
 
+ /**
+  * Fixed string used to generate an extra column based on 
+  * the original field's name
+  */
+  public static String UNION_COL_SUFIX = "UnionIndex";
+  
   /**
    * Default schema index used when AVRO Union data types are stored
    */
@@ -81,7 +85,8 @@ public class CassandraStore<K, T extends
    * The values are Avro fields pending to be stored.
    *
    * We want to iterate over the keys in insertion order.
-   * We don't want to lock the entire collection before iterating over the keys, since in the meantime other threads are adding entries to the map.
+   * We don't want to lock the entire collection before iterating over the keys, 
+   * since in the meantime other threads are adding entries to the map.
    */
   private Map<K, T> buffer = Collections.synchronizedMap(new LinkedHashMap<K, T>());
   
@@ -138,7 +143,7 @@ public class CassandraStore<K, T extends
 
   /**
    * When executing Gora Queries in Cassandra we query the Cassandra keyspace by families.
-   * When add sub/supercolumns, Gora keys are mapped to Cassandra partition keys only. 
+   * When we add sub/supercolumns, Gora keys are mapped to Cassandra partition keys only. 
    * This is because we follow the Cassandra logic where column family data is 
    * partitioned across nodes based on row Key.
    */
@@ -237,7 +242,11 @@ public class CassandraStore<K, T extends
   }
 
   /**
-   * Flush the buffer. Write the buffered rows.
+   * Flush the buffer which is a synchronized {@link java.util.LinkedHashMap}
+   * storing fields pending to be stored by 
+   * {@link org.apache.gora.cassandra.store.CassandraStore#put(Object, PersistentBase)}
+   * operations. Invoking this method therefore writes the buffered rows
+   * into Cassandra.
    * @see org.apache.gora.store.DataStore#flush()
    */
   @Override
@@ -246,9 +255,11 @@ public class CassandraStore<K, T extends
     Set<K> keys = this.buffer.keySet();
     
     // this duplicates memory footprint
+    @SuppressWarnings("unchecked")
     K[] keyArray = (K[]) keys.toArray();
     
-    // iterating over the key set directly would throw ConcurrentModificationException with java.util.HashMap and subclasses
+    // iterating over the key set directly would throw 
+    //ConcurrentModificationException with java.util.HashMap and subclasses
     for (K key: keyArray) {
       T value = this.buffer.get(key);
       if (value == null) {
@@ -256,6 +267,7 @@ public class CassandraStore<K, T extends
         continue;
       }
       Schema schema = value.getSchema();
+      
       for (Field field: schema.getFields()) {
         if (value.isDirty(field.pos())) {
           addOrUpdateField(key, field, value.get(field.pos()));
@@ -263,7 +275,8 @@ public class CassandraStore<K, T extends
       }
     }
     
-    // remove flushed rows
+    // remove flushed rows from the buffer as all 
+    // added or updated fields should now have been written.
     for (K key: keyArray) {
       this.buffer.remove(key);
     }
@@ -290,7 +303,9 @@ public class CassandraStore<K, T extends
   @Override
   public List<PartitionQuery<K, T>> getPartitions(Query<K, T> query)
       throws IOException {
-    // just a single partition
+    // TODO right now this just obtains a single partition
+    // we need to obtain the correct splits for partitions in 
+    // order to achieve data locality.
     List<PartitionQuery<K,T>> partitions = new ArrayList<PartitionQuery<K,T>>();
     PartitionQueryImpl<K, T> pqi = new PartitionQueryImpl<K, T>(query);
     pqi.setConf(getConf());
@@ -315,62 +330,84 @@ public class CassandraStore<K, T extends
   }
 
   /**
-   * Duplicate instance to keep all the objects in memory till flushing.
-   * @see org.apache.gora.store.DataStore#put(java.lang.Object, org.apache.gora.persistency.Persistent)
+   * 
+   * When doing the 
+   * {@link org.apache.gora.cassandra.store.CassandraStore#put(Object, PersistentBase)}
+   * operation, the logic is as follows:
+   * <ol>
+   * <li>Obtain the Avro {@link org.apache.avro.Schema} for the object.</li>
+   * <li>Create a new duplicate instance of the object (explained in more detail below) **.</li>
+   * <li>Obtain a {@link java.util.List} of the {@link org.apache.avro.Schema} 
+   * {@link org.apache.avro.Schema.Field}'s.</li>
+   * <li>Iterate through the {@link java.util.List}. This allows us to process
+   * each item appropriately.</li>
+   * <li>Check to see if the {@link org.apache.avro.Schema.Field} is either at 
+   * position 0 OR it is NOT dirty. If one of these conditions is true then we DO NOT
+   * process this field.</li>
+   * <li>Obtain the element at the specified position in this list.</li>
+   * <li>Obtain the {@link org.apache.avro.Schema.Type} of the element obtained 
+   * above and process it accordingly. N.B. For nested type RECORD we shadow 
+   * the checks to see if the {@link org.apache.avro.Schema.Field} is either at 
+   * position 0 OR it is NOT dirty. If one of these conditions is true then we DO NOT
+   * process this field.</li>
+   * </ol>
+   * ** We create a duplicate instance of the object to be persisted and insert processed
+   * objects into a synchronized {@link java.util.LinkedHashMap}. This allows 
+   * us to keep all the objects in memory till flushing.
+   * @see org.apache.gora.store.DataStore#put(java.lang.Object, 
+   * org.apache.gora.persistency.Persistent).
+   * @param key for the Avro Record (object).
+   * @param value Record object to be persisted in Cassandra
    */
   @Override
   public void put(K key, T value) {
-    T p = (T) value.newInstance(new StateManagerImpl());
     Schema schema = value.getSchema();
-    for (Field field: schema.getFields()) {
-      int fieldPos = field.pos();
-      if (value.isDirty(fieldPos)) {
-        Object fieldValue = value.get(fieldPos);
+    @SuppressWarnings("unchecked")
+    T p = (T) SpecificData.get().newRecord(value, schema);
+    List<Field> fields = schema.getFields();
+    for (int i = 1; i < fields.size(); i++) {
+      if (!value.isDirty(i)) {
+        continue;
+      }
+      Field field = fields.get(i);
+      Type type = field.schema().getType();
+      Object fieldValue = value.get(field.pos());
+      // check if field has a nested structure (array, map, record or union)
         
-        // check if field has a nested structure (array, map, or record)
-        Schema fieldSchema = field.schema();
-        Type type = fieldSchema.getType();
-        switch(type) {
-          case RECORD:
-            PersistentBase persistent = (PersistentBase) fieldValue;
-            PersistentBase newRecord = (PersistentBase) persistent.newInstance(new StateManagerImpl());
-            for (Field member: fieldSchema.getFields()) {
-              newRecord.put(member.pos(), persistent.get(member.pos()));
-            }
-            fieldValue = newRecord;
-            break;
-          case MAP:
-            StatefulHashMap map = (StatefulHashMap) fieldValue;
-            StatefulHashMap newMap = new StatefulHashMap();
-            for (Object mapKey : map.keySet()) {
-              newMap.put(mapKey, map.get(mapKey));
-              newMap.putState(mapKey, map.getState(mapKey));
-            }
-            fieldValue = newMap;
-            break;
-          case ARRAY:
-            GenericArray array = (GenericArray) fieldValue;
-            ListGenericArray newArray = new ListGenericArray(fieldSchema.getElementType());
-            Iterator iter = array.iterator();
-            while (iter.hasNext()) {
-              newArray.add(iter.next());
+      switch(type) {
+        case RECORD:
+          Persistent persistent = (Persistent) fieldValue;
+          Persistent newRecord = (Persistent) SpecificData.get().newRecord(persistent, persistent.getSchema());
+          for (Field member: field.schema().getFields()) {
+            if (member.pos() == 0 || !persistent.isDirty()) {
+              continue;
             }
-            fieldValue = newArray;
-            break;
-          case UNION:
-            // storing the union selected schema, the actual value will be stored as soon as getting out of here
-            // TODO determine which schema we are using: int schemaPos = getUnionSchema(fieldValue,fieldSchema);
-            // and save it p.put( p.getFieldIndex(field.name() + CassandraStore.UNION_COL_SUFIX), schemaPos);
-            break;
-        }
-        
-        p.put(fieldPos, fieldValue);
+            newRecord.put(member.pos(), persistent.get(member.pos()));
+          }
+          fieldValue = newRecord;
+          break;
+        case MAP:
+          Map<?, ?> map = (Map<?, ?>) fieldValue;
+          fieldValue = map;
+          break;
+        case ARRAY:
+          fieldValue = (List<?>) fieldValue;
+          break;
+        case UNION:
+          // storing the union selected schema, the actual value will 
+          // be stored as soon as we get break out.
+          int schemaPos = getUnionSchema(fieldValue,field.schema());
+          p.put( schemaPos, p.getSchema().getField(field.name() + CassandraStore.UNION_COL_SUFIX));
+          //p.put(fieldPos, fieldValue);
+          break;
+      default:
+        break;
       }
+      p.put(field.pos(), fieldValue);
     }
-    
     // this performs a structural modification of the map
     this.buffer.put(key, p);
- }
+  }
 
   /**
    * Add a field to Cassandra according to its type.
@@ -378,9 +415,12 @@ public class CassandraStore<K, T extends
    * @param field   the Avro field representing a datum
    * @param value   the field value
    */
+  @SuppressWarnings({ "unchecked", "null" })
   private void addOrUpdateField(K key, Field field, Object value) {
     Schema schema = field.schema();
     Type type = schema.getType();
+    // checking if the value to be updated is used for saving union schema
+    if (field.name().indexOf(CassandraStore.UNION_COL_SUFIX) < 0){
       switch (type) {
         case STRING:
         case BOOLEAN:
@@ -400,16 +440,20 @@ public class CassandraStore<K, T extends
                 
                 // TODO: hack, do not store empty arrays
                 Object memberValue = persistentBase.get(member.pos());
-                if (memberValue instanceof GenericArray<?>) {
-                  if (((GenericArray)memberValue).size() == 0) {
+                if (memberValue instanceof List<?>) {
+                  if (((List<?>)memberValue).size() == 0) {
+                    continue;
+                  }
+                } else if (memberValue instanceof Map<?,?>) {
+                  if (((Map<?, ?>)memberValue).size() == 0) {
                     continue;
                   }
                 }
-                this.cassandraClient.addSubColumn(key, field.name(), member.name(), memberValue);
+                this.cassandraClient.addSubColumn(key, field.name(), 
+                    member.name(), memberValue);
               }
           } else {
             LOG.info("Record not supported: " + value.toString());
-            
           }
         }
         break;
@@ -425,31 +469,40 @@ public class CassandraStore<K, T extends
       case ARRAY:
         if (value != null) {
           if (value instanceof GenericArray<?>) {
-            this.cassandraClient.addGenericArray(key, field.name(), (GenericArray)value);
+            this.cassandraClient.addGenericArray(key, field.name(), (GenericArray<?>)value);
           } else {
             LOG.info("Array not supported: " + value.toString());
           }
         }
         break;
-       case UNION:
-         if(value != null) {
-           LOG.info("Union being supported with value: " + value.toString());
-           // TODO add union schema index used
-           // adding union value
-           this.cassandraClient.addColumn(key, field.name(), value);
-         } else {
-           LOG.info("Union not supported: " + value.toString());
-         }
+      case UNION:
+        if(value != null) {
+          LOG.info("Union being supported: " + value.toString());
+          // adding union schema index
+          String columnName = field.name() + UNION_COL_SUFIX;
+          String familyName = this.cassandraClient.getCassandraMapping().getFamily(field.name());
+          this.cassandraClient.getCassandraMapping().addColumn(familyName, columnName, columnName);
+          this.cassandraClient.addColumn(key, columnName, getUnionSchema(value, schema));
+          // adding union value
+          this.cassandraClient.addColumn(key, field.name(), value);
+        } else {
+          LOG.info("Union not supported: " + value.toString());
+        }
+        break;
       default:
-        LOG.info("Type not considered: " + type.name());      
+        LOG.info("Type not considered: " + type.name());
+      }
     }
   }
 
   /**
-   * Gets the position within the schema of the type used
+   * Given an object and the object schema this function obtains,
+   * from within the UNION schema, the position of the type used.
+   * If no data type can be inferred then we return a default value
+   * of position 0.
    * @param pValue
    * @param pUnionSchema
-   * @return
+   * @return the unionSchemaPosition.
    */
   private int getUnionSchema(Object pValue, Schema pUnionSchema){
     int unionSchemaPos = 0;
@@ -474,9 +527,13 @@ public class CassandraStore<K, T extends
       unionSchemaPos ++;
     }
     // if we weren't able to determine which data type it is, then we return the default
-    return 0;
+    return DEFAULT_UNION_SCHEMA;
   }
 
+  /**
+   * Simple method to check if a Cassandra Keyspace exists.
+   * @return true if a Keyspace exists.
+   */
   @Override
   public boolean schemaExists() {
     LOG.info("schema exists");

Modified: gora/branches/GORA_94/gora-cassandra/src/test/conf/cassandra.yaml
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-cassandra/src/test/conf/cassandra.yaml?rev=1558333&r1=1558332&r2=1558333&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-cassandra/src/test/conf/cassandra.yaml (original)
+++ gora/branches/GORA_94/gora-cassandra/src/test/conf/cassandra.yaml Wed Jan 15 10:11:08 2014
@@ -7,7 +7,7 @@
 
 # The name of the cluster. This is mainly used to prevent machines in
 # one logical cluster from joining another.
-cluster_name: 'Gora Cassandra Test Cluster'
+cluster_name: "Gora Cassandra Test Cluster"
 
 # You should always specify InitialToken when setting up a production
 # cluster for the first time, and often when adding capacity later.
@@ -27,13 +27,13 @@ hinted_handoff_enabled: true
 # generated. After it has been dead this long, hints will be dropped.
 max_hint_window_in_ms: 3600000 # one hour
 # Sleep this long after delivering each row or row fragment
-hinted_handoff_throttle_delay_in_ms: 50
+#hinted_handoff_throttle_delay_in_ms: 50 (deprecated in 2.0.2)
 
 # authentication backend, implementing IAuthenticator; used to identify users
 authenticator: org.apache.cassandra.auth.AllowAllAuthenticator
 
 # authorization backend, implementing IAuthority; used to limit access/provide permissions
-authority: org.apache.cassandra.auth.AllowAllAuthority
+authorizer: org.apache.cassandra.auth.AllowAllAuthorizer
 
 # The partitioner is responsible for distributing rows (by key) across
 # nodes in the cluster. Any IPartitioner may be used, including your
@@ -109,7 +109,7 @@ seed_provider:
 # it is most effective under light to moderate load, or read-heavy
 # workloads; under truly massive write load, it will often be too
 # little, too late.
-flush_largest_memtables_at: 0.75
+#flush_largest_memtables_at: 0.75 (deprecated in 2.0.2)
 
 # emergency pressure valve #2: the first time heap usage after a full
 # (CMS) garbage collection is above this fraction of the max,
@@ -120,8 +120,8 @@ flush_largest_memtables_at: 0.75
 #
 # Set to 1.0 to disable. Setting this lower than
 # CMSInitiatingOccupancyFraction is not likely to be useful.
-reduce_cache_sizes_at: 0.85
-reduce_cache_capacity_to: 0.6
+#reduce_cache_sizes_at: 0.85 (deprecated in 2.0.2)
+#reduce_cache_capacity_to: 0.6 (deprecated in 2.0.2)
 
 # For workloads with more data than can fit in memory, Cassandra's
 # bottleneck will be reads that need to fetch data from
@@ -311,7 +311,7 @@ compaction_preheat_key_cache: true
 # stream_throughput_outbound_megabits_per_sec: 400
 
 # Time to wait for a reply from other nodes before failing the command
-rpc_timeout_in_ms: 10000
+#rpc_timeout_in_ms: 10000 (deprecated in 2.0.2)
 
 # phi value that must be reached for a host to be marked down.
 # most users should never need to adjust this.
@@ -410,7 +410,7 @@ index_interval: 128
 # The passwords used in these options must match the passwords used when generating
 # the keystore and truststore. For instructions on generating these files, see:
 # http://download.oracle.com/javase/6/docs/technotes/guides/security/jsse/JSSERefGuide.html#CreateKeystore
-encryption_options:
+server_encryption_options:
     internode_encryption: none
     keystore: conf/.keystore
     keystore_password: cassandra

Modified: gora/branches/GORA_94/gora-cassandra/src/test/java/org/apache/gora/cassandra/GoraCassandraTestDriver.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-cassandra/src/test/java/org/apache/gora/cassandra/GoraCassandraTestDriver.java?rev=1558333&r1=1558332&r2=1558333&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-cassandra/src/test/java/org/apache/gora/cassandra/GoraCassandraTestDriver.java (original)
+++ gora/branches/GORA_94/gora-cassandra/src/test/java/org/apache/gora/cassandra/GoraCassandraTestDriver.java Wed Jan 15 10:11:08 2014
@@ -23,17 +23,13 @@
 
 package org.apache.gora.cassandra;
 
-import java.io.IOException;
-
 import org.apache.gora.GoraTestDriver;
 import org.apache.gora.cassandra.store.CassandraStore;
 
-import org.apache.hadoop.conf.Configuration;
-
 import java.io.File;
 
 import org.apache.cassandra.io.util.FileUtils;
-import org.apache.cassandra.thrift.CassandraDaemon;
+import org.apache.cassandra.service.CassandraDaemon;
 
 // Logging imports
 import org.slf4j.Logger;
@@ -70,7 +66,7 @@ public class GoraCassandraTestDriver ext
   }
 	
   /**
-   * starts embedded Cassandra server.
+   * Starts embedded Cassandra server.
    *
    * @throws Exception
    * 	if an error occurs
@@ -91,21 +87,21 @@ public class GoraCassandraTestDriver ext
 	
         public void run() {
           try {
-	    cassandraDaemon.start();
-	  } catch (Exception e) {
-	    log.error("Embedded casandra server run failed!", e);
-	  }
+            cassandraDaemon.start();
+          } catch (Exception e) {
+            log.error("Embedded casandra server run failed!", e);
+          }
         }
       });
 	
       cassandraThread.setDaemon(true);
       cassandraThread.start();
-      } catch (Exception e) {
-	log.error("Embedded casandra server start failed!", e);
+    } catch (Exception e) {
+      log.error("Embedded casandra server start failed!", e);
 
-	// cleanup
-	tearDownClass();
-      }
+      // cleanup
+      tearDownClass();
+    }
   }
 
   /**
@@ -136,15 +132,15 @@ public class GoraCassandraTestDriver ext
     int tries = 3;
     while (tries-- > 0) {
       try {
-	cleanupDirectories();
-	break;
+        cleanupDirectories();
+        break;
       } catch (Exception e) {
-	// ignore exception
-	try {
-	  Thread.sleep(250);
-	} catch (InterruptedException e1) {
-	  // ignore exception
-	}
+        // ignore exception
+        try {
+          Thread.sleep(250);
+        } catch (InterruptedException e1) {
+          // ignore exception
+        }
       }
     }
   }

Modified: gora/branches/GORA_94/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java?rev=1558333&r1=1558332&r2=1558333&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java (original)
+++ gora/branches/GORA_94/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java Wed Jan 15 10:11:08 2014
@@ -968,7 +968,7 @@ public class DataStoreTestUtil {
     String url = "http://foo.com/";
 
     store.createSchema();
-    WebPage page = store.newPersistent();
+    WebPage page = WebPage.newBuilder().build();
     Metadata metadata = Metadata.newBuilder().build();
     metadata.setVersion(1);
     metadata.getData().put(new Utf8("foo"), new Utf8("baz"));

Modified: gora/branches/GORA_94/gora-hbase/pom.xml
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-hbase/pom.xml?rev=1558333&r1=1558332&r2=1558333&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-hbase/pom.xml (original)
+++ gora/branches/GORA_94/gora-hbase/pom.xml Wed Jan 15 10:11:08 2014
@@ -129,6 +129,11 @@
             <artifactId>jdom</artifactId>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <scope>compile</scope>
+        </dependency>
 
         <!-- Logging Dependencies -->
         <dependency>

Modified: gora/branches/GORA_94/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java?rev=1558333&r1=1558332&r2=1558333&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java (original)
+++ gora/branches/GORA_94/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java Wed Jan 15 10:11:08 2014
@@ -239,10 +239,10 @@ implements Configurable {
       boolean hasDeletes = false;
       List<Field> fields = schema.getFields();
       for (int i = 1; i<fields.size(); i++) {
-        Field field = fields.get(i);
-        if (i==0 || !persistent.isDirty(i)) {
+        if (!persistent.isDirty(i)) {
           continue;
         }
+        Field field = fields.get(i);
         Type type = field.schema().getType();
         Object o = persistent.get(i);
         HBaseColumn hcol = mapping.getColumn(field.name());

Modified: gora/branches/GORA_94/pom.xml
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/pom.xml?rev=1558333&r1=1558332&r2=1558333&view=diff
==============================================================================
--- gora/branches/GORA_94/pom.xml (original)
+++ gora/branches/GORA_94/pom.xml Wed Jan 15 10:11:08 2014
@@ -410,6 +410,7 @@
                 <inherited>true</inherited>
                 <executions>
                     <execution>
+                        <id>copy</id>
                         <phase>package</phase>
                         <goals>
                             <goal>copy-dependencies</goal>
@@ -576,7 +577,7 @@
         <module>gora-core</module>
         <module>gora-hbase</module>
         <!--module>gora-accumulo</module-->
-        <!--module>gora-cassandra</module-->
+        <module>gora-cassandra</module>
         <!-- module>gora-solr</module-->
         <!--module>gora-dynamodb</module-->
         <!--module>gora-sql</module-->
@@ -598,9 +599,8 @@
         <!-- Amazon Dependencies -->
         <amazon.version>1.3.12</amazon.version>
         <!-- Cassandra Dependencies -->
-        <cassandra.version>1.1.2</cassandra.version>
-        <libthrift.version>0.7.0</libthrift.version>
-        <hector.version>1.1-0</hector.version>
+        <cassandra.version>2.0.2</cassandra.version>
+        <hector.version>1.1-4</hector.version>
         <!-- Solr Dependencies -->
         <lucene-solr.version>4.3.0</lucene-solr.version>
         <solr-solrj.version>4.3.0</solr-solrj.version>
@@ -613,7 +613,7 @@
         <restlet.version>2.1.1</restlet.version>
 
         <!-- Misc Dependencies -->
-        <guava.version>10.0.1</guava.version>
+        <guava.version>13.0</guava.version>
         <commons-lang.version>2.6</commons-lang.version>
         <jdom.version>1.1.2</jdom.version>
         <hsqldb.version>2.2.8</hsqldb.version>



Mime
View raw message