/** * Adds a query option. See Bytes.QUERYOPTION_* for list. * * @param option the option to be added * @return {@code this} so calls can be chained * @see Bytes * @mongodb.driver.manual ../meta-driver/latest/legacy/mongodb-wire-protocol/#op-query Query Flags * @deprecated Prefer per-option methods, e.g. {@link #cursorType(CursorType)}, {@link #noCursorTimeout(boolean)}, etc. */ @Deprecated public DBCursor addOption(final int option) { setOptions(this.options |= option); return this; }
/** * Select documents in collection and get a cursor to the selected documents. * * @param query the selection criteria using query operators. Omit the query parameter or pass an empty document to return all * documents in the collection. * @param projection specifies which fields MongoDB will return from the documents in the result set. * @param numToSkip number of documents to skip * @param batchSize see {@link DBCursor#batchSize(int)} for more information * @param options query options to be used * @return A cursor to the documents that match the query criteria * @mongodb.driver.manual tutorial/query-documents/ Querying * @deprecated use {@link com.mongodb.DBCursor#skip(int)}, {@link com.mongodb.DBCursor#batchSize(int)} and {@link * com.mongodb.DBCursor#setOptions(int)} on the {@code DBCursor} returned from {@link com.mongodb.DBCollection#find(DBObject, * DBObject)} */ @Deprecated public DBCursor find(final DBObject query, final DBObject projection, final int numToSkip, final int batchSize, final int options) { return new DBCursor(this, query, projection, getReadPreference()).batchSize(batchSize).skip(numToSkip).setOptions(options); }
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; }
/** * sets the query option - see Bytes.QUERYOPTION_* for simpleList * * @param options The options * @return This object */ public DBCursor<T> setOptions(int options) { cursor.setOptions(options); return this; }
/** * sets the query option - see Bytes.QUERYOPTION_* for simpleList * * @param options * The options * @return This object */ public DBCursor<T> setOptions(int options) { cursor.setOptions(options); return this; }
/** * sets the query option - see Bytes.QUERYOPTION_* for simpleList * * @param options The options * @return This object */ public DBCursor<T> setOptions(int options) { cursor.setOptions(options); return this; }
@Override public DBCursor setOptions(int options) { return cursor.setOptions(options); }
@Override public DBCursor setOptions(int options) { return cursor.setOptions(options); }
/** * Adds a query option. See Bytes.QUERYOPTION_* for list. * * @param option the option to be added * @return {@code this} so calls can be chained * @see Bytes * @mongodb.driver.manual ../meta-driver/latest/legacy/mongodb-wire-protocol/#op-query Query Flags * @deprecated Prefer per-option methods, e.g. {@link #cursorType(CursorType)}, {@link #noCursorTimeout(boolean)}, etc. */ @Deprecated public DBCursor addOption(final int option) { setOptions(this.options |= option); return this; }
DBCursor getCursor(){ // Return the cursor with the split's query, etc. already slotted in for // them. // todo - support limit/skip if ( _cursor == null ){ _cursor = MongoConfigUtil.getCollection( _mongoURI ).find( _querySpec, _fieldSpec ).sort( _sortSpec ); if (_notimeout) _cursor.setOptions( Bytes.QUERYOPTION_NOTIMEOUT ); _cursor.slaveOk(); } return _cursor; }
/** * Select documents in collection and get a cursor to the selected documents. * * @param query the selection criteria using query operators. Omit the query parameter or pass an empty document to return all * documents in the collection. * @param projection specifies which fields MongoDB will return from the documents in the result set. * @param numToSkip number of documents to skip * @param batchSize see {@link DBCursor#batchSize(int)} for more information * @param options query options to be used * @return A cursor to the documents that match the query criteria * @mongodb.driver.manual tutorial/query-documents/ Querying * @deprecated use {@link com.mongodb.DBCursor#skip(int)}, {@link com.mongodb.DBCursor#batchSize(int)} and {@link * com.mongodb.DBCursor#setOptions(int)} on the {@code DBCursor} returned from {@link com.mongodb.DBCollection#find(DBObject, * DBObject)} */ @Deprecated public DBCursor find(final DBObject query, final DBObject projection, final int numToSkip, final int batchSize, final int options) { return new DBCursor(this, query, projection, getReadPreference()).batchSize(batchSize).skip(numToSkip).setOptions(options); }
DBCursor getCursor(){ // Return the cursor with the split's query, etc. already slotted in for // them. // todo - support limit/skip if ( _cursor == null ){ _cursor = MongoConfigUtil.getCollection( _mongoURI ).find( _querySpec, _fieldSpec ).sort( _sortSpec ); if (_notimeout) _cursor.setOptions( Bytes.QUERYOPTION_NOTIMEOUT ); _cursor.slaveOk(); } return _cursor; }
DBCursor getCursor(){ // Return the cursor with the split's query, etc. already slotted in for // them. // todo - support limit/skip if ( _cursor == null ){ _cursor = MongoConfigUtil.getCollection( _mongoURI ).find( _querySpec, _fieldSpec ).sort( _sortSpec ); if (_notimeout) _cursor.setOptions( Bytes.QUERYOPTION_NOTIMEOUT ); _cursor.slaveOk(); } return _cursor; }
DBCursor getCursor(){ // Return the cursor with the split's query, etc. already slotted in for // them. // todo - support limit/skip if ( _cursor == null ){ _cursor = MongoConfigUtil.getCollection( _mongoURI ).find( _querySpec, _fieldSpec ).sort( _sortSpec ); if (_notimeout) _cursor.setOptions( Bytes.QUERYOPTION_NOTIMEOUT ); _cursor.slaveOk(); } return _cursor; }
DBCursor getCursor(){ // Return the cursor with the split's query, etc. already slotted in for // them. // todo - support limit/skip if ( _cursor == null ){ _cursor = MongoConfigUtil.getCollection( _mongoURI ).find( _querySpec, _fieldSpec ).sort( _sortSpec ); if (_notimeout) _cursor.setOptions( Bytes.QUERYOPTION_NOTIMEOUT ); _cursor.slaveOk(); } return _cursor; }
public DBCursor getCursor() { if (this.cursor == null) { DBCollection coll; if (this.authURI != null) { coll = MongoConfigUtil.getCollectionWithAuth(this.inputURI, this.authURI); } else { coll = MongoConfigUtil.getCollection(this.inputURI); } this.cursor = coll.find(this.query, this.fields).sort(this.sort); if (this.notimeout) { this.cursor.setOptions(Bytes.QUERYOPTION_NOTIMEOUT); } if (this.min != null) { this.cursor.addSpecial("$min", this.min); } if (this.max != null) { this.cursor.addSpecial("$max", this.max); } } return this.cursor; }
.setOptions(Bytes.QUERYOPTION_NOTIMEOUT);
public DBCursor getCursor() { if (this.cursor == null) { DBCollection coll; if (this.authURI != null) { coll = MongoConfigUtil.getCollectionWithAuth(this.inputURI, this.authURI); } else { coll = MongoConfigUtil.getCollection(this.inputURI); } this.cursor = coll.find(this.query, this.fields).sort(this.sort); if (this.notimeout) { this.cursor.setOptions(Bytes.QUERYOPTION_NOTIMEOUT); } if (this.min != null) { this.cursor.addSpecial("$min", this.min); } if (this.max != null) { this.cursor.addSpecial("$max", this.max); } if (skip != null) { cursor = cursor.skip(skip); } if (limit != null) { cursor = cursor.limit(limit); } } return this.cursor; }