Class WorkloadPlacer

java.lang.Object
com.eqixiac.equinix.design.placement.WorkloadPlacer

public final class WorkloadPlacer extends Object
Places every workload of a spec on a portfolio. Pure and deterministic: the same portfolio and context give the same plan.

For each workload, in spec order:

  1. Eligible metros: its pinnedMetro only (when the portfolio holds it), otherwise every portfolio metro.
  2. Keep the metros that reach every cloud the workload names; when none does, keep those that reach the most and record the missing clouds as an issue.
  3. Keep the metros whose worst known round trip to any site is within the workload's maxLatencyMs; when none is, keep them all and record the breach as an issue. Sites whose latency is unknown are not counted against the limit.
  4. Rank by site-weighted round trip (known sites only), then by metro code. The first metro is the primary. When the portfolio has two or more metros and the workload is not pinned, the next ranked eligible metro is its standby: its cloud connections are duplicated there at full size (active/standby), which is what lets the design survive the loss of the primary metro.

A cloud of the spec that no workload names is connected at the best-ranked metro that reaches it (and a standby), unsized, under the label cloud:<id>. A cloud leg is only created in a metro that reaches the cloud: a placement that could not honour a cloud records the gap instead.

  • Field Details

    • CLOUD_PREFIX

      public static final String CLOUD_PREFIX
      Label prefix of the placement made for a cloud that no workload names.
      See Also:
  • Method Details

    • place

      public static PlacementPlan place(MetroPortfolio portfolio, DesignContext context)
      Parameters:
      portfolio - the metros
      context - the facts of the run
      Returns:
      the plan
    • weightedLatency

      public static double weightedLatency(MetroId metro, DesignContext context)
      Parameters:
      metro - a metro
      context - the facts of the run
      Returns:
      the site-weighted mean round trip over the sites whose latency is known (weights renormalised over them), or positive infinity when none is known
    • worstSiteLatency

      public static OptionalDouble worstSiteLatency(MetroId metro, DesignContext context)
      Parameters:
      metro - a metro
      context - the facts of the run
      Returns:
      the worst known site round trip from the metro, or empty when no site latency is known