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: Remove unnecessary recursion from CpWalker and un-ignore the re-index test.
Date Fri, 17 Oct 2014 19:12:42 GMT
Repository: incubator-usergrid
Updated Branches:
  refs/heads/two-dot-o 2cdcf6240 -> 68bd94fd0


Remove unnecessary recursion from CpWalker and un-ignore the re-index test.


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

Branch: refs/heads/two-dot-o
Commit: 1d26caa52dda711cfe2b113ac489c2546492a16b
Parents: c88282b
Author: Dave Johnson <dmjohnson@apigee.com>
Authored: Mon Oct 13 16:50:33 2014 -0400
Committer: Dave Johnson <dmjohnson@apigee.com>
Committed: Mon Oct 13 16:50:33 2014 -0400

----------------------------------------------------------------------
 .../usergrid/corepersistence/CpWalker.java      | 18 -----------------
 .../PerformanceEntityRebuildIndexTest.java      | 21 ++++++++++----------
 2 files changed, 11 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1d26caa5/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpWalker.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpWalker.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpWalker.java
index b507edd..049f43f 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpWalker.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpWalker.java
@@ -90,11 +90,6 @@ public class CpWalker {
                         applicationScope.getApplication().getUuid()
                 });
 
-
-                Observable<String> edgeTypes = gm.getEdgeTypesFromSource( new SimpleSearchEdgeType(fromEntityId,
CpNamingUtils.EDGE_COLL_SUFFIX, null ));
-
-
-
                 Observable<Edge> edges = gm.loadEdgesFromSource( new SimpleSearchByEdgeType(

                         fromEntityId, edgeType, Long.MAX_VALUE, 
                         SearchByEdgeType.Order.DESCENDING, null ));
@@ -133,13 +128,6 @@ public class CpWalker {
                             visitor.visitCollectionEntry( 
                                     em, collName, sourceEntity, targetEntity );
 
-                            // recursion
-                            if ( !stack.contains( targetEntity.getUuid() )) {
-                                stack.push( targetEntity.getUuid() );
-                                doWalkCollections( em, edge.getSourceNode(), visitor, stack
);
-                                stack.pop(); 
-                            }
-
                         } else {
 
                             String collName = CpNamingUtils.getConnectionType(edgeType);
@@ -147,12 +135,6 @@ public class CpWalker {
                             visitor.visitConnectionEntry( 
                                     em, collName, sourceEntity, targetEntity );
 
-                            // recursion
-                            if ( !stack.contains( targetEntity.getUuid() )) {
-                                stack.push( targetEntity.getUuid() );
-                                doWalkCollections( em, edge.getTargetNode(), visitor, stack
);
-                                stack.pop(); 
-                            }
                         }
                     }
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1d26caa5/stack/core/src/test/java/org/apache/usergrid/persistence/PerformanceEntityRebuildIndexTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/PerformanceEntityRebuildIndexTest.java
b/stack/core/src/test/java/org/apache/usergrid/persistence/PerformanceEntityRebuildIndexTest.java
index 8de520a..a759f48 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/PerformanceEntityRebuildIndexTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/PerformanceEntityRebuildIndexTest.java
@@ -60,17 +60,15 @@ import static org.junit.Assert.fail;
 //@RunWith(JukitoRunner.class)
 //@UseModules({ GuiceModule.class })
 @Concurrent()
-@Ignore("Temporary ignore")
 public class PerformanceEntityRebuildIndexTest extends AbstractCoreIT {
     private static final Logger logger = LoggerFactory.getLogger(PerformanceEntityRebuildIndexTest.class
);
 
     private static final MetricRegistry registry = new MetricRegistry();
     private Slf4jReporter reporter;
 
-    private static final long RUNTIME = TimeUnit.MINUTES.toMillis( 1 );
+    private static final long RuntimeMs = 10000;  
 
-    private static final long writeDelayMs = 100;
-    //private static final long readDelayMs = 7;
+    private static final long writeDelayMs = 10;
 
     @Rule
     public Application app = new CoreApplication( setup );
@@ -106,8 +104,6 @@ public class PerformanceEntityRebuildIndexTest extends AbstractCoreIT
{
 
         // ----------------- create a bunch of entities
 
-        final long stopTime = System.currentTimeMillis() + RUNTIME;
-
         Map<String, Object> entityMap = new HashMap<String, Object>() {{
             put("key1", 1000 );
             put("key2", 2000 );
@@ -130,6 +126,8 @@ public class PerformanceEntityRebuildIndexTest extends AbstractCoreIT
{
         Entity cat2 = em.create("cat", cat2map );
         Entity cat3 = em.create("cat", cat3map );
 
+        final long stopTime = System.currentTimeMillis() + RuntimeMs;
+
         List<EntityRef> entityRefs = new ArrayList<EntityRef>();
         int entityCount = 0;
         while ( System.currentTimeMillis() < stopTime ) {
@@ -151,7 +149,7 @@ public class PerformanceEntityRebuildIndexTest extends AbstractCoreIT
{
             }
 
             entityRefs.add(new SimpleEntityRef( entity.getType(), entity.getUuid() ) );
-            if ( entityCount % 100 == 0 ) {
+            if ( entityCount % 10 == 0 ) {
                 logger.info("Created {} entities", entityCount );
             }
 
@@ -191,12 +189,15 @@ public class PerformanceEntityRebuildIndexTest extends AbstractCoreIT
{
         
         EntityManagerFactory.ProgressObserver po = new EntityManagerFactory.ProgressObserver()
{
             int counter = 0;
+
             @Override
             public void onProgress( EntityRef s, EntityRef t, String etype ) {
                 meter.mark();
-                logger.debug("Indexing from {}:{} to {}:{} edgeType {}", new Object[] {
-                    s.getType(), s.getUuid(), t.getType(), t.getUuid(), etype });
-                if ( !logger.isDebugEnabled() && counter % 100 == 0 ) {
+
+//                logger.debug("Indexing from {}:{} to {}:{} edgeType {}", new Object[] {
+//                    s.getType(), s.getUuid(), t.getType(), t.getUuid(), etype });
+
+                if ( !logger.isDebugEnabled() && counter % 10 == 0 ) {
                     logger.info("Reindexed {} entities", counter );
                 }
                 counter++;


Mime
View raw message