Adding ability to customize keyspaces but if they aren't set then set them to default values. .
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/f512fed8 Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/f512fed8 Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/f512fed8 Branch: refs/heads/two-dot-o Commit: f512fed8d5067ee038c7e7eb1947d44d4d17b3d2 Parents: b1a75f0 Author: GERey <gre...@apigee.com> Authored: Fri Apr 17 09:14:02 2015 -0700 Committer: GERey <gre...@apigee.com> Committed: Fri Apr 17 09:14:02 2015 -0700 ---------------------------------------------------------------------- .../persistence/cassandra/CassandraService.java | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f512fed8/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/CassandraService.java ---------------------------------------------------------------------- diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/CassandraService.java b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/CassandraService.java index cd81912..43bfd2d 100644 --- a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/CassandraService.java +++ b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/CassandraService.java @@ -94,13 +94,6 @@ import static org.apache.usergrid.utils.MapUtils.filter; public class CassandraService { -// public static String SYSTEM_KEYSPACE = "Usergrid"; -// -// public static String STATIC_APPLICATION_KEYSPACE = "Usergrid_Applications"; - - public static String SYSTEM_KEYSPACE = System.getProperty( "cassandra.system.keyspace" ); - public static String STATIC_APPLICATION_KEYSPACE = System.getProperty( "cassandra.application.keyspace" ); - public static final boolean USE_VIRTUAL_KEYSPACES = true; public static final String APPLICATIONS_CF = "Applications"; @@ -134,6 +127,9 @@ public class CassandraService { ConsistencyLevelPolicy consistencyLevelPolicy; + public static String SYSTEM_KEYSPACE; + public static String STATIC_APPLICATION_KEYSPACE; + private Keyspace systemKeyspace; private Map<String, String> accessMap; @@ -159,18 +155,16 @@ public class CassandraService { public void init() throws Exception { + SYSTEM_KEYSPACE = properties.getProperty( "cassandra.system.keyspace" ,"Usergrid"); + STATIC_APPLICATION_KEYSPACE = properties.getProperty( "cassandra.application.keyspace","Usergrid_Applications" ); + if ( consistencyLevelPolicy == null ) { consistencyLevelPolicy = new ConfigurableConsistencyLevel(); ( ( ConfigurableConsistencyLevel ) consistencyLevelPolicy ) .setDefaultReadConsistencyLevel( HConsistencyLevel.ONE ); } accessMap = new HashMap<String, String>( 2 ); - if ( SYSTEM_KEYSPACE == null ) { - SYSTEM_KEYSPACE = "Usergrid"; - } - if ( STATIC_APPLICATION_KEYSPACE == null) { - STATIC_APPLICATION_KEYSPACE = "Usergrid_Applications"; - } + accessMap.put( "username", properties.getProperty( "cassandra.username" ) ); accessMap.put( "password", properties.getProperty( "cassandra.password" ) ); systemKeyspace =