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

    https://github.com/apache/incubator-rya/pull/204#discussion_r132990636
  
    --- Diff: 
dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/MongoDBQueryEngine.java ---
    @@ -140,72 +121,35 @@ public MongoDBRdfConfiguration getConf() {
         public CloseableIteration<RyaStatement, RyaDAOException> batchQuery(
                 final Collection<RyaStatement> stmts, MongoDBRdfConfiguration 
conf)
                 throws RyaDAOException {
    -        if (conf == null) {
    -            conf = configuration;
    -        }
    -        final Long maxResults = conf.getLimit();
    -        final Set<DBObject> queries = new HashSet<DBObject>();
    -
    -        try {
    -            for (final RyaStatement stmt : stmts) {
    -                queries.add( strategy.getQuery(stmt));
    -             }
    +        final Map<RyaStatement, BindingSet> queries = new HashMap<>();
     
    -            // TODO not sure what to do about regex ranges?
    -            final RyaStatementCursorIterator iterator = new 
RyaStatementCursorIterator(getCollection(conf), queries,
    -                    strategy, configuration.getAuthorizations());
    -
    -            if (maxResults != null) {
    -                iterator.setMaxResults(maxResults);
    -            }
    -            return iterator;
    -        } catch (final Exception e) {
    -            throw new RyaDAOException(e);
    +        for (final RyaStatement stmt : stmts) {
    +            queries.put(stmt, new MapBindingSet());
             }
     
    +        return new 
RyaStatementCursorIterator(queryWithBindingSet(queries.entrySet(), conf));
         }
    +    
         @Override
         public CloseableIterable<RyaStatement> query(final RyaQuery ryaQuery)
                 throws RyaDAOException {
    -            final Set<DBObject> queries = new HashSet<DBObject>();
    -
    -            try {
    -                queries.add( strategy.getQuery(ryaQuery));
    -
    -                // TODO not sure what to do about regex ranges?
    -                // TODO this is gross
    -            final RyaStatementCursorIterable iterator = new 
RyaStatementCursorIterable(
    -                    new NonCloseableRyaStatementCursorIterator(new 
RyaStatementCursorIterator(getCollection(getConf()),
    -                            queries, strategy, 
configuration.getAuthorizations())));
    -
    -                return iterator;
    -            } catch (final Exception e) {
    -                throw new RyaDAOException(e);
    -            }
    +        return query(new 
BatchRyaQuery(Collections.singleton(ryaQuery.getQuery())));
    --- End diff --
    
    Null check


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