@SuppressWarnings("unchecked") private QueryResult<T> createQueryResult(final BsonDocument cursorDocument, final ServerAddress serverAddress) { return cursorDocumentToQueryResult(cursorDocument, serverAddress); }
static <T> QueryResult<T> cursorDocumentToQueryResult(final BsonDocument cursorDocument, final ServerAddress serverAddress) { return cursorDocumentToQueryResult(cursorDocument, serverAddress, "firstBatch"); }
static <T> QueryResult<T> getMoreCursorDocumentToQueryResult(final BsonDocument cursorDocument, final ServerAddress serverAddress) { return cursorDocumentToQueryResult(cursorDocument, serverAddress, "nextBatch"); }
static <T> BatchCursor<T> cursorDocumentToBatchCursor(final BsonDocument cursorDocument, final Decoder<T> decoder, final ConnectionSource source, final int batchSize) { return new QueryBatchCursor<T>(OperationHelper.<T>cursorDocumentToQueryResult(cursorDocument, source.getServerDescription().getAddress()), 0, batchSize, decoder, source); }
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 QueryResult<T> documentToQueryResult(final BsonDocument result, final ServerAddress serverAddress) { QueryResult<T> queryResult; if (isExplain()) { T decodedDocument = decoder.decode(new BsonDocumentReader(result), DecoderContext.builder().build()); queryResult = new QueryResult<T>(getNamespace(), Collections.singletonList(decodedDocument), 0, serverAddress); } else { queryResult = cursorDocumentToQueryResult(result.getDocument("cursor"), serverAddress); } return queryResult; }
private QueryResult<T> createQueryResult(final BsonDocument result, final ConnectionDescription description) { if (!isInline(description) || result.containsKey(CURSOR)) { return cursorDocumentToQueryResult(result.getDocument(CURSOR), description.getServerAddress()); } else { return new QueryResult<T>(namespace, BsonDocumentWrapperHelper.<T>toList(result, RESULT), 0L, description.getServerAddress()); } }
@SuppressWarnings("unchecked") private QueryResult<T> createQueryResult(final BsonDocument cursorDocument, final ServerAddress serverAddress) { return cursorDocumentToQueryResult(cursorDocument, serverAddress); }
static <T> QueryResult<T> cursorDocumentToQueryResult(final BsonDocument cursorDocument, final ServerAddress serverAddress) { return cursorDocumentToQueryResult(cursorDocument, serverAddress, "firstBatch"); }
static <T> QueryResult<T> getMoreCursorDocumentToQueryResult(final BsonDocument cursorDocument, final ServerAddress serverAddress) { return cursorDocumentToQueryResult(cursorDocument, serverAddress, "nextBatch"); }
static <T> BatchCursor<T> cursorDocumentToBatchCursor(final BsonDocument cursorDocument, final Decoder<T> decoder, final ConnectionSource source, final int batchSize) { return new QueryBatchCursor<T>(OperationHelper.<T>cursorDocumentToQueryResult(cursorDocument, source.getServerDescription().getAddress()), 0, batchSize, decoder, source); }
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 QueryResult<T> documentToQueryResult(final BsonDocument result, final ServerAddress serverAddress) { QueryResult<T> queryResult; if (isExplain()) { T decodedDocument = decoder.decode(new BsonDocumentReader(result), DecoderContext.builder().build()); queryResult = new QueryResult<T>(getNamespace(), Collections.singletonList(decodedDocument), 0, serverAddress); } else { queryResult = cursorDocumentToQueryResult(result.getDocument("cursor"), serverAddress); } return queryResult; }
private QueryResult<T> createQueryResult(final BsonDocument result, final ConnectionDescription description) { if (!isInline(description) || result.containsKey(CURSOR)) { return cursorDocumentToQueryResult(result.getDocument(CURSOR), description.getServerAddress()); } else { return new QueryResult<T>(namespace, BsonDocumentWrapperHelper.<T>toList(result, RESULT), 0L, description.getServerAddress()); } }