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:02 UTC
[1/5] usergrid git commit: fix alias issues
Repository: usergrid
Updated Branches:
refs/heads/2.1-release 204bf0427 -> b89564398
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/fec6520e
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/fec6520e
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/fec6520e
Branch: refs/heads/2.1-release
Commit: fec6520eb47fa6fe7bc1d8d7fad6a729874f3475
Parents: 204bf04
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Nov 12 11:07:29 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Nov 12 11:47:08 2015 -0700
----------------------------------------------------------------------
.../asyncevents/AmazonAsyncEventService.java | 15 ++++++++
.../index/impl/DeIndexOperation.java | 4 +--
.../persistence/index/impl/IndexingUtils.java | 21 ++++++++++++
.../index/impl/IndexingUtilsTest.java | 36 ++++++++++++++++++++
4 files changed, 74 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/fec6520e/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 16e119c..77777c2 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
@@ -30,6 +30,7 @@ import java.util.concurrent.atomic.AtomicLong;
import java.util.stream.Collectors;
import java.util.stream.Stream;
+import org.apache.usergrid.persistence.index.impl.IndexingUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -550,6 +551,7 @@ public class AmazonAsyncEventService implements AsyncEventService {
indexOperationMessage = ObjectJsonSerializer.INSTANCE.fromString( message, IndexOperationMessage.class );
}
+ checkInitialize(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
@@ -565,6 +567,19 @@ public class AmazonAsyncEventService implements AsyncEventService {
}
+ private void checkInitialize(final IndexOperationMessage indexOperationMessage) {
+ indexOperationMessage.getIndexRequests().stream().forEach(req -> {
+ UUID appId = IndexingUtils.getApplicationIdFromIndexDocId(req.documentId);
+ ApplicationScope appScope = CpNamingUtils.getApplicationScope(appId);
+ entityIndexFactory.createEntityIndex(indexLocationStrategyFactory.getIndexLocationStrategy(appScope));
+ });
+
+ indexOperationMessage.getDeIndexRequests().stream().forEach(req -> {
+ UUID appId = IndexingUtils.getApplicationIdFromIndexDocId(req.documentId);
+ ApplicationScope appScope = CpNamingUtils.getApplicationScope(appId);
+ entityIndexFactory.createEntityIndex(indexLocationStrategyFactory.getIndexLocationStrategy(appScope));
+ });
+ }
@Override
http://git-wip-us.apache.org/repos/asf/usergrid/blob/fec6520e/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/DeIndexOperation.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/DeIndexOperation.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/DeIndexOperation.java
index dbecf8a..aefceda 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/DeIndexOperation.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/DeIndexOperation.java
@@ -44,10 +44,10 @@ import static org.apache.usergrid.persistence.index.impl.IndexingUtils.createInd
public class DeIndexOperation implements BatchOperation {
@JsonProperty
- private String[] indexes;
+ public String[] indexes;
@JsonProperty
- private String documentId;
+ public String documentId;
public DeIndexOperation() {
http://git-wip-us.apache.org/repos/asf/usergrid/blob/fec6520e/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexingUtils.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexingUtils.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexingUtils.java
index 18cb928..179b3c4 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexingUtils.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexingUtils.java
@@ -244,6 +244,23 @@ public class IndexingUtils {
return new CandidateResult( entityId, UUID.fromString( versionUUID ), documentId );
}
+ /**
+ * Parse the document id into a candidate result
+ */
+ public static UUID parseAppIdFromIndexDocId( final String documentId) {
+
+ final Matcher matcher = DOCUMENT_PATTERN.matcher(documentId);
+
+ Preconditions.checkArgument(matcher.matches(), "Pattern for document id did not match expected format");
+ Preconditions.checkArgument(matcher.groupCount() == 9, "9 groups expected in the pattern");
+
+ //Other fields can be parsed using groups. The groups start at value 1, group 0 is the entire match
+ final String appUUID = matcher.group(1);
+
+ return UUID.fromString(appUUID);
+
+ }
+
/**
* Get the entity type
@@ -262,4 +279,8 @@ public class IndexingUtils {
sb.append( ENTITY_TYPE_NAME).append("(" ).append( type ).append( ")" );
return sb.toString();
}
+
+ public static UUID getApplicationIdFromIndexDocId(String documentId) {
+ return parseAppIdFromIndexDocId(documentId);
+ }
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/fec6520e/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/IndexingUtilsTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/IndexingUtilsTest.java b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/IndexingUtilsTest.java
index 97389b2..d93f8a3 100644
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/IndexingUtilsTest.java
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/IndexingUtilsTest.java
@@ -31,6 +31,7 @@ import org.apache.usergrid.persistence.model.entity.Id;
import org.apache.usergrid.persistence.model.entity.SimpleId;
import org.apache.usergrid.persistence.model.util.UUIDGenerator;
+import static org.apache.usergrid.persistence.index.impl.IndexingUtils.parseAppIdFromIndexDocId;
import static org.apache.usergrid.persistence.index.impl.IndexingUtils.parseIndexDocId;
import static org.junit.Assert.assertEquals;
@@ -91,6 +92,41 @@ public class IndexingUtilsTest {
@Test
+ public void testAppIdFromDocumentId() {
+
+ final ApplicationScopeImpl applicationScope = new ApplicationScopeImpl( new SimpleId( "application" ) );
+
+ final Id id = new SimpleId( "id" );
+ final UUID version = UUIDGenerator.newTimeUUID();
+
+ final SearchEdgeImpl searchEdge =
+ new SearchEdgeImpl( new SimpleId( "source" ), "users", SearchEdge.NodeType.TARGET );
+
+ final String output = IndexingUtils.createIndexDocId( applicationScope, id, version, searchEdge );
+
+
+ final String expected =
+ "appId(" + applicationScope.getApplication().getUuid() + ",application).entityId(" + id.getUuid() + "," + id
+ .getType() + ").version(" + version + ").nodeId(" + searchEdge.getNodeId().getUuid() + "," + searchEdge
+ .getNodeId().getType() + ").edgeName(users).nodeType(TARGET)";
+
+
+ assertEquals( output, expected );
+
+
+ //now parse it
+
+ final CandidateResult parsedId = parseIndexDocId( output );
+
+ assertEquals(version, parsedId.getVersion());
+ assertEquals(id, parsedId.getId());
+
+ final UUID appId = parseAppIdFromIndexDocId(output);
+ assertEquals(appId,applicationScope.getApplication().getUuid());
+ }
+
+
+ @Test
public void testDocumentIdPipes() {
final ApplicationScopeImpl applicationScope = new ApplicationScopeImpl( new SimpleId( "application" ) );
[3/5] usergrid git commit: fix alias issues
Posted by mr...@apache.org.
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/c068ab0d
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/c068ab0d
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/c068ab0d
Branch: refs/heads/2.1-release
Commit: c068ab0d471bf8bf86dff2a9d3d30ae1baa0f24d
Parents: 3005331
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Nov 12 12:34:46 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Nov 12 12:34:46 2015 -0700
----------------------------------------------------------------------
.../asyncevents/AmazonAsyncEventService.java | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/c068ab0d/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 a4b7ef7..e99c052 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
@@ -22,9 +22,7 @@ package org.apache.usergrid.corepersistence.asyncevents;
import java.io.IOException;
import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.UUID;
+import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
import java.util.stream.Collectors;
@@ -573,18 +571,25 @@ public class AmazonAsyncEventService implements AsyncEventService {
* @param indexOperationMessage
*/
private void initializeEntityIndexes(final IndexOperationMessage indexOperationMessage) {
+ Map<UUID,Boolean> apps = new HashMap<>(indexOperationMessage.getIndexRequests().size()+indexOperationMessage.getDeIndexRequests().size());
//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));
+ if(!apps.containsKey(appId)) {
+ ApplicationScope appScope = CpNamingUtils.getApplicationScope(appId);
+ entityIndexFactory.createEntityIndex(indexLocationStrategyFactory.getIndexLocationStrategy(appScope));
+ apps.put(appId,true);
+ }
});
//loop through all deletes
indexOperationMessage.getDeIndexRequests().stream().forEach(req -> {
UUID appId = IndexingUtils.getApplicationIdFromIndexDocId(req.documentId);
- ApplicationScope appScope = CpNamingUtils.getApplicationScope(appId);
- entityIndexFactory.createEntityIndex(indexLocationStrategyFactory.getIndexLocationStrategy(appScope));
+ if(!apps.containsKey(appId)) {
+ ApplicationScope appScope = CpNamingUtils.getApplicationScope(appId);
+ entityIndexFactory.createEntityIndex(indexLocationStrategyFactory.getIndexLocationStrategy(appScope));
+ apps.put(appId,true);
+ }
});
}
[4/5] usergrid git commit: fix alias issues
Posted by mr...@apache.org.
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/f13e45b1
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/f13e45b1
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/f13e45b1
Branch: refs/heads/2.1-release
Commit: f13e45b16561494d460a0f9c8592e319308be049
Parents: c068ab0
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Nov 12 12:36:52 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Nov 12 12:36:52 2015 -0700
----------------------------------------------------------------------
.../asyncevents/AmazonAsyncEventService.java | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/f13e45b1/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 e99c052..b5e77c1 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
@@ -28,7 +28,8 @@ import java.util.concurrent.atomic.AtomicLong;
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import org.apache.usergrid.persistence.index.impl.IndexingUtils;
+import org.apache.usergrid.persistence.index.impl.*;
+import org.elasticsearch.action.index.IndexRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -56,8 +57,6 @@ import org.apache.usergrid.persistence.graph.Edge;
import org.apache.usergrid.persistence.index.EntityIndex;
import org.apache.usergrid.persistence.index.EntityIndexFactory;
import org.apache.usergrid.persistence.index.IndexLocationStrategy;
-import org.apache.usergrid.persistence.index.impl.IndexOperationMessage;
-import org.apache.usergrid.persistence.index.impl.IndexProducer;
import org.apache.usergrid.persistence.map.MapManager;
import org.apache.usergrid.persistence.map.MapManagerFactory;
import org.apache.usergrid.persistence.map.MapScope;
@@ -571,26 +570,26 @@ public class AmazonAsyncEventService implements AsyncEventService {
* @param indexOperationMessage
*/
private void initializeEntityIndexes(final IndexOperationMessage indexOperationMessage) {
- Map<UUID,Boolean> apps = new HashMap<>(indexOperationMessage.getIndexRequests().size()+indexOperationMessage.getDeIndexRequests().size());
+ final Map<UUID,Boolean> apps = new HashMap<>(indexOperationMessage.getIndexRequests().size()+indexOperationMessage.getDeIndexRequests().size());
//loop through all adds
- indexOperationMessage.getIndexRequests().stream().forEach(req -> {
- UUID appId = IndexingUtils.getApplicationIdFromIndexDocId(req.documentId);
+ for(IndexOperation req : indexOperationMessage.getIndexRequests()) {
+ final UUID appId = IndexingUtils.getApplicationIdFromIndexDocId(req.documentId);
if(!apps.containsKey(appId)) {
ApplicationScope appScope = CpNamingUtils.getApplicationScope(appId);
entityIndexFactory.createEntityIndex(indexLocationStrategyFactory.getIndexLocationStrategy(appScope));
apps.put(appId,true);
}
- });
+ };
//loop through all deletes
- indexOperationMessage.getDeIndexRequests().stream().forEach(req -> {
- UUID appId = IndexingUtils.getApplicationIdFromIndexDocId(req.documentId);
+ for(DeIndexOperation req : indexOperationMessage.getDeIndexRequests()) {
+ final UUID appId = IndexingUtils.getApplicationIdFromIndexDocId(req.documentId);
if(!apps.containsKey(appId)) {
ApplicationScope appScope = CpNamingUtils.getApplicationScope(appId);
entityIndexFactory.createEntityIndex(indexLocationStrategyFactory.getIndexLocationStrategy(appScope));
apps.put(appId,true);
}
- });
+ };
}
[5/5] usergrid git commit: Call foreach on the set directly and only
call createEntityIndex on a unique set of appIds.
Posted by mr...@apache.org.
Call foreach on the set directly and only call createEntityIndex on a unique set of appIds.
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/b8956439
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/b8956439
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/b8956439
Branch: refs/heads/2.1-release
Commit: b89564398e1094203d224a1586103fe9298d12d9
Parents: f13e45b
Author: Michael Russo <mi...@gmail.com>
Authored: Thu Nov 12 11:39:17 2015 -0800
Committer: Michael Russo <mi...@gmail.com>
Committed: Thu Nov 12 11:39:17 2015 -0800
----------------------------------------------------------------------
.../asyncevents/AmazonAsyncEventService.java | 34 +++++++++++---------
1 file changed, 18 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/b8956439/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 b5e77c1..e3b60a6 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
@@ -570,26 +570,28 @@ public class AmazonAsyncEventService implements AsyncEventService {
* @param indexOperationMessage
*/
private void initializeEntityIndexes(final IndexOperationMessage indexOperationMessage) {
- final Map<UUID,Boolean> apps = new HashMap<>(indexOperationMessage.getIndexRequests().size()+indexOperationMessage.getDeIndexRequests().size());
- //loop through all adds
- for(IndexOperation req : indexOperationMessage.getIndexRequests()) {
- final UUID appId = IndexingUtils.getApplicationIdFromIndexDocId(req.documentId);
- if(!apps.containsKey(appId)) {
- ApplicationScope appScope = CpNamingUtils.getApplicationScope(appId);
- entityIndexFactory.createEntityIndex(indexLocationStrategyFactory.getIndexLocationStrategy(appScope));
- apps.put(appId,true);
- }
- };
- //loop through all deletes
- for(DeIndexOperation req : indexOperationMessage.getDeIndexRequests()) {
- final UUID appId = IndexingUtils.getApplicationIdFromIndexDocId(req.documentId);
- if(!apps.containsKey(appId)) {
+ // create a set so we can have a unique list of appIds for which we call createEntityIndex
+ Set<UUID> appIds = new HashSet<>();
+
+ // loop through all indexRequests and add the appIds to the set
+ indexOperationMessage.getIndexRequests().forEach(req -> {
+ UUID appId = IndexingUtils.getApplicationIdFromIndexDocId(req.documentId);
+ appIds.add(appId);
+ });
+
+ // loop through all deindexRequests and add the appIds to the set
+ indexOperationMessage.getDeIndexRequests().forEach(req -> {
+ UUID appId = IndexingUtils.getApplicationIdFromIndexDocId(req.documentId);
+ appIds.add(appId);
+ });
+
+ // for each of the appIds in the unique set, call create entity index to ensure the aliases are created
+ appIds.forEach(appId -> {
ApplicationScope appScope = CpNamingUtils.getApplicationScope(appId);
entityIndexFactory.createEntityIndex(indexLocationStrategyFactory.getIndexLocationStrategy(appScope));
- apps.put(appId,true);
}
- };
+ );
}
[2/5] usergrid git commit: fix alias issues
Posted by mr...@apache.org.
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);