You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by mr...@apache.org on 2015/11/12 20:44:03 UTC

[2/5] usergrid git commit: fix alias issues

fix alias issues


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

Branch: refs/heads/2.1-release
Commit: 30053318fd848cf777d76af77c90edc474a579ee
Parents: fec6520
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Nov 12 12:10:07 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Nov 12 12:10:07 2015 -0700

----------------------------------------------------------------------
 .../asyncevents/AmazonAsyncEventService.java             | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/30053318/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java
index 77777c2..a4b7ef7 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java
@@ -551,7 +551,7 @@ public class AmazonAsyncEventService implements AsyncEventService {
             indexOperationMessage = ObjectJsonSerializer.INSTANCE.fromString( message, IndexOperationMessage.class );
         }
 
-        checkInitialize(indexOperationMessage);
+        initializeEntityIndexes(indexOperationMessage);
 
         //NOTE that we intentionally do NOT delete from the map.  We can't know when all regions have consumed the message
         //so we'll let compaction on column expiration handle deletion
@@ -567,13 +567,20 @@ public class AmazonAsyncEventService implements AsyncEventService {
 
     }
 
-    private void checkInitialize(final IndexOperationMessage indexOperationMessage) {
+    /**
+     *     this method will call initialize for each message, since we are caching the entity indexes,
+     *     we don't worry about aggregating by app id
+     * @param indexOperationMessage
+     */
+    private void initializeEntityIndexes(final IndexOperationMessage indexOperationMessage) {
+        //loop through all adds
         indexOperationMessage.getIndexRequests().stream().forEach(req -> {
             UUID appId = IndexingUtils.getApplicationIdFromIndexDocId(req.documentId);
             ApplicationScope appScope = CpNamingUtils.getApplicationScope(appId);
             entityIndexFactory.createEntityIndex(indexLocationStrategyFactory.getIndexLocationStrategy(appScope));
         });
 
+        //loop through all deletes
         indexOperationMessage.getDeIndexRequests().stream().forEach(req -> {
             UUID appId = IndexingUtils.getApplicationIdFromIndexDocId(req.documentId);
             ApplicationScope appScope = CpNamingUtils.getApplicationScope(appId);