usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [6/8] git commit: Allow configuration of either old EM or new CP-based EM via a new "usergrid.persistence" property that can be set to either EM or CP.
Date Wed, 16 Jul 2014 13:54:44 GMT
Allow configuration of either old EM or new CP-based EM via a new "usergrid.persistence" property
that can be set to either EM or CP.


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

Branch: refs/heads/two-dot-o
Commit: 0f0e70add05f22304231fab65ef642bc1ac7681e
Parents: 2b03357
Author: Dave Johnson <dmjohnson@apigee.com>
Authored: Sat Jul 12 09:16:21 2014 -0400
Committer: Dave Johnson <dmjohnson@apigee.com>
Committed: Sat Jul 12 09:16:21 2014 -0400

----------------------------------------------------------------------
 .../main/resources/usergrid-default.properties  |   3 +
 .../batch/service/SchedulerServiceImpl.java     |   7 +-
 .../corepersistence/CpEntityManagerFactory.java |  10 +-
 .../HybridEntityManagerFactory.java             | 141 +++++++++++++++++++
 .../usergrid/corepersistence/HybridSetup.java   |  72 ++++++++++
 .../persistence/EntityManagerFactory.java       |   3 +
 .../cassandra/EntityManagerFactoryImpl.java     |   5 +-
 .../cassandra/EntityManagerImpl.java            |  47 ++++---
 .../persistence/cassandra/SetupImpl.java        |   7 +-
 .../main/resources/usergrid-core-context.xml    |  21 +--
 .../test/resources/usergrid-test-context.xml    |  10 +-
 .../test/resources/usergrid-test-context.xml    |  17 +--
 .../test/resources/usergrid-test-context.xml    |   8 +-
 13 files changed, 268 insertions(+), 83 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0f0e70ad/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 e132ee1..739ff8f 100644
--- a/stack/config/src/main/resources/usergrid-default.properties
+++ b/stack/config/src/main/resources/usergrid-default.properties
@@ -24,6 +24,9 @@
 # instead.
 #
 
+# EM for old Entity Manager, CP for new Core Persistence
+usergrid.persistence=EM
+
 ## Corepersistence properties
 cassandra.embedded=true
 cassandra.hosts=127.0.0.1

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0f0e70ad/stack/core/src/main/java/org/apache/usergrid/batch/service/SchedulerServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/batch/service/SchedulerServiceImpl.java
b/stack/core/src/main/java/org/apache/usergrid/batch/service/SchedulerServiceImpl.java
index be9d6cc..1e09810 100644
--- a/stack/core/src/main/java/org/apache/usergrid/batch/service/SchedulerServiceImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/batch/service/SchedulerServiceImpl.java
@@ -120,8 +120,8 @@ public class SchedulerServiceImpl implements SchedulerService, JobAccessor,
JobR
         Message message = new Message();
         message.setTimestamp( fireTime );
         message.setStringProperty( JOB_NAME, jobName );
-        message.setProperty( JOB_ID, jobDataId );
-        message.setProperty( STATS_ID, jobStatId );
+        message.setProperty( JOB_ID, jobDataId.toString() );
+        message.setProperty( STATS_ID, jobStatId.toString() );
 
         getQm().postToQueue( jobQueueName, message );
     }
@@ -167,6 +167,9 @@ public class SchedulerServiceImpl implements SchedulerService, JobAccessor,
JobR
 
         for ( Message job : jobs.getMessages() ) {
 
+            Object jo = job.getStringProperty( JOB_ID );
+            LOG.info("jo type " + jo.getClass().getCanonicalName() );
+
             UUID jobUuid = UUID.fromString( job.getStringProperty( JOB_ID ) );
             UUID statsUuid = UUID.fromString( job.getStringProperty( STATS_ID ) );
             String jobName = job.getStringProperty( JOB_NAME );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0f0e70ad/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
index 6446e05..823daed 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
@@ -87,9 +87,11 @@ public class CpEntityManagerFactory implements EntityManagerFactory, Application
     // The System Application where we store app and org metadata
     public static final String SYSTEM_APPS_UUID = "b6768a08-b5d5-11e3-a495-10ddb1de66c3";
     
-    public static final  UUID MANAGEMENT_APPLICATION_ID = UUID.fromString("b6768a08-b5d5-11e3-a495-11ddb1de66c8");
+    public static final  UUID MANAGEMENT_APPLICATION_ID = 
+            UUID.fromString("b6768a08-b5d5-11e3-a495-11ddb1de66c8");
 
-    public static final  UUID DEFAULT_APPLICATION_ID = UUID.fromString("b6768a08-b5d5-11e3-a495-11ddb1de66c9");
+    public static final  UUID DEFAULT_APPLICATION_ID = 
+            UUID.fromString("b6768a08-b5d5-11e3-a495-11ddb1de66c9");
 
 
     // Three types of things we store in System Application
@@ -188,7 +190,7 @@ public class CpEntityManagerFactory implements EntityManagerFactory, Application
 
     
     private EntityManager _getEntityManager( UUID applicationId ) {
-        EntityManager em = applicationContext.getBean( "entityManager", EntityManager.class
);
+        EntityManager em = new CpEntityManager();
         em.init( this, applicationId );
         return em;
     }
@@ -300,7 +302,7 @@ public class CpEntityManagerFactory implements EntityManagerFactory, Application
 
     public ApplicationScope getApplicationScope( UUID applicationId ) {
 
-        //We can always generate a scope, it doesn't matter if  the application exists yet
or not.
+        // We can always generate a scope, it doesn't matter if  the application exists yet
or not.
 
         final ApplicationScopeImpl scope = new ApplicationScopeImpl( generateApplicationId(
applicationId ) );
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0f0e70ad/stack/core/src/main/java/org/apache/usergrid/corepersistence/HybridEntityManagerFactory.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/HybridEntityManagerFactory.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/HybridEntityManagerFactory.java
new file mode 100644
index 0000000..4414ade
--- /dev/null
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/HybridEntityManagerFactory.java
@@ -0,0 +1,141 @@
+/*
+ * Copyright 2014 The Apache Software Foundation.
+ *
+ * Licensed 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.corepersistence;
+
+import java.util.Map;
+import java.util.UUID;
+import org.apache.usergrid.persistence.EntityManager;
+import org.apache.usergrid.persistence.EntityManagerFactory;
+import org.apache.usergrid.persistence.cassandra.CassandraService;
+import org.apache.usergrid.persistence.cassandra.CounterUtils;
+import org.apache.usergrid.persistence.cassandra.EntityManagerFactoryImpl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+
+
+/**
+ * Can read from either old EntityManagerImpl or new CpEntityManager, can write to either
or both.
+ */
+public class HybridEntityManagerFactory implements EntityManagerFactory, ApplicationContextAware
{
+    private static final Logger logger = LoggerFactory.getLogger( CpEntityManagerFactory.class
);
+    private final EntityManagerFactory factory;
+
+
+    public HybridEntityManagerFactory( 
+            CassandraService cass, CounterUtils counterUtils, boolean skipAggCounters ) {
+
+        boolean useCP = cass.getPropertiesMap().get("usergrid.persistence").equals("CP");
+        if ( useCP ) {
+            logger.info("HybridEntityManagerFactory: configured for New Core Persistence
engine");
+            factory = new CpEntityManagerFactory(cass, counterUtils, skipAggCounters );
+        } else {
+            logger.info("HybridEntityManagerFactory: configured for Classic Usergrid persistence");
+            factory = new EntityManagerFactoryImpl( cass, counterUtils, skipAggCounters );
+        }
+    }
+
+    @Override
+    public String getImpementationDescription() throws Exception {
+        return factory.getImpementationDescription();
+    }
+
+    @Override
+    public EntityManager getEntityManager(UUID applicationId) {
+        return factory.getEntityManager(applicationId);
+    }
+
+    @Override
+    public UUID createApplication(String organizationName, String name) throws Exception
{
+        return factory.createApplication(organizationName, name);
+    }
+
+    @Override
+    public UUID createApplication(String organizationName, String name, 
+            Map<String, Object> properties) throws Exception {
+        return factory.createApplication(organizationName, name, properties);
+    }
+
+    @Override
+    public UUID importApplication(String organization, UUID applicationId, String name, 
+            Map<String, Object> properties) throws Exception {
+        return factory.importApplication(organization, applicationId, name, properties);
+    }
+
+    @Override
+    public UUID lookupApplication(String name) throws Exception {
+        return factory.lookupApplication(name);
+    }
+
+    @Override
+    public Map<String, UUID> getApplications() throws Exception {
+        return factory.getApplications();
+    }
+
+    @Override
+    public void setup() throws Exception {
+        factory.setup();
+    }
+
+    @Override
+    public Map<String, String> getServiceProperties() {
+        return factory.getServiceProperties();
+    }
+
+    @Override
+    public boolean updateServiceProperties(Map<String, String> properties) {
+        return factory.updateServiceProperties(properties);
+    }
+
+    @Override
+    public boolean setServiceProperty(String name, String value) {
+        return factory.setServiceProperty(name, value);
+    }
+
+    @Override
+    public boolean deleteServiceProperty(String name) {
+        return factory.deleteServiceProperty(name);
+    }
+
+    @Override
+    public UUID initializeApplication(String orgName, UUID appId, String appName, 
+            Map<String, Object> props) throws Exception {
+        return factory.initializeApplication(orgName, appId, appName, props);
+    }
+
+    @Override
+    public UUID getManagementAppId() {
+        return factory.getManagementAppId();
+    }
+
+    @Override
+    public UUID getDefaultAppId() {
+        return factory.getDefaultAppId();
+    }
+
+    @Override
+    public void refreshIndex() {
+        factory.refreshIndex();
+    }
+
+    @Override
+    public void setApplicationContext(ApplicationContext ac) throws BeansException {
+        factory.setApplicationContext(ac);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0f0e70ad/stack/core/src/main/java/org/apache/usergrid/corepersistence/HybridSetup.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/HybridSetup.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/HybridSetup.java
new file mode 100644
index 0000000..963f8db
--- /dev/null
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/HybridSetup.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2014 The Apache Software Foundation.
+ *
+ * Licensed 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.corepersistence;
+
+import java.util.Properties;
+import java.util.UUID;
+import org.apache.usergrid.persistence.EntityManagerFactory;
+import org.apache.usergrid.persistence.cassandra.CassandraService;
+import org.apache.usergrid.persistence.cassandra.Setup;
+import org.apache.usergrid.persistence.cassandra.SetupImpl;
+
+
+public class HybridSetup implements Setup {
+
+    private final Setup setup;
+
+    public HybridSetup(Properties props, EntityManagerFactory emf, CassandraService cass
) {
+        
+        boolean useCP = cass.getPropertiesMap().get("usergrid.persistence").equals("CP");
+        if ( useCP ) {
+            setup = new CpSetup( emf, cass);
+        } else {
+            setup = new SetupImpl( emf, cass );
+        }
+
+    }
+
+    @Override
+    public void init() throws Exception {
+        setup.init();
+    }
+
+    @Override
+    public void setupSystemKeyspace() throws Exception {
+        setup.setupSystemKeyspace();
+    }
+
+    @Override
+    public void setupStaticKeyspace() throws Exception {
+        setup.setupStaticKeyspace();
+    }
+
+    @Override
+    public boolean keyspacesExist() {
+        return setup.keyspacesExist();
+    }
+
+    @Override
+    public void createDefaultApplications() throws Exception {
+        setup.createDefaultApplications();
+    }
+
+    @Override
+    public void setupApplicationKeyspace(UUID applicationId, String appName) throws Exception
{
+        setup.setupApplicationKeyspace(applicationId, appName);
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0f0e70ad/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManagerFactory.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManagerFactory.java
b/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManagerFactory.java
index 18540f4..9ff98b7 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManagerFactory.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManagerFactory.java
@@ -19,6 +19,7 @@ package org.apache.usergrid.persistence;
 
 import java.util.Map;
 import java.util.UUID;
+import org.springframework.context.ApplicationContext;
 
 
 // TODO: Auto-generated Javadoc
@@ -115,4 +116,6 @@ public interface EntityManagerFactory {
     public UUID getDefaultAppId();
 
     public void refreshIndex();
+
+    public void setApplicationContext(ApplicationContext ac);
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0f0e70ad/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImpl.java
b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImpl.java
index 1b71f5f..1cc1752 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImpl.java
@@ -142,9 +142,8 @@ public class EntityManagerFactoryImpl implements EntityManagerFactory,
Applicati
 
 
     private EntityManager _getEntityManager( UUID applicationId ) {
-        //EntityManagerImpl em = new EntityManagerImpl();
-        EntityManager em = applicationContext.getBean( "entityManager", EntityManager.class
);
-        //em.init(this,cass,counterUtils,applicationId, skipAggregateCounters);
+        EntityManagerImpl em = new EntityManagerImpl();
+        em.init( this, cass, counterUtils, applicationId, skipAggregateCounters );
         em.setApplicationId( applicationId );
         return em;
     }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0f0e70ad/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerImpl.java
b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerImpl.java
index d4cd92f..4f1f2ae 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerImpl.java
@@ -41,6 +41,9 @@ import org.slf4j.LoggerFactory;
 import org.springframework.context.ApplicationContext;
 import org.springframework.util.Assert;
 
+import org.apache.usergrid.persistence.IndexBucketLocator.IndexType;
+import static org.apache.usergrid.persistence.cassandra.ApplicationCF.ENTITY_ID_SETS;
+
 import org.apache.usergrid.locking.Lock;
 import org.apache.usergrid.mq.Message;
 import org.apache.usergrid.mq.QueueManager;
@@ -519,7 +522,7 @@ public class EntityManagerImpl implements EntityManager {
          */
 
         Set<UUID> ownerEntityIds = getUUIDsForUniqueProperty( 
-            new SimpleEntityRef("applicaion", applicationId), entityType, propertyName, propertyValue
);
+            new SimpleEntityRef(Application.ENTITY_TYPE, applicationId), entityType, propertyName,
propertyValue );
 
         //if there are no entities for this property, we know it's unique.  If there are,
         // we have to make sure the one we were passed is in the set.  otherwise it belongs
@@ -648,7 +651,7 @@ public class EntityManagerImpl implements EntityManager {
 
     @Override
     public Map<String, EntityRef> getAlias( String aliasType, List<String> aliases
) throws Exception {
-        return getAlias( new SimpleEntityRef("applicaion", applicationId), aliasType, aliases
);
+        return getAlias( new SimpleEntityRef(Application.ENTITY_TYPE, applicationId), aliasType,
aliases );
     }
 
 
@@ -831,28 +834,28 @@ public class EntityManagerImpl implements EntityManager {
         // Create collection name based on entity: i.e. "users"
         String collection_name = Schema.defaultCollectionName( eType );
         // Create collection key based collection name
-//        String bucketId = indexBucketLocator.getBucket( applicationId, IndexType.COLLECTION,
itemId, collection_name );
-//
-//        Object collection_key = key( applicationId, Schema.DICTIONARY_COLLECTIONS, collection_name,
bucketId );
+        String bucketId = indexBucketLocator.getBucket( applicationId, IndexType.COLLECTION,
itemId, collection_name );
+
+        Object collection_key = key( applicationId, Schema.DICTIONARY_COLLECTIONS, collection_name,
bucketId );
 
         CollectionInfo collection = null;
 
-//        if ( !is_application ) {
-//            // Add entity to collection
-//
-//
-//            if ( !emptyPropertyMap ) {
-//                addInsertToMutator( m, ENTITY_ID_SETS, collection_key, itemId, null, timestamp
);
-//            }
-//
-//            // Add name of collection to dictionary property
-//            // Application.collections
-//            addInsertToMutator( m, ENTITY_DICTIONARIES, key( applicationId, Schema.DICTIONARY_COLLECTIONS
),
-//                    collection_name, null, timestamp );
-//
-//            addInsertToMutator( m, ENTITY_COMPOSITE_DICTIONARIES, key( itemId, Schema.DICTIONARY_CONTAINER_ENTITIES
),
-//                    asList( TYPE_APPLICATION, collection_name, applicationId ), null, timestamp
);
-//        }
+        if ( !is_application ) {
+            // Add entity to collection
+
+
+            if ( !emptyPropertyMap ) {
+                addInsertToMutator( m, ENTITY_ID_SETS, collection_key, itemId, null, timestamp
);
+            }
+
+            // Add name of collection to dictionary property
+            // Application.collections
+            addInsertToMutator( m, ENTITY_DICTIONARIES, key( applicationId, Schema.DICTIONARY_COLLECTIONS
),
+                    collection_name, null, timestamp );
+
+            addInsertToMutator( m, ENTITY_COMPOSITE_DICTIONARIES, key( itemId, Schema.DICTIONARY_CONTAINER_ENTITIES
),
+                    asList( TYPE_APPLICATION, collection_name, applicationId ), null, timestamp
);
+        }
 
         if ( emptyPropertyMap ) {
             return null;
@@ -1549,7 +1552,7 @@ public class EntityManagerImpl implements EntityManager {
         }
         if ( identifier.isName() ) {
             return this.getAlias( 
-                    new SimpleEntityRef("applicaion", applicationId), 
+                    new SimpleEntityRef(Application.ENTITY_TYPE, applicationId), 
                     "user", identifier.getName() );
         }
         if ( identifier.isEmail() ) {

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0f0e70ad/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/SetupImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/SetupImpl.java
b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/SetupImpl.java
index 07ced9b..3716958 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/SetupImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/SetupImpl.java
@@ -21,6 +21,7 @@ import java.util.UUID;
 import me.prettyprint.hector.api.ddl.ComparatorType;
 import static me.prettyprint.hector.api.factory.HFactory.createColumnFamilyDefinition;
 import org.apache.usergrid.mq.cassandra.QueuesCF;
+import org.apache.usergrid.persistence.EntityManagerFactory;
 import static org.apache.usergrid.persistence.cassandra.CassandraPersistenceUtils.getCfDefs;
 import static org.apache.usergrid.persistence.cassandra.CassandraService.APPLICATIONS_CF;
 import static org.apache.usergrid.persistence.cassandra.CassandraService.DEFAULT_APPLICATION;
@@ -51,7 +52,7 @@ public class SetupImpl implements Setup {
     private final CassandraService cass;
 
 
-    public SetupImpl( EntityManagerFactoryImpl emf, CassandraService cass ) {
+    public SetupImpl( EntityManagerFactory emf, CassandraService cass ) {
         this.emf = emf;
         this.cass = cass;
     }
@@ -67,10 +68,10 @@ public class SetupImpl implements Setup {
 
     public void createDefaultApplications() throws Exception {
         // TODO unique check?
-        ( ( EntityManagerFactoryImpl ) emf ).initializeApplication( 
+        ( ( EntityManagerFactory ) emf ).initializeApplication( 
                 DEFAULT_ORGANIZATION, emf.getDefaultAppId(), DEFAULT_APPLICATION, null );
 
-        ( ( EntityManagerFactoryImpl ) emf ).initializeApplication( 
+        ( ( EntityManagerFactory ) emf ).initializeApplication( 
                 DEFAULT_ORGANIZATION, emf.getManagementAppId(), MANAGEMENT_APPLICATION, null
);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0f0e70ad/stack/core/src/main/resources/usergrid-core-context.xml
----------------------------------------------------------------------
diff --git a/stack/core/src/main/resources/usergrid-core-context.xml b/stack/core/src/main/resources/usergrid-core-context.xml
index 6ca7244..9321fb6 100644
--- a/stack/core/src/main/resources/usergrid-core-context.xml
+++ b/stack/core/src/main/resources/usergrid-core-context.xml
@@ -103,22 +103,12 @@
         <property name="defaultWriteConsistencyLevel" value="${cassandra.writecl}"/>
     </bean>
 	
-<!--	
     <bean id="entityManagerFactory"
-		class="org.apache.usergrid.corepersistence.CpEntityManagerFactory" scope="singleton">
+		class="org.apache.usergrid.corepersistence.HybridEntityManagerFactory" scope="singleton">
 		<constructor-arg ref="cassandraService" />
         <constructor-arg ref="counterUtils"/>
         <constructor-arg value="${usergrid.counter.skipAggregate}"/>
     </bean>
--->
-
-    <bean id="entityManagerFactory"
-		class="org.apache.usergrid.persistence.cassandra.EntityManagerFactoryImpl">
-		<constructor-arg ref="cassandraService" />
-        <constructor-arg ref="counterUtils"/>
-        <constructor-arg value="${usergrid.counter.skipAggregate}"/>
-    </bean>
-
 
     <bean id="queueManagerFactory"
           class="org.apache.usergrid.mq.cassandra.QueueManagerFactoryImpl">
@@ -163,15 +153,6 @@
     
     <bean id="mailUtils" class="org.apache.usergrid.utils.MailUtils" />
 
-    <bean id="entityManager" 
-        class="org.apache.usergrid.persistence.cassandra.EntityManagerImpl" 
-        scope="prototype"/>
-    <bean id="relationManager" 
-        class="org.apache.usergrid.persistence.cassandra.RelationManagerImpl" 
-        scope="prototype"/>
-
-<!--    <bean id="entityManager" class="org.apache.usergrid.corepersistence.CpEntityManager"
scope="prototype"/>-->
-
     <bean id="traceTagAspect" class="org.apache.usergrid.persistence.cassandra.util.TraceTagAspect"/>
 
     <aop:config>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0f0e70ad/stack/core/src/test/resources/usergrid-test-context.xml
----------------------------------------------------------------------
diff --git a/stack/core/src/test/resources/usergrid-test-context.xml b/stack/core/src/test/resources/usergrid-test-context.xml
index 8fc54e5..300d57b 100644
--- a/stack/core/src/test/resources/usergrid-test-context.xml
+++ b/stack/core/src/test/resources/usergrid-test-context.xml
@@ -28,14 +28,8 @@
 
     <import resource="classpath:/usergrid-core-context.xml"/>
 
-<!--
-    <bean id="setup" class="org.apache.usergrid.corepersistence.CpSetup">
-        <constructor-arg ref="entityManagerFactory"/>
-        <constructor-arg ref="cassandraService"/>
-    </bean>
--->
-
-    <bean id="setup" class="org.apache.usergrid.persistence.cassandra.SetupImpl">
+    <bean id="setup" class="org.apache.usergrid.corepersistence.HybridSetup">
+        <constructor-arg ref="properties"/>
         <constructor-arg ref="entityManagerFactory"/>
         <constructor-arg ref="cassandraService"/>
     </bean>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0f0e70ad/stack/rest/src/test/resources/usergrid-test-context.xml
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/resources/usergrid-test-context.xml b/stack/rest/src/test/resources/usergrid-test-context.xml
index 8141f50..352b3d2 100644
--- a/stack/rest/src/test/resources/usergrid-test-context.xml
+++ b/stack/rest/src/test/resources/usergrid-test-context.xml
@@ -28,7 +28,6 @@
         <property name="traceEnabled" value="false"/>
     </bean>
 
-
     <bean id="binaryStore" class="org.apache.usergrid.services.assets.data.LocalFileBinaryStore"/>
 
     <!--<bean id="binaryStore" class="org.apache.usergrid.services.assets.data.S3BinaryStore">-->
@@ -37,24 +36,12 @@
     <!--<constructor-arg name="bucketName" value="xx" />-->
     <!--</bean>-->
 
-    <bean id="setup" class="org.apache.usergrid.corepersistence.CpSetup">
+    <bean id="setup" class="org.apache.usergrid.corepersistence.HybridSetup">
+        <constructor-arg ref="properties"/>
         <constructor-arg ref="entityManagerFactory"/>
         <constructor-arg ref="cassandraService"/>
     </bean>
 
-
-    <!--    <bean id="setup" class="org.apache.usergrid.persistence.cassandra.Setup">
-        <constructor-arg ref="entityManagerFactory"/>
-        <constructor-arg ref="cassandraService"/>
-    </bean>-->
-
-    <!-- The default schema manager -->
-    <!--
-    <bean class="org.apache.usergrid.persistence.CoreSchemaManager">
-        <constructor-arg ref="svcSetup"/>
-        <constructor-arg ref="cassandraCluster"/>
-    </bean>
-    -->
     <!-- refer to a named schemaManager from the DataControl annotation thusly -->
     <bean id="coreManager" class="org.apache.usergrid.persistence.CoreSchemaManager">
         <constructor-arg ref="setup"/>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0f0e70ad/stack/services/src/test/resources/usergrid-test-context.xml
----------------------------------------------------------------------
diff --git a/stack/services/src/test/resources/usergrid-test-context.xml b/stack/services/src/test/resources/usergrid-test-context.xml
index af11880..1a1720b 100644
--- a/stack/services/src/test/resources/usergrid-test-context.xml
+++ b/stack/services/src/test/resources/usergrid-test-context.xml
@@ -38,16 +38,12 @@
 
     <import resource="classpath:/usergrid-services-context.xml" />
 
-    <bean id="setup" class="org.apache.usergrid.corepersistence.CpSetup">
+    <bean id="setup" class="org.apache.usergrid.corepersistence.HybridSetup">
+        <constructor-arg ref="properties"/>
         <constructor-arg ref="entityManagerFactory"/>
         <constructor-arg ref="cassandraService"/>
     </bean>
 
-    <!--  <bean id="setup" class="org.apache.usergrid.persistence.cassandra.Setup">
-      <constructor-arg ref="entityManagerFactory"/>
-      <constructor-arg ref="cassandraService"/>
-    </bean>-->
-
     <!-- The default schema manager -->
     <!-- refer to a named schemaManager from the DataControl annotation thusly -->
     <bean id="coreManager" class="org.apache.usergrid.persistence.CoreSchemaManager">


Mime
View raw message