Last active
December 19, 2015 17:59
-
-
Save helena/5995883 to your computer and use it in GitHub Desktop.
Proximity And Network Topology Aware Load Balanced Routing - Base Descriptors Using AWS Regions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A marker trait. | |
*/ | |
trait ProximalTopology implements Serializable | |
case class AvailabilityZone(id: Int, proximalTo: IndexSeq[Int]) | |
case class Region(name: RegionName, zones: Set[AvailabilityZone]) | |
abstract class RegionName | |
object RegionName { | |
@SerialVersionUID(1L) | |
case class AsiaPacificNortheast(id="0" code="ap-northeast-1" name="Asia Pacific (Tokyo) Region") extends RegionName | |
@SerialVersionUID(1L) | |
case class AsiaPacificSoutheast(id="1" code="ap-southeast-1" name="Asia Pacific (Singapore) Region) extends RegionName | |
@SerialVersionUID(1L) | |
case class AsiaPacificSydney(id="2" code="ap-southeast-2" name="Asia Pacific (Sydney) Region") extends RegionName | |
@SerialVersionUID(1L) | |
case class EuropeWest(id="3" code="eu-west-1" name="EU (Ireland) Region") extends RegionName | |
@SerialVersionUID(1L) | |
case class SouthAmericaEast(id="4" code="sa-east-1" name="South America (Sao Paulo) Region") extends RegionName | |
@SerialVersionUID(1L) | |
case class UnitedStatesEast(id="5" code="us-east-1" name="US East (Northern Virginia) Region") extends RegionName | |
@SerialVersionUID(1L) | |
case class UnitedStatesWestCalifornia(id="6" code="us-west-1" name="US East (Northern California) Region") extends RegionName | |
@SerialVersionUID(1L) | |
case class UnitedStatesWestOregon(id="7" code="us-west-2" name="US East (Oregon) Region") extends RegionName | |
} | |
/* | |
Describe the AWS Asia Pacific (Tokyo) Region: | |
Region("api-northeast-1", Set(AvailabilityZone(0, IndexedSeq(01, 02)))) | |
*/ | |
case class Node(id: String, zoneId: String, roles: Set[String]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment