usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [21/50] [abbrv] incubator-usergrid git commit: Fix bug observed at test-time, caused by new way of injecting EMF.
Date Wed, 03 Dec 2014 19:59:31 GMT
Fix bug observed at test-time, caused by new way of injecting EMF.


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

Branch: refs/heads/two-dot-o-events
Commit: 5f0dc347711c0d7921669e20ec03723acfcf0c7c
Parents: c326179
Author: Dave Johnson <dmjohnson@apigee.com>
Authored: Tue Nov 25 10:23:11 2014 -0500
Committer: Dave Johnson <dmjohnson@apigee.com>
Committed: Tue Nov 25 10:23:11 2014 -0500

----------------------------------------------------------------------
 .../corepersistence/events/EntityDeletedHandler.java         | 4 +---
 .../corepersistence/events/EntityVersionCreatedHandler.java  | 8 ++++----
 .../corepersistence/events/EntityVersionDeletedHandler.java  | 5 +----
 3 files changed, 6 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/5f0dc347/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityDeletedHandler.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityDeletedHandler.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityDeletedHandler.java
index d34b51c..865e284 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityDeletedHandler.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityDeletedHandler.java
@@ -24,7 +24,6 @@ import org.apache.usergrid.persistence.model.entity.Id;
 
 import java.util.UUID;
 import org.apache.usergrid.corepersistence.CpEntityManagerFactory;
-import org.apache.usergrid.corepersistence.HybridEntityManagerFactory;
 import org.apache.usergrid.persistence.EntityManagerFactory;
 import org.apache.usergrid.persistence.index.EntityIndex;
 import org.slf4j.Logger;
@@ -52,8 +51,7 @@ public class EntityDeletedHandler implements EntityDeleted {
             new Object[] { entityId.getType(), entityId.getUuid(), version,
                 scope.getName(), scope.getOwner(), scope.getApplication()});
 
-        HybridEntityManagerFactory hemf = (HybridEntityManagerFactory)emf;
-        CpEntityManagerFactory cpemf = (CpEntityManagerFactory)hemf.getImplementation();
+        CpEntityManagerFactory cpemf = (CpEntityManagerFactory)emf;
 
         final EntityIndex ei = cpemf.getManagerCache().getEntityIndex(scope);
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/5f0dc347/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityVersionCreatedHandler.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityVersionCreatedHandler.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityVersionCreatedHandler.java
index 3462ecb..68c5547 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityVersionCreatedHandler.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityVersionCreatedHandler.java
@@ -22,7 +22,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import org.apache.usergrid.corepersistence.CpEntityManagerFactory;
-import org.apache.usergrid.corepersistence.HybridEntityManagerFactory;
 import org.apache.usergrid.persistence.EntityManagerFactory;
 import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.event.EntityVersionCreated;
@@ -54,13 +53,14 @@ public class EntityVersionCreatedHandler implements EntityVersionCreated
{
                 new Object[] { entity.getId().getType(), entity.getId().getUuid(), entity.getVersion(),
                         scope.getName(), scope.getOwner(), scope.getApplication()});
 
-        HybridEntityManagerFactory hemf = (HybridEntityManagerFactory)emf;
-        CpEntityManagerFactory cpemf = (CpEntityManagerFactory)hemf.getImplementation();
+        CpEntityManagerFactory cpemf = (CpEntityManagerFactory)emf;
 
         final EntityIndex ei = cpemf.getManagerCache().getEntityIndex(scope);
 
-        //TODO why aren't we using a collection fig here? This seems kludgy
+        // This check is for testing purposes and for a test that to be able to dynamically
turn 
+        // off and on delete previous versions so that it can test clean-up on read.
         if ( System.getProperty( "allow.stale.entities", "false" ).equals( "false" )) {
+
             ei.deletePreviousVersions( entity.getId(), entity.getVersion() );
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/5f0dc347/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityVersionDeletedHandler.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityVersionDeletedHandler.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityVersionDeletedHandler.java
index d63edb7..a6e971a 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityVersionDeletedHandler.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityVersionDeletedHandler.java
@@ -18,7 +18,6 @@
 package org.apache.usergrid.corepersistence.events;
 
 import org.apache.usergrid.corepersistence.CpEntityManagerFactory;
-import org.apache.usergrid.corepersistence.CpSetup;
 import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.MvccEntity;
 import org.apache.usergrid.persistence.collection.event.EntityVersionDeleted;
@@ -35,7 +34,6 @@ import rx.schedulers.Schedulers;
 import java.util.List;
 
 import com.google.inject.Inject;
-import org.apache.usergrid.corepersistence.HybridEntityManagerFactory;
 import org.apache.usergrid.persistence.EntityManagerFactory;
 
 
@@ -59,8 +57,7 @@ public class EntityVersionDeletedHandler implements EntityVersionDeleted
{
     public void versionDeleted(
             final CollectionScope scope, final Id entityId, final List<MvccEntity>
entityVersions) {
 
-        HybridEntityManagerFactory hemf = (HybridEntityManagerFactory)emf;
-        CpEntityManagerFactory cpemf = (CpEntityManagerFactory)hemf.getImplementation();
+        CpEntityManagerFactory cpemf = (CpEntityManagerFactory)emf;
 
         final EntityIndex ei = cpemf.getManagerCache().getEntityIndex(scope);
         


Mime
View raw message