usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [1/8] git commit: Work to ensure we can still run Usergrid WITHOUT Core Persistence.
Date Wed, 16 Jul 2014 13:54:39 GMT
Repository: incubator-usergrid
Updated Branches:
  refs/heads/two-dot-o 71cb9c266 -> 2bad73d3c


Work to ensure we can still run Usergrid WITHOUT Core Persistence.


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

Branch: refs/heads/two-dot-o
Commit: dbeccea0b42f4c5fa442167911cc999bf0afeff2
Parents: 738a99d
Author: Dave Johnson <dmjohnson@apigee.com>
Authored: Fri May 30 10:59:07 2014 -0400
Committer: Dave Johnson <dmjohnson@apigee.com>
Committed: Fri May 30 10:59:07 2014 -0400

----------------------------------------------------------------------
 .../usergrid/persistence/AbstractEntity.java    |  2 +-
 .../cassandra/EntityManagerImpl.java            |  3 +-
 .../main/resources/usergrid-core-context.xml    | 20 +++---
 stack/core/src/test/resources/log4j.properties  | 25 +++----
 .../test/resources/usergrid-test-context.xml    | 68 ++++++++++----------
 .../resources/usergrid-rest-deploy-context.xml  |  2 -
 6 files changed, 62 insertions(+), 58 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/dbeccea0/stack/core/src/main/java/org/apache/usergrid/persistence/AbstractEntity.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/AbstractEntity.java
b/stack/core/src/main/java/org/apache/usergrid/persistence/AbstractEntity.java
index 1d97304..5cfe102 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/AbstractEntity.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/AbstractEntity.java
@@ -267,7 +267,7 @@ public abstract class AbstractEntity implements Entity {
     @Override
     @JsonAnySetter
     public void setDynamicProperty( String key, Object value ) {
-        if (value.equals("")) {
+        if (value == null || value.equals("")) {
 			if (dynamic_properties.containsKey(key)) {
 				dynamic_properties.remove(key);
 			}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/dbeccea0/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 b328ecc..7e6668d 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
@@ -664,12 +664,13 @@ public class EntityManagerImpl implements EntityManager {
         Assert.notEmpty( aliases, "aliases are required" );
 
         String propertyName = Schema.getDefaultSchema().aliasProperty( collectionName );
+        String entityType = Schema.getDefaultSchema().getCollectionType(ownerRef.getType(),
collectionName);
 
         Map<String, EntityRef> results = new HashMap<String, EntityRef>();
 
         for ( String alias : aliases ) {
             for ( UUID id : getUUIDsForUniqueProperty( ownerRef, collectionName, propertyName,
alias ) ) {
-                results.put( alias, new SimpleEntityRef( collectionName, id ) );
+                results.put( alias, new SimpleEntityRef( entityType, id ) );
             }
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/dbeccea0/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 c36e65a..2cb8a88 100644
--- a/stack/core/src/main/resources/usergrid-core-context.xml
+++ b/stack/core/src/main/resources/usergrid-core-context.xml
@@ -89,8 +89,6 @@
 		<property name="maxAttempts" value="10"/>
 	</bean>  -->
 	
-		
-	
 	<bean id="cassandraService"
 		class="org.apache.usergrid.persistence.cassandra.CassandraService" init-method="init" destroy-method="destroy">
 		<constructor-arg ref="properties" />
@@ -105,20 +103,22 @@
         <property name="defaultWriteConsistencyLevel" value="${cassandra.writecl}"/>
     </bean>
 	
-	<bean id="entityManagerFactory"
+<!--	
+    <bean id="entityManagerFactory"
 		class="org.apache.usergrid.corepersistence.CpEntityManagerFactory" 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,16 +163,18 @@
     
     <bean id="mailUtils" class="org.apache.usergrid.utils.MailUtils" />
 
-    <bean id="entityManager" class="org.apache.usergrid.corepersistence.CpEntityManager"
scope="prototype"/>
-<!--
+<!--    
     <bean id="entityManager" 
-        class="org.apache.usergrid.cassandra.EntityManagerImpl" 
+        class="org.apache.usergrid.corepersistence.CpEntityManager" 
         scope="prototype"/>
+-->
 
+    <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="traceTagAspect" class="org.apache.usergrid.persistence.cassandra.util.TraceTagAspect"/>
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/dbeccea0/stack/core/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/stack/core/src/test/resources/log4j.properties b/stack/core/src/test/resources/log4j.properties
index 75dc4d8..ef04b7d 100644
--- a/stack/core/src/test/resources/log4j.properties
+++ b/stack/core/src/test/resources/log4j.properties
@@ -26,18 +26,19 @@ log4j.appender.stdout=org.apache.log4j.ConsoleAppender
 log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
 log4j.appender.stdout.layout.ConversionPattern=%d %p (%t) %c{1} - %m%n
 
-#log4j.logger.org.apache.usergrid.persistence.cassandra.DB=WARN, stdout
-#log4j.logger.org.apache.usergrid.persistence.cassandra.BATCH=WARN, stdout
-#log4j.logger.org.apache.usergrid.persistence.cassandra.EntityManagerFactoryImpl=WARN, stdout
-#log4j.logger.org.apache.usergrid.persistence.cassandra.DaoUtils=WARN, stdout
-#log4j.logger.org.apache.usergrid.persistence.cassandra.EntityManagerImpl=WARN, stdout
-#log4j.logger.org.apache.usergrid.persistence.cassandra.ConnectionRefImpl=WARN, stdout
-#log4j.logger.me.prettyprint.cassandra.hector.TimingLogger=WARN, stdout
-#log4j.logger.org.apache.usergrid.rest.security.AllowAjaxFilter=WARN, stdout
-#log4j.logger.me.prettyprint.hector.api.beans.AbstractComposite=ERROR, stdout
-#log4j.logger.org.apache.usergrid.locking.singlenode.SingleNodeLockManagerImpl=DEBUG, stdout
-
-log4j.logger.org.apache.usergrid.persistence=INFO
+log4j.logger.org.apache.usergrid.persistence.cassandra.DB=WARN, stdout
+log4j.logger.org.apache.usergrid.persistence.cassandra.BATCH=WARN, stdout
+log4j.logger.org.apache.usergrid.persistence.cassandra.EntityManagerFactoryImpl=WARN, stdout
+log4j.logger.org.apache.usergrid.persistence.cassandra.DaoUtils=WARN, stdout
+log4j.logger.org.apache.usergrid.persistence.cassandra.EntityManagerImpl=DEBUG, stdout
+log4j.logger.org.apache.usergrid.persistence.cassandra.RelationshipManagerImpl=DEBUG, stdout
+log4j.logger.org.apache.usergrid.persistence.cassandra.ConnectionRefImpl=WARN, stdout
+log4j.logger.me.prettyprint.cassandra.hector.TimingLogger=WARN, stdout
+log4j.logger.org.apache.usergrid.rest.security.AllowAjaxFilter=WARN, stdout
+log4j.logger.me.prettyprint.hector.api.beans.AbstractComposite=ERROR, stdout
+log4j.logger.org.apache.usergrid.locking.singlenode.SingleNodeLockManagerImpl=DEBUG, stdout
+
+#log4j.logger.org.apache.usergrid.persistence=DEBUG
 #log4j.logger.org.apache.usergrid.corepersistence=DEBUG
 #log4j.logger.com.netflix.hystrix=DEBUG
 #log4j.logger.org.antlr=DEBUG

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/dbeccea0/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 f41d766..8fc54e5 100644
--- a/stack/core/src/test/resources/usergrid-test-context.xml
+++ b/stack/core/src/test/resources/usergrid-test-context.xml
@@ -1,46 +1,48 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <beans xmlns="http://www.springframework.org/schema/beans"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xmlns:util="http://www.springframework.org/schema/util"
-	xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
-	xmlns:hz="http://www.hazelcast.com/schema/config" xmlns:aop="http://www.springframework.org/schema/aop"
-	xsi:schemaLocation="
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:util="http://www.springframework.org/schema/util"
+       xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
+       xmlns:hz="http://www.hazelcast.com/schema/config" xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="
 	http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
 	http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
 	http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd
 	http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
 
 	
-	<!--  configure our test properties -->
-	<bean id="properties"
-		class="org.springframework.beans.factory.config.PropertiesFactoryBean">
-		<property name="singleton" value="true" />
-		<property name="ignoreResourceNotFound" value="true" />
-		<property name="locations">
-			<list>
-				<value>classpath:/usergrid-default.properties</value>
-				<value>classpath:/usergrid-test.properties</value>
-				<value>classpath:/usergrid-scheduler-test.properties</value>
-				<value>${usergrid-custom-spring-test-properties}</value>
-			</list>
-		</property>
-	</bean>
+    <!--  configure our test properties -->
+    <bean id="properties"
+          class="org.springframework.beans.factory.config.PropertiesFactoryBean">
+        <property name="singleton" value="true" />
+        <property name="ignoreResourceNotFound" value="true" />
+        <property name="locations">
+            <list>
+                <value>classpath:/usergrid-default.properties</value>
+                <value>classpath:/usergrid-test.properties</value>
+                <value>classpath:/usergrid-scheduler-test.properties</value>
+                <value>${usergrid-custom-spring-test-properties}</value>
+            </list>
+        </property>
+    </bean>
 
-	<import resource="classpath:/usergrid-core-context.xml"/>
+    <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.corepersistence.CpSetup">
+        <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>-->
+    <bean id="setup" class="org.apache.usergrid.persistence.cassandra.SetupImpl">
+        <constructor-arg ref="entityManagerFactory"/>
+        <constructor-arg ref="cassandraService"/>
+    </bean>
 
-  <!-- Refer to a named schemaManager from the DataControl annotation thusly -->
-  <bean id="coreManager" class="org.apache.usergrid.persistence.CoreSchemaManager">
-    <constructor-arg ref="setup"/>
-    <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"/>
+        <constructor-arg ref="cassandraCluster"/>
+    </bean>
 </beans>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/dbeccea0/stack/rest/src/main/resources/usergrid-rest-deploy-context.xml
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/resources/usergrid-rest-deploy-context.xml b/stack/rest/src/main/resources/usergrid-rest-deploy-context.xml
index c9d5fcf..73a4bd2 100644
--- a/stack/rest/src/main/resources/usergrid-rest-deploy-context.xml
+++ b/stack/rest/src/main/resources/usergrid-rest-deploy-context.xml
@@ -37,7 +37,5 @@
 			</list>
 		</property>
 	</bean>
-	
-
 
 </beans>


Mime
View raw message