@Stability.Internal public class ReplicaHelper extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ReplicaHelper.GetReplicaResponse
Deprecated.
Please use
CoreGetResult in new code. |
Modifier and Type | Method and Description |
---|---|
static <R> CompletableFuture<List<CompletableFuture<R>>> |
getAllReplicasAsync(Core core,
CollectionIdentifier collectionIdentifier,
String documentId,
Duration timeout,
RetryStrategy retryStrategy,
Map<String,Object> clientContext,
RequestSpan parentSpan,
Function<ReplicaHelper.GetReplicaResponse,R> responseMapper)
Reads from replicas or the active node based on the options and returns the results as a list
of futures that might complete or fail.
|
static Flux<ReplicaHelper.GetReplicaResponse> |
getAllReplicasReactive(Core core,
CollectionIdentifier collectionIdentifier,
String documentId,
Duration timeout,
RetryStrategy retryStrategy,
Map<String,Object> clientContext,
RequestSpan parentSpan) |
static CompletableFuture<Stream<GetRequest>> |
getAllReplicasRequests(Core core,
CollectionIdentifier collectionIdentifier,
String documentId,
Map<String,Object> clientContext,
RetryStrategy retryStrategy,
Duration timeout,
RequestSpan parent)
Helper method to assemble a stream of requests to the active and all replicas
|
static <R> CompletableFuture<R> |
getAnyReplicaAsync(Core core,
CollectionIdentifier collectionIdentifier,
String documentId,
Duration timeout,
RetryStrategy retryStrategy,
Map<String,Object> clientContext,
RequestSpan parentSpan,
Function<ReplicaHelper.GetReplicaResponse,R> responseMapper) |
static <R> CompletableFuture<List<CompletableFuture<R>>> |
lookupInAllReplicasAsync(Core core,
CollectionIdentifier collectionIdentifier,
String documentId,
List<CoreSubdocGetCommand> commands,
Duration timeout,
RetryStrategy retryStrategy,
Map<String,Object> clientContext,
RequestSpan parentSpan,
Function<CoreSubdocGetResult,R> responseMapper)
Reads from replicas or the active node based on the options and returns the results as a list
of futures that might complete or fail.
|
static Flux<CoreSubdocGetResult> |
lookupInAllReplicasReactive(Core core,
CollectionIdentifier collectionIdentifier,
String documentId,
List<CoreSubdocGetCommand> commands,
Duration timeout,
RetryStrategy retryStrategy,
Map<String,Object> clientContext,
RequestSpan parentSpan) |
static CompletableFuture<Stream<SubdocGetRequest>> |
lookupInAllReplicasRequests(Core core,
CollectionIdentifier collectionIdentifier,
String documentId,
List<CoreSubdocGetCommand> commands,
Map<String,Object> clientContext,
RetryStrategy retryStrategy,
Duration timeout,
RequestSpan parent)
Helper method to assemble a stream of requests to the active and all replicas
|
static <R> CompletableFuture<R> |
lookupInAnyReplicaAsync(Core core,
CollectionIdentifier collectionIdentifier,
String documentId,
List<CoreSubdocGetCommand> commands,
Duration timeout,
RetryStrategy retryStrategy,
Map<String,Object> clientContext,
RequestSpan parentSpan,
Function<CoreSubdocGetResult,R> responseMapper) |
public static Flux<ReplicaHelper.GetReplicaResponse> getAllReplicasReactive(Core core, CollectionIdentifier collectionIdentifier, String documentId, Duration timeout, RetryStrategy retryStrategy, Map<String,Object> clientContext, RequestSpan parentSpan)
clientContext
- (nullable)parentSpan
- (nullable)public static Flux<CoreSubdocGetResult> lookupInAllReplicasReactive(Core core, CollectionIdentifier collectionIdentifier, String documentId, List<CoreSubdocGetCommand> commands, Duration timeout, RetryStrategy retryStrategy, Map<String,Object> clientContext, RequestSpan parentSpan)
core
- the core to execute the requestcollectionIdentifier
- the collection containing the documentdocumentId
- the ID of the documentcommands
- specifies the type of lookups to performtimeout
- the timeout until we need to stop the get all replicasretryStrategy
- the retry strategy to useclientContext
- (nullable) client context infoparentSpan
- the "lookupIn all/any replicas" request spanpublic static <R> CompletableFuture<List<CompletableFuture<R>>> getAllReplicasAsync(Core core, CollectionIdentifier collectionIdentifier, String documentId, Duration timeout, RetryStrategy retryStrategy, Map<String,Object> clientContext, RequestSpan parentSpan, Function<ReplicaHelper.GetReplicaResponse,R> responseMapper)
clientContext
- (nullable)parentSpan
- (nullable)responseMapper
- converts the GetReplicaResponse to the client's native result typepublic static <R> CompletableFuture<List<CompletableFuture<R>>> lookupInAllReplicasAsync(Core core, CollectionIdentifier collectionIdentifier, String documentId, List<CoreSubdocGetCommand> commands, Duration timeout, RetryStrategy retryStrategy, Map<String,Object> clientContext, RequestSpan parentSpan, Function<CoreSubdocGetResult,R> responseMapper)
core
- the core to execute the requestcollectionIdentifier
- the collection containing the documentdocumentId
- the ID of the documentcommands
- specifies the type of lookups to performtimeout
- the timeout until we need to stop the get all replicasretryStrategy
- the retry strategy to useclientContext
- (nullable) client context infoparentSpan
- the "lookupIn all/any replicas" request spanresponseMapper
- converts the GetReplicaResponse to the client's native result typepublic static <R> CompletableFuture<R> getAnyReplicaAsync(Core core, CollectionIdentifier collectionIdentifier, String documentId, Duration timeout, RetryStrategy retryStrategy, Map<String,Object> clientContext, RequestSpan parentSpan, Function<ReplicaHelper.GetReplicaResponse,R> responseMapper)
clientContext
- (nullable)parentSpan
- (nullable)responseMapper
- converts the GetReplicaResponse to the client's native result typepublic static <R> CompletableFuture<R> lookupInAnyReplicaAsync(Core core, CollectionIdentifier collectionIdentifier, String documentId, List<CoreSubdocGetCommand> commands, Duration timeout, RetryStrategy retryStrategy, Map<String,Object> clientContext, RequestSpan parentSpan, Function<CoreSubdocGetResult,R> responseMapper)
core
- the core to execute the requestcollectionIdentifier
- the collection containing the documentdocumentId
- the ID of the documentcommands
- specifies the type of lookups to performtimeout
- the timeout until we need to stop the get all replicasretryStrategy
- the retry strategy to useclientContext
- (nullable) client context infoparentSpan
- the "lookupIn all/any replicas" request spanresponseMapper
- converts the CoreSubdocGetResult to the client's native result typepublic static CompletableFuture<Stream<GetRequest>> getAllReplicasRequests(Core core, CollectionIdentifier collectionIdentifier, String documentId, Map<String,Object> clientContext, RetryStrategy retryStrategy, Duration timeout, RequestSpan parent)
core
- the core to execute the requestcollectionIdentifier
- the collection containing the documentdocumentId
- the ID of the documentclientContext
- (nullable) client context inforetryStrategy
- the retry strategy to usetimeout
- the timeout until we need to stop the get all replicasparent
- the "get all/any replicas" request spanpublic static CompletableFuture<Stream<SubdocGetRequest>> lookupInAllReplicasRequests(Core core, CollectionIdentifier collectionIdentifier, String documentId, List<CoreSubdocGetCommand> commands, Map<String,Object> clientContext, RetryStrategy retryStrategy, Duration timeout, RequestSpan parent)
core
- the core to execute the requestcollectionIdentifier
- the collection containing the documentdocumentId
- the ID of the documentcommands
- specifies the type of lookups to performclientContext
- (nullable) client context inforetryStrategy
- the retry strategy to usetimeout
- the timeout until we need to stop the get all replicasparent
- the "get all/any replicas" request spanCopyright © 2024 Couchbase, Inc.. All rights reserved.