public class PartitionSelectionStrategy extends Object implements SelectionStrategy
Selects the Endpoint
based on the information enclosed in the CouchbaseRequest
.
This strategy can be used to “pin” certain requests to specific endpoints based on the supplied information. The current implementation uses this technique to tie ID-based BinaryRequest
s to the same endpoint to enforce at least some amount of ordering guarantees.
Modifier and Type | Field and Description |
---|---|
static PartitionSelectionStrategy |
INSTANCE |
Modifier and Type | Method and Description |
---|---|
Endpoint |
select(CouchbaseRequest request,
Endpoint[] endpoints)
Selects an
Endpoint for the given CouchbaseRequest . |
public static final PartitionSelectionStrategy INSTANCE
public Endpoint select(CouchbaseRequest request, Endpoint[] endpoints)
SelectionStrategy
Selects an Endpoint
for the given CouchbaseRequest
.
If null is returned, it means that no endpoint could be selected and it is up to the calling party to decide what to do next.
select
in interface SelectionStrategy
request
- the input request.endpoints
- all the available endpoints.Copyright © 2016 Couchbase, Inc.. All rights reserved.