usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mru...@apache.org
Subject [13/38] usergrid git commit: Expose creation of keyspace via the interface so other classes can use that method to create the keyspace if for some reason it does not already exist.
Date Wed, 17 Aug 2016 21:48:20 GMT
Expose creation of keyspace via the interface so other classes can use that method to create
the keyspace if for some reason it does not already exist.


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

Branch: refs/heads/master
Commit: ecbd495970b73e0c1ed85fa6491c906cac33de6e
Parents: 7ff31eb
Author: Michael Russo <michaelarusso@gmail.com>
Authored: Fri Feb 12 22:48:09 2016 -0800
Committer: Michael Russo <michaelarusso@gmail.com>
Committed: Fri Feb 12 22:48:09 2016 -0800

----------------------------------------------------------------------
 .../usergrid/persistence/core/datastax/DataStaxCluster.java      | 2 ++
 .../persistence/core/datastax/impl/DatastaxClusterImpl.java      | 4 +++-
 .../persistence/core/migration/schema/MigrationManagerImpl.java  | 3 ++-
 .../usergrid/persistence/core/datastax/DatastaxClusterTest.java  | 2 +-
 4 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/ecbd4959/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/DataStaxCluster.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/DataStaxCluster.java
b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/DataStaxCluster.java
index 206c2a0..768a7a2 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/DataStaxCluster.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/DataStaxCluster.java
@@ -30,6 +30,8 @@ public interface DataStaxCluster {
 
     Session getApplicationSession();
 
+    void createOrUpdateKeyspace() throws Exception;
+
     void waitForSchemaAgreement();
 
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/ecbd4959/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/impl/DatastaxClusterImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/impl/DatastaxClusterImpl.java
b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/impl/DatastaxClusterImpl.java
index 1e9061f..e15475e 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/impl/DatastaxClusterImpl.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/impl/DatastaxClusterImpl.java
@@ -26,6 +26,7 @@ import com.google.inject.Singleton;
 import org.apache.usergrid.persistence.core.astyanax.CassandraFig;
 import org.apache.usergrid.persistence.core.datastax.CQLUtils;
 import org.apache.usergrid.persistence.core.datastax.DataStaxCluster;
+import org.safehaus.guicyfig.Overrides;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -92,7 +93,8 @@ public class DataStaxClusterImpl implements DataStaxCluster {
      * Execute CQL that will create the keyspace if it doesn't exist and alter it if it does.
      * @throws Exception
      */
-    private void createOrUpdateKeyspace() throws Exception {
+    @Override
+    public void createOrUpdateKeyspace() throws Exception {
 
         clusterSession = getClusterSession();
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/ecbd4959/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerImpl.java
b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerImpl.java
index 105f93a..9ab403d 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerImpl.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerImpl.java
@@ -71,9 +71,10 @@ public class MigrationManagerImpl implements MigrationManager {
     @Override
     public void migrate() throws MigrationException {
 
-
         try {
 
+            dataStaxCluster.createOrUpdateKeyspace();
+
             for ( Migration migration : migrations ) {
 
                 final Collection<MultiTenantColumnFamilyDefinition> columnFamilies
= migration.getColumnFamilies();

http://git-wip-us.apache.org/repos/asf/usergrid/blob/ecbd4959/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/datastax/DatastaxClusterTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/datastax/DatastaxClusterTest.java
b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/datastax/DatastaxClusterTest.java
index 81b7d8f..593e71b 100644
--- a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/datastax/DatastaxClusterTest.java
+++ b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/datastax/DatastaxClusterTest.java
@@ -57,7 +57,7 @@ public class DatastaxClusterTest {
         cluster = dataStaxCluster.getCluster();
         assertTrue(!cluster.isClosed());
 
-        
+
     }
 
     @Test


Mime
View raw message