gora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lewi...@apache.org
Subject svn commit: r1392402 - in /gora/branches/goraamazon: conf/ gora-accumulo/src/main/java/org/apache/gora/accumulo/store/ gora-cassandra/src/main/java/org/apache/gora/cassandra/query/ gora-cassandra/src/main/java/org/apache/gora/cassandra/store/ gora-dyna...
Date Mon, 01 Oct 2012 15:41:48 GMT
Author: lewismc
Date: Mon Oct  1 15:41:47 2012
New Revision: 1392402

URL: http://svn.apache.org/viewvc?rev=1392402&view=rev
Log:
GORA-103-final-v2.patch

Modified:
    gora/branches/goraamazon/conf/log4j.properties
    gora/branches/goraamazon/gora-accumulo/src/main/java/org/apache/gora/accumulo/store/AccumuloStore.java
    gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraQuery.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/store/CassandraStore.java
    gora/branches/goraamazon/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/compiler/GoraDynamoDBCompiler.java
    gora/branches/goraamazon/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/query/DynamoDBKey.java
    gora/branches/goraamazon/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/query/DynamoDBQuery.java
    gora/branches/goraamazon/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/query/DynamoDBResult.java
    gora/branches/goraamazon/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/store/DynamoDBStore.java
    gora/branches/goraamazon/gora-dynamodb/src/test/java/org/apache/gora/dynamodb/GoraDynamoDBTestDriver.java
    gora/branches/goraamazon/gora-dynamodb/src/test/java/org/apache/gora/dynamodb/TestDynamoDBStore.java
    gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/query/SqlQuery.java
    gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/query/SqlResult.java
    gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/statement/HSqlInsertUpdateStatement.java
    gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/statement/InsertUpdateStatement.java
    gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/statement/MySqlInsertUpdateStatement.java
    gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/store/SqlStore.java
    gora/branches/goraamazon/gora-sql/src/test/java/org/apache/gora/sql/store/TestSqlStore.java

Modified: gora/branches/goraamazon/conf/log4j.properties
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/conf/log4j.properties?rev=1392402&r1=1392401&r2=1392402&view=diff
==============================================================================
--- gora/branches/goraamazon/conf/log4j.properties (original)
+++ gora/branches/goraamazon/conf/log4j.properties Mon Oct  1 15:41:47 2012
@@ -13,7 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-gora.root.logger=DEBUG,console
+gora.root.logger=INFO,console
 gora.log.dir=.
 gora.log.file=gora.log
 

Modified: gora/branches/goraamazon/gora-accumulo/src/main/java/org/apache/gora/accumulo/store/AccumuloStore.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-accumulo/src/main/java/org/apache/gora/accumulo/store/AccumuloStore.java?rev=1392402&r1=1392401&r2=1392402&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-accumulo/src/main/java/org/apache/gora/accumulo/store/AccumuloStore.java (original)
+++ gora/branches/goraamazon/gora-accumulo/src/main/java/org/apache/gora/accumulo/store/AccumuloStore.java Mon Oct  1 15:41:47 2012
@@ -81,7 +81,6 @@ import org.apache.gora.accumulo.encoders
 import org.apache.gora.accumulo.query.AccumuloQuery;
 import org.apache.gora.accumulo.query.AccumuloResult;
 import org.apache.gora.persistency.ListGenericArray;
-import org.apache.gora.persistency.Persistent;
 import org.apache.gora.persistency.State;
 import org.apache.gora.persistency.StateManager;
 import org.apache.gora.persistency.StatefulHashMap;

Modified: gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraQuery.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraQuery.java?rev=1392402&r1=1392401&r2=1392402&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraQuery.java (original)
+++ gora/branches/goraamazon/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraQuery.java Mon Oct  1 15:41:47 2012
@@ -21,7 +21,6 @@ package org.apache.gora.cassandra.query;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.gora.persistency.Persistent;
 import org.apache.gora.persistency.impl.PersistentBase;
 import org.apache.gora.query.Query;
 import org.apache.gora.query.impl.QueryBase;

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=1392402&r1=1392401&r2=1392402&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 Mon Oct  1 15:41:47 2012
@@ -27,7 +27,6 @@ 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;
 import org.apache.gora.query.impl.ResultBase;
@@ -65,7 +64,6 @@ public class CassandraResult<K, T extend
    * Load key/value pair from Cassandra row to Avro record.
    * @throws IOException
    */
