|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cassandra.gms.Gossiper
public class Gossiper
This module is responsible for Gossiping information for the local endpoint. This abstraction maintains the list of live and dead endpoints. Periodically i.e. every 1 second this module chooses a random node and initiates a round of Gossip with it. A round of Gossip involves 3 rounds of messaging. For instance if node A wants to initiate a round of Gossip with node B it starts off by sending node B a GossipDigestSynMessage. Node B on receipt of this message sends node A a GossipDigestAckMessage. On receipt of this message node A sends node B a GossipDigestAck2Message which completes a round of Gossip. This module as and when it hears one of the three above mentioned messages updates the Failure Detector with the liveness information.
Field Summary | |
---|---|
static long |
aVeryLongTime
|
static Gossiper |
instance
|
static int |
intervalInMillis
|
static int |
QUARANTINE_DELAY
|
Method Summary | |
---|---|
void |
addExpireTimeForEndpoint(java.net.InetAddress endpoint,
long expireTime)
|
void |
addLocalApplicationState(ApplicationState state,
VersionedValue value)
|
void |
addSavedEndpoint(java.net.InetAddress ep)
Add an endpoint we knew about previously, but whose state is unknown |
void |
advertiseRemoving(java.net.InetAddress endpoint,
Token token,
Token mytoken)
This method will begin removing an existing endpoint from the cluster by spoofing its state This should never be called unless this coordinator has had 'removetoken' invoked |
void |
advertiseTokenRemoved(java.net.InetAddress endpoint,
Token token)
Handles switching the endpoint's state from REMOVING_TOKEN to REMOVED_TOKEN This should only be called after advertiseRemoving |
int |
compareEndpointStartup(java.net.InetAddress addr1,
java.net.InetAddress addr2)
determine which endpoint started up earlier |
static long |
computeExpireTime()
|
void |
convict(java.net.InetAddress endpoint,
double phi)
This method is part of IFailureDetectionEventListener interface. |
int |
getCurrentGenerationNumber(java.net.InetAddress endpoint)
|
int |
getCurrentGenerationNumber(java.lang.String address)
|
long |
getEndpointDowntime(java.net.InetAddress ep)
|
long |
getEndpointDowntime(java.lang.String address)
|
EndpointState |
getEndpointStateForEndpoint(java.net.InetAddress ep)
|
java.util.Set<java.util.Map.Entry<java.net.InetAddress,EndpointState>> |
getEndpointStates()
|
protected long |
getExpireTimeForEndpoint(java.net.InetAddress endpoint)
|
java.util.Set<java.net.InetAddress> |
getLiveMembers()
|
java.util.Set<java.net.InetAddress> |
getUnreachableMembers()
|
java.lang.Integer |
getVersion(java.net.InetAddress address)
|
int |
getVersion(java.lang.String address)
|
void |
initializeNodeUnsafe(java.net.InetAddress addr,
int generationNbr)
This should *only* be used for testing purposes. |
boolean |
isEnabled()
|
boolean |
isKnownEndpoint(java.net.InetAddress endpoint)
|
void |
maybeInitializeLocalState(int generationNbr)
|
void |
register(IEndpointStateChangeSubscriber subscriber)
Register for interesting state changes. |
void |
removeEndpoint(java.net.InetAddress endpoint)
Removes the endpoint from Gossip but retains endpoint state |
void |
replacedEndpoint(java.net.InetAddress endpoint)
Remove the Endpoint and evict immediately, to avoid gossiping about this node. |
void |
resetVersion(java.net.InetAddress endpoint)
|
void |
setVersion(java.net.InetAddress address,
int version)
|
void |
start(int generationNbr)
Start the gossiper with the generation # retrieved from the System table |
void |
stop()
|
void |
unregister(IEndpointStateChangeSubscriber subscriber)
Unregister interest for state changes. |
void |
unsafeAssassinateEndpoint(java.lang.String address)
Do not call this method unless you know what you are doing. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int intervalInMillis
public static final int QUARANTINE_DELAY
public static final Gossiper instance
public static final long aVeryLongTime
Method Detail |
---|
public void register(IEndpointStateChangeSubscriber subscriber)
subscriber
- module which implements the IEndpointStateChangeSubscriberpublic void unregister(IEndpointStateChangeSubscriber subscriber)
subscriber
- module which implements the IEndpointStateChangeSubscriberpublic void setVersion(java.net.InetAddress address, int version)
public void resetVersion(java.net.InetAddress endpoint)
public java.lang.Integer getVersion(java.net.InetAddress address)
public java.util.Set<java.net.InetAddress> getLiveMembers()
public java.util.Set<java.net.InetAddress> getUnreachableMembers()
public long getEndpointDowntime(java.net.InetAddress ep)
public void convict(java.net.InetAddress endpoint, double phi)
convict
in interface IFailureDetectionEventListener
endpoint
- endpoint to be convictedphi
- the value of phi with with ep was convictedpublic void removeEndpoint(java.net.InetAddress endpoint)
public void replacedEndpoint(java.net.InetAddress endpoint)
endpoint
- The endpoint that has been replacedpublic void advertiseRemoving(java.net.InetAddress endpoint, Token token, Token mytoken)
endpoint
- - the endpoint being removedtoken
- - the token being removedmytoken
- - my own token for replication coordinationpublic void advertiseTokenRemoved(java.net.InetAddress endpoint, Token token)
endpoint
- token
- public void unsafeAssassinateEndpoint(java.lang.String address) throws java.net.UnknownHostException
unsafeAssassinateEndpoint
in interface GossiperMBean
address
-
java.net.UnknownHostException
public boolean isKnownEndpoint(java.net.InetAddress endpoint)
public int getCurrentGenerationNumber(java.net.InetAddress endpoint)
protected long getExpireTimeForEndpoint(java.net.InetAddress endpoint)
public EndpointState getEndpointStateForEndpoint(java.net.InetAddress ep)
public java.util.Set<java.util.Map.Entry<java.net.InetAddress,EndpointState>> getEndpointStates()
public int compareEndpointStartup(java.net.InetAddress addr1, java.net.InetAddress addr2)
public void start(int generationNbr)
public void maybeInitializeLocalState(int generationNbr)
public void addSavedEndpoint(java.net.InetAddress ep)
public void addLocalApplicationState(ApplicationState state, VersionedValue value)
public void stop()
public boolean isEnabled()
public void initializeNodeUnsafe(java.net.InetAddress addr, int generationNbr)
public int getVersion(java.lang.String address) throws java.net.UnknownHostException
getVersion
in interface GossiperMBean
java.net.UnknownHostException
public long getEndpointDowntime(java.lang.String address) throws java.net.UnknownHostException
getEndpointDowntime
in interface GossiperMBean
java.net.UnknownHostException
public int getCurrentGenerationNumber(java.lang.String address) throws java.net.UnknownHostException
getCurrentGenerationNumber
in interface GossiperMBean
java.net.UnknownHostException
public void addExpireTimeForEndpoint(java.net.InetAddress endpoint, long expireTime)
public static long computeExpireTime()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |