com.netflix.astyanax.connectionpool.impl
Class TokenPartitionedTopology<CL>

java.lang.Object
  extended by com.netflix.astyanax.connectionpool.impl.TokenPartitionedTopology<CL>
All Implemented Interfaces:
Topology<CL>

public class TokenPartitionedTopology<CL>
extends Object
implements Topology<CL>


Constructor Summary
TokenPartitionedTopology(LatencyScoreStrategy strategy)
           
 
Method Summary
 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
protected  HostConnectionPoolPartition<CL> makePartition(BigInteger partition)
           
 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
 boolean setPools(Map<BigInteger,Collection<HostConnectionPool<CL>>> ring)
          Refresh the internal topology structure
 void suspendPool(HostConnectionPool<CL> pool)
          Suspend a host that is down
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TokenPartitionedTopology

public TokenPartitionedTopology(LatencyScoreStrategy strategy)
Method Detail

makePartition

protected HostConnectionPoolPartition<CL> makePartition(BigInteger partition)

setPools

public boolean setPools(Map<BigInteger,Collection<HostConnectionPool<CL>>> ring)
Description copied from interface: Topology
Refresh the internal topology structure

Specified by:
setPools in interface Topology<CL>
Returns:

resumePool

public void resumePool(HostConnectionPool<CL> pool)
Description copied from interface: Topology
Resume a host that was previously down

Specified by:
resumePool in interface Topology<CL>

suspendPool

public void suspendPool(HostConnectionPool<CL> pool)
Description copied from interface: Topology
Suspend a host that is down

Specified by:
suspendPool in interface Topology<CL>

refresh

public void refresh()
Description copied from interface: Topology
Refresh the internal state and apply the latency score strategy

Specified by:
refresh in interface Topology<CL>

getPartition

public HostConnectionPoolPartition<CL> getPartition(BigInteger token)
Description copied from interface: Topology
Search for the partition that owns this token

Specified by:
getPartition in interface Topology<CL>
Returns:

getAllPools

public HostConnectionPoolPartition<CL> getAllPools()
Description copied from interface: Topology
Return a partition that represents all hosts in the ring

Specified by:
getAllPools in interface Topology<CL>
Returns:

getPartitionCount

public int getPartitionCount()
Description copied from interface: Topology
Get total number of tokens in the topology

Specified by:
getPartitionCount in interface Topology<CL>
Returns:

removePool

public void removePool(HostConnectionPool<CL> pool)
Description copied from interface: Topology
Remove this pool from all partitions

Specified by:
removePool in interface Topology<CL>

addPool

public void addPool(HostConnectionPool<CL> pool)
Description copied from interface: Topology
Add a pool without knowing it's token. This pool will be added to the all pools partition only

Specified by:
addPool in interface Topology<CL>

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012. All Rights Reserved.