-  @SuppressWarnings("unchecked")
   private void updatePersistent() throws IOException {
     CassandraRow<K> cassandraRow = this.cassandraResultSet.get(this.rowNumber);
     

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=1392402&r1=1392401&r2=1392402&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 Mon Oct  1 15:41:47 2012
@@ -50,7 +50,6 @@ import org.apache.gora.cassandra.query.C
 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.Persistent;
 import org.apache.gora.persistency.StatefulHashMap;
 import org.apache.gora.persistency.impl.PersistentBase;
 import org.apache.gora.persistency.impl.StateManagerImpl;

Modified: gora/branches/goraamazon/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/compiler/GoraDynamoDBCompiler.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/compiler/GoraDynamoDBCompiler.java?rev=1392402&r1=1392401&r2=1392402&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/compiler/GoraDynamoDBCompiler.java (original)
+++ gora/branches/goraamazon/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/compiler/GoraDynamoDBCompiler.java Mon Oct  1 15:41:47 2012
@@ -27,7 +27,6 @@ import java.io.OutputStreamWriter;
 import java.io.Writer;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 
 import org.apache.gora.dynamodb.store.DynamoDBMapping;
 import org.apache.gora.dynamodb.store.DynamoDBMapping.DynamoDBMappingBuilder;
@@ -37,7 +36,6 @@ import org.jdom.input.SAXBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.amazonaws.services.dynamodb.datamodeling.DynamoDBAttribute;
 import com.amazonaws.services.dynamodb.model.KeySchema;
 import com.amazonaws.services.dynamodb.model.KeySchemaElement;
 
@@ -362,28 +360,28 @@ public class GoraDynamoDBCompiler {
       List<Element> tableElements = root.getChildren("table");
       for(Element tableElement : tableElements) {
     	  
-    	String tableName = tableElement.getAttributeValue("name");
-    	long readCapacUnits = Long.parseLong(tableElement.getAttributeValue("readcunit"));
-    	long writeCapacUnits = Long.parseLong(tableElement.getAttributeValue("readcunit"));
+      String tableName = tableElement.getAttributeValue("name");
+      long readCapacUnits = Long.parseLong(tableElement.getAttributeValue("readcunit"));
+      long writeCapacUnits = Long.parseLong(tableElement.getAttributeValue("readcunit"));
     	
-    	mappingBuilder.setTableName(tableName);
-    	mappingBuilder.setProvisionedThroughput(tableName, readCapacUnits, writeCapacUnits);
-    	log.debug("Basic table properties have been set: Name, and Provisioned throughput.");
+      mappingBuilder.setTableName(tableName);
+      mappingBuilder.setProvisionedThroughput(tableName, readCapacUnits, writeCapacUnits);
+      log.debug("Basic table properties have been set: Name, and Provisioned throughput.");
     	
-    	// Retrieving key's features
-    	List<Element> fieldElements = tableElement.getChildren("key");
-    	for(Element fieldElement : fieldElements) {
-    	  String keyName  = fieldElement.getAttributeValue("name");
-    	  String keyType  = fieldElement.getAttributeValue("type");
-    	  String keyAttrType  = fieldElement.getAttributeValue("att-type");
-    	  if(keyType.equals("hash"))
-    	    mappingBuilder.setHashKeySchema(tableName, keyName, keyAttrType);
-    	  else if(keyType.equals("hashrange"))
-    	    mappingBuilder.setHashRangeKeySchema(tableName, keyName, keyAttrType);
-    	}
-    	log.debug("Table key schemas have been set.");
+      // Retrieving key's features
+      List<Element> fieldElements = tableElement.getChildren("key");
+      for(Element fieldElement : fieldElements) {
+        String keyName  = fieldElement.getAttributeValue("name");
+        String keyType  = fieldElement.getAttributeValue("type");
+        String keyAttrType  = fieldElement.getAttributeValue("att-type");
+        if(keyType.equals("hash"))
+          mappingBuilder.setHashKeySchema(tableName, keyName, keyAttrType);
+        else if(keyType.equals("hashrange"))
+          mappingBuilder.setHashRangeKeySchema(tableName, keyName, keyAttrType);
+      }
+      log.debug("Table key schemas have been set.");
     	
-    	// Retrieving attributes
+      // Retrieving attributes
         fieldElements = tableElement.getChildren("attribute");
         for(Element fieldElement : fieldElements) {
           String attributeName  = fieldElement.getAttributeValue("name");

Modified: gora/branches/goraamazon/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/query/DynamoDBKey.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/query/DynamoDBKey.java?rev=1392402&r1=1392401&r2=1392402&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/query/DynamoDBKey.java (original)
+++ gora/branches/goraamazon/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/query/DynamoDBKey.java Mon Oct  1 15:41:47 2012
@@ -38,7 +38,7 @@ public class DynamoDBKey<H, R>  {
    * @return
    */
   public H getHashKey() {
-	return hashKey;
+    return hashKey;
   }
   
   /**
@@ -46,7 +46,7 @@ public class DynamoDBKey<H, R>  {
    * @param hashKey
    */
   public void setHashKey(H hashKey) {
-	this.hashKey = hashKey;
+    this.hashKey = hashKey;
   }
   
   /**
@@ -54,7 +54,7 @@ public class DynamoDBKey<H, R>  {
    * @return
    */
   public R getRangeKey() {
-	return rangeKey;
+    return rangeKey;
   }
   
   /**
@@ -62,6 +62,6 @@ public class DynamoDBKey<H, R>  {
    * @param rangeKey
    */
   public void setRangeKey(R rangeKey) {
-	this.rangeKey = rangeKey;
+    this.rangeKey = rangeKey;
   }
 }

Modified: gora/branches/goraamazon/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/query/DynamoDBQuery.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/query/DynamoDBQuery.java?rev=1392402&r1=1392401&r2=1392402&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/query/DynamoDBQuery.java (original)
+++ gora/branches/goraamazon/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/query/DynamoDBQuery.java Mon Oct  1 15:41:47 2012
@@ -24,7 +24,6 @@ package org.apache.gora.dynamodb.query;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 
-import org.apache.gora.dynamodb.store.DynamoDBStore;
 import org.apache.gora.persistency.Persistent;
 import org.apache.gora.query.Query;
 import org.apache.gora.query.ws.impl.QueryWSBase;
@@ -149,10 +148,10 @@ public class DynamoDBQuery<K, T extends 
    * @param pHashAttrValue	Hash attribute value where to start scanning
    */
   public void buildScanExpression(AttributeValue pHashAttrValue){
-  	DynamoDBScanExpression newScanExpression = new DynamoDBScanExpression();
-	// TODO right now we only support scanning using the key, but we should support other types of scans
-	newScanExpression.addFilterCondition(getKeySchema().getHashKeyElement().getAttributeName(), buildKeyScanCondition());
-	dynamoDBExpression = newScanExpression;
+    DynamoDBScanExpression newScanExpression = new DynamoDBScanExpression();
+    // TODO right now we only support scanning using the key, but we should support other types of scans
+    newScanExpression.addFilterCondition(getKeySchema().getHashKeyElement().getAttributeName(), buildKeyScanCondition());
+    dynamoDBExpression = newScanExpression;
   }
 	
   /**
@@ -161,10 +160,10 @@ public class DynamoDBQuery<K, T extends 
    * @param pHashAttrValue	Hash attribute value where to start
    */
   public void buildQueryExpression(Condition pNewCondition, AttributeValue pHashAttrValue) {
-  	DynamoDBQueryExpression newQueryExpression = new DynamoDBQueryExpression(pHashAttrValue); 
-  	newQueryExpression.setConsistentRead(getConsistencyReadLevel());
-  	newQueryExpression.setRangeKeyCondition(pNewCondition);
-	dynamoDBExpression = newQueryExpression;
+    DynamoDBQueryExpression newQueryExpression = new DynamoDBQueryExpression(pHashAttrValue); 
+    newQueryExpression.setConsistentRead(getConsistencyReadLevel());
+    newQueryExpression.setRangeKeyCondition(pNewCondition);
+    dynamoDBExpression = newQueryExpression;
   }
 	
   /**
@@ -172,12 +171,12 @@ public class DynamoDBQuery<K, T extends 
    * @return	AttributeValue build from query
    */
   private AttributeValue buildKeyHashAttribute(){
-  	String pAttrType = getKeySchema().getHashKeyElement().getAttributeType();
-	if(pAttrType.equals("S"))
-		return new AttributeValue().withS(getHashKey(query.getKey()).toString());
-	else if(pAttrType.equals("N"))
-		return new AttributeValue().withN(getHashKey(query.getKey()).toString());
-	return null;
+    String pAttrType = getKeySchema().getHashKeyElement().getAttributeType();
+    if(pAttrType.equals("S"))
+      return new AttributeValue().withS(getHashKey(query.getKey()).toString());
+    else if(pAttrType.equals("N"))
+      return new AttributeValue().withN(getHashKey(query.getKey()).toString());
+    return null;
   }
 	
   /**
@@ -188,25 +187,25 @@ public class DynamoDBQuery<K, T extends 
   private Object getHashKey(K key){
     Object hashKey = null;
     try {
-	  // Our key may be have hash and range keys
-	  for (Method met :key.getClass().getDeclaredMethods()){
-	    if(met.getName().equals("getHashKey")){
-	      Object [] params = null;
-	      hashKey = met.invoke(key, params);
-	      break;
-	    }
-	  }
-	} catch (IllegalArgumentException e) {
-	  LOG.info("DynamoDBStore: Error while trying to fetch range key.");
-	  e.printStackTrace();
-	} catch (IllegalAccessException e) {
-	  LOG.info("DynamoDBStore: Error while trying to fetch range key.");
-	  e.printStackTrace();
-	} catch (InvocationTargetException e) {
-	  LOG.info("DynamoDBStore: Error while trying to fetch range key.");
-	  e.printStackTrace();
-	}
-	return hashKey;
+    // Our key may be have hash and range keys
+    for (Method met :key.getClass().getDeclaredMethods()){
+      if(met.getName().equals("getHashKey")){
+        Object [] params = null;
+        hashKey = met.invoke(key, params);
+        break;
+      }
+    }
+  } catch (IllegalArgumentException e) {
+    LOG.info("DynamoDBStore: Error while trying to fetch range key.");
+    e.printStackTrace();
+  } catch (IllegalAccessException e) {
+    LOG.info("DynamoDBStore: Error while trying to fetch range key.");
+    e.printStackTrace();
+  } catch (InvocationTargetException e) {
+    LOG.info("DynamoDBStore: Error while trying to fetch range key.");
+    e.printStackTrace();
+  }
+  return hashKey;
   }
 
   /**
@@ -215,27 +214,27 @@ public class DynamoDBQuery<K, T extends 
    * @return
    */
   private Object getRangeKey(K key){
-	  Object rangeKey = null;
-	  try {
+    Object rangeKey = null;
+    try {
         // Our key may be have hash and range keys
-	    for (Method met :key.getClass().getDeclaredMethods()){
-		  if(met.getName().equals("getRangeKey")){
-		    Object [] params = null;
-		    rangeKey = met.invoke(key, params);
-		    break;
-	      }
-	    }
-	  } catch (IllegalArgumentException e) {
-	    LOG.info("DynamoDBStore: Error while trying to fetch range key.");
-		e.printStackTrace();
-	  } catch (IllegalAccessException e) {
-		LOG.info("DynamoDBStore: Error while trying to fetch range key.");
-		e.printStackTrace();
-	  } catch (InvocationTargetException e) {
-		LOG.info("DynamoDBStore: Error while trying to fetch range key.");
-		e.printStackTrace();
-	  }
-	  return rangeKey;
+      for (Method met :key.getClass().getDeclaredMethods()){
+      if(met.getName().equals("getRangeKey")){
+        Object [] params = null;
+        rangeKey = met.invoke(key, params);
+        break;
+        }
+      }
+    } catch (IllegalArgumentException e) {
+      LOG.info("DynamoDBStore: Error while trying to fetch range key.");
+    e.printStackTrace();
+    } catch (IllegalAccessException e) {
+    LOG.info("DynamoDBStore: Error while trying to fetch range key.");
+    e.printStackTrace();
+    } catch (InvocationTargetException e) {
+    LOG.info("DynamoDBStore: Error while trying to fetch range key.");
+    e.printStackTrace();
+    }
+    return rangeKey;
   }
 
   /**
@@ -243,10 +242,10 @@ public class DynamoDBQuery<K, T extends 
    * @return
    */
   private Condition buildKeyScanCondition(){
-	Condition scanKeyCondition = new Condition();
-	scanKeyCondition.setComparisonOperator(getScanCompOp());
-	scanKeyCondition.withAttributeValueList(buildKeyHashAttribute());
-	return scanKeyCondition;
+  Condition scanKeyCondition = new Condition();
+  scanKeyCondition.setComparisonOperator(getScanCompOp());
+  scanKeyCondition.withAttributeValueList(buildKeyHashAttribute());
+  return scanKeyCondition;
   }
 
   /**
@@ -254,24 +253,24 @@ public class DynamoDBQuery<K, T extends 
    * @return
    */
   private Condition buildRangeCondition(){
-	KeySchemaElement kRangeSchema = getKeySchema().getRangeKeyElement();
-	Condition rangeKeyCondition = null;
-	if(kRangeSchema != null){
-		rangeKeyCondition = new Condition();
-		rangeKeyCondition.setComparisonOperator(ComparisonOperator.BETWEEN.toString());
-		AttributeValue startVal = null, endVal = null;
-		//startVal = buildKeyHashAttribute();
-		if(kRangeSchema.getAttributeType().equals("S")){
-			startVal = new AttributeValue().withS(getRangeKey(query.getStartKey()).toString());
-			endVal = new AttributeValue().withS(getRangeKey(query.getEndKey()).toString());
-		}
-		else if (kRangeSchema.getAttributeType().equals("N")){
-			startVal = new AttributeValue().withN(getRangeKey(query.getStartKey()).toString());
-			endVal = new AttributeValue().withN(getRangeKey(query.getEndKey()).toString());
-		}
-		rangeKeyCondition.withAttributeValueList(startVal, endVal);
-	}
-	return rangeKeyCondition;
+  KeySchemaElement kRangeSchema = getKeySchema().getRangeKeyElement();
+  Condition rangeKeyCondition = null;
+  if(kRangeSchema != null){
+    rangeKeyCondition = new Condition();
+    rangeKeyCondition.setComparisonOperator(ComparisonOperator.BETWEEN.toString());
+    AttributeValue startVal = null, endVal = null;
+    //startVal = buildKeyHashAttribute();
+    if(kRangeSchema.getAttributeType().equals("S")){
+      startVal = new AttributeValue().withS(getRangeKey(query.getStartKey()).toString());
+      endVal = new AttributeValue().withS(getRangeKey(query.getEndKey()).toString());
+    }
+    else if (kRangeSchema.getAttributeType().equals("N")){
+      startVal = new AttributeValue().withN(getRangeKey(query.getStartKey()).toString());
+      endVal = new AttributeValue().withN(getRangeKey(query.getEndKey()).toString());
+    }
+    rangeKeyCondition.withAttributeValueList(startVal, endVal);
+  }
+  return rangeKeyCondition;
   }
 
   /**
@@ -279,7 +278,7 @@ public class DynamoDBQuery<K, T extends 
    * @return
    */
   public boolean getConsistencyReadLevel(){
-  	return consistencyReadLevel;
+    return consistencyReadLevel;
   }
 	
   /**
@@ -287,7 +286,7 @@ public class DynamoDBQuery<K, T extends 
    * @param pConsistencyReadLevel
    */
   public void setConsistencyReadLevel(boolean pConsistencyReadLevel){
-	this.consistencyReadLevel = pConsistencyReadLevel;
+    this.consistencyReadLevel = pConsistencyReadLevel;
   }
 	
   /**
@@ -295,7 +294,7 @@ public class DynamoDBQuery<K, T extends 
    * @return
    */
   public KeySchema getKeySchema(){
-	return keySchema;
+    return keySchema;
   }
 
   /**
@@ -303,7 +302,7 @@ public class DynamoDBQuery<K, T extends 
    * @return
    */
   public Object getQueryExpression(){
-	return dynamoDBExpression;
+    return dynamoDBExpression;
   }
 
   /**
@@ -311,7 +310,7 @@ public class DynamoDBQuery<K, T extends 
    * @param pKeySchema
    */
   public void setKeySchema(KeySchema pKeySchema){
-	this.keySchema = pKeySchema;
+    this.keySchema = pKeySchema;
   }
 
   /**
@@ -319,7 +318,7 @@ public class DynamoDBQuery<K, T extends 
    * @param pQuery
    */
   public void setQuery(Query<K, T> pQuery){
-	this.query = pQuery;
+    this.query = pQuery;
   }
 	
   /**
@@ -327,7 +326,7 @@ public class DynamoDBQuery<K, T extends 
    * @return
    */
   public Query<K, T> getQuery(){
-	return this.query;
+    return this.query;
   }
 
   /**
@@ -335,7 +334,7 @@ public class DynamoDBQuery<K, T extends 
    * @return
    */
   public static String getType() {
-	return type;
+    return type;
   }
 
   /**
@@ -343,7 +342,7 @@ public class DynamoDBQuery<K, T extends 
    * @param pType
    */
   public static void setType(String pType) {
-	type = pType;
+    type = pType;
   }
 
   /**
@@ -351,9 +350,9 @@ public class DynamoDBQuery<K, T extends 
    * @return
    */
   public static ComparisonOperator getScanCompOp() {
-	if (scanCompOp == null)
-		scanCompOp = ComparisonOperator.GE;
-	return scanCompOp;
+    if (scanCompOp == null)
+      scanCompOp = ComparisonOperator.GE;
+    return scanCompOp;
   }
 
   /**
@@ -361,7 +360,7 @@ public class DynamoDBQuery<K, T extends 
    * @param scanCompOp
    */
   public static void setScanCompOp(ComparisonOperator scanCompOp) {
-	DynamoDBQuery.scanCompOp = scanCompOp;
+    DynamoDBQuery.scanCompOp = scanCompOp;
   }
 	
   /**
@@ -369,9 +368,9 @@ public class DynamoDBQuery<K, T extends 
    * @return
    */
   public static ComparisonOperator getRangeCompOp(){
-	 if (rangeCompOp == null)
-		rangeCompOp = ComparisonOperator.BETWEEN;
-	return rangeCompOp;
+    if (rangeCompOp == null)
+      rangeCompOp = ComparisonOperator.BETWEEN;
+    return rangeCompOp;
   }
 	
   /**
@@ -379,6 +378,6 @@ public class DynamoDBQuery<K, T extends 
    * @param pRangeCompOp
    */
   public static void setRangeCompOp(ComparisonOperator pRangeCompOp){
-	rangeCompOp = pRangeCompOp;
+    rangeCompOp = pRangeCompOp;
   }
 }

Modified: gora/branches/goraamazon/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/query/DynamoDBResult.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/query/DynamoDBResult.java?rev=1392402&r1=1392401&r2=1392402&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/query/DynamoDBResult.java (original)
+++ gora/branches/goraamazon/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/query/DynamoDBResult.java Mon Oct  1 15:41:47 2012
@@ -50,8 +50,8 @@ public class DynamoDBResult<K, T extends
    * @param objList		Objects obtained from querying
    */
   public DynamoDBResult(DataStore<K, T> dataStore, Query<K, T> query, List<T> objList) {
-	super(dataStore, query);
-	LOG.debug("DynamoDB result created.");
+    super(dataStore, query);
+    LOG.debug("DynamoDB result created.");
     this.setResultSet(objList);
   }
 
@@ -68,24 +68,24 @@ public class DynamoDBResult<K, T extends
    * Gets the items reading progress
    */
   public float getProgress() throws IOException, InterruptedException, Exception {
-	if (this.limit <= 0 || this.offset <= 0)
-		return 0;
-	return this.limit/this.offset;
+    if (this.limit <= 0 || this.offset <= 0)
+      return 0;
+    return this.limit/this.offset;
   }
 
   /**
    * Gets the next item
    */
   protected boolean nextInner() throws Exception {
-	if (offset < 0 || offset > ( dynamoDBResultSet.size() - 1))
-		return false;
-	persistent = dynamoDBResultSet.get((int) this.offset);
-	return true;
+    if (offset < 0 || offset > ( dynamoDBResultSet.size() - 1))
+      return false;
+    persistent = dynamoDBResultSet.get((int) this.offset);
+    return true;
   }
 
   @Override
   public void close() throws IOException {
-	// TODO Auto-generated method stub
+  // TODO Auto-generated method stub
   }
 
 }

Modified: gora/branches/goraamazon/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/store/DynamoDBStore.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/store/DynamoDBStore.java?rev=1392402&r1=1392401&r2=1392402&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/store/DynamoDBStore.java (original)
+++ gora/branches/goraamazon/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/store/DynamoDBStore.java Mon Oct  1 15:41:47 2012
@@ -158,22 +158,22 @@ public class DynamoDBStore<K, T extends 
    * setting the client's properties up, setting the end point and reading the mapping file  
    */
   public void initialize(Class<K> keyClass, Class<T> pPersistentClass,
-	     Properties properties) throws Exception {
-	 try {
-		 LOG.debug("Initializing DynamoDB store");
-		 getCredentials();
-		 setWsProvider(wsProvider);
-		 preferredSchema = properties.getProperty(PREF_SCH_NAME);
-		 dynamoDBClient = getClient(properties.getProperty(CLI_TYP_PROP),(AWSCredentials)getConf());
-		 dynamoDBClient.setEndpoint(properties.getProperty(ENDPOINT_PROP));
-		 mapping = readMapping();
-		 consistency = properties.getProperty(CONSISTENCY_READS);
-		 persistentClass = pPersistentClass;
-	 }
-	 catch (Exception e) {
-		 LOG.error("Error while initializing DynamoDB store");
-	     throw new IOException(e.getMessage(), e);
-	 }
+       Properties properties) throws Exception {
+    try {
+      LOG.debug("Initializing DynamoDB store");
+      getCredentials();
+      setWsProvider(wsProvider);
+      preferredSchema = properties.getProperty(PREF_SCH_NAME);
+      dynamoDBClient = getClient(properties.getProperty(CLI_TYP_PROP),(AWSCredentials)getConf());
+      dynamoDBClient.setEndpoint(properties.getProperty(ENDPOINT_PROP));
+      mapping = readMapping();
+      consistency = properties.getProperty(CONSISTENCY_READS);
+      persistentClass = pPersistentClass;
+    }
+    catch (Exception e) {
+      LOG.error("Error while initializing DynamoDB store");
+      throw new IOException(e.getMessage(), e);
+    }
   }
   
    /**
@@ -183,11 +183,11 @@ public class DynamoDBStore<K, T extends 
     * @return
     */
   public AmazonDynamoDB getClient(String clientType, AWSCredentials credentials){
-	  if (clientType.equals("sync"))
-		  return new AmazonDynamoDBClient(credentials);
-	  if (clientType.equals("async"))
-		  return new AmazonDynamoDBAsyncClient(credentials);
-	  return null;
+    if (clientType.equals("sync"))
+      return new AmazonDynamoDBClient(credentials);
+    if (clientType.equals("async"))
+      return new AmazonDynamoDBAsyncClient(credentials);
+    return null;
   }
   
   /**
@@ -210,28 +210,28 @@ public class DynamoDBStore<K, T extends 
       List<Element> tableElements = root.getChildren("table");
       for(Element tableElement : tableElements) {
     	  
-    	String tableName = tableElement.getAttributeValue("name");
-    	long readCapacUnits = Long.parseLong(tableElement.getAttributeValue("readcunit"));
-    	long writeCapacUnits = Long.parseLong(tableElement.getAttributeValue("readcunit"));
+        String tableName = tableElement.getAttributeValue("name");
+        long readCapacUnits = Long.parseLong(tableElement.getAttributeValue("readcunit"));
+        long writeCapacUnits = Long.parseLong(tableElement.getAttributeValue("readcunit"));
     	
-    	mappingBuilder.setTableName(tableName);
-    	mappingBuilder.setProvisionedThroughput(tableName, readCapacUnits, writeCapacUnits);
-    	LOG.debug("Basic table properties have been set: Name, and Provisioned throughput.");
+        mappingBuilder.setTableName(tableName);
+        mappingBuilder.setProvisionedThroughput(tableName, readCapacUnits, writeCapacUnits);
+        LOG.debug("Basic table properties have been set: Name, and Provisioned throughput.");
     	
-    	// Retrieving key's features
-    	List<Element> fieldElements = tableElement.getChildren("key");
-    	for(Element fieldElement : fieldElements) {
-    		String keyName  = fieldElement.getAttributeValue("name");
-    		String keyType  = fieldElement.getAttributeValue("type");
-    		String keyAttrType  = fieldElement.getAttributeValue("att-type");
-    		if(keyType.equals("hash"))
-    			mappingBuilder.setHashKeySchema(tableName, keyName, keyAttrType);
-    		else if(keyType.equals("hashrange"))
-    			mappingBuilder.setHashRangeKeySchema(tableName, keyName, keyAttrType);
-    	}
-    	LOG.debug("Table key schemas have been set.");
+        // Retrieving key's features
+        List<Element> fieldElements = tableElement.getChildren("key");
+        for(Element fieldElement : fieldElements) {
+          String keyName  = fieldElement.getAttributeValue("name");
+          String keyType  = fieldElement.getAttributeValue("type");
+          String keyAttrType  = fieldElement.getAttributeValue("att-type");
+          if(keyType.equals("hash"))
+            mappingBuilder.setHashKeySchema(tableName, keyName, keyAttrType);
+          else if(keyType.equals("hashrange"))
+            mappingBuilder.setHashRangeKeySchema(tableName, keyName, keyAttrType);
+        }
+        LOG.debug("Table key schemas have been set.");
     	
-    	// Retrieving attributes
+        // Retrieving attributes
         fieldElements = tableElement.getChildren("attribute");
         for(Element fieldElement : fieldElements) {
           String attributeName  = fieldElement.getAttributeValue("name");
@@ -265,14 +265,14 @@ public class DynamoDBStore<K, T extends 
   private AWSCredentials getCredentials() throws FileNotFoundException, 
     IllegalArgumentException, IOException {
     
-	if(authentication == null){
-	  InputStream awsCredInpStr = getClass().getClassLoader().getResourceAsStream(awsCredentialsProperties);
+  if(authentication == null){
+    InputStream awsCredInpStr = getClass().getClassLoader().getResourceAsStream(awsCredentialsProperties);
       if (awsCredInpStr == null)
         LOG.info("AWS Credentials File was not found on the classpath!");
       AWSCredentials credentials = new PropertiesCredentials(awsCredInpStr);
       setConf(credentials);
-	}
-	return (AWSCredentials)authentication;
+  }
+  return (AWSCredentials)authentication;
   }
 
   /**
@@ -281,15 +281,15 @@ public class DynamoDBStore<K, T extends 
    * @return	DynamoDBQuery 
    */
   private DynamoDBQuery<K, T> buildDynamoDBQuery(Query<K, T> query){
-	  if(getSchemaName() == null) throw new IllegalStateException("There is not a preferred schema defined.");
-	  
-	  DynamoDBQuery<K, T> dynamoDBQuery = new DynamoDBQuery<K, T>();
-	  dynamoDBQuery.setKeySchema(mapping.getKeySchema(getSchemaName()));
-	  dynamoDBQuery.setQuery(query);
-	  dynamoDBQuery.setConsistencyReadLevel(getConsistencyReads());
-	  dynamoDBQuery.buildExpression();
-	  
-	  return dynamoDBQuery;
+    if(getSchemaName() == null) throw new IllegalStateException("There is not a preferred schema defined.");
+    
+      DynamoDBQuery<K, T> dynamoDBQuery = new DynamoDBQuery<K, T>();
+      dynamoDBQuery.setKeySchema(mapping.getKeySchema(getSchemaName()));
+      dynamoDBQuery.setQuery(query);
+      dynamoDBQuery.setConsistencyReadLevel(getConsistencyReads());
+      dynamoDBQuery.buildExpression();
+    
+      return dynamoDBQuery;
   }
   
   /**
@@ -297,10 +297,10 @@ public class DynamoDBStore<K, T extends 
    * @return True for strong consistency or false for eventual consistent reads
    */
   private boolean getConsistencyReads(){
-	  if(consistency != null)
-		  if(consistency.equals("true")) 
-			  return true;
-	  return false;
+    if(consistency != null)
+      if(consistency.equals("true")) 
+        return true;
+    return false;
   }
   
   /**
@@ -308,14 +308,14 @@ public class DynamoDBStore<K, T extends 
    */
   @Override
   public Result<K, T> execute(Query<K, T> query) throws Exception {
-	 DynamoDBQuery<K, T> dynamoDBQuery = buildDynamoDBQuery(query);
-	 DynamoDBMapper mapper = new DynamoDBMapper(dynamoDBClient);
-	 List<T> objList = null;
-	 if (DynamoDBQuery.getType().equals(DynamoDBQuery.RANGE_QUERY))
-		 objList = mapper.query(persistentClass, (DynamoDBQueryExpression)dynamoDBQuery.getQueryExpression());
-	 if (DynamoDBQuery.getType().equals(DynamoDBQuery.SCAN_QUERY))
-		 objList = mapper.scan(persistentClass, (DynamoDBScanExpression)dynamoDBQuery.getQueryExpression());
-	 return new DynamoDBResult<K, T>(this, query, objList);  
+    DynamoDBQuery<K, T> dynamoDBQuery = buildDynamoDBQuery(query);
+    DynamoDBMapper mapper = new DynamoDBMapper(dynamoDBClient);
+    List<T> objList = null;
+    if (DynamoDBQuery.getType().equals(DynamoDBQuery.RANGE_QUERY))
+      objList = mapper.query(persistentClass, (DynamoDBQueryExpression)dynamoDBQuery.getQueryExpression());
+      if (DynamoDBQuery.getType().equals(DynamoDBQuery.SCAN_QUERY))
+        objList = mapper.scan(persistentClass, (DynamoDBScanExpression)dynamoDBQuery.getQueryExpression());
+        return new DynamoDBResult<K, T>(this, query, objList);  
   }
   
   @Override
@@ -328,7 +328,7 @@ public class DynamoDBStore<K, T extends 
     Result<K,T> result = execute(query);
     boolean hasResult = result.next();
     return hasResult ? result.get() : null;*/
-	  return null;
+    return null;
   }
 
   /**
@@ -345,9 +345,9 @@ public class DynamoDBStore<K, T extends 
       else
         object = mapper.load(persistentClass, hashKey);
     }
-	else
+    else
       throw new GoraException("Error while retrieving keys from object: " + key.toString());
-	return object;
+    return object;
   }
     
   /**
@@ -363,9 +363,9 @@ public class DynamoDBStore<K, T extends 
    * Gets the preferred schema
    */
   public String getSchemaName() {
-	if (preferredSchema != null)
-		return preferredSchema;
-	return null;
+    if (preferredSchema != null)
+      return preferredSchema;
+    return null;
   }
   
   /**
@@ -373,7 +373,7 @@ public class DynamoDBStore<K, T extends 
    * @param pSchemaName
    */
   public void setSchemaName(String pSchemaName){
-	  preferredSchema = pSchemaName;
+    preferredSchema = pSchemaName;
   }
   
   /**
@@ -381,19 +381,19 @@ public class DynamoDBStore<K, T extends 
    * for a group of schemas defined withing the mapping file
    */
   public void createSchema() throws Exception {
-	  LOG.info("Creating schema");
-	  if (mapping.getTables().isEmpty())	throw new IllegalStateException("There are not tables defined.");
-	  if (preferredSchema == null){
-		  LOG.debug("create schemas");
-		  // read the mapping object
-		  for(String tableName : mapping.getTables().keySet())
-			  executeCreateTableRequest(tableName);
-		  LOG.debug("tables created successfully.");
-	  }
-	  else{
-		  LOG.debug("create schema " + preferredSchema);
-		  executeCreateTableRequest(preferredSchema);
-	  }
+    LOG.info("Creating schema");
+    if (mapping.getTables().isEmpty())	throw new IllegalStateException("There are not tables defined.");
+    if (preferredSchema == null){
+      LOG.debug("create schemas");
+      // read the mapping object
+      for(String tableName : mapping.getTables().keySet())
+        executeCreateTableRequest(tableName);
+        LOG.debug("tables created successfully.");
+    }
+    else{
+      LOG.debug("create schema " + preferredSchema);
+      executeCreateTableRequest(preferredSchema);
+    }
   }
   
   /**
@@ -402,14 +402,13 @@ public class DynamoDBStore<K, T extends 
    * @param tableName
    */
   private void executeCreateTableRequest(String tableName){
-	  CreateTableRequest createTableRequest = getCreateTableRequest(tableName,
-				mapping.getKeySchema(tableName), 
-				mapping.getProvisionedThroughput(tableName));
-	  // use the client to perform the request
-	  dynamoDBClient.createTable(createTableRequest).getTableDescription();
-	  // wait for table to become active
-	  waitForTableToBecomeAvailable(tableName);
-	  LOG.info(tableName + "Schema now available");
+    CreateTableRequest createTableRequest = getCreateTableRequest(tableName,
+      mapping.getKeySchema(tableName), mapping.getProvisionedThroughput(tableName));
+    // use the client to perform the request
+    dynamoDBClient.createTable(createTableRequest).getTableDescription();
+    // wait for table to become active
+    waitForTableToBecomeAvailable(tableName);
+    LOG.info(tableName + "Schema now available");
   }
   
   /**
@@ -420,11 +419,11 @@ public class DynamoDBStore<K, T extends 
    * @return
    */
   private CreateTableRequest getCreateTableRequest(String tableName, KeySchema keySchema, ProvisionedThroughput proThrou){
-	  CreateTableRequest createTableRequest = new CreateTableRequest();
-	  createTableRequest.setTableName(tableName);
-	  createTableRequest.setKeySchema(keySchema);
-	  createTableRequest.setProvisionedThroughput(proThrou);
-	  return createTableRequest;
+    CreateTableRequest createTableRequest = new CreateTableRequest();
+    createTableRequest.setTableName(tableName);
+    createTableRequest.setKeySchema(keySchema);
+    createTableRequest.setProvisionedThroughput(proThrou);
+    return createTableRequest;
   }
   
   /**
@@ -439,11 +438,11 @@ public class DynamoDBStore<K, T extends 
       for(String tableName : mapping.getTables().keySet())
         executeDeleteTableRequest(tableName);
         LOG.debug("All schemas deleted successfully.");
-	  }
+    }
       else{
         LOG.debug("create schema " + preferredSchema);
         executeDeleteTableRequest(preferredSchema);
-	  }
+    }
   }
   
   /**
@@ -460,7 +459,7 @@ public class DynamoDBStore<K, T extends 
     catch(Exception e){
       LOG.debug("Schema: " + pTableName + " deleted.");
       e.printStackTrace();
-	}
+    }
   }
 
   /**
@@ -515,13 +514,13 @@ public class DynamoDBStore<K, T extends 
    */
   public boolean schemaExists() throws Exception {
     LOG.info("Verifying schemas.");
-	TableDescription success = null;
-	if (mapping.getTables().isEmpty())	throw new IllegalStateException("There are not tables defined.");
-	if (preferredSchema == null){
-	  LOG.debug("Verifying schemas");
-	  if (mapping.getTables().isEmpty())	throw new IllegalStateException("There are not tables defined.");
-	  // read the mapping object
-	  for(String tableName : mapping.getTables().keySet()){
+  TableDescription success = null;
+  if (mapping.getTables().isEmpty())	throw new IllegalStateException("There are not tables defined.");
+  if (preferredSchema == null){
+    LOG.debug("Verifying schemas");
+    if (mapping.getTables().isEmpty())	throw new IllegalStateException("There are not tables defined.");
+    // read the mapping object
+    for(String tableName : mapping.getTables().keySet()){
         success = getTableSchema(tableName);
         if (success == null) return false;
       }
@@ -529,7 +528,7 @@ public class DynamoDBStore<K, T extends 
     else{
       LOG.info("Verifying schema " + preferredSchema);
       success = getTableSchema(preferredSchema);
-	}
+  }
     LOG.info("Finished verifying schemas.");
     return (success != null)? true: false;
   }
@@ -540,51 +539,50 @@ public class DynamoDBStore<K, T extends 
    * @return
    */
   private TableDescription getTableSchema(String tableName){
-	TableDescription tableDescription = null;
+    TableDescription tableDescription = null;
   	try{
       DescribeTableRequest describeTableRequest = new DescribeTableRequest().withTableName(tableName);
       tableDescription = dynamoDBClient.describeTable(describeTableRequest).getTable();
     }
-  	catch(ResourceNotFoundException e){
-  	  LOG.error("Error while getting table schema: " + tableName);
+    catch(ResourceNotFoundException e){
+      LOG.error("Error while getting table schema: " + tableName);
       return tableDescription;
     }
-  	return tableDescription;
+    return tableDescription;
   }
   
   public K newKey() throws Exception {
-	// TODO Auto-generated method stub
-	return null;
+    // TODO Auto-generated method stub
+    return null;
   }
 
   /**
    * Returns a new persistent object
    */
   public T newPersistent() throws Exception {
-	T obj = persistentClass.newInstance();
-	return obj;
+    T obj = persistentClass.newInstance();
+    return obj;
   }
 
   /**
    * Puts an object identified by a key
    */
   public void put(K key, T obj) throws Exception {
-	try{
-	  Object rangeKey = getRangeKey(key);
-	  Object hashKey = getHashKey(key);
+    try{
+      Object rangeKey = getRangeKey(key);
+      Object hashKey = getHashKey(key);
       // if the key does not have these attributes then try to get them from the object
       if (hashKey == null)
         hashKey = getHashKey(obj);
       if (rangeKey == null)
-	    rangeKey = getRangeKey(obj);
-	
+        rangeKey = getRangeKey(obj);
       if (hashKey != null){
         DynamoDBMapper mapper = new DynamoDBMapper(dynamoDBClient);
         if (rangeKey != null)
-	      mapper.load(persistentClass, hashKey.toString(), rangeKey.toString());
+          mapper.load(persistentClass, hashKey.toString(), rangeKey.toString());
         else
           mapper.load(persistentClass, hashKey.toString());
-        mapper.save(obj);
+          mapper.save(obj);
       }
       else
         throw new GoraException("Error while retrieving keys from object: " + obj.toString());
@@ -741,30 +739,29 @@ public class DynamoDBStore<K, T extends 
     return rangeKey;
   }
   
-  public List<PartitionQuery<K, T>> getPartitions(Query<K, T> query)
-		throws IOException {
-	// TODO Auto-generated method stub
-	return null;
+  public List<PartitionQuery<K, T>> getPartitions(Query<K, T> query) throws IOException {
+    // TODO Auto-generated method stub
+    return null;
   }
 
   public void flush() throws Exception {
-	// TODO Auto-generated method stub
+    // TODO Auto-generated method stub
   }
 
   public void setBeanFactory(BeanFactory<K, T> beanFactory) {
-	// TODO Auto-generated method stub
+    // TODO Auto-generated method stub
   }
 
   public BeanFactory<K, T> getBeanFactory() {
-	// TODO Auto-generated method stub
-	return null;
+    // TODO Auto-generated method stub
+    return null;
   }
 
   /**
    * Closes the data store.
    */
   public void close() throws IOException, InterruptedException, Exception {
-	  LOG.debug("Datastore closed.");
-	  flush();
+    LOG.debug("Datastore closed.");
+    flush();
   }
 }

Modified: gora/branches/goraamazon/gora-dynamodb/src/test/java/org/apache/gora/dynamodb/GoraDynamoDBTestDriver.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-dynamodb/src/test/java/org/apache/gora/dynamodb/GoraDynamoDBTestDriver.java?rev=1392402&r1=1392401&r2=1392402&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-dynamodb/src/test/java/org/apache/gora/dynamodb/GoraDynamoDBTestDriver.java (original)
+++ gora/branches/goraamazon/gora-dynamodb/src/test/java/org/apache/gora/dynamodb/GoraDynamoDBTestDriver.java Mon Oct  1 15:41:47 2012
@@ -77,18 +77,18 @@ public class GoraDynamoDBTestDriver exte
    */
   public GoraDynamoDBTestDriver() {
     super(DynamoDBStore.class);
-	try {
-	  AWSCredentials credentials;
-	  File file = new File(awsCredentialsPath + awsCredentialsFile);
-	  credentials = new PropertiesCredentials(file);
-	  auth = credentials;
-	} catch (FileNotFoundException e) {
-	  e.printStackTrace();
-	} catch (IllegalArgumentException e) {
-	  e.printStackTrace();
-	} catch (IOException e) {
-	  e.printStackTrace();
-	}
+    try {
+      AWSCredentials credentials;
+      File file = new File(awsCredentialsPath + awsCredentialsFile);
+      credentials = new PropertiesCredentials(file);
+      auth = credentials;
+    } catch (FileNotFoundException e) {
+      e.printStackTrace();
+    } catch (IllegalArgumentException e) {
+      e.printStackTrace();
+    } catch (IOException e) {
+      e.printStackTrace();
+    }
   }
 
   /**
@@ -118,7 +118,7 @@ public class GoraDynamoDBTestDriver exte
   protected DataStore<DynamoDBKey, person> createDataStore() throws IOException {
     if(personStore == null)
       personStore = WSDataStoreFactory.createDataStore(DynamoDBStore.class, 
-    		  DynamoDBKey.class,person.class, auth);
+        DynamoDBKey.class,person.class, auth);
       return personStore;
   }
   
@@ -128,10 +128,9 @@ public class GoraDynamoDBTestDriver exte
   @SuppressWarnings("unchecked")
   public<K, T extends Persistent> DataStore<K,T>
     createDataStore(Class<K> keyClass, Class<T> persistentClass) throws GoraException {
-	personStore = (DynamoDBStore<DynamoDBKey, person>) WSDataStoreFactory.createDataStore(
+      personStore = (DynamoDBStore<DynamoDBKey, person>) WSDataStoreFactory.createDataStore(
         (Class<? extends DataStore<K,T>>)dataStoreClass, keyClass, persistentClass, auth);
-    dataStores.add(personStore);
-
+      dataStores.add(personStore);
     return (DataStore<K, T>) personStore;
   }
   
@@ -140,15 +139,15 @@ public class GoraDynamoDBTestDriver exte
    * @return
    */
   public DataStore<DynamoDBKey, person> getDataStore(){
-	try {
-	  if(personStore != null)
-	    return personStore;
-	  else
-		return createDataStore();
-	} catch (IOException e) {
-		e.printStackTrace();
-		return null;
-	}
+    try {
+      if(personStore != null)
+        return personStore;
+      else
+        return createDataStore();
+    } catch (IOException e) {
+      e.printStackTrace();
+      return null;
+    }
   }
 
   /**
@@ -172,7 +171,7 @@ public class GoraDynamoDBTestDriver exte
    * @return
    */
   public Object getAuth() {
-      return auth;
+    return auth;
   }
   
   /**
@@ -189,16 +188,16 @@ public class GoraDynamoDBTestDriver exte
    * @return
    */
   public TableDescription checkResource(String tableName){
-  	TableDescription tableDescription = null;
+    TableDescription tableDescription = null;
   	
-  	try{
-  		DescribeTableRequest describeTableRequest = new DescribeTableRequest().withTableName(tableName);
-  		tableDescription = dynamoDBClient.describeTable(describeTableRequest).getTable();
-  	}
-  	catch(ResourceNotFoundException e){
-  		tableDescription = null;
-  	}
+    try{
+      DescribeTableRequest describeTableRequest = new DescribeTableRequest().withTableName(tableName);
+      tableDescription = dynamoDBClient.describeTable(describeTableRequest).getTable();
+    }
+    catch(ResourceNotFoundException e){
+      tableDescription = null;
+    }
       
-  	return tableDescription;
+    return tableDescription;
   }
 }
\ No newline at end of file

Modified: gora/branches/goraamazon/gora-dynamodb/src/test/java/org/apache/gora/dynamodb/TestDynamoDBStore.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-dynamodb/src/test/java/org/apache/gora/dynamodb/TestDynamoDBStore.java?rev=1392402&r1=1392401&r2=1392402&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-dynamodb/src/test/java/org/apache/gora/dynamodb/TestDynamoDBStore.java (original)
+++ gora/branches/goraamazon/gora-dynamodb/src/test/java/org/apache/gora/dynamodb/TestDynamoDBStore.java Mon Oct  1 15:41:47 2012
@@ -38,6 +38,9 @@ import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import com.amazonaws.services.dynamodb.model.ComparisonOperator;
 
 /**
@@ -45,6 +48,8 @@ import com.amazonaws.services.dynamodb.m
  */
 public class TestDynamoDBStore extends WSDataStoreTestBase<DynamoDBKey, person> {
 
+  public static final Logger log = LoggerFactory.getLogger(TestDynamoDBStore.class);
+
   static {
     setTestDriver(new GoraDynamoDBTestDriver());
   }
@@ -61,64 +66,64 @@ public class TestDynamoDBStore extends W
   }
   
 //============================================================================
- //We need to skip the following tests for a while until we fix some issues..
- @Override
- public void testQueryStartKey() throws IOException {
-   log.info("test method: TestQueryStartKey SKIPPED.");
- }
- @Override
- public void testQueryEndKey() throws IOException {
-   log.info("test method: TestQueryEndKey SKIPPED.");
- }
- @Override
- public void testDeleteByQueryFields() throws IOException {
-   log.info("test method: TestDeleteByQueryFields SKIPPED.");
- }
- @Override
- public void testNewInstance() throws IOException, Exception {
-   log.info("test method: TestNewInstance SKIPPED.");
- } 
- @Override
- public void testAutoCreateSchema() throws Exception {
-   log.info("test method: TestAutoCreateSchema SKIPPED.");
- }
- @Override
- public void testTruncateSchema() throws Exception {
-   log.info("test method: TestTruncateSchema SKIPPED.");
- }
- @Override
- public void testPutNested() throws IOException, Exception {
-   log.info("test method: TestPutNested SKIPPED.");
- }
- @Override
- public void testPutArray() throws IOException, Exception {
-   log.info("test method: TestPutArray SKIPPED.");
- }
- @Override
- public void testPutBytes() throws IOException, Exception {
-   log.info("test method: TestPutBytes SKIPPED."); 
- }
- @Override
- public void testPutMap() throws IOException, Exception {
-   log.info("test method: TestPutMap SKIPPED.");
- }
- @Override
- public void testEmptyUpdate() throws IOException, Exception {
-   log.info("test method: TestEmptyUpdate SKIPPED."); 
- }
- @Override
- public void testDeleteSchema() throws IOException, Exception {
-   log.info("test method: TestDeleteSchema SKIPPED.");
- }
- @Override
- public void testGetWithFields() throws IOException, Exception {
-   log.info("test method: TestGetWithFields SKIPPED."); 
- }
+  //We need to skip the following tests for a while until we fix some issues..
+  @Override
+  public void testQueryStartKey() throws IOException {
+    log.info("test method: TestQueryStartKey SKIPPED.");
+  }
+  @Override
+  public void testQueryEndKey() throws IOException {
+    log.info("test method: TestQueryEndKey SKIPPED.");
+  }
+  @Override
+  public void testDeleteByQueryFields() throws IOException {
+    log.info("test method: TestDeleteByQueryFields SKIPPED.");
+  }
+  @Override
+  public void testNewInstance() throws IOException, Exception {
+    log.info("test method: TestNewInstance SKIPPED.");
+  } 
+  @Override
+  public void testAutoCreateSchema() throws Exception {
+    log.info("test method: TestAutoCreateSchema SKIPPED.");
+  }
+  @Override
+  public void testTruncateSchema() throws Exception {
+    log.info("test method: TestTruncateSchema SKIPPED.");
+  }
+  @Override
+  public void testPutNested() throws IOException, Exception {
+    log.info("test method: TestPutNested SKIPPED.");
+  }
+  @Override
+  public void testPutArray() throws IOException, Exception {
+    log.info("test method: TestPutArray SKIPPED.");
+  }
+  @Override
+  public void testPutBytes() throws IOException, Exception {
+    log.info("test method: TestPutBytes SKIPPED."); 
+  }
+  @Override
+  public void testPutMap() throws IOException, Exception {
+    log.info("test method: TestPutMap SKIPPED.");
+  }
+  @Override
+  public void testEmptyUpdate() throws IOException, Exception {
+    log.info("test method: TestEmptyUpdate SKIPPED."); 
+  }
+  @Override
+  public void testDeleteSchema() throws IOException, Exception {
+    log.info("test method: TestDeleteSchema SKIPPED.");
+  }
+  @Override
+  public void testGetWithFields() throws IOException, Exception {
+    log.info("test method: TestGetWithFields SKIPPED."); 
+  }
 //============================================================================
- 
- /**
-  * Tests deleting items using a query
-  */
+  
+  /**
+   * Tests deleting items using a query
+   */
   @Override
   public void assertTestDeleteByQueryDataStore(){
     try {
@@ -136,10 +141,10 @@ public class TestDynamoDBStore extends W
       Query<DynamoDBKey, person> query = new DynamoDBQuery<DynamoDBKey, person>();
       query.setKey(dKey);
       log.info("Number of records deleted: "+ dataStore.deleteByQuery(query));
-	} catch (Exception e) {
+    } catch (Exception e) {
       log.error("Error while running test: TestDeleteByQuery");
-	  e.printStackTrace();
-	}
+      e.printStackTrace();
+    }
   }
   
   /**
@@ -169,7 +174,7 @@ public class TestDynamoDBStore extends W
   public void assertDeleteSchema(){
     try {
       log.info("test method: TestDeleteSchema using DynamoDB store.");
-	  dataStore.deleteSchema();
+    dataStore.deleteSchema();
     } catch (Exception e) {
       log.error("error in test method: testDeleteSchema.");
       e.printStackTrace();
@@ -181,7 +186,7 @@ public class TestDynamoDBStore extends W
    */
   @Override
   public void assertSchemaExists(String schemaName) throws Exception {
-	log.info("test method: TestSchemaExists using DynamoDB store.");
+    log.info("test method: TestSchemaExists using DynamoDB store.");
     Assert.assertTrue(dataStore.schemaExists());
   }
 
@@ -202,7 +207,7 @@ public class TestDynamoDBStore extends W
       dataStore.put(dKey, p2);
     } catch (Exception e) {
       log.error("error in test method: testPut.");
-	  e.printStackTrace();
+    e.printStackTrace();
     }
   }
   
@@ -221,8 +226,8 @@ public class TestDynamoDBStore extends W
       query.setKey(dKey);
       Result<DynamoDBKey, person> queryResult = dataStore.execute(query);
       processQueryResult(queryResult);
-	} catch (Exception e) {
-	  log.error("error in test method: testQuery.");
+  } catch (Exception e) {
+    log.error("error in test method: testQuery.");
       e.printStackTrace();
     }
   }
