Package org.apache.cassandra.locator
Class ReconnectableSnitchHelper
java.lang.Object
org.apache.cassandra.locator.ReconnectableSnitchHelper
- All Implemented Interfaces:
IEndpointStateChangeSubscriber
Sidekick helper for snitches that want to reconnect from one IP addr for a node to another.
Typically, this is for situations like EC2 where a node will have a public address and a private address,
where we connect on the public, discover the private, and reconnect on the private.
-
Constructor Summary
ConstructorsConstructorDescriptionReconnectableSnitchHelper(IEndpointSnitch snitch, String localDc, boolean preferLocal) -
Method Summary
Modifier and TypeMethodDescriptionvoidbeforeChange(InetAddressAndPort endpoint, EndpointState currentState, ApplicationState newStateKey, VersionedValue newValue) 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.
-
Constructor Details
-
ReconnectableSnitchHelper
-
-
Method Details
-
beforeChange
public void beforeChange(InetAddressAndPort endpoint, EndpointState currentState, ApplicationState newStateKey, VersionedValue newValue) - Specified by:
beforeChangein 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.
-
onChange
- Specified by:
onChangein interfaceIEndpointStateChangeSubscriber
-
onAlive
- Specified by:
onAlivein interfaceIEndpointStateChangeSubscriber
-
onDead
- Specified by:
onDeadin interfaceIEndpointStateChangeSubscriber
-
onRemove
- Specified by:
onRemovein 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
-