com.netflix.astyanax.connectionpool.impl
Class NodeDiscoveryImpl

java.lang.Object
  extended by com.netflix.astyanax.connectionpool.impl.NodeDiscoveryImpl
Type Parameters:
CL -
All Implemented Interfaces:
NodeDiscovery

public class NodeDiscoveryImpl
extends Object
implements NodeDiscovery

Re-discover the ring on a fixed interval to identify new nodes or changes to the ring tokens.

Author:
elandau

Constructor Summary
NodeDiscoveryImpl(String name, int interval, com.google.common.base.Supplier<Map<BigInteger,List<Host>>> tokenRangeSupplier, ConnectionPool<?> connectionPool)
           
 
Method Summary
 long getErrorCount()
          Get total number of errors encountered during a refresh
 Exception getLastException()
          Get the last exception that was encountered
 org.joda.time.DateTime getLastRefreshTime()
          Get the last refresh time in the discovery thread
 String getRawHostList()
          Get the raw list of nodes from the underlying refresh mechanism
 long getRefreshCount()
          Get the number of refreshes
 void shutdown()
          Stop the node discovery thread
 void start()
          Start the node discovery thread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeDiscoveryImpl

public NodeDiscoveryImpl(String name,
                         int interval,
                         com.google.common.base.Supplier<Map<BigInteger,List<Host>>> tokenRangeSupplier,
                         ConnectionPool<?> connectionPool)
Method Detail

start

public void start()
Description copied from interface: NodeDiscovery
Start the node discovery thread

Specified by:
start in interface NodeDiscovery

shutdown

public void shutdown()
Description copied from interface: NodeDiscovery
Stop the node discovery thread

Specified by:
shutdown in interface NodeDiscovery

getLastRefreshTime

public org.joda.time.DateTime getLastRefreshTime()
Description copied from interface: NodeDiscovery
Get the last refresh time in the discovery thread

Specified by:
getLastRefreshTime in interface NodeDiscovery
Returns:

getRefreshCount

public long getRefreshCount()
Description copied from interface: NodeDiscovery
Get the number of refreshes

Specified by:
getRefreshCount in interface NodeDiscovery
Returns:

getLastException

public Exception getLastException()
Description copied from interface: NodeDiscovery
Get the last exception that was encountered

Specified by:
getLastException in interface NodeDiscovery
Returns:

getErrorCount

public long getErrorCount()
Description copied from interface: NodeDiscovery
Get total number of errors encountered during a refresh

Specified by:
getErrorCount in interface NodeDiscovery
Returns:

getRawHostList

public String getRawHostList()
Description copied from interface: NodeDiscovery
Get the raw list of nodes from the underlying refresh mechanism

Specified by:
getRawHostList in interface NodeDiscovery
Returns:


Copyright © 2012. All Rights Reserved.