gora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject svn commit: r1363657 - in /gora/trunk: CHANGES.txt gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java
Date Fri, 20 Jul 2012 05:48:11 GMT
Author: kazk
Date: Fri Jul 20 05:48:11 2012
New Revision: 1363657

URL: http://svn.apache.org/viewvc?rev=1363657&view=rev
Log:
Fixes GORA-151 to check if keyspace already exists

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

Modified: gora/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/gora/trunk/CHANGES.txt?rev=1363657&r1=1363656&r2=1363657&view=diff
==============================================================================
--- gora/trunk/CHANGES.txt (original)
+++ gora/trunk/CHANGES.txt Fri Jul 20 05:48:11 2012
@@ -6,6 +6,8 @@ Gora Change Log
 
 0.3 (trunk) Current Development:
 
+* GORA-151 CassandraStore's schemaExists() method always returns false (kazk)
+
 * GORA-150 Introduce Configuration property preferred.schema.name (ferdy)
 
 * GORA-142 Creates org.apache.gora.cassandra.serializers package in order to clean the code
of store and query packages and to support additional types in future. (kazk)

Modified: gora/trunk/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java
URL: http://svn.apache.org/viewvc/gora/trunk/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java?rev=1363657&r1=1363656&r2=1363657&view=diff
==============================================================================
--- gora/trunk/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java
(original)
+++ gora/trunk/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java
Fri Jul 20 05:48:11 2012
@@ -93,6 +93,14 @@ public class CassandraClient<K, T extend
     this.keySerializer = GoraSerializerTypeInferer.getSerializer(keyClass);
     this.mutator = HFactory.createMutator(this.keyspace, this.keySerializer);
   }
+
+  /**
+   * Check if keyspace already exists.
+   */
+  public boolean keyspaceExists() {
+    KeyspaceDefinition keyspaceDefinition = this.cluster.describeKeyspace(this.cassandraMapping.getKeyspaceName());
+    return (keyspaceDefinition != null);
+  }
   
   /**
    * Check if keyspace already exists. If not, create it.

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=1363657&r1=1363656&r2=1363657&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
Fri Jul 20 05:48:11 2012
@@ -390,7 +390,7 @@ public class CassandraStore<K, T extends
   @Override
   public boolean schemaExists() throws IOException {
     LOG.info("schema exists");
-    return false;
+    return cassandraClient.keyspaceExists();
   }
 
 }



Mime
View raw message