usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [3/4] git commit: Additional debugging.
Date Thu, 02 Oct 2014 16:18:29 GMT
Additional debugging.


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

Branch: refs/heads/two-dot-o
Commit: 1073f11588a55f0718325ec66f23800546aeda8f
Parents: a6665f1
Author: Dave Johnson <dmjohnson@apigee.com>
Authored: Thu Oct 2 12:17:52 2014 -0400
Committer: Dave Johnson <dmjohnson@apigee.com>
Committed: Thu Oct 2 12:17:52 2014 -0400

----------------------------------------------------------------------
 .../corepersistence/CpEntityManager.java        | 88 +++++++++++++-------
 .../corepersistence/CpEntityManagerFactory.java |  2 -
 2 files changed, 59 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1073f115/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
index 8d3940d..f618a80 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
@@ -2846,20 +2846,20 @@ public class CpEntityManager implements EntityManager {
                             org.apache.usergrid.persistence.model.entity.Entity collEntity
= 
                                 collMgr.load( edge.getSourceNode() ).toBlockingObservable().last();
 
-//                            if (collEntity == null) {
-//                                if (logger.isDebugEnabled()) {
-//                                    logger.error("FAILED to load entity {}:{} "
-//                                            + "from scope\n   app {}\n   owner {}\n   name
{}",
-//                                            new Object[]{
-//                                                edge.getSourceNode().getType(), 
-//                                                edge.getSourceNode().getUuid(),
-//                                                collScope.getApplication(),
-//                                                collScope.getOwner(),
-//                                                collScope.getName()
-//                                            });
-//                                }
-//                                return;
-//                            }
+                            if (collEntity == null) {
+                                if (logger.isDebugEnabled()) {
+                                    logger.error("FAILED to load entity {}:{} "
+                                            + "from scope\n   app {}\n   owner {}\n   name
{}",
+                                            new Object[]{
+                                                edge.getSourceNode().getType(), 
+                                                edge.getSourceNode().getUuid(),
+                                                collScope.getApplication(),
+                                                collScope.getOwner(),
+                                                collScope.getName()
+                                            });
+                                }
+                                return;
+                            }
 
                             CollectionScope memberScope = new CollectionScopeImpl(
                                 applicationScope.getApplication(),
@@ -2871,20 +2871,20 @@ public class CpEntityManager implements EntityManager {
                             org.apache.usergrid.persistence.model.entity.Entity memberEntity
= 
                                 memberMgr.load( edge.getTargetNode()).toBlockingObservable().last();
 
-//                            if (memberEntity == null) {
-//                                if (logger.isDebugEnabled()) {
-//                                    logger.error("FAILED to load entity {}:{} "
-//                                            + "from scope\n   app {}\n   owner {}\n   name
{}",
-//                                            new Object[]{
-//                                                edge.getTargetNode().getType(), 
-//                                                edge.getTargetNode().getUuid(),
-//                                                memberScope.getApplication(),
-//                                                memberScope.getOwner(),
-//                                                memberScope.getName()
-//                                            });
-//                                }
-//                                return;
-//                            }
+                            if (memberEntity == null) {
+                                if (logger.isDebugEnabled()) {
+                                    logger.error("FAILED to load entity {}:{} "
+                                            + "from scope\n   app {}\n   owner {}\n   name
{}",
+                                            new Object[]{
+                                                edge.getTargetNode().getType(), 
+                                                edge.getTargetNode().getUuid(),
+                                                memberScope.getApplication(),
+                                                memberScope.getOwner(),
+                                                memberScope.getName()
+                                            });
+                                }
+                                return;
+                            }
 
                             indexEntityIntoCollections( collEntity, memberEntity, collName,
true );
 
@@ -2914,7 +2914,22 @@ public class CpEntityManager implements EntityManager {
                                 managerCache.getEntityCollectionManager(sourceScope);
 
                             org.apache.usergrid.persistence.model.entity.Entity sourceEntity
= 
-                                sourceEcm.load( fromEntityId ).toBlockingObservable().last();
+                                sourceEcm.load( edge.getSourceNode() ).toBlockingObservable().last();
+
+                            if (sourceEntity == null) {
+                                if (logger.isDebugEnabled()) {
+                                    logger.error("FAILED to load entity {}:{} "
+                                            + "from scope\n   app {}\n   owner {}\n   name
{}",
+                                            new Object[]{
+                                                edge.getSourceNode().getType(), 
+                                                edge.getSourceNode().getUuid(),
+                                                sourceScope.getApplication(),
+                                                sourceScope.getOwner(),
+                                                sourceScope.getName()
+                                            });
+                                }
+                                return;
+                            }
 
                             CollectionScope targetScope = new CollectionScopeImpl(
                                 applicationScope.getApplication(),
@@ -2926,6 +2941,21 @@ public class CpEntityManager implements EntityManager {
                             org.apache.usergrid.persistence.model.entity.Entity targetEntity
= 
                                 targetEcm.load( edge.getTargetNode() ).toBlockingObservable().last();
 
+                            if (targetEntity == null) {
+                                if (logger.isDebugEnabled()) {
+                                    logger.error("FAILED to load entity {}:{} "
+                                            + "from scope\n   app {}\n   owner {}\n   name
{}",
+                                            new Object[]{
+                                                edge.getTargetNode().getType(), 
+                                                edge.getTargetNode().getUuid(),
+                                                targetScope.getApplication(),
+                                                targetScope.getOwner(),
+                                                targetScope.getName()
+                                            });
+                                }
+                                return;
+                            }
+
                             indexEntityIntoConnection( 
                                     sourceEntity, targetEntity, targetEntityType, connType
);
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1073f115/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 845d798..26f4234 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
@@ -52,8 +52,6 @@ import org.apache.usergrid.persistence.graph.GraphManagerFactory;
 import org.apache.usergrid.persistence.graph.SearchByEdgeType;
 import org.apache.usergrid.persistence.graph.impl.SimpleSearchByEdgeType;
 import org.apache.usergrid.persistence.index.EntityIndexFactory;
-import org.apache.usergrid.persistence.index.IndexScope;
-import org.apache.usergrid.persistence.index.impl.IndexScopeImpl;
 import org.apache.usergrid.persistence.index.query.Query;
 import org.apache.usergrid.persistence.model.entity.Id;
 import org.apache.usergrid.persistence.model.entity.SimpleId;


Mime
View raw message