com.netflix.astyanax.connectionpool
Interface LatencyScoreStrategy

All Known Implementing Classes:
EmptyLatencyScoreStrategyImpl, SmaLatencyScoreStrategyImpl

public interface LatencyScoreStrategy


Nested Class Summary
static interface LatencyScoreStrategy.Instance
          Single instance of this strategy associated with an endpoint
static interface LatencyScoreStrategy.Listener
           
 
Method Summary
 LatencyScoreStrategy.Instance createInstance()
          Create a new instance to associate with an endpoint
 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>> pools, 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
 

Method Detail

update

void update()
Update all instance scores


reset

void reset()
Reset all instance scores


createInstance

LatencyScoreStrategy.Instance createInstance()
Create a new instance to associate with an endpoint

Returns:

removeInstance

void removeInstance(LatencyScoreStrategy.Instance instance)
Remove the instance for an endpoint that is no longer being tracked

Parameters:
instance -

start

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

Parameters:
listener -

shutdown

void shutdown()
Shutdown the threads created by calling start()


sortAndfilterPartition

<CL> List<HostConnectionPool<CL>> sortAndfilterPartition(List<HostConnectionPool<CL>> pools,
                                                         AtomicBoolean prioritized)
Sorts and filters a list of hosts by looking at their up state and score.

Type Parameters:
CL -
Parameters:
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.
Returns:


Copyright © 2012. All Rights Reserved.