[
https://issues.apache.org/jira/browse/RYA-119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15703551#comment-15703551
]
ASF GitHub Bot commented on RYA-119:
------------------------------------
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
> Add visibility support to MongoDB
> ---------------------------------
>
> Key: RYA-119
> URL: https://issues.apache.org/jira/browse/RYA-119
> Project: Rya
> Issue Type: Improvement
> Components: dao
> Affects Versions: 3.2.10
> Reporter: Andrew Smith
> Assignee: Eric White
>
> Currently, when querying mongo, visibility is ignored. Need to add support
> for visibility when querying mongo.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)