Class PartitionSelectionStrategy
java.lang.Object
com.couchbase.client.core.service.strategies.PartitionSelectionStrategy
- All Implemented Interfaces:
SelectionStrategy
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.- Since:
- 1.0
- Author:
- Michael Nitschinger
-
Field Summary
Fields Modifier and Type Field Description static PartitionSelectionStrategy
INSTANCE
-
Method Summary
Modifier and Type Method Description Endpoint
select(CouchbaseRequest request, List<Endpoint> endpoints)
Selects anEndpoint
for the givenCouchbaseRequest
.
-
Field Details
-
INSTANCE
-
-
Method Details
-
select
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.
-