|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvoldemort.cluster.failuredetector.NoopFailureDetector
public class NoopFailureDetector
NoopFailureDetector is used for testing classes which don't actually need a working FailureDetector ;)
Constructor Summary | |
---|---|
NoopFailureDetector()
|
Method Summary | |
---|---|
void |
addFailureDetectorListener(FailureDetectorListener failureDetectorListener)
Adds a FailureDetectorListener instance that can receive event callbacks about node availability state changes. |
void |
destroy()
Cleans up any open resources in preparation for shutdown. |
int |
getAvailableNodeCount()
Returns the number of nodes that are considered to be available at the time of calling. |
FailureDetectorConfig |
getConfig()
Retrieves the FailureDetectorConfig instance with which this FailureDetector was constructed. |
long |
getLastChecked(Node node)
Returns the number of milliseconds since the node was last checked for availability. |
int |
getNodeCount()
Returns the number of nodes that are in the set of all nodes at the time of calling. |
boolean |
isAvailable(Node node)
Determines if the node is available or offline. |
void |
recordException(Node node,
long requestTime,
UnreachableStoreException e)
Allows external callers to provide input to the FailureDetector that an error occurred when trying to access the node. |
void |
recordSuccess(Node node,
long requestTime)
Allows external callers to provide input to the FailureDetector that an access to the node succeeded. |
void |
removeFailureDetectorListener(FailureDetectorListener failureDetectorListener)
Removes a FailureDetectorListener instance from the event listener list. |
void |
waitForAvailability(Node node)
waitForAvailability causes the calling thread to block until the given Node is available. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NoopFailureDetector()
Method Detail |
---|
public long getLastChecked(Node node)
FailureDetector
getLastChecked
in interface FailureDetector
node
- Node to check
public boolean isAvailable(Node node)
FailureDetector
isAvailable
in interface FailureDetector
node
- Node to check
public FailureDetectorConfig getConfig()
FailureDetector
getConfig
in interface FailureDetector
public void recordException(Node node, long requestTime, UnreachableStoreException e)
FailureDetector
recordException
in interface FailureDetector
node
- Node to checkrequestTime
- Length of time (in milliseconds) to perform requeste
- Exception that occurred when trying to access the nodepublic void recordSuccess(Node node, long requestTime)
FailureDetector
recordSuccess
in interface FailureDetector
node
- Node to checkrequestTime
- Length of time (in milliseconds) to perform requestpublic void addFailureDetectorListener(FailureDetectorListener failureDetectorListener)
FailureDetector
addFailureDetectorListener
in interface FailureDetector
failureDetectorListener
- FailureDetectorListener that receives
eventsFailureDetector.removeFailureDetectorListener(voldemort.cluster.failuredetector.FailureDetectorListener)
public void removeFailureDetectorListener(FailureDetectorListener failureDetectorListener)
FailureDetector
removeFailureDetectorListener
in interface FailureDetector
failureDetectorListener
- FailureDetectorListener that was receiving
eventsFailureDetector.addFailureDetectorListener(voldemort.cluster.failuredetector.FailureDetectorListener)
public int getAvailableNodeCount()
FailureDetector
n
= the results of
getNodeCount()
, the return value is bounded in the range
[0..n]
.
getAvailableNodeCount
in interface FailureDetector
FailureDetector.getNodeCount()
public int getNodeCount()
FailureDetector
getNodeCount
in interface FailureDetector
FailureDetector.getAvailableNodeCount()
public void waitForAvailability(Node node)
FailureDetector
waitForAvailability
in interface FailureDetector
node
- Node on which to waitpublic void destroy()
FailureDetector
destroy
in interface FailureDetector
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |