Repository: usergrid Updated Branches: refs/heads/master 6e5978bb6 -> e504aae65
Fix cassandra properties that are used during setup and bootstrap. Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/e504aae6 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/e504aae6 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/e504aae6 Branch: refs/heads/master Commit: e504aae6532d392461dcb7041259ffc7a27c773d Parents: 6e5978b Author: Michael Russo <mru...@apigee.com> Authored: Thu Nov 17 13:42:50 2016 -0800 Committer: Michael Russo <mru...@apigee.com> Committed: Thu Nov 17 13:42:50 2016 -0800 ---------------------------------------------------------------------- .../main/resources/usergrid-default.properties | 8 +++- .../usergrid/corepersistence/GuiceFactory.java | 13 ++++-- .../persistence/core/guice/CommonModule.java | 3 +- .../migration/schema/MigrationManagerFig.java | 45 -------------------- 4 files changed, 17 insertions(+), 52 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/usergrid/blob/e504aae6/stack/config/src/main/resources/usergrid-default.properties ---------------------------------------------------------------------- diff --git a/stack/config/src/main/resources/usergrid-default.properties b/stack/config/src/main/resources/usergrid-default.properties index 349a3cc..9c75ef0 100644 --- a/stack/config/src/main/resources/usergrid-default.properties +++ b/stack/config/src/main/resources/usergrid-default.properties @@ -90,11 +90,17 @@ cassandra.keyspace.application=Usergrid_Applications # cassandra.keyspace.strategy=SimpleStrategy +# Set the keyspace strategy to be used for the local keyspace +# +cassandra.keyspace.strategy.local=SimpleStrategy + # Set the replication factor to be used for cassandra.keyspace.application. # cassandra.keyspace.replication=replication_factor:1 -cassandra.keyspace.local.replication=replication_factor:1 +# Set the replication factor to be used for the local keyspace ( {cassandra.keyspace.application}_{cassandra.datacenter.local} ) +# +cassandra.keyspace.replication.local=replication_factor:1 # Tell Usergrid that Cassandra is not embedded. # http://git-wip-us.apache.org/repos/asf/usergrid/blob/e504aae6/stack/core/src/main/java/org/apache/usergrid/corepersistence/GuiceFactory.java ---------------------------------------------------------------------- diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/GuiceFactory.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/GuiceFactory.java index b003c2f..f2be27a 100644 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/GuiceFactory.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/GuiceFactory.java @@ -113,14 +113,19 @@ public class GuiceFactory implements FactoryBean<Injector> { cpProps.put( "cassandra.cluster_name", getAndValidateProperty( "cassandra.cluster" ) ); cpProps - .put( "collections.keyspace.strategy.class", getAndValidateProperty( "cassandra.keyspace.strategy" ) ); + .put( "cassandra.strategy", getAndValidateProperty( "cassandra.keyspace.strategy" ) ); - cpProps.put( "collections.keyspace.local.strategy.options", - getAndValidateProperty( "cassandra.keyspace.local.replication" ) ); + cpProps + .put( "cassandra.strategy.local", getAndValidateProperty( "cassandra.keyspace.strategy.local" ) ); - cpProps.put( "collections.keyspace.strategy.options", + cpProps.put( "cassandra.strategy.options", getAndValidateProperty( "cassandra.keyspace.replication" ) ); + cpProps.put( "cassandra.strategy.options.local", + getAndValidateProperty( "cassandra.keyspace.replication.local" ) ); + + + if (logger.isDebugEnabled()) { logger.debug("Set Cassandra properties for Core Persistence: {}", cpProps.toString()); } http://git-wip-us.apache.org/repos/asf/usergrid/blob/e504aae6/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/guice/CommonModule.java ---------------------------------------------------------------------- diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/guice/CommonModule.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/guice/CommonModule.java index 4681674..790acc3 100644 --- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/guice/CommonModule.java +++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/guice/CommonModule.java @@ -45,7 +45,6 @@ import org.apache.usergrid.persistence.core.migration.data.MigrationInfoSerializ import org.apache.usergrid.persistence.core.migration.data.MigrationPlugin; import org.apache.usergrid.persistence.core.migration.schema.Migration; import org.apache.usergrid.persistence.core.migration.schema.MigrationManager; -import org.apache.usergrid.persistence.core.migration.schema.MigrationManagerFig; import org.apache.usergrid.persistence.core.migration.schema.MigrationManagerImpl; import com.google.inject.AbstractModule; @@ -63,7 +62,7 @@ public class CommonModule extends AbstractModule { protected void configure() { //noinspection unchecked - install(new GuicyFigModule(MigrationManagerFig.class, CassandraFig.class)); + install(new GuicyFigModule(CassandraFig.class)); // bind our Cassandra cluster to the Astyanax Implementation bind(CassandraCluster.class).to(CassandraClusterImpl.class).asEagerSingleton(); http://git-wip-us.apache.org/repos/asf/usergrid/blob/e504aae6/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerFig.java ---------------------------------------------------------------------- diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerFig.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerFig.java deleted file mode 100644 index be2866a..0000000 --- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerFig.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.usergrid.persistence.core.migration.schema; - - -import org.safehaus.guicyfig.Default; -import org.safehaus.guicyfig.FigSingleton; -import org.safehaus.guicyfig.GuicyFig; -import org.safehaus.guicyfig.Key; - - -/** - * Configuration for the MigrationManager. - */ -@FigSingleton -public interface MigrationManagerFig extends GuicyFig { - @Key( "collections.keyspace.strategy.class" ) - @Default( "org.apache.cassandra.locator.SimpleStrategy" ) - String getStrategyClass(); - - @Key( "collections.keyspace.strategy.options" ) - @Default("replication_factor:1") - String getStrategyOptions(); - - @Key( "collections.keyspace.strategy.options" ) - @Default("replication_factor:1") - String getLocalStrategyOptions(); - -}