Class PartitionSelectionStrategy
- java.lang.Object
-
- com.couchbase.client.core.service.strategies.PartitionSelectionStrategy
-
- All Implemented Interfaces:
SelectionStrategy
public class PartitionSelectionStrategy extends Object implements SelectionStrategy
Selects theEndpoint
based on the information enclosed in theCouchbaseRequest
. 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-basedBinaryRequest
s to the same endpoint to enforce at least some amount of ordering guarantees.- Since:
- 1.0
- Author:
- Michael Nitschinger
-
-
Field Summary
Fields Modifier and Type Field Description static PartitionSelectionStrategy
INSTANCE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Endpoint
select(CouchbaseRequest request, List<Endpoint> endpoints)
Selects anEndpoint
for the givenCouchbaseRequest
.
-
-
-
Field Detail
-
INSTANCE
public static final PartitionSelectionStrategy INSTANCE
-
-
Method Detail
-
select
public Endpoint select(CouchbaseRequest request, List<Endpoint> endpoints)
Description copied from interface:SelectionStrategy
Selects anEndpoint
for the givenCouchbaseRequest
. 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.- Specified by:
select
in interfaceSelectionStrategy
- Parameters:
request
- the input request.endpoints
- all the available endpoints.- Returns:
- the selected endpoint.
-
-