public static interface Host.StateListener
It is possible for the same event to be fired multiple times, particularly for up or down events. Therefore, a listener should ignore the same event if it has already been notified of a node's state.
Modifier and Type | Method and Description |
---|---|
void |
onAdd(Host host)
Called when a new node is added to the cluster.
|
void |
onDown(Host host)
Called when a node is determined to be down.
|
void |
onRegister(Cluster cluster)
Gets invoked when the tracker is registered with a cluster, or at cluster startup if the
tracker was registered at initialization with
Cluster.register(LatencyTracker) . |
void |
onRemove(Host host)
Called when a node is removed from the cluster.
|
void |
onUnregister(Cluster cluster)
Gets invoked when the tracker is unregistered from a cluster, or at cluster shutdown if the
tracker was not unregistered.
|
void |
onUp(Host host)
Called when a node is determined to be up.
|
void onAdd(Host host)
The newly added node should be considered up.
host
- the host that has been newly added.void onUp(Host host)
host
- the host that has been detected up.void onDown(Host host)
host
- the host that has been detected down.void onRemove(Host host)
host
- the removed host.void onRegister(Cluster cluster)
Cluster.register(LatencyTracker)
.cluster
- the cluster that this tracker is registered with.void onUnregister(Cluster cluster)
cluster
- the cluster that this tracker was registered with.Copyright © 2012–2024. All rights reserved.