public class LatencyMinimizingServerSelector extends java.lang.Object implements ServerSelector
Constructor and Description |
---|
LatencyMinimizingServerSelector(long acceptableLatencyDifference,
java.util.concurrent.TimeUnit timeUnit) |
Modifier and Type | Method and Description |
---|---|
long |
getAcceptableLatencyDifference(java.util.concurrent.TimeUnit timeUnit)
Gets the acceptable latency difference.
|
java.util.List<ServerDescription> |
select(ClusterDescription clusterDescription)
Select a list of server descriptions from the given cluster description according to some criteria.
|
java.lang.String |
toString() |
public LatencyMinimizingServerSelector(long acceptableLatencyDifference, java.util.concurrent.TimeUnit timeUnit)
acceptableLatencyDifference
- the maximum difference in ping-time latency between the fastest ping time and the slowest of
the chosen serverstimeUnit
- the time unit of the acceptableLatencyDifferencepublic long getAcceptableLatencyDifference(java.util.concurrent.TimeUnit timeUnit)
timeUnit
- the time unit to get it in.public java.util.List<ServerDescription> select(ClusterDescription clusterDescription)
ServerSelector
select
in interface ServerSelector
clusterDescription
- the cluster of servers to select frompublic java.lang.String toString()
toString
in class java.lang.Object