public class

TokenPartitionedTopology

extends Object
implements Topology<CL>
java.lang.Object
   ↳ com.netflix.astyanax.connectionpool.impl.TokenPartitionedTopology<CL>

Summary

Public Constructors
TokenPartitionedTopology(LatencyScoreStrategy strategy)
Public Methods
void addPool(HostConnectionPool<CL> pool)
Add a pool without knowing it's token.
HostConnectionPoolPartition<CL> getAllPools()
Return a partition that represents all hosts in the ring
HostConnectionPoolPartition<CL> getPartition(BigInteger token)
Search for the partition that owns this token
int getPartitionCount()
Get total number of tokens in the topology
void refresh()
Refresh the internal state and apply the latency score strategy
void removePool(HostConnectionPool<CL> pool)
Remove this pool from all partitions
void resumePool(HostConnectionPool<CL> pool)
Resume a host that was previously down
synchronized boolean setPools(Map<BigIntegerCollection<HostConnectionPool<CL>>> ring)
Refresh the internal topology structure
void suspendPool(HostConnectionPool<CL> pool)
Suspend a host that is down
String toString()
Protected Methods
HostConnectionPoolPartition<CL> makePartition(BigInteger partition)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.netflix.astyanax.connectionpool.impl.Topology

Public Constructors

public TokenPartitionedTopology (LatencyScoreStrategy strategy)

Public Methods

public void addPool (HostConnectionPool<CL> pool)

Add a pool without knowing it's token. This pool will be added to the all pools partition only

public HostConnectionPoolPartition<CL> getAllPools ()

Return a partition that represents all hosts in the ring

public HostConnectionPoolPartition<CL> getPartition (BigInteger token)

Search for the partition that owns this token

public int getPartitionCount ()

Get total number of tokens in the topology

public void refresh ()

Refresh the internal state and apply the latency score strategy

public void removePool (HostConnectionPool<CL> pool)

Remove this pool from all partitions

public void resumePool (HostConnectionPool<CL> pool)

Resume a host that was previously down

public synchronized boolean setPools (Map<BigIntegerCollection<HostConnectionPool<CL>>> ring)

Refresh the internal topology structure

public void suspendPool (HostConnectionPool<CL> pool)

Suspend a host that is down

public String toString ()

Protected Methods

protected HostConnectionPoolPartition<CL> makePartition (BigInteger partition)