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

    https://github.com/apache/incubator-rya/pull/124#discussion_r89909207
  
    --- Diff: 
dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/iter/RyaStatementCursorIterator.java
 ---
    @@ -22,83 +40,83 @@
     
     import info.aduna.iteration.CloseableIteration;
     
    -import java.util.Iterator;
    -import java.util.Map.Entry;
    -import java.util.Set;
    -
    -import org.apache.rya.api.RdfCloudTripleStoreUtils;
    -import org.apache.rya.api.domain.RyaStatement;
    -import org.apache.rya.api.persist.RyaDAOException;
    -import org.apache.rya.mongodb.dao.MongoDBStorageStrategy;
    -
    -import org.calrissian.mango.collect.CloseableIterable;
    -import org.openrdf.query.BindingSet;
    -
    -import com.mongodb.DBCollection;
    -import com.mongodb.DBCursor;
    -import com.mongodb.DBObject;
    -
     public class RyaStatementCursorIterator implements 
CloseableIteration<RyaStatement, RyaDAOException> {
    -
    -   private DBCollection coll;
    -   private Iterator<DBObject> queryIterator;
    -   private DBCursor currentCursor;
    -   private MongoDBStorageStrategy strategy;
    -   private Long maxResults;
    -
    -   public RyaStatementCursorIterator(DBCollection coll, Set<DBObject> 
queries, MongoDBStorageStrategy strategy) {
    -           this.coll = coll;
    -           this.queryIterator = queries.iterator();
    -           this.strategy = strategy;
    -   }
    -
    -   @Override
    -   public boolean hasNext() {
    -           if (!currentCursorIsValid()) {
    -                   findNextValidCursor();
    -           }
    -           return currentCursorIsValid();
    -   }
    -
    -   @Override
    -   public RyaStatement next() {
    -           if (!currentCursorIsValid()) {
    -                   findNextValidCursor();
    -           }
    -           if (currentCursorIsValid()) {
    -                   // convert to Rya Statement
    -                   DBObject queryResult = currentCursor.next();
    -                   RyaStatement statement = 
strategy.deserializeDBObject(queryResult);
    -                   return statement;
    -           }
    -           return null;
    -   }
    -   
    -   private void findNextValidCursor() {
    -           while (queryIterator.hasNext()){
    -                   DBObject currentQuery = queryIterator.next();
    -                   currentCursor = coll.find(currentQuery);
    -                   if (currentCursor.hasNext()) break;
    -           }
    -   }
    -   
    -   private boolean currentCursorIsValid() {
    -           return (currentCursor != null) && currentCursor.hasNext();
    -   }
    -
    -
    -   public void setMaxResults(Long maxResults) {
    -           this.maxResults = maxResults;
    -   }
    -
    -   @Override
    -   public void close() throws RyaDAOException {
    -           // TODO don't know what to do here
    -   }
    -
    -   @Override
    -   public void remove() throws RyaDAOException {
    -           next();
    -   }
    -
    +    private static final Logger log = 
Logger.getLogger(RyaStatementCursorIterator.class);
    +
    +    private final DBCollection coll;
    +    private final Iterator<DBObject> queryIterator;
    +    private Iterator<DBObject> resultsIterator;
    +    private final MongoDBStorageStrategy<RyaStatement> strategy;
    +    private Long maxResults;
    +    private final Authorizations auths;
    +
    +    public RyaStatementCursorIterator(final DBCollection coll, final 
Set<DBObject> queries, final MongoDBStorageStrategy<RyaStatement> strategy, 
final MongoDBRdfConfiguration conf) {
    --- End diff --
    
    same, don't pass the config when all you need is auths


---
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