Github user tnine commented on a diff in the pull request:

    https://github.com/apache/incubator-usergrid/pull/246#discussion_r30270165
  
    --- Diff: 
stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexServiceImpl.java
 ---
    @@ -163,16 +168,54 @@ public IndexServiceImpl( final GraphManagerFactory 
graphManagerFactory, final En
         }
     
     
    +    //Steps to delete an IndexEdge.
    +    //1.Take the search edge given and search for all the edges in 
elasticsearch matching that search edge
    +    //2. Batch Delete all of those edges returned in the previous search.
    +    //TODO: optimize loops further.
         @Override
         public Observable<IndexOperationMessage> deleteIndexEdge( final 
ApplicationScope applicationScope,
                                                                   final Edge 
edge ) {
     
    +        final Observable<IndexOperationMessage> batches =
    +            Observable.just( edge ).flatMap( edgeValue -> {
    +                final ApplicationEntityIndex ei = 
entityIndexFactory.createApplicationEntityIndex( applicationScope );
    +                EntityIndexBatch batch = ei.createBatch();
     
    -        //TODO, query ES and remove this edge
     
    -        throw new NotImplementedException( "Implement me" );
    -    }
    +                //review why generating the Scope from the Source  and the 
target node makes sense.
    +                final IndexEdge fromSource = generateScopeFromSource( edge 
);
    +                final Id targetId = edge.getTargetNode();
    +
    +
    +                CandidateResults targetEdgesToBeDeindexed = 
ei.getAllEdgeDocuments( fromSource, targetId, 1000, 0 );
    --- End diff --
    
    Can you instead refactor this to use Functional?  This way we have 1 type 
of implementation, and the codebase becomes more consistent.  


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to