gora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lewi...@apache.org
Subject svn commit: r1244777 - in /gora/trunk: CHANGES.txt gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java gora-core/src/main/java/org/apache/gora/store/impl/DataStoreBase.java
Date Wed, 15 Feb 2012 22:55:00 GMT
Author: lewismc
Date: Wed Feb 15 22:54:59 2012
New Revision: 1244777

URL: http://svn.apache.org/viewvc?rev=1244777&view=rev
Log:
commit to address GORA-93 and update to CHANGES.txt

Modified:
    gora/trunk/CHANGES.txt
    gora/trunk/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java
    gora/trunk/gora-core/src/main/java/org/apache/gora/store/impl/DataStoreBase.java

Modified: gora/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/gora/trunk/CHANGES.txt?rev=1244777&r1=1244776&r2=1244777&view=diff
==============================================================================
--- gora/trunk/CHANGES.txt (original)
+++ gora/trunk/CHANGES.txt Wed Feb 15 22:54:59 2012
@@ -2,6 +2,10 @@ Gora Change Log
 
 Trunk (unreleased changes):
 
+* GORA-93 [gora-cassandra] Add implementation of CassandraStore.get(key) (Sujit Pal via lewismc)
+
+* GORA-58 Upgrade Gora-Cassandra to use Cassandra 1.0.2 (lewismc)
+
 * GORA-80 Implement functionality to define consistency used for Cassandra read and 
 write operations. (lewismc)
 

Modified: gora/trunk/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java
URL: http://svn.apache.org/viewvc/gora/trunk/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java?rev=1244777&r1=1244776&r2=1244777&view=diff
==============================================================================
--- gora/trunk/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java
(original)
+++ gora/trunk/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java
Wed Feb 15 22:54:59 2012
@@ -223,7 +223,14 @@ public class CassandraStore<K, T extends
   @Override
   public T get(K key, String[] fields) throws IOException {
     LOG.info("get " + key);
-    return null;
+    CassandraQuery<K,T> query = new CassandraQuery<K,T>();
+    query.setDataStore(this);
+    query.setKeyRange(key, key);
+    query.setFields(fields);
+    query.setLimit(1);
+    Result<K,T> result = execute(query);
+    boolean hasResult = result.next();
+    return hasResult ? result.get() : null;
   }
 
   @Override

Modified: gora/trunk/gora-core/src/main/java/org/apache/gora/store/impl/DataStoreBase.java
URL: http://svn.apache.org/viewvc/gora/trunk/gora-core/src/main/java/org/apache/gora/store/impl/DataStoreBase.java?rev=1244777&r1=1244776&r2=1244777&view=diff
==============================================================================
--- gora/trunk/gora-core/src/main/java/org/apache/gora/store/impl/DataStoreBase.java (original)
+++ gora/trunk/gora-core/src/main/java/org/apache/gora/store/impl/DataStoreBase.java Wed Feb
15 22:54:59 2012
@@ -137,8 +137,8 @@ implements DataStore<K, T> {
   }
 
   @Override
-public T get(K key) throws IOException {
-    return get(key, null);
+  public T get(K key) throws IOException {
+    return get(key, getFieldsToQuery(null));
   };
 
   /**



Mime
View raw message