CL - public class HostConnectionPoolPartition<CL>
extends java.lang.Object
TokenPartitionedTopology instanceTokenPartitionedTopology} for details on how this class is referenced.| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
HostConnectionPoolPartition(LatencyScoreStrategy strategy) |
| Modifier and Type | Method and Description |
|---|---|
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() |
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
public HostConnectionPoolPartition(LatencyScoreStrategy strategy)
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