public interface LatencyScoreStrategy
| Modifier and Type | Interface and Description |
|---|---|
static interface |
LatencyScoreStrategy.Instance
Single instance of this strategy associated with an endpoint
|
static interface |
LatencyScoreStrategy.Listener |
| Modifier and Type | Method and Description |
|---|---|
LatencyScoreStrategy.Instance |
createInstance()
Create a new instance to associate with an endpoint
|
int |
getBlockedThreshold() |
double |
getKeepRatio() |
int |
getResetInterval() |
double |
getScoreThreshold() |
int |
getUpdateInterval() |
void |
removeInstance(LatencyScoreStrategy.Instance instance)
Remove the instance for an endpoint that is no longer being tracked
|
void |
reset()
Reset all instance scores
|
void |
shutdown()
Shutdown the threads created by calling start()
|
<CL> java.util.List<HostConnectionPool<CL>> |
sortAndfilterPartition(java.util.List<HostConnectionPool<CL>> pools,
java.util.concurrent.atomic.AtomicBoolean prioritized)
Sorts and filters a list of hosts by looking at their up state and score.
|
void |
start(LatencyScoreStrategy.Listener listener)
Start updating stats for instances created using createInstance.
|
void |
update()
Update all instance scores
|
int getUpdateInterval()
int getResetInterval()
double getScoreThreshold()
int getBlockedThreshold()
double getKeepRatio()
void update()
void reset()
LatencyScoreStrategy.Instance createInstance()
void removeInstance(LatencyScoreStrategy.Instance instance)
instance - void start(LatencyScoreStrategy.Listener listener)
listener - void shutdown()
<CL> java.util.List<HostConnectionPool<CL>> sortAndfilterPartition(java.util.List<HostConnectionPool<CL>> pools, java.util.concurrent.atomic.AtomicBoolean prioritized)
CL - pools - prioritized - - Will be set to true if the filtered data is prioritized or
not. If prioritized then the first element should be selected
from by the load balancing strategy. Otherwise round robin
could be used.