private DBCursor oplogCursor(final Timestamp<?> time) throws SlurperException { DBObject indexFilter = time.getOplogFilter(); if (indexFilter == null) { return null; } int options = Bytes.QUERYOPTION_TAILABLE | Bytes.QUERYOPTION_AWAITDATA | Bytes.QUERYOPTION_NOTIMEOUT // Using OPLOGREPLAY to improve performance: // https://jira.mongodb.org/browse/JAVA-771 | Bytes.QUERYOPTION_OPLOGREPLAY; DBCursor cursor = oplogCollection.find(indexFilter).setOptions(options); // Toku sometimes gets stuck without this hint: if (indexFilter.containsField(MongoDBRiver.MONGODB_ID_FIELD)) { cursor = cursor.hint("_id_"); } isRiverStale(cursor, time); return cursor; }