Enum ServerStatus
- java.lang.Object
-
- java.lang.Enum<ServerStatus>
-
- org.opends.server.replication.common.ServerStatus
-
- All Implemented Interfaces:
Serializable
,Comparable<ServerStatus>
public enum ServerStatus extends Enum<ServerStatus>
The various status a DS can take.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BAD_DATA
DS in bad data status.DEGRADED
Deprecated status: DS in degraded status.FULL_UPDATE
DS in full update (local DS is initialized from another DS).INVALID
Invalid status: special status used to return an error (impossible status).NORMAL
DS in normal 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.TOO_LATE
Replica is no more covered by the changelog because it is older than the purge delay.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte
getValue()
Get a numeric representation of the status.boolean
isTransitionAllowedTo(ServerStatus toStatus)
Returns whether the transition going from this status totoStatus
is valid.boolean
isValidInitialStatus()
Checks if a given status is valid as an entering status for the state machine.ServerStatus
toStatusCompatibleWith(short protocolVersion)
Compute a compatible status for servers not implementing the same replication protocol version as this server.String
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
valueOf(String name)
Returns the enum constant of this type with the specified name.static ServerStatus[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INVALID
public static final ServerStatus INVALID
Invalid status: special status used to return an error (impossible status).
-
NOT_CONNECTED
public static final ServerStatus 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
public static final ServerStatus NORMAL
DS in normal status.When: everything is fine
Properties:
- no referrals
- updates received from RS
-
DEGRADED
public static final ServerStatus 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
public static final ServerStatus 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
public static final ServerStatus 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
public static final ServerStatus 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 Detail
-
values
public static ServerStatus[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ServerStatus c : ServerStatus.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ServerStatus valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
valueOf
public static ServerStatus valueOf(byte value) throws IllegalArgumentException
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
public boolean isTransitionAllowedTo(ServerStatus toStatus)
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
public ServerStatus toStatusCompatibleWith(short protocolVersion)
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
public String 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.
-
-