@@ -232,26 +237,26 @@ public class TestDynamoDBStore extends W
    */
   @Override
   public void assertTestQueryKeyRange(){
-	log.info("test method: testQueryKeyRange using specific data store.");  
-	try {
-	  DynamoDBKey<String, String> dKey = new DynamoDBKey<String, String>();
-	  DynamoDBKey<String, String> startKey = new DynamoDBKey<String, String>();
-	  DynamoDBKey<String, String> endKey = new DynamoDBKey<String, String>();
-	  dKey.setHashKey("Peru");
+    log.info("test method: testQueryKeyRange using specific data store.");  
+    try {
+      DynamoDBKey<String, String> dKey = new DynamoDBKey<String, String>();
+      DynamoDBKey<String, String> startKey = new DynamoDBKey<String, String>();
+      DynamoDBKey<String, String> endKey = new DynamoDBKey<String, String>();
+      dKey.setHashKey("Peru");
       startKey.setRangeKey("01/01/1700");
-	  endKey.setRangeKey("31/12/1900");
-	  DynamoDBQuery.setRangeCompOp(ComparisonOperator.BETWEEN);
-	  DynamoDBQuery.setType(DynamoDBQuery.RANGE_QUERY);
-	  Query<DynamoDBKey, person> query = new DynamoDBQuery<DynamoDBKey, person>();
-	  query.setKey(dKey);
-	  query.setStartKey(startKey);
-	  query.setEndKey(endKey);
-	  Result<DynamoDBKey, person> queryResult = dataStore.execute(query);
-	  processQueryResult(queryResult);
-	} catch (Exception e) {
-	  log.error("error in test method: testQueryKeyRange.");
-	  e.printStackTrace();
-	}
+      endKey.setRangeKey("31/12/1900");
+      DynamoDBQuery.setRangeCompOp(ComparisonOperator.BETWEEN);
+      DynamoDBQuery.setType(DynamoDBQuery.RANGE_QUERY);
+      Query<DynamoDBKey, person> query = new DynamoDBQuery<DynamoDBKey, person>();
+      query.setKey(dKey);
+      query.setStartKey(startKey);
+      query.setEndKey(endKey);
+      Result<DynamoDBKey, person> queryResult = dataStore.execute(query);
+      processQueryResult(queryResult);
+    } catch (Exception e) {
+      log.error("error in test method: testQueryKeyRange.");
+      e.printStackTrace();
+    }
   }
   
   /**
@@ -259,21 +264,21 @@ public class TestDynamoDBStore extends W
    */
   @Override
   public void assertTestGetDataStore(){
-	log.info("test method: testGet using specific data store.");
-	try {
-	  DynamoDBKey<String, String> dKey = new DynamoDBKey<String, String>();
-	  dKey.setHashKey("USA");
-	  dKey.setRangeKey("10/10/1999");
-	  // insert item
-	  person p1 = buildPerson(dKey.getHashKey().toString(), dKey.getRangeKey().toString(), "Inca", "Atahualpa", "Peru", "Brazil", "Ecuador");
-	  dataStore.put(dKey, p1);
-	  // get item
-	  person p2 = dataStore.get(dKey);
-	  printPersonInfo(p2);
-	} catch (Exception e) {
-	  log.error("error in test method: testGetDataStore.");
-	  e.printStackTrace();
-	}
+    log.info("test method: testGet using specific data store.");
+    try {
+      DynamoDBKey<String, String> dKey = new DynamoDBKey<String, String>();
+      dKey.setHashKey("USA");
+      dKey.setRangeKey("10/10/1999");
+      // insert item
+      person p1 = buildPerson(dKey.getHashKey().toString(), dKey.getRangeKey().toString(), "Inca", "Atahualpa", "Peru", "Brazil", "Ecuador");
+      dataStore.put(dKey, p1);
+      // get item
+      person p2 = dataStore.get(dKey);
+      printPersonInfo(p2);
+    } catch (Exception e) {
+      log.error("error in test method: testGetDataStore.");
+      e.printStackTrace();
+    }
   }
   
   /**
@@ -281,8 +286,8 @@ public class TestDynamoDBStore extends W
    */
   @Override
   public void assertTestDeleteDataStore() {
-	log.info("test method: testDelete by key");
-	try {
+    log.info("test method: testDelete by key");
+    try {
       DynamoDBKey<String, String> dKey = new DynamoDBKey<String, String>();
       dKey.setHashKey("Brazil");
       dKey.setRangeKey("10/10/1985");
@@ -298,7 +303,7 @@ public class TestDynamoDBStore extends W
     }catch (Exception e) {
       log.error("error in test method: testDeleteDataStore.");
       e.printStackTrace();
-	}
+  }
   }
   
   /**
@@ -362,10 +367,10 @@ public class TestDynamoDBStore extends W
    */
   private void printPersonInfo(person pPerson){
     System.out.println(	"Origin:\t" + pPerson.getHashKey() +
-		  				"\n Birthday:\t" + pPerson.getRangeKey() +
-		  				"\n FirstName:" + pPerson.getFirstName() +
-		  				"\n LastName:" + pPerson.getLastName() + 
-		  				"\n Visited Places:");
+    "\n Birthday:\t" + pPerson.getRangeKey() +
+    "\n FirstName:" + pPerson.getFirstName() +
+    "\n LastName:" + pPerson.getLastName() + 
+    "\n Visited Places:");
     for(String place : pPerson.getVisitedplaces())
       System.out.println("\t" + place);
   }

