usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [3/5] git commit: Formatting and import cleanup only.
Date Tue, 07 Oct 2014 13:28:04 GMT
Formatting and import cleanup only.


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

Branch: refs/heads/two-dot-o
Commit: 79bebe6736b2d94141550de265535b097c71ef0b
Parents: 6ea9940
Author: Dave Johnson <dmjohnson@apigee.com>
Authored: Tue Oct 7 07:21:43 2014 -0400
Committer: Dave Johnson <dmjohnson@apigee.com>
Committed: Tue Oct 7 07:21:43 2014 -0400

----------------------------------------------------------------------
 .../CpEntityIndexDeleteListener.java            | 23 +++++++++++++-------
 1 file changed, 15 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/79bebe67/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityIndexDeleteListener.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityIndexDeleteListener.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityIndexDeleteListener.java
index 3d4d661..125b90b 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityIndexDeleteListener.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityIndexDeleteListener.java
@@ -42,6 +42,7 @@ import rx.Observable;
 import rx.functions.Func1;
 import rx.schedulers.Schedulers;
 
+
 /**
  * Listener for cleans up old indexes and deletes from indexer
  */
@@ -51,6 +52,7 @@ public class CpEntityIndexDeleteListener {
     private final SerializationFig serializationFig;
     private final EntityIndexFactory entityIndexFactory;
 
+
     @Inject
     public CpEntityIndexDeleteListener(final EntityIndexFactory entityIndexFactory,
                                        SerializationFig serializationFig) {
@@ -60,32 +62,37 @@ public class CpEntityIndexDeleteListener {
 
 
     public Observable<EntityVersion> receive(final MvccEntityDeleteEvent event) {
+
         final CollectionScope collectionScope = event.getCollectionScope();
-        final IndexScope indexScope = new IndexScopeImpl(collectionScope.getOwner(), collectionScope.getName());
-        final EntityIndex entityIndex = entityIndexFactory.createEntityIndex(new ApplicationScopeImpl(
collectionScope.getApplication()));
+        final IndexScope indexScope = 
+                new IndexScopeImpl(collectionScope.getOwner(), collectionScope.getName());
+        final EntityIndex entityIndex = entityIndexFactory.createEntityIndex(
+                new ApplicationScopeImpl( collectionScope.getApplication()));
+
         return Observable.create(new ObservableIterator<CandidateResult>("deleteEsIndexVersions")
{
             @Override
             protected Iterator<CandidateResult> getIterator() {
-                CandidateResults results = entityIndex.getEntityVersions(indexScope, event.getEntity().getId());
+                CandidateResults results = 
+                        entityIndex.getEntityVersions(indexScope, event.getEntity().getId());
                 return results.iterator();
             }
         }).subscribeOn(Schedulers.io())
                 .buffer(serializationFig.getBufferSize())
                 .flatMap(new Func1<List<CandidateResult>, Observable<? extends
EntityVersion>>() {
+
                     @Override
-                    public Observable<? extends EntityVersion> call(List<CandidateResult>
candidateResults) {
+                    public Observable<? extends EntityVersion> call(List<CandidateResult>
crs) {
                         List<EntityVersion> versions = new ArrayList<>();
-                        for (CandidateResult entity : candidateResults) {
+                        for (CandidateResult entity : crs) {
                             //filter find entities <= current version
                             if (entity.getVersion().timestamp() <= event.getVersion().timestamp())
{
                                 versions.add(entity);
-                                entityIndex.createBatch().deindex(indexScope, entity.getId(),
entity.getVersion());
+                                entityIndex.createBatch()
+                                        .deindex(indexScope, entity.getId(), entity.getVersion());
                             }
                         }
                         return Observable.from(versions);
                     }
                 });
     }
-
-
 }


Mime
View raw message