usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sfeld...@apache.org
Subject [07/36] usergrid git commit: removing async processing
Date Thu, 01 Oct 2015 16:27:42 GMT
removing async processing


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

Branch: refs/heads/master
Commit: 3ece30f018bbd28feea53537b62724b247904bfa
Parents: 2a16827
Author: Shawn Feldman <sfeldman@apache.org>
Authored: Tue Sep 15 15:09:28 2015 -0600
Committer: Shawn Feldman <sfeldman@apache.org>
Committed: Thu Sep 24 15:00:59 2015 -0600

----------------------------------------------------------------------
 .../apache/usergrid/corepersistence/CoreModule.java   |  4 ----
 .../usergrid/corepersistence/CpEntityManager.java     |  9 ---------
 .../corepersistence/index/IndexServiceImpl.java       |  4 ----
 .../corepersistence/StaleIndexCleanupTest.java        | 14 +++++---------
 .../index/impl/EsEntityIndexBatchImpl.java            |  5 +----
 .../index/impl/EsIndexBufferConsumerImpl.java         |  4 +---
 6 files changed, 7 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/3ece30f0/stack/core/src/main/java/org/apache/usergrid/corepersistence/CoreModule.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CoreModule.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CoreModule.java
index 486aa6f..959edec 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CoreModule.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CoreModule.java
@@ -77,14 +77,10 @@ public class CoreModule  extends AbstractModule {
 
 
 
-    public static final String EVENTS_DISABLED = "corepersistence.events.disabled";
-
-
 
     @Override
     protected void configure() {
 
-
         install( new CommonModule());
         install( new CollectionModule() {
             /**

http://git-wip-us.apache.org/repos/asf/usergrid/blob/3ece30f0/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 dc3d6a2..d46c112 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
@@ -2627,15 +2627,6 @@ public class CpEntityManager implements EntityManager {
             handleWriteUniqueVerifyException( entity, wuve );
         }
 
-
-        // Index CP entity into default collection scope
-        //        IndexScope defaultIndexScope = new IndexScopeImpl(
-        //            applicationScope.getApplication(),
-        //            applicationScope.getApplication(),
-        //            CpEntityManager.getCollectionScopeNameFromEntityType( entity.getType()
) );
-        //        EntityIndex ei = managerCache.getEntityIndex( applicationScope );
-        //        ei.createBatch().index( defaultIndexScope, cpEntity ).execute();
-
         // reflect changes in the legacy Entity
         entity.setUuid( cpEntity.getId().getUuid() );
         entity.setProperties( cpEntity );

http://git-wip-us.apache.org/repos/asf/usergrid/blob/3ece30f0/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexServiceImpl.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexServiceImpl.java
index 3ca33a3..8a8dba1 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexServiceImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexServiceImpl.java
@@ -104,10 +104,6 @@ public class IndexServiceImpl implements IndexService {
 
         //do our observable for batching
         //try to send a whole batch if we can
-
-
-        //do our observable for batching
-        //try to send a whole batch if we can
         final Observable<IndexOperationMessage>  batches =  sourceEdgesToIndex.buffer(
indexFig.getIndexBatchSize() )
 
             //map into batches based on our buffer size

http://git-wip-us.apache.org/repos/asf/usergrid/blob/3ece30f0/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
b/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
index 832409b..366d41c 100644
--- a/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
@@ -60,7 +60,6 @@ import com.google.inject.Injector;
 
 import net.jcip.annotations.NotThreadSafe;
 
-import static org.apache.usergrid.corepersistence.CoreModule.EVENTS_DISABLED;
 import static org.apache.usergrid.persistence.Schema.TYPE_APPLICATION;
 import static org.apache.usergrid.persistence.core.util.IdGenerator.createId;
 import static org.junit.Assert.assertEquals;
@@ -73,6 +72,7 @@ import static org.junit.Assert.assertTrue;
 @NotThreadSafe
 public class StaleIndexCleanupTest extends AbstractCoreIT {
     private static final Logger logger = LoggerFactory.getLogger( StaleIndexCleanupTest.class
);
+    public static final String EVENTS_DISABLED = "corepersistence.events.disabled";
 
     // take it easy on Cassandra
     private static final long writeDelayMs = 0;
@@ -379,7 +379,7 @@ public class StaleIndexCleanupTest extends AbstractCoreIT {
         app.refreshIndex();
 
         Thread.sleep(250); // refresh happens asynchronously, wait for some time
-        
+
 
         //we can't use our candidate result sets here.  The repair won't happen since we
now have orphaned documents in our index
         //us the EM so the repair process happens
@@ -401,7 +401,7 @@ public class StaleIndexCleanupTest extends AbstractCoreIT {
      * 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(timeout=30000)
+    @Test()
     public void testCleanupOnUpdate() throws Exception {
 
         logger.info( "Started testCleanupOnUpdate()" );
@@ -425,20 +425,17 @@ public class StaleIndexCleanupTest extends AbstractCoreIT {
         app.refreshIndex();
 
         CandidateResults crs = queryCollectionCp( "dogs", "dog", "select *");
-        Assert.assertEquals( "Expect no stale candidates yet", numEntities, crs.size() );
+        Assert.assertEquals("Expect no stale candidates yet", numEntities, crs.size());
 
         // turn off post processing stuff that cleans up stale entities
-        System.setProperty( EVENTS_DISABLED, "false" );
 
         // update each entity a bunch of times
 
-        List<Entity> maxVersions = new ArrayList<>(numEntities);
         int count = 0;
         for ( Entity dog : dogs ) {
-            Entity toUpdate = null;
 
             for ( int j=0; j<numUpdates; j++) {
-                toUpdate = em.get( dog.getUuid() );
+                Entity toUpdate = em.get( dog.getUuid() );
                 toUpdate.setProperty( "property", RandomStringUtils.randomAlphanumeric(10));
                 em.update(toUpdate);
                 count++;
@@ -447,7 +444,6 @@ public class StaleIndexCleanupTest extends AbstractCoreIT {
                 }
             }
 
-            maxVersions.add( toUpdate );
         }
         app.refreshIndex();
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/3ece30f0/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
index 87b2368..c11feed 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
@@ -123,10 +123,7 @@ public class EsEntityIndexBatchImpl implements EntityIndexBatch {
 
     @Override
     public Observable execute() {
-        IndexOperationMessage tempContainer = container;
-        container = new IndexOperationMessage();
-
-        return indexBatchBufferProducer.put( tempContainer );
+        return indexBatchBufferProducer.put( container );
     }
 
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/3ece30f0/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java
index 93c0d85..514e6eb 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java
@@ -96,7 +96,6 @@ public class EsIndexBufferConsumerImpl implements IndexBufferConsumer {
         Preconditions.checkNotNull(message, "Message cannot be null");
         indexSizeCounter.inc(message.getDeIndexRequests().size());
         indexSizeCounter.inc(message.getIndexRequests().size());
-
         return  processBatch(message);
     }
 
@@ -185,8 +184,7 @@ public class EsIndexBufferConsumerImpl implements IndexBufferConsumer
{
 
         try {
             responses = bulkRequest.execute().actionGet( );
-        }
-        catch ( Throwable t ) {
+        } catch ( Throwable t ) {
             log.error( "Unable to communicate with elasticsearch" );
             failureMonitor.fail( "Unable to execute batch", t );
             throw t;


Mime
View raw message