usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject [2/5] incubator-usergrid git commit: Updates iteration logic in the management service for iterating apps
Date Wed, 01 Apr 2015 18:28:05 GMT
Updates iteration logic in the management service for iterating apps

Reverts connect back removal.  This is required for dual indexing.


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

Branch: refs/heads/two-dot-o_exception_verification
Commit: beb2a2a5337927f13d9a7c563bb936214eda159b
Parents: c7fa864
Author: Todd Nine <tnine@apigee.com>
Authored: Wed Mar 25 16:59:21 2015 -0600
Committer: Todd Nine <tnine@apigee.com>
Committed: Wed Mar 25 16:59:21 2015 -0600

----------------------------------------------------------------------
 .../corepersistence/CpRelationManager.java        | 13 ++++++-------
 stack/core/src/test/resources/log4j.properties    |  2 +-
 .../cassandra/ManagementServiceImpl.java          | 18 +++++++++++-------
 3 files changed, 18 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/beb2a2a5/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
index 7179baf..da39ea9 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
@@ -702,13 +702,12 @@ public class CpRelationManager implements RelationManager {
         //            headEntityScope.getOwner().toString(),
         //            headEntityScope.getName()});
 
-        //TODO T.N.  This should even be neccessary any longer, graph maintains 2 edges.
 .
-//        if ( connectBack && collection != null && collection.getLinkedCollection()
!= null ) {
-//            getRelationManager( itemEntity ).addToCollection(
-//                    collection.getLinkedCollection(), headEntity, cpHeadEntity, false );
-//            getRelationManager( itemEntity ).addToCollection(
-//                    collection.getLinkedCollection(), headEntity, false );
-//        }
+        if ( connectBack && collection != null && collection.getLinkedCollection()
!= null ) {
+            getRelationManager( itemEntity ).addToCollection(
+                    collection.getLinkedCollection(), headEntity, cpHeadEntity, false );
+            getRelationManager( itemEntity ).addToCollection(
+                    collection.getLinkedCollection(), headEntity, false );
+        }
 
         return itemEntity;
     }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/beb2a2a5/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 0ba16ea..3dee8f6 100644
--- a/stack/core/src/test/resources/log4j.properties
+++ b/stack/core/src/test/resources/log4j.properties
@@ -45,7 +45,7 @@ log4j.logger.org.apache.usergrid.persistence.PerformanceEntityRebuildIndexTest=D
 
 log4j.logger.org.apache.usergrid.corepersistence.migration=WARN
 
-log4j.logger.org.apache.usergrid.persistence.index.impl=DEBUG
+#log4j.logger.org.apache.usergrid.persistence.index.impl=DEBUG
 #log4j.logger.org.apache.usergrid.corepersistence.CpSetup=INFO
 #log4j.logger.org.apache.usergrid.corepersistence=DEBUG
 #log4j.logger.org.apache.usergrid.corepersistence.CpEntityManagerFactory=DEBUG

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/beb2a2a5/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
b/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
index 854c3e0..0cf80b4 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
@@ -1477,21 +1477,25 @@ public class ManagementServiceImpl implements ManagementService {
 
         BiMap<UUID, String> organizations = HashBiMap.create();
         EntityManager em = emf.getEntityManager( smf.getManagementAppId() );
-        Results results = em.getCollection( new SimpleEntityRef( User.ENTITY_TYPE, userId
), "groups", null, 10000,
+        Results results = em.getCollection( new SimpleEntityRef( User.ENTITY_TYPE, userId
), "groups", null, 1000,
                 Level.ALL_PROPERTIES, false );
 
         String path = null;
 
-        for ( Entity entity : results.getEntities() ) {
+        do {
+            for ( Entity entity : results.getEntities() ) {
+
+                path = ( String ) entity.getProperty( PROPERTY_PATH );
 
-            path = ( String ) entity.getProperty( PROPERTY_PATH );
+                if ( path != null ) {
+                    path = path.toLowerCase();
+                }
 
-            if ( path != null ) {
-                path = path.toLowerCase();
+                organizations.put( entity.getUuid(), path );
             }
 
-            organizations.put( entity.getUuid(), path );
-        }
+            results = results.getNextPageResults();
+        }while(results != null);
 
         return organizations;
     }


Mime
View raw message