Modified: gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/query/SqlQuery.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/query/SqlQuery.java?rev=1392402&r1=1392401&r2=1392402&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/query/SqlQuery.java (original)
+++ gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/query/SqlQuery.java Mon Oct  1 15:41:47 2012
@@ -18,7 +18,6 @@
 
 package org.apache.gora.sql.query;
 
-import org.apache.gora.persistency.Persistent;
 import org.apache.gora.persistency.impl.PersistentBase;
 import org.apache.gora.query.impl.QueryBase;
 import org.apache.gora.sql.store.SqlStore;

Modified: gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/query/SqlResult.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/query/SqlResult.java?rev=1392402&r1=1392401&r2=1392402&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/query/SqlResult.java (original)
+++ gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/query/SqlResult.java Mon Oct  1 15:41:47 2012
@@ -22,7 +22,6 @@ import java.io.IOException;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 
-import org.apache.gora.persistency.Persistent;
 import org.apache.gora.persistency.impl.PersistentBase;
 import org.apache.gora.query.Query;
 import org.apache.gora.query.impl.ResultBase;

Modified: gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/statement/HSqlInsertUpdateStatement.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/statement/HSqlInsertUpdateStatement.java?rev=1392402&r1=1392401&r2=1392402&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/statement/HSqlInsertUpdateStatement.java (original)
+++ gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/statement/HSqlInsertUpdateStatement.java Mon Oct  1 15:41:47 2012
@@ -23,7 +23,6 @@ import java.sql.PreparedStatement;
 import java.sql.SQLException;
 import java.util.Map.Entry;
 
