Package org.apache.cassandra.gms
Class EndpointState
java.lang.Object
org.apache.cassandra.gms.EndpointState
This 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
FieldsModifier and TypeFieldDescriptionprotected static final org.slf4j.Loggerstatic final IVersionedSerializer<EndpointState>static final IVersionedSerializer<EndpointState> -
Constructor Summary
ConstructorsConstructorDescriptionEndpointState(EndpointState other) EndpointState(HeartBeatState initialHbState) EndpointState(HeartBeatState initialHbState, Map<ApplicationState, VersionedValue> states) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddApplicationState(ApplicationState key, VersionedValue value) voidvoidvoidaddApplicationStates(Set<Map.Entry<ApplicationState, VersionedValue>> values, HeartBeatState hbState) booleanvoidvoidlongbooleanisAlive()booleanbooleanbooleanbooleanbooleanisSupersededBy(EndpointState that) voidvoidmarkDead()states()toString()voidunsafeSetUpdateTimestamp(long value) void
-
Field Details
-
logger
protected static final org.slf4j.Logger logger -
serializer
-
nullableSerializer
-
-
Constructor Details
-
EndpointState
-
EndpointState
-
EndpointState
-
-
Method Details
-
getHeartBeatState
-
updateHeartBeat
public void updateHeartBeat() -
forceNewerGenerationUnsafe
public void forceNewerGenerationUnsafe() -
forceHighestPossibleVersionUnsafe
public void forceHighestPossibleVersionUnsafe() -
getApplicationState
-
containsApplicationState
-
states
-
addApplicationState
-
addApplicationStates
-
addApplicationStates
-
addApplicationStates
public void addApplicationStates(Set<Map.Entry<ApplicationState, VersionedValue>> values, @Nullable HeartBeatState hbState) -
getUpdateTimestamp
public long getUpdateTimestamp()- Returns:
- System.nanoTime() when state was updated last time.
-
unsafeSetUpdateTimestamp
public void unsafeSetUpdateTimestamp(long value) -
isAlive
public boolean isAlive() -
markAlive
public void markAlive() -
markDead
public void markDead() -
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
-
getSchemaVersion
-
getReleaseVersion
-
toString
-
isSupersededBy
-