Enum Class ServerStatus
- All Implemented Interfaces:
Serializable
,Comparable<ServerStatus>
,java.lang.constant.Constable
The various status a DS can take.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionDS in bad data status.Deprecated status: DS in degraded status.DS in full update (local DS is initialized from another DS).Invalid status: special status used to return an error (impossible status).DS in normal status.Not connected status: special status used as initial status of the state machine in the DS context only as already connected while state machine considered in RS context.Replica is no more covered by the changelog because it is older than the purge delay. -
Method Summary
Modifier and TypeMethodDescriptionbyte
getValue()
Get a numeric representation of the status.boolean
isTransitionAllowedTo
(ServerStatus toStatus) Returns whether the transition going from this status totoStatus
is valid.boolean
Checks if a given status is valid as an entering status for the state machine.toStatusCompatibleWith
(short protocolVersion) Compute a compatible status for servers not implementing the same replication protocol version as this server.toString()
Get a user readable string representing this status (User friendly string for monitoring purpose).static ServerStatus
valueOf
(byte value) Returns the ServerStatus matching the passed status numeric representation.static ServerStatus
Returns the enum constant of this class with the specified name.static ServerStatus[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INVALID
Invalid status: special status used to return an error (impossible status). -
NOT_CONNECTED
Not connected status: special status used as initial status of the state machine in the DS context only as already connected while state machine considered in RS context. -
NORMAL
DS in normal status.When: everything is fine
Properties:
- no referrals
- updates received from RS
-
DEGRADED
Deprecated status: DS in degraded status.When: DS is too late compared to number of updates RS has to send
Properties:
- referrals returned
- updates received from RS
-
FULL_UPDATE
DS in full update (local DS is initialized from another DS). (if local DS initializes another, it is not in this status)A better name would be "INITIALIZING". Although we need to check the impact renaming will have on tools and mixed topologies.
When: A full update is being performed to our local DS
Properties:
- referrals returned
- no updates received from RS
-
BAD_DATA
DS in bad data status.- A reset generation id order has been sent to topology
- Fractional replication configuration is inconsistent
- no referrals returned
- RS does not send changes to replica having this status
-
TOO_LATE
Replica is no more covered by the changelog because it is older than the purge delay. Properties:- no referrals returned
- RS do not send changes to replica having this status
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
valueOf
Returns the ServerStatus matching the passed status numeric representation.- Parameters:
value
- The numeric value for the status to return- Returns:
- The matching ServerStatus
- Throws:
IllegalArgumentException
- If provided status value is wrong
-
isValidInitialStatus
public boolean isValidInitialStatus()Checks if a given status is valid as an entering status for the state machine.- Returns:
- True if the passed status is a valid initial status.
-
isTransitionAllowedTo
Returns whether the transition going from this status totoStatus
is valid.- Parameters:
toStatus
- The status we are trying to go to.- Returns:
true
if transition from this status totoStatus
is valid,false
otherwise
-
getValue
public byte getValue()Get a numeric representation of the status.- Returns:
- The numeric representation of the status
-
toStatusCompatibleWith
Compute a compatible status for servers not implementing the same replication protocol version as this server.- Parameters:
protocolVersion
- the replication version of the peer server.- Returns:
- the compatible status
-
toString
Get a user readable string representing this status (User friendly string for monitoring purpose).- Overrides:
toString
in classEnum<ServerStatus>
- Returns:
- A user readable string representing this status.
-