gora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lewi...@apache.org
Subject [15/37] gora git commit: Add getPartitions Method
Date Wed, 23 Aug 2017 20:55:13 GMT
Add getPartitions Method


Project: http://git-wip-us.apache.org/repos/asf/gora/repo
Commit: http://git-wip-us.apache.org/repos/asf/gora/commit/4ebfabb1
Tree: http://git-wip-us.apache.org/repos/asf/gora/tree/4ebfabb1
Diff: http://git-wip-us.apache.org/repos/asf/gora/diff/4ebfabb1

Branch: refs/heads/master
Commit: 4ebfabb194c88fa10db51d6f2db6282a357ae15d
Parents: 163624a
Author: madhawa <madhawa30@gmail.com>
Authored: Sat Jul 8 11:54:05 2017 +0530
Committer: madhawa <madhawa30@gmail.com>
Committed: Sat Jul 8 11:54:05 2017 +0530

----------------------------------------------------------------------
 .../org/apache/gora/cassandra/store/CassandraStore.java     | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/gora/blob/4ebfabb1/gora-cassandra-cql/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java
----------------------------------------------------------------------
diff --git a/gora-cassandra-cql/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java
b/gora-cassandra-cql/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java
index e6cf373..8a100aa 100644
--- a/gora-cassandra-cql/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java
+++ b/gora-cassandra-cql/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java
@@ -25,12 +25,15 @@ import org.apache.gora.persistency.Persistent;
 import org.apache.gora.query.PartitionQuery;
 import org.apache.gora.query.Query;
 import org.apache.gora.query.Result;
+import org.apache.gora.query.impl.PartitionQueryImpl;
+import org.apache.gora.query.ws.impl.PartitionWSQueryImpl;
 import org.apache.gora.store.DataStore;
 import org.apache.gora.store.DataStoreFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Properties;
 
@@ -227,7 +230,11 @@ public class CassandraStore<K, T extends Persistent> implements
DataStore<K, T>
 
   @Override
   public List<PartitionQuery<K, T>> getPartitions(Query<K, T> query) throws
IOException {
-    return null;
+    List<PartitionQuery<K,T>> partitions = new ArrayList<>();
+    PartitionWSQueryImpl<K, T> pqi = new PartitionWSQueryImpl<>(query);
+    pqi.setDataStore(this);
+    partitions.add(pqi);
+    return partitions;
   }
 
   @Override


Mime
View raw message