Record Class DesignGraph

java.lang.Object
java.lang.Record
com.eqixiac.equinix.design.resilience.DesignGraph
Record Components:
specFingerprint - the DesignSpec.fingerprint() the graph was built from
specName - the spec's name
portfolio - the portfolio key (for example DC+NY)
nodes - every node, in a fixed order (by kind, then id)
edges - every edge, in a fixed order (by kind, then id)
placements - every workload's placement, in spec order
requiredClouds - ids of the spec clouds marked required
allowedZones - the spec's constraints.geoZones (upper case); empty when sovereignty is not constrained
siteMaxLatencyMs - the spec's constraints.maxLatencyMs (site to its access metro), or null
assumptions - how the graph was built where the spec is silent (stated for the reader)

public record DesignGraph(String specFingerprint, String specName, String portfolio, List<GraphNode> nodes, List<GraphEdge> edges, List<PlacementView> placements, List<String> requiredClouds, List<String> allowedZones, Double siteMaxLatencyMs, List<String> assumptions) extends Record
An explicit, immutable graph of one design: sites, metros, Cloud Routers, cloud on-ramps, clouds, workloads and (optionally) peer networks, joined by access circuits, the inter-metro backbone, primary and standby cloud connections, provider links and workload hosting, each with its capacity and round-trip latency where known. Built by DesignGraphBuilder; simulated by FailureSimulator. Jackson-serialisable; toMermaid() draws it and toTable() lists it.
  • Constructor Details

  • Method Details

    • node

      public Optional<GraphNode> node(String id)
      Parameters:
      id - a node id
      Returns:
      the node
    • edge

      public Optional<GraphEdge> edge(String id)
      Parameters:
      id - an edge id
      Returns:
      the edge
    • nodes

      public List<GraphNode> nodes(NodeKind kind)
      Parameters:
      kind - a node kind
      Returns:
      the nodes of that kind, in graph order
    • edges

      public List<GraphEdge> edges(EdgeKind kind)
      Parameters:
      kind - an edge kind
      Returns:
      the edges of that kind, in graph order
    • toMermaid

      public String toMermaid()
      Draws the graph as a Mermaid flowchart: one subgraph per metro (its metro, Cloud Router and on-ramps), sites on the left, clouds on the right. Standby edges are dashed; edge labels carry capacity and round-trip latency where known.
      Returns:
      Mermaid source (paste into a mermaid fenced block)
    • toTable

      public String toTable()
      Returns:
      a Markdown table of every edge: kind, endpoints, role, capacity and round trip with its basis
    • toJson

      public String toJson()
      Returns:
      the graph as indented JSON
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • specFingerprint

      public String specFingerprint()
      Returns the value of the specFingerprint record component.
      Returns:
      the value of the specFingerprint record component
    • specName

      public String specName()
      Returns the value of the specName record component.
      Returns:
      the value of the specName record component
    • portfolio

      public String portfolio()
      Returns the value of the portfolio record component.
      Returns:
      the value of the portfolio record component
    • nodes

      public List<GraphNode> nodes()
      Returns the value of the nodes record component.
      Returns:
      the value of the nodes record component
    • edges

      public List<GraphEdge> edges()
      Returns the value of the edges record component.
      Returns:
      the value of the edges record component
    • placements

      public List<PlacementView> placements()
      Returns the value of the placements record component.
      Returns:
      the value of the placements record component
    • requiredClouds

      public List<String> requiredClouds()
      Returns the value of the requiredClouds record component.
      Returns:
      the value of the requiredClouds record component
    • allowedZones

      public List<String> allowedZones()
      Returns the value of the allowedZones record component.
      Returns:
      the value of the allowedZones record component
    • siteMaxLatencyMs

      public Double siteMaxLatencyMs()
      Returns the value of the siteMaxLatencyMs record component.
      Returns:
      the value of the siteMaxLatencyMs record component
    • assumptions

      public List<String> assumptions()
      Returns the value of the assumptions record component.
      Returns:
      the value of the assumptions record component