usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdun...@apache.org
Subject usergrid git commit: during tests, drop keyspaces using astyanax driver
Date Wed, 09 Aug 2017 21:55:14 GMT
Repository: usergrid
Updated Branches:
  refs/heads/hotfix-20170728 cbc400651 -> e4c65126b


during tests, drop keyspaces using astyanax driver


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

Branch: refs/heads/hotfix-20170728
Commit: e4c65126be6effcac328f4ca1afc2599fc7a748f
Parents: cbc4006
Author: Mike Dunker <mdunker@google.com>
Authored: Wed Aug 9 14:54:40 2017 -0700
Committer: Mike Dunker <mdunker@google.com>
Committed: Wed Aug 9 14:54:40 2017 -0700

----------------------------------------------------------------------
 .../usergrid/persistence/CoreSchemaManager.java | 21 ++------------------
 .../migration/schema/MigrationManagerImpl.java  | 10 +++++++++-
 .../setup/ConcurrentProcessSingleton.java       |  2 +-
 3 files changed, 12 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/e4c65126/stack/core/src/test/java/org/apache/usergrid/persistence/CoreSchemaManager.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/CoreSchemaManager.java
b/stack/core/src/test/java/org/apache/usergrid/persistence/CoreSchemaManager.java
index ce98735..8038d36 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/CoreSchemaManager.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/CoreSchemaManager.java
@@ -57,7 +57,7 @@ public class CoreSchemaManager implements SchemaManager {
     @Override
     public void create(boolean dropKeyspace) {
         try {
-            setup.initSchema();
+            setup.initSchema(dropKeyspace);
             lockManager.setup();
         }
         catch ( Exception ex ) {
@@ -87,24 +87,7 @@ public class CoreSchemaManager implements SchemaManager {
 
     @Override
     public void destroy() {
-        logger.info( "dropping keyspaces" );
-        try {
-            cluster.dropKeyspace( CassandraService.getApplicationKeyspace() );
-        }
-        catch ( RuntimeException ire ) {
-            //swallow if it just doesn't exist
-        }
-
-
-        try {
-            cluster.dropKeyspace( CassandraService.getApplicationKeyspace() );
-        }
-        catch ( RuntimeException ire ) {
-            //swallow if it just doesn't exist
-        }
-
-        logger.info( "keyspaces dropped" );
-
+        logger.info( "keyspace dropping deferred" );
 
         final EsProvider provider =
             SpringResource.getInstance().getBean( Injector.class ).getInstance( EsProvider.class
);

http://git-wip-us.apache.org/repos/asf/usergrid/blob/e4c65126/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 cb62f4a..003565e 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
@@ -134,7 +134,15 @@ public class MigrationManagerImpl implements MigrationManager {
      * Drop keyspace.
      */
     private void dropKeyspace() throws ConnectionException {
-        keyspace.dropKeyspace();
+        try {
+            keyspace.dropKeyspace();
+        }
+        catch (NotFoundException nfe) {
+            logger.info( "Received a NotFoundException when attempting to drop keyspace.
 It does not exist" );
+        }
+        catch (ConnectionException e) {
+            logger.info( "Received a ConnectionException when attempting to drop keyspace:
{}", e.getMessage());
+        }
     }
 
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/e4c65126/stack/test-utils/src/main/java/org/apache/usergrid/setup/ConcurrentProcessSingleton.java
----------------------------------------------------------------------
diff --git a/stack/test-utils/src/main/java/org/apache/usergrid/setup/ConcurrentProcessSingleton.java
b/stack/test-utils/src/main/java/org/apache/usergrid/setup/ConcurrentProcessSingleton.java
index 3b08bc8..5363381 100644
--- a/stack/test-utils/src/main/java/org/apache/usergrid/setup/ConcurrentProcessSingleton.java
+++ b/stack/test-utils/src/main/java/org/apache/usergrid/setup/ConcurrentProcessSingleton.java
@@ -98,7 +98,7 @@ public class ConcurrentProcessSingleton {
 
                 // create our schema
                 logger.info("Creating database");
-                schemaManager.create();
+                schemaManager.create(CLEAN_STORAGE);
 
                 logger.info( "Populating database" );
                 schemaManager.populateBaseData();


Mime
View raw message