Repository: usergrid
Updated Branches:
  refs/heads/master f0ec3a903 -> cae0605ad


Reduce long polling time in tests and switch back to database driver metadata 
now that Hector is no longer used for altering test schema.


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

Branch: refs/heads/master
Commit: cae0605adf3fb03e262a1a89ba92758630f1f1d6
Parents: f0ec3a9
Author: Michael Russo <[email protected]>
Authored: Sun Nov 20 00:13:29 2016 -0800
Committer: Michael Russo <[email protected]>
Committed: Sun Nov 20 00:13:29 2016 -0800

----------------------------------------------------------------------
 .../usergrid/persistence/CoreSchemaManager.java  |  2 +-
 .../resources/usergrid-custom-test.properties    |  2 +-
 .../core/datastax/impl/DataStaxClusterImpl.java  |  9 ++++++---
 .../migration/schema/MigrationManagerImpl.java   | 19 ++++++++-----------
 .../resources/usergrid-custom-test.properties    |  2 +-
 .../resources/usergrid-custom-test.properties    |  2 +-
 6 files changed, 18 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/cae0605a/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 5488142..c85e2f0 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
@@ -53,7 +53,7 @@ public class CoreSchemaManager implements SchemaManager {
     @Override
     public void create() {
         try {
-            setup.initSchema(true);
+            setup.initSchema(false);
             lockManager.setup();
         }
         catch ( Exception ex ) {

http://git-wip-us.apache.org/repos/asf/usergrid/blob/cae0605a/stack/core/src/test/resources/usergrid-custom-test.properties
----------------------------------------------------------------------
diff --git a/stack/core/src/test/resources/usergrid-custom-test.properties 
b/stack/core/src/test/resources/usergrid-custom-test.properties
index 13ef8cf..c544967 100644
--- a/stack/core/src/test/resources/usergrid-custom-test.properties
+++ b/stack/core/src/test/resources/usergrid-custom-test.properties
@@ -48,7 +48,7 @@ collection.uniquevalues.authoritative.region=us-east
 
 # Queueing Test Settings
 # Reduce the long polling time for the tests
-queue.long.polling.time.millis=250
+queue.long.polling.time.millis=50
 
 # --- End: Usergrid cluster/actor system settings
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/cae0605a/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 0fac3f7..aec25a5 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
@@ -31,6 +31,8 @@ import 
org.apache.usergrid.persistence.core.datastax.DataStaxCluster;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.apache.commons.lang.StringUtils.isBlank;
+
 
 @Singleton
 public class DataStaxClusterImpl implements DataStaxCluster {
@@ -135,6 +137,8 @@ public class DataStaxClusterImpl implements DataStaxCluster 
{
 
         getClusterSession().execute(createApplicationKeyspace);
 
+        waitForSchemaAgreement();
+
         logger.info("Created keyspace: {}", 
cassandraConfig.getApplicationKeyspace());
 
     }
@@ -175,9 +179,7 @@ public class DataStaxClusterImpl implements DataStaxCluster 
{
 
         getClusterSession().execute(createQueueMessageKeyspace);
 
-        if ( forceCheck ){
-            waitForSchemaAgreement();
-        }
+        waitForSchemaAgreement();
 
         logger.info("Created keyspace: {}", 
cassandraConfig.getApplicationLocalKeyspace());
 
@@ -246,6 +248,7 @@ public class DataStaxClusterImpl implements DataStaxCluster 
{
             .setConsistencyLevel(defaultConsistencyLevel)
             .setMetadataEnabled(true); // choose whether to have the driver 
store metadata such as schema info
 
+        //String clusterName = !isBlank(name) ? name : 
cassandraConfig.getClusterName();
         Cluster.Builder datastaxCluster = Cluster.builder()
             .withClusterName( cassandraConfig.getClusterName())
             .addContactPoints( cassandraConfig.getHosts().split(","))

http://git-wip-us.apache.org/repos/asf/usergrid/blob/cae0605a/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 dfc834d..b0fec3c 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
@@ -146,17 +146,14 @@ public class MigrationManagerImpl implements 
MigrationManager {
 
     private void createTable(TableDefinition tableDefinition ) throws 
Exception {
 
-        // this snippet will use the drivers metadata info, but that doesn't 
play nice with tests
-        // use the system table to verify instead
-
-        //KeyspaceMetadata keyspaceMetadata = 
dataStaxCluster.getClusterSession().getCluster().getMetadata()
-        //    .getKeyspace(CQLUtils.quote( tableDefinition.getKeyspace() ) );
-        //boolean exists =  keyspaceMetadata != null
-        //    && keyspaceMetadata.getTable( tableDefinition.getTableName() ) 
!= null;
-
-        boolean exists = dataStaxCluster.getClusterSession()
-            .execute("select * from system.schema_columnfamilies where 
keyspace_name='"+tableDefinition.getKeyspace()
-                +"' and 
columnfamily_name='"+CQLUtils.unquote(tableDefinition.getTableName())+"'").one()
 != null;
+        KeyspaceMetadata keyspaceMetadata = 
dataStaxCluster.getClusterSession().getCluster().getMetadata()
+            .getKeyspace(CQLUtils.quote( tableDefinition.getKeyspace() ) );
+        boolean exists =  keyspaceMetadata != null
+            && keyspaceMetadata.getTable( tableDefinition.getTableName() ) != 
null;
+
+        //boolean exists = dataStaxCluster.getClusterSession()
+        //    .execute("select * from system.schema_columnfamilies where 
keyspace_name='"+tableDefinition.getKeyspace()
+        //        +"' and 
columnfamily_name='"+CQLUtils.unquote(tableDefinition.getTableName())+"'").one()
 != null;
 
         if( exists ){
             logger.info("Not creating table {}, it already exists.", 
tableDefinition.getTableName());

http://git-wip-us.apache.org/repos/asf/usergrid/blob/cae0605a/stack/rest/src/test/resources/usergrid-custom-test.properties
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/resources/usergrid-custom-test.properties 
b/stack/rest/src/test/resources/usergrid-custom-test.properties
index 0c042d1..18eed9b 100644
--- a/stack/rest/src/test/resources/usergrid-custom-test.properties
+++ b/stack/rest/src/test/resources/usergrid-custom-test.properties
@@ -71,4 +71,4 @@ elasticsearch.queue_impl=DISTRIBUTED
 
 # Queueing Test Settings
 # Reduce the long polling time for the tests
-queue.long.polling.time.millis=250
+queue.long.polling.time.millis=50

http://git-wip-us.apache.org/repos/asf/usergrid/blob/cae0605a/stack/services/src/test/resources/usergrid-custom-test.properties
----------------------------------------------------------------------
diff --git a/stack/services/src/test/resources/usergrid-custom-test.properties 
b/stack/services/src/test/resources/usergrid-custom-test.properties
index 696766c..5f0a505 100644
--- a/stack/services/src/test/resources/usergrid-custom-test.properties
+++ b/stack/services/src/test/resources/usergrid-custom-test.properties
@@ -37,7 +37,7 @@ elasticsearch.queue_impl=DISTRIBUTED
 
 # Queueing Test Settings
 # Reduce the long polling time for the tests
-queue.long.polling.time.millis=250
+queue.long.polling.time.millis=50
 
 
 # This property is required to be set and cannot be defaulted anywhere

Reply via email to