public class

SmaLatencyScoreStrategyImpl

extends Object
implements LatencyScoreStrategy
java.lang.Object
   ↳ com.netflix.astyanax.connectionpool.impl.SmaLatencyScoreStrategyImpl

Summary

Public Constructors
SmaLatencyScoreStrategyImpl(int updateInterval, int resetInterval, int windowSize, double badnessThreshold)
Public Methods
final LatencyScoreStrategy.Instance createInstance()
Create a new instance to associate with an endpoint
double getBadnessThreshold()
String getName()
int getResetInterval()
int getUpdateInterval()
int getWindowSize()
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> List<HostConnectionPool<CL>> sortAndfilterPartition(List<HostConnectionPool<CL>> srcPools, 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.
String toString()
void update()
Update all instance scores
Protected Methods
LatencyScoreStrategy.Instance internalCreateInstance()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.netflix.astyanax.connectionpool.LatencyScoreStrategy

Public Constructors

public SmaLatencyScoreStrategyImpl (int updateInterval, int resetInterval, int windowSize, double badnessThreshold)

Public Methods

public final LatencyScoreStrategy.Instance createInstance ()

Create a new instance to associate with an endpoint

public double getBadnessThreshold ()

public String getName ()

public int getResetInterval ()

public int getUpdateInterval ()

public int getWindowSize ()

public void removeInstance (LatencyScoreStrategy.Instance instance)

Remove the instance for an endpoint that is no longer being tracked

public void reset ()

Reset all instance scores

public void shutdown ()

Shutdown the threads created by calling start()

public List<HostConnectionPool<CL>> sortAndfilterPartition (List<HostConnectionPool<CL>> srcPools, AtomicBoolean prioritized)

Sorts and filters a list of hosts by looking at their up state and score.

Parameters
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.

public void start (LatencyScoreStrategy.Listener listener)

Start updating stats for instances created using createInstance. This usually spawns an update thread as well as a reset thread operating at configurable intervals

public String toString ()

public void update ()

Update all instance scores

Protected Methods

protected LatencyScoreStrategy.Instance internalCreateInstance ()