Package org.apache.cassandra.gms
Class EndpointState
- java.lang.Object
-
- org.apache.cassandra.gms.EndpointState
-
public class EndpointState extends java.lang.ObjectThis abstraction represents both the HeartBeatState and the ApplicationState in an EndpointState instance. Any state for a given endpoint can be retrieved from this instance.
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Loggerloggerstatic IVersionedSerializer<EndpointState>nullableSerializerstatic IVersionedSerializer<EndpointState>serializer
-
Constructor Summary
Constructors Constructor Description EndpointState(EndpointState other)EndpointState(HeartBeatState initialHbState)EndpointState(HeartBeatState initialHbState, java.util.Map<ApplicationState,VersionedValue> states)
-
Method Summary
-
-
-
Field Detail
-
logger
protected static final org.slf4j.Logger logger
-
serializer
public static final IVersionedSerializer<EndpointState> serializer
-
nullableSerializer
public static final IVersionedSerializer<EndpointState> nullableSerializer
-
-
Constructor Detail
-
EndpointState
public EndpointState(HeartBeatState initialHbState)
-
EndpointState
public EndpointState(EndpointState other)
-
EndpointState
public EndpointState(HeartBeatState initialHbState, java.util.Map<ApplicationState,VersionedValue> states)
-
-
Method Detail
-
getHeartBeatState
public HeartBeatState getHeartBeatState()
-
updateHeartBeat
public void updateHeartBeat()
-
forceNewerGenerationUnsafe
public void forceNewerGenerationUnsafe()
-
forceHighestPossibleVersionUnsafe
public void forceHighestPossibleVersionUnsafe()
-
getApplicationState
public VersionedValue getApplicationState(ApplicationState key)
-
containsApplicationState
public boolean containsApplicationState(ApplicationState key)
-
states
public java.util.Set<java.util.Map.Entry<ApplicationState,VersionedValue>> states()
-
addApplicationState
public void addApplicationState(ApplicationState key, VersionedValue value)
-
addApplicationStates
public void addApplicationStates(java.util.Map<ApplicationState,VersionedValue> values)
-
addApplicationStates
public void addApplicationStates(java.util.Set<java.util.Map.Entry<ApplicationState,VersionedValue>> values)
-
addApplicationStates
public void addApplicationStates(java.util.Set<java.util.Map.Entry<ApplicationState,VersionedValue>> values, @Nullable HeartBeatState hbState)
-
getUpdateTimestamp
public long getUpdateTimestamp()
- Returns:
- System.nanoTime() when state was updated last time.
-
isAlive
public boolean isAlive()
-
isStateEmpty
public boolean isStateEmpty()
-
isEmptyWithoutStatus
public boolean isEmptyWithoutStatus()
- Returns:
- true if
HeartBeatState.isEmpty()is true and no STATUS application state exists
-
isRpcReady
public boolean isRpcReady()
-
isNormalState
public boolean isNormalState()
-
getStatus
public java.lang.String getStatus()
-
getSchemaVersion
@Nullable public java.util.UUID getSchemaVersion()
-
getReleaseVersion
@Nullable public CassandraVersion getReleaseVersion()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isSupersededBy
public boolean isSupersededBy(EndpointState that)
-
-