@Signature public WrapMongoIterable hint(BasicDBObject hint) { if (getWrappedObject() instanceof FindIterable) { return new WrapMongoIterable(this.__env__, ((FindIterable) getWrappedObject()).hint(hint)); } else { return this; } }
cursorToUse = cursorToUse.hint(Document.parse(query.getHint()));
@Override public FindOperationConfigurator hint(Bson hint) { iterable.hint(hint); return this; }
cursorToUse = cursorToUse.hint(Document.parse(query.getHint()));
@Override public Iterator<String> getAllChunkIds(long maxLastModifiedTime) throws Exception { Bson fields = new BasicDBObject(MongoBlob.KEY_ID, 1); Bson query = new Document(); if (maxLastModifiedTime != 0 && maxLastModifiedTime != -1) { query = Filters.lte(MongoBlob.KEY_LAST_MOD, maxLastModifiedTime); } final MongoCursor<MongoBlob> cur = getBlobCollection().find(query) .projection(fields).hint(fields).iterator(); //TODO The cursor needs to be closed return new AbstractIterator<String>() { @Override protected String computeNext() { if (cur.hasNext()) { MongoBlob blob = cur.next(); if (blob != null) { return blob.getId(); } } return endOfData(); } }; } }
@Override public Iterator<String> getAllChunkIds(long maxLastModifiedTime) throws Exception { Bson fields = new BasicDBObject(MongoBlob.KEY_ID, 1); Bson query = new Document(); if (maxLastModifiedTime != 0 && maxLastModifiedTime != -1) { query = Filters.lte(MongoBlob.KEY_LAST_MOD, maxLastModifiedTime); } final MongoCursor<MongoBlob> cur = getBlobCollection().find(query) .projection(fields).hint(fields).iterator(); //TODO The cursor needs to be closed return new AbstractIterator<String>() { @Override protected String computeNext() { if (cur.hasNext()) { MongoBlob blob = cur.next(); if (blob != null) { return blob.getId(); } } return endOfData(); } }; } }
result.hint(hint);
result.hint(hint);
/** * Returs the FindIterable<BsonDocument> of the collection applying sorting, * filtering and projection. * * @param sortBy the sort expression to use for sorting (prepend field name * with - for descending sorting) * @param filters the filters to apply. * @param keys the keys to return (projection) * @return * @throws JsonParseException */ FindIterable<BsonDocument> getFindIterable( final MongoCollection<BsonDocument> coll, final BsonDocument sortBy, final BsonDocument filters, final BsonDocument hint, final BsonDocument keys) throws JsonParseException { return coll.find(filters) .projection(keys) .sort(sortBy) .batchSize(BATCH_SIZE) .hint(hint) .maxTime(Bootstrapper.getConfiguration() .getQueryTimeLimit(), TimeUnit.MILLISECONDS); }