Class DiskUsageBroadcaster
java.lang.Object
org.apache.cassandra.service.disk.usage.DiskUsageBroadcaster
- All Implemented Interfaces:
IEndpointStateChangeSubscriber
Starts
DiskUsageMonitor to monitor local disk usage state and broadcast new state via Gossip.
At the same time, it caches cluster's disk usage state received via Gossip.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbeforeChange(InetAddressAndPort endpoint, EndpointState currentState, ApplicationState newStateKey, VersionedValue newValue) booleanbooleanisFull(InetAddressAndPort endpoint) booleanisStuffed(InetAddressAndPort endpoint) voidonAlive(InetAddressAndPort endpoint, EndpointState state) voidonChange(InetAddressAndPort endpoint, ApplicationState state, VersionedValue value) voidonDead(InetAddressAndPort endpoint, EndpointState state) voidonJoin(InetAddressAndPort endpoint, EndpointState epState) Use to inform interested parties about the change in the state for specified endpointvoidonRemove(InetAddressAndPort endpoint) voidonRestart(InetAddressAndPort endpoint, EndpointState state) Called whenever a node is restarted.voidstate(InetAddressAndPort endpoint)
-
Field Details
-
instance
-
-
Constructor Details
-
DiskUsageBroadcaster
-
-
Method Details
-
hasStuffedOrFullNode
public boolean hasStuffedOrFullNode()- Returns:
trueif any node in the cluster is STUFFED OR FULL
-
isFull
- Returns:
trueif given node's disk usage is FULL
-
isStuffed
- Returns:
trueif given node's disk usage is STUFFED
-
state
-
startBroadcasting
public void startBroadcasting() -
onChange
- Specified by:
onChangein interfaceIEndpointStateChangeSubscriber
-
onJoin
Description copied from interface:IEndpointStateChangeSubscriberUse to inform interested parties about the change in the state for specified endpoint- Specified by:
onJoinin interfaceIEndpointStateChangeSubscriber- Parameters:
endpoint- endpoint for which the state change occurred.epState- state that actually changed for the above endpoint.
-
beforeChange
public void beforeChange(InetAddressAndPort endpoint, EndpointState currentState, ApplicationState newStateKey, VersionedValue newValue) - Specified by:
beforeChangein interfaceIEndpointStateChangeSubscriber
-
onAlive
- Specified by:
onAlivein interfaceIEndpointStateChangeSubscriber
-
onDead
- Specified by:
onDeadin interfaceIEndpointStateChangeSubscriber
-
onRestart
Description copied from interface:IEndpointStateChangeSubscriberCalled whenever a node is restarted. Note that there is no guarantee when that happens that the node was previously marked down. It will have only ifstate.isAlive() == falseasstateis from before the restarted node is marked up.- Specified by:
onRestartin interfaceIEndpointStateChangeSubscriber
-
onRemove
- Specified by:
onRemovein interfaceIEndpointStateChangeSubscriber
-