usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [4/5] git commit: Merge branch 'pr/92' into two-dot-o-events. This closes #92
Date Tue, 04 Nov 2014 16:11:48 GMT
Merge branch 'pr/92' into two-dot-o-events.  This closes #92

Conflicts:
	stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java


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

Branch: refs/heads/two-dot-o-events
Commit: 5706b2c0551bb64b1d1ad31718b16026a1d226ce
Parents: 5c4c24d e9f876c
Author: Dave Johnson <dmjohnson@apigee.com>
Authored: Tue Nov 4 10:32:30 2014 -0500
Committer: Dave Johnson <dmjohnson@apigee.com>
Committed: Tue Nov 4 10:32:30 2014 -0500

----------------------------------------------------------------------
 .../corepersistence/CpEntityManager.java        |   2 +-
 .../usergrid/corepersistence/GuiceModule.java   |   9 ++
 .../events/EntityVersionCreatedHandler.java     |  17 ++-
 .../corepersistence/StaleIndexCleanupTest.java  |  33 ++++-
 .../corepersistence/TestGuiceModule.java        |   5 +
 .../impl/EntityCollectionManagerImpl.java       |   9 +-
 .../impl/EntityVersionCreatedTask.java          |   4 +-
 .../impl/EntityVersionCreatedTaskTest.java      | 132 +++++++++++++++----
 .../index/impl/EsEntityIndexBatchImpl.java      |  27 ++--
 .../persistence/index/impl/IndexingUtils.java   |   2 +
 10 files changed, 189 insertions(+), 51 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/5706b2c0/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/5706b2c0/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
----------------------------------------------------------------------
diff --cc stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
index 3dd63c0,1e64502..97a7288
--- a/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
@@@ -284,10 -310,12 +310,12 @@@ public class StaleIndexCleanupTest exte
       * Test that the EntityDeleteImpl cleans up stale indexes on update. Ensures that when
an 
       * entity is updated its old indexes are cleared from ElasticSearch.
       */
 -    @Test
 +    @Test(timeout=10000)
      public void testCleanupOnUpdate() throws Exception {
  
-         logger.info("Started testCleanupOnUpdate()");
+         System.setProperty( "allow.stale.entities","false" );
+ 
+         logger.info( "Started testCleanupOnUpdate()" );
  
          // TODO: turn off index cleanup on read
  
@@@ -337,16 -365,9 +365,17 @@@
  
          // query Core Persistence directly for total number of result candidates
          crs = queryCollectionCp("things", "select *");
-         Assert.assertEquals( "Expect stale candidates", numEntities * (numUpdates + 1),
crs.size());
+         Assert.assertEquals( "Expect candidates without earlier stale entities", numEntities,
crs.size() );
  
 +        // wait for indexes to be cleared for the deleted entities
 +        do {
 +            Thread.sleep(100);
 +            crs = queryCollectionCp("things", "select *");
 +        } while ( crs.size() > 0 );
 +
 +        // will never get here if test times out
 +        Assert.assertEquals( "Expect no candidates", 0, crs.size() );
+         System.clearProperty( "allow.stale.entities" );
      }
  
      

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/5706b2c0/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerImpl.java
----------------------------------------------------------------------


Mime
View raw message