private AsyncBatchCursor<T> emptyAsyncCursor(final AsyncConnectionSource source) { return createEmptyAsyncBatchCursor(namespace, source.getServerDescription().getAddress()); }
@Override public List<AsyncBatchCursor<T>> apply(final BsonDocument result, final ServerAddress serverAddress) { List<AsyncBatchCursor<T>> cursors = new ArrayList<AsyncBatchCursor<T>>(); for (BsonValue cursorValue : getCursorDocuments(result)) { cursors.add(new AsyncQueryBatchCursor<T>(createQueryResult(getCursorDocument(cursorValue.asDocument()), source.getServerDescription().getAddress()), 0, getBatchSize(), 0, decoder, source, connection)); } return cursors; } };
static <T> AsyncBatchCursor<T> cursorDocumentToAsyncBatchCursor(final BsonDocument cursorDocument, final Decoder<T> decoder, final AsyncConnectionSource source, final AsyncConnection connection, final int batchSize) { return new AsyncQueryBatchCursor<T>(OperationHelper.<T>cursorDocumentToQueryResult(cursorDocument, source.getServerDescription().getAddress()), 0, batchSize, 0, decoder, source, connection); }
private AsyncBatchCursor<T> emptyAsyncCursor(final AsyncConnectionSource source) { return createEmptyAsyncBatchCursor(createNamespace(), source.getServerDescription().getAddress()); }
@Override public void call(final AsyncConnectionSource source, final AsyncConnection connection, final Throwable t) { if (t != null) { callback.onResult(null, originalError); } else { final ConnectionReleasingWrappedCallback<BulkWriteResult> releasingCallback = new ConnectionReleasingWrappedCallback<BulkWriteResult>(callback, source, connection); if (!isRetryableWrite(retryWrites, writeConcern, source.getServerDescription(), connection.getDescription(), binding.getSessionContext())) { checkMongoWriteConcernWithResponseException(connection, releasingCallback); } else { executeCommandAsync(binding, connection, retryBatch, releasingCallback, new SingleResultCallback<BsonDocument>() { @Override public void onResult(final BsonDocument result, final Throwable t) { if (t != null) { checkMongoWriteConcernWithResponseException(connection, releasingCallback); } else { getCommandCallback(binding, connection, retryBatch, true, true, releasingCallback) .onResult(result, null); } } }); } } }
private AsyncBatchCursor<T> emptyAsyncCursor(final AsyncConnectionSource source) { return createEmptyAsyncBatchCursor(namespace, source.getServerDescription().getAddress()); }
@Override public List<AsyncBatchCursor<T>> apply(final BsonDocument result, final ServerAddress serverAddress) { List<AsyncBatchCursor<T>> cursors = new ArrayList<AsyncBatchCursor<T>>(); for (BsonValue cursorValue : getCursorDocuments(result)) { cursors.add(new AsyncQueryBatchCursor<T>(createQueryResult(getCursorDocument(cursorValue.asDocument()), source.getServerDescription().getAddress()), 0, getBatchSize(), 0, decoder, source, connection)); } return cursors; } };
static <T> AsyncBatchCursor<T> cursorDocumentToAsyncBatchCursor(final BsonDocument cursorDocument, final Decoder<T> decoder, final AsyncConnectionSource source, final AsyncConnection connection, final int batchSize) { return new AsyncQueryBatchCursor<T>(OperationHelper.<T>cursorDocumentToQueryResult(cursorDocument, source.getServerDescription().getAddress()), 0, batchSize, 0, decoder, source, connection); }
private AsyncBatchCursor<T> emptyAsyncCursor(final AsyncConnectionSource source) { return createEmptyAsyncBatchCursor(createNamespace(), source.getServerDescription().getAddress()); }
@Override public void call(final AsyncConnectionSource source, final AsyncConnection connection, final Throwable t) { if (t != null) { callback.onResult(null, originalError); } else { final ConnectionReleasingWrappedCallback<BulkWriteResult> releasingCallback = new ConnectionReleasingWrappedCallback<BulkWriteResult>(callback, source, connection); if (!isRetryableWrite(retryWrites, writeConcern, source.getServerDescription(), connection.getDescription(), binding.getSessionContext())) { checkMongoWriteConcernWithResponseException(connection, releasingCallback); } else { executeCommandAsync(binding, connection, retryBatch, releasingCallback, new SingleResultCallback<BsonDocument>() { @Override public void onResult(final BsonDocument result, final Throwable t) { if (t != null) { checkMongoWriteConcernWithResponseException(connection, releasingCallback); } else { getCommandCallback(binding, connection, retryBatch, true, true, releasingCallback) .onResult(result, null); } } }); } } }