@Override @SuppressWarnings("checkstyle:methodlength") public ConnectionSource retain() { wrapped = wrapped.retain(); return this; }
QueryBatchCursor(final QueryResult<T> firstQueryResult, final int limit, final int batchSize, final long maxTimeMS, final Decoder<T> decoder, final ConnectionSource connectionSource, final Connection connection) { isTrueArgument("maxTimeMS >= 0", maxTimeMS >= 0); this.maxTimeMS = maxTimeMS; this.namespace = firstQueryResult.getNamespace(); this.serverAddress = firstQueryResult.getAddress(); this.limit = limit; this.batchSize = batchSize; this.decoder = notNull("decoder", decoder); if (firstQueryResult.getCursor() != null) { notNull("connectionSource", connectionSource); } if (connectionSource != null) { this.connectionSource = connectionSource.retain(); } else { this.connectionSource = null; } initFromQueryResult(firstQueryResult); if (limitReached()) { killCursor(connection); } if (serverCursor == null && this.connectionSource != null) { this.connectionSource.release(); this.connectionSource = null; } }
@Override @SuppressWarnings("checkstyle:methodlength") public ConnectionSource retain() { wrapped = wrapped.retain(); return this; }
@Override @SuppressWarnings("checkstyle:methodlength") public ConnectionSource retain() { wrapped = wrapped.retain(); return this; }
QueryBatchCursor(final QueryResult<T> firstQueryResult, final int limit, final int batchSize, final long maxTimeMS, final Decoder<T> decoder, final ConnectionSource connectionSource, final Connection connection) { isTrueArgument("maxTimeMS >= 0", maxTimeMS >= 0); this.maxTimeMS = maxTimeMS; this.namespace = firstQueryResult.getNamespace(); this.serverAddress = firstQueryResult.getAddress(); this.limit = limit; this.batchSize = batchSize; this.decoder = notNull("decoder", decoder); if (firstQueryResult.getCursor() != null) { notNull("connectionSource", connectionSource); } if (connectionSource != null) { this.connectionSource = connectionSource.retain(); } else { this.connectionSource = null; } initFromQueryResult(firstQueryResult); if (limitReached()) { killCursor(connection); } if (serverCursor == null && this.connectionSource != null) { this.connectionSource.release(); this.connectionSource = null; } }