com.netflix.astyanax.connectionpool.impl
Interface Topology<CL>

All Known Implementing Classes:
AbstractTopology, TokenPartitionedTopology

public interface Topology<CL>


Method Summary
 void addPool(HostConnectionPool<CL> pool)
          Add a pool without knowing its token.
 TokenHostConnectionPoolPartition<CL> getAllPools()
          Return a partition that represents all hosts in the ring
 TokenHostConnectionPoolPartition<CL> getPartition(java.nio.ByteBuffer rowkey)
          Get the partition best suited to handle a row key
 TokenHostConnectionPoolPartition<CL> getPartition(java.lang.String token)
          Return the partition for a specific token
 int getPartitionCount()
           
 java.util.List<java.lang.String> getPartitionNames()
           
 java.util.Map<java.lang.String,TokenHostConnectionPoolPartition<CL>> getPartitions()
           
 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(java.util.Collection<HostConnectionPool<CL>> ring)
          Refresh the internal topology structure
 void suspendPool(HostConnectionPool<CL> pool)
          Suspend a host that is down
 

Method Detail

setPools

boolean setPools(java.util.Collection<HostConnectionPool<CL>> ring)
Refresh the internal topology structure

Parameters:
ring -
Returns:
True if anything changed in the internal state

addPool

void addPool(HostConnectionPool<CL> pool)
Add a pool without knowing its token. This pool will be added to the all pools partition only

Parameters:
pool -

removePool

void removePool(HostConnectionPool<CL> pool)
Remove this pool from all partitions

Parameters:
pool -

resumePool

void resumePool(HostConnectionPool<CL> pool)
Resume a host that was previously down

Parameters:
pool -

suspendPool

void suspendPool(HostConnectionPool<CL> pool)
Suspend a host that is down

Parameters:
pool -

refresh

void refresh()
Refresh the internal state and apply the latency score strategy


getPartition

TokenHostConnectionPoolPartition<CL> getPartition(java.nio.ByteBuffer rowkey)
Get the partition best suited to handle a row key

Parameters:
token -

getAllPools

TokenHostConnectionPoolPartition<CL> getAllPools()
Return a partition that represents all hosts in the ring


getPartitionCount

int getPartitionCount()
Returns:
Get total number of tokens in the topology

getPartitionNames

java.util.List<java.lang.String> getPartitionNames()
Returns:
Return a list of all unqiue ids or first token for partitions in the topology

getPartitions

java.util.Map<java.lang.String,TokenHostConnectionPoolPartition<CL>> getPartitions()
Returns:
Return a mapping of partition ids to partition details

getPartition

TokenHostConnectionPoolPartition<CL> getPartition(java.lang.String token)
Return the partition for a specific token

Parameters:
token -