|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.zib.scalaris.NodeDiscovery
public class NodeDiscovery
Provides a node discovery service.
When started with startWithFixedDelay(long)
or
startWithFixedDelay(long, long, TimeUnit)
, periodically connects to
a Scalaris node and gets information about other Scalaris nodes. These will
then be added to the given ConnectionFactory
where old nodes with
connection failures will be removed in favour of newly discovered nodes.
Nested Class Summary | |
---|---|
static interface |
NodeDiscovery.NewNodeHandler
Handler that is invoked whenever a new node is found by the NodeDiscovery thread. |
Constructor Summary | |
---|---|
NodeDiscovery(ConnectionFactory cf)
Constructor |
|
NodeDiscovery(ConnectionPool cPool)
Constructor |
Method Summary | |
---|---|
ConnectionFactory |
getCf()
Gets the ConnectionFactory to work with. |
int |
getMaxNodes()
Gets the maximum number of nodes that should remain in the ConnectionFactory cf . |
int |
getMinAgeToRemove()
Gets the minimum time in seconds since the last successful connection for a node to be removed in favour of newly discovered nodes. |
void |
run()
Executed a single call to a known Scalaris node asking for other known nodes. |
void |
setMaxNodes(int maxNodes)
Sets the maximum number of nodes that should remain in the ConnectionFactory cf . |
void |
setMinAgeToRemove(int minAgeToRemove)
Sets the minimum time in seconds since the last successful connection for a node to be removed in favour of newly discovered nodes. |
void |
startWithFixedDelay(long delay)
Starts the node discovery service at the given fixed delay. |
void |
startWithFixedDelay(long initialDelay,
long delay,
TimeUnit unit)
Starts the node discovery service at the given fixed delay. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NodeDiscovery(ConnectionFactory cf)
cf
- the ConnectionFactory
to add nodes to / remove nodes
frompublic NodeDiscovery(ConnectionPool cPool)
cPool
- the ConnectionPool
to interact withMethod Detail |
---|
public void startWithFixedDelay(long delay)
delay
- the delay between the termination of one execution and the
commencement of the nextpublic void startWithFixedDelay(long initialDelay, long delay, TimeUnit unit)
initialDelay
- the time to delay first executiondelay
- the delay between the termination of one execution and the
commencement of the nextunit
- the time unit of the initialDelay and delay parameterspublic void run()
ConnectionFactory
cf
.
run
in interface Runnable
public final int getMaxNodes()
ConnectionFactory
cf
.
public final void setMaxNodes(int maxNodes)
ConnectionFactory
cf
.
maxNodes
- the maxNodes to setpublic final int getMinAgeToRemove()
public final void setMinAgeToRemove(int minAgeToRemove)
minAgeToRemove
- the minAgeToRemove to setpublic final ConnectionFactory getCf()
ConnectionFactory
to work with.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |