|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.netflix.astyanax.connectionpool.impl.HostConnectionPoolPartition<CL>
CL - public class HostConnectionPoolPartition<CL>
Collection of hosts that are grouped by a certain criteria (such as token or rack)
The class maintains the list of active pools for the given criteria (such as a token range in a ring)
Any changes to the pools in this partition causes the active set to be revised and sorted according to the latency score strategy provided.
Note that an instance of this class is maintained / referenced for each token range partition by the TokenPartitionedTopology instance
TokenPartitionedTopology} for details on how this class is referenced.| Field Summary | |
|---|---|
protected java.util.concurrent.atomic.AtomicReference<java.util.List<HostConnectionPool<CL>>> |
activePools
|
protected org.cliffc.high_scale_lib.NonBlockingHashSet<HostConnectionPool<CL>> |
pools
|
protected java.util.concurrent.atomic.AtomicBoolean |
prioritize
|
protected LatencyScoreStrategy |
strategy
|
| Constructor Summary | |
|---|---|
HostConnectionPoolPartition(LatencyScoreStrategy strategy)
|
|
| Method Summary | |
|---|---|
boolean |
addPool(HostConnectionPool<CL> pool)
Add a new pool to the partition. |
java.util.List<HostConnectionPool<CL>> |
getPools()
|
boolean |
hasPool(HostConnectionPool<CL> pool)
Returns true if a pool is contained in this partition |
boolean |
isSorted()
If true the the hosts are sorted by order of priority where the first host gives the best performance |
void |
refresh()
Refresh the partition |
boolean |
removePool(HostConnectionPool<CL> pool)
|
boolean |
setPools(java.util.Collection<HostConnectionPool<CL>> newPools)
Sets all pools for this partition. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final java.util.concurrent.atomic.AtomicBoolean prioritize
protected final org.cliffc.high_scale_lib.NonBlockingHashSet<HostConnectionPool<CL>> pools
protected final java.util.concurrent.atomic.AtomicReference<java.util.List<HostConnectionPool<CL>>> activePools
protected final LatencyScoreStrategy strategy
| Constructor Detail |
|---|
public HostConnectionPoolPartition(LatencyScoreStrategy strategy)
| Method Detail |
|---|
public boolean setPools(java.util.Collection<HostConnectionPool<CL>> newPools)
newPools - public boolean addPool(HostConnectionPool<CL> pool)
pool -
public boolean removePool(HostConnectionPool<CL> pool)
public java.util.List<HostConnectionPool<CL>> getPools()
public boolean isSorted()
public boolean hasPool(HostConnectionPool<CL> pool)
pool - public void refresh()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||