You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sf...@apache.org on 2015/06/30 23:04:08 UTC

[3/3] incubator-usergrid git commit: simplify interface

simplify interface


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

Branch: refs/heads/two-dot-o-dev
Commit: a30670a504a385bfb6e198acc9ca9847b8f982e2
Parents: 2a31237
Author: Shawn Feldman <sf...@apache.org>
Authored: Tue Jun 30 14:54:46 2015 -0600
Committer: Shawn Feldman <sf...@apache.org>
Committed: Tue Jun 30 14:54:46 2015 -0600

----------------------------------------------------------------------
 .../corepersistence/asyncevents/AmazonAsyncEventService.java  | 7 ++++---
 .../asyncevents/InMemoryAsyncEventService.java                | 6 ++++--
 .../apache/usergrid/corepersistence/index/ReIndexAction.java  | 4 ++--
 .../usergrid/corepersistence/index/ReIndexServiceImpl.java    | 5 +++--
 4 files changed, 13 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a30670a5/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 d163d09..b32d594 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
@@ -232,7 +232,8 @@ public class AmazonAsyncEventService implements AsyncEventService {
     @Override
     public void queueEntityIndexUpdate(final ApplicationScope applicationScope,
                                        final Entity entity) {
-        index(applicationScope,entity.getId());
+
+        offer(new EntityIndexEvent(new EntityIdScope(applicationScope, entity.getId())));
     }
 
 
@@ -427,8 +428,8 @@ public class AmazonAsyncEventService implements AsyncEventService {
     }
 
     @Override
-    public void index(final ApplicationScope applicationScope, final Id id) {
+    public void index(final ApplicationScope applicationScope, final Id id, final long updatedSince) {
         //change to id scope to avoid serialization issues
-        offer(new EntityIndexEvent(new EntityIdScope(applicationScope,id)));
+        offer(new EntityIndexEvent(new EntityIdScope(applicationScope, id)));
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a30670a5/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/InMemoryAsyncEventService.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/InMemoryAsyncEventService.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/InMemoryAsyncEventService.java
index e659dd5..f035b43 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/InMemoryAsyncEventService.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/InMemoryAsyncEventService.java
@@ -96,8 +96,10 @@ public class InMemoryAsyncEventService implements AsyncEventService {
 
 
     @Override
-    public void index( final ApplicationScope applicationScope, final Id id ) {
-        run(eventBuilder.index(new EntityIndexOperation(applicationScope, id, Long.MAX_VALUE)));
+    public void index( final ApplicationScope applicationScope, final Id id, final long updatedSince ) {
+        final EntityIndexOperation entityIndexOperation = new EntityIndexOperation( applicationScope, id, updatedSince );
+
+        run(eventBuilder.index( entityIndexOperation ));
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a30670a5/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ReIndexAction.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ReIndexAction.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ReIndexAction.java
index 409cdff..8a74540 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ReIndexAction.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ReIndexAction.java
@@ -33,8 +33,8 @@ public interface ReIndexAction {
 
     /**
      * Index this entity with the specified scope
-     * @param id
      * @param applicationScope
+     * @param id
      */
-    void index(final ApplicationScope applicationScope, final Id id );
+    void index( final ApplicationScope applicationScope, final Id id, final long updatedSince );
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a30670a5/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ReIndexServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ReIndexServiceImpl.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ReIndexServiceImpl.java
index f084634..194e187 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ReIndexServiceImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ReIndexServiceImpl.java
@@ -126,10 +126,11 @@ public class ReIndexServiceImpl implements ReIndexService {
 
             //for each edge, create our scope and index on it
             .doOnNext( edge -> {
+                final EntityIndexOperation entityIndexOperation = new EntityIndexOperation( edge.getApplicationScope(), edge.getEdge().getTargetNode(), modifiedSince );
 
-                logger.info( "Queueing {} {}", edge.getApplicationScope(), edge.getEdge().getTargetNode() );
+                logger.info( "Queueing {}", entityIndexOperation );
 
-                indexService.index(edge.getApplicationScope(),edge.getEdge().getTargetNode());
+                indexService.index(entityIndexOperation.getApplicationScope(),entityIndexOperation.getId(), modifiedSince);
 
             } );