Enum Class DiversityRating
- All Implemented Interfaces:
Serializable, Comparable<DiversityRating>, Constable
Rates the geographic diversity of failover paths for resiliency analysis.
Geographic diversity measures how independent two locations are in terms of shared failure domains (power grids, fiber routes, weather corridors, seismic zones). A backup in the same metro area provides minimal diversity, while a backup on a different continent provides maximum diversity.
- Author:
- ianjones
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionUnder 150 km apart — effectively the same failure domain (same-metro pairings).3000 km or more apart — typically cross-region/continental (e.g.1500–2999 km apart — good diversity within a continent (e.g.500–1499 km apart — some shared infrastructure risk (e.g.150–499 km apart — limited diversity, likely shared corridors (e.g.The distance between the two metros could not be determined (no facility or Fabric metro coordinates were available for at least one of them). -
Method Summary
Modifier and TypeMethodDescriptionstatic DiversityRatingfromDistance(double distanceKm) Rates geographic diversity based on the distance between two metros.static DiversityRatingReturns the enum constant of this class with the specified name.static DiversityRating[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
EXCELLENT
3000 km or more apart — typically cross-region/continental (e.g. Ashburn–Frankfurt). Score 1.0. -
GOOD
1500–2999 km apart — good diversity within a continent (e.g. Ashburn–Dallas). Score 0.75. -
MODERATE
500–1499 km apart — some shared infrastructure risk (e.g. Ashburn–Chicago). Score 0.5. -
POOR
150–499 km apart — limited diversity, likely shared corridors (e.g. Ashburn–New York). Score 0.25. -
CRITICAL
Under 150 km apart — effectively the same failure domain (same-metro pairings). Score 0.0. -
UNKNOWN
The distance between the two metros could not be determined (no facility or Fabric metro coordinates were available for at least one of them). This is an absence of data, not a proximity finding: it is never returned byfromDistance(double)and must be excluded from same-site detection and diversity scoring rather than treated as0 km(which would falsely read as CRITICAL "same-site"). Itsscoreis a placeholder and must not be averaged into a resiliency score.
-
-
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
-
fromDistance
Rates geographic diversity based on the distance between two metros.Only ever returns one of the five distance-based ratings;
UNKNOWNis reserved for the caller to assign when the distance itself is unavailable and is never produced here.- Parameters:
distanceKm- the distance between primary and backup metros in kilometers- Returns:
- the diversity rating for the given distance
-