RyaStatementBindingSetCursorIterator.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:incubator-rya 作者:
private void submitBatchQuery() {
    int count = 0;
    executedRangeMap.clear();
    final List<Document> pipeline = new ArrayList<>();
    final List<DBObject> match = new ArrayList<>();

    while (queryIterator.hasNext() && count < QUERY_BATCH_SIZE){
        count++;
        RyaStatement query = queryIterator.next();
        executedRangeMap.putAll(query, rangeMap.get(query));
        final DBObject currentQuery = strategy.getQuery(query);
        match.add(currentQuery);
    }

    if (match.size() > 1) {
        pipeline.add(new Document("$match", new Document("$or", match)));
    } else if (match.size() == 1) {
        pipeline.add(new Document("$match", match.get(0)));
    } else {
        batchQueryResultsIterator = Iterators.emptyIterator();
        return;
    }

    // Executing redact aggregation to only return documents the user has access to.
    pipeline.addAll(AggregationUtil.createRedactPipeline(auths));
    log.info(pipeline);

    final AggregateIterable<Document> aggIter = coll.aggregate(pipeline);
    aggIter.batchSize(1000);
    batchQueryResultsIterator = aggIter.iterator();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号