-import org.apache.gora.persistency.Persistent;
 import org.apache.gora.persistency.impl.PersistentBase;
 import org.apache.gora.sql.store.Column;
 import org.apache.gora.sql.store.SqlMapping;

Modified: gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/statement/InsertUpdateStatement.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/statement/InsertUpdateStatement.java?rev=1392402&r1=1392401&r2=1392402&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/statement/InsertUpdateStatement.java (original)
+++ gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/statement/InsertUpdateStatement.java Mon Oct  1 15:41:47 2012
@@ -24,7 +24,6 @@ import java.util.SortedMap;
 import java.util.TreeMap;
 
 import org.apache.avro.Schema;
-import org.apache.gora.persistency.Persistent;
 import org.apache.gora.persistency.impl.PersistentBase;
 import org.apache.gora.sql.store.Column;
 import org.apache.gora.sql.store.SqlMapping;

Modified: gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/statement/MySqlInsertUpdateStatement.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/statement/MySqlInsertUpdateStatement.java?rev=1392402&r1=1392401&r2=1392402&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/statement/MySqlInsertUpdateStatement.java (original)
+++ gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/statement/MySqlInsertUpdateStatement.java Mon Oct  1 15:41:47 2012
@@ -24,7 +24,6 @@ import java.sql.SQLException;
 import java.util.Map.Entry;
 
 import org.apache.avro.Schema;
-import org.apache.gora.persistency.Persistent;
 import org.apache.gora.persistency.impl.PersistentBase;
 import org.apache.gora.sql.store.Column;
 import org.apache.gora.sql.store.SqlMapping;

Modified: gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/store/SqlStore.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/store/SqlStore.java?rev=1392402&r1=1392401&r2=1392402&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/store/SqlStore.java (original)
+++ gora/branches/goraamazon/gora-sql/src/main/java/org/apache/gora/sql/store/SqlStore.java Mon Oct  1 15:41:47 2012
@@ -47,7 +47,6 @@ import org.apache.avro.specific.Specific
 import org.apache.avro.util.Utf8;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.apache.gora.persistency.Persistent;
 import org.apache.gora.persistency.StateManager;
 import org.apache.gora.persistency.impl.PersistentBase;
 import org.apache.gora.query.PartitionQuery;

Modified: gora/branches/goraamazon/gora-sql/src/test/java/org/apache/gora/sql/store/TestSqlStore.java
URL: http://svn.apache.org/viewvc/gora/branches/goraamazon/gora-sql/src/test/java/org/apache/gora/sql/store/TestSqlStore.java?rev=1392402&r1=1392401&r2=1392402&view=diff
==============================================================================
--- gora/branches/goraamazon/gora-sql/src/test/java/org/apache/gora/sql/store/TestSqlStore.java (original)
+++ gora/branches/goraamazon/gora-sql/src/test/java/org/apache/gora/sql/store/TestSqlStore.java Mon Oct  1 15:41:47 2012
@@ -40,6 +40,7 @@ public class TestSqlStore extends DataSt
   public TestSqlStore() {
   }
 
+  @SuppressWarnings("deprecation")
   @Override
   protected DataStore<String, Employee> createEmployeeDataStore() throws IOException {
     SqlStore<String, Employee> store = new SqlStore<String, Employee>();
@@ -47,6 +48,7 @@ public class TestSqlStore extends DataSt
     return store;
   }
 
+  @SuppressWarnings("deprecation")
   @Override
   protected DataStore<String, WebPage> createWebPageDataStore() throws IOException {
     SqlStore<String, WebPage> store = new SqlStore<String, WebPage>();



Mime
View raw message