org.apache.cassandra.locator
Class Ec2MultiRegionSnitch
java.lang.Object
org.apache.cassandra.locator.AbstractEndpointSnitch
org.apache.cassandra.locator.AbstractNetworkTopologySnitch
org.apache.cassandra.locator.Ec2Snitch
org.apache.cassandra.locator.Ec2MultiRegionSnitch
- All Implemented Interfaces:
- IEndpointStateChangeSubscriber, IEndpointSnitch
public class Ec2MultiRegionSnitch
- extends Ec2Snitch
- implements IEndpointStateChangeSubscriber
1) Snitch will automatically set the public IP by querying the AWS API
2) Snitch will set the private IP as a Gossip application state.
3) Snitch implements IESCS and will reset the connection if it is within the
same region to communicate via private IP.
Implements Ec2Snitch to inherit its functionality and extend it for
Multi-Region.
Operational: All the nodes in this cluster needs to be able to (modify the
Security group settings in AWS) communicate via Public IP's.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Ec2MultiRegionSnitch
public Ec2MultiRegionSnitch()
throws java.io.IOException,
ConfigurationException
- Throws:
java.io.IOException
ConfigurationException
onJoin
public void onJoin(java.net.InetAddress endpoint,
EndpointState epState)
- Description copied from interface:
IEndpointStateChangeSubscriber
- Use to inform interested parties about the change in the state
for specified endpoint
- Specified by:
onJoin
in interface IEndpointStateChangeSubscriber
- Parameters:
endpoint
- endpoint for which the state change occurred.epState
- state that actually changed for the above endpoint.
onChange
public void onChange(java.net.InetAddress endpoint,
ApplicationState state,
VersionedValue value)
- Specified by:
onChange
in interface IEndpointStateChangeSubscriber
onAlive
public void onAlive(java.net.InetAddress endpoint,
EndpointState state)
- Specified by:
onAlive
in interface IEndpointStateChangeSubscriber
onDead
public void onDead(java.net.InetAddress endpoint,
EndpointState state)
- Specified by:
onDead
in interface IEndpointStateChangeSubscriber
onRestart
public void onRestart(java.net.InetAddress endpoint,
EndpointState state)
- Description copied from interface:
IEndpointStateChangeSubscriber
- Called 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 if
state.isAlive() == false
as state
is from before the restarted node is marked up.
- Specified by:
onRestart
in interface IEndpointStateChangeSubscriber
onRemove
public void onRemove(java.net.InetAddress endpoint)
- Specified by:
onRemove
in interface IEndpointStateChangeSubscriber
gossiperStarting
public void gossiperStarting()
- Description copied from interface:
IEndpointSnitch
- called after Gossiper instance exists immediately before it starts gossiping
- Specified by:
gossiperStarting
in interface IEndpointSnitch
- Overrides:
gossiperStarting
in class AbstractEndpointSnitch
Copyright © 2013 The Apache Software Foundation