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 2016/07/26 21:18:07 UTC

[28/50] usergrid git commit: Fix issue where de-indexing assumed all entities were time based UUIDs. They should be, but there could be some legacy data. USERGRID-1305

Fix issue where de-indexing assumed all entities were time based UUIDs.  They should be, but there could be some legacy data.  USERGRID-1305


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

Branch: refs/heads/apigee-sso-provider
Commit: f95bf96cd30b41bc8c1edea73a827049acaee747
Parents: 86ae2cd
Author: Michael Russo <mr...@apigee.com>
Authored: Fri Jul 8 08:32:03 2016 -0700
Committer: Michael Russo <mr...@apigee.com>
Committed: Fri Jul 8 08:32:03 2016 -0700

----------------------------------------------------------------------
 .../usergrid/corepersistence/index/IndexServiceImpl.java | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/f95bf96c/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 54b18bb..1d56928 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
@@ -278,10 +278,12 @@ public class IndexServiceImpl implements IndexService {
         final EntityIndex ei = entityIndexFactory.
             createEntityIndex(indexLocationStrategyFactory.getIndexLocationStrategy(applicationScope) );
 
-
+        // use LONG.MAX_VALUE in search edge because this value is not used elsewhere in lower code foe de-indexing
+        // previously .timstamp() was used on entityId, but some entities do not have type-1 UUIDS ( legacy data)
         final SearchEdge searchEdgeFromSource = createSearchEdgeFromSource( new SimpleEdge( applicationScope.getApplication(),
             CpNamingUtils.getEdgeTypeFromCollectionName( InflectionUtils.pluralize( entityId.getType() ) ), entityId,
-            entityId.getUuid().timestamp() ) );
+            Long.MAX_VALUE ) );
+
 
 
         final EntityIndexBatch batch = ei.createBatch();
@@ -308,10 +310,11 @@ public class IndexServiceImpl implements IndexService {
         final EntityIndex ei = entityIndexFactory.
             createEntityIndex(indexLocationStrategyFactory.getIndexLocationStrategy(applicationScope) );
 
-
+        // use LONG.MAX_VALUE in search edge because this value is not used elsewhere in lower code foe de-indexing
+        // previously .timstamp() was used on entityId, but some entities do not have type-1 UUIDS ( legacy data)
         final SearchEdge searchEdgeFromSource = createSearchEdgeFromSource( new SimpleEdge( applicationScope.getApplication(),
             CpNamingUtils.getEdgeTypeFromCollectionName( InflectionUtils.pluralize( entityId.getType() ) ), entityId,
-             entityId.getUuid().timestamp() ) );
+            Long.MAX_VALUE ) );
 
 
         final EntityIndexBatch batch = ei.createBatch();