Class RuntimePlan

java.lang.Object
me.ahoo.cosid.internal.RuntimePlan

public final class RuntimePlan extends Object
A RuntimeSpec checked as a whole before anything starts (07-runtime-and-spring.md §1): every problem is reported at once, and the codecs are built. Only the stores the enabled generators and the started machines use are opened, and only the machines an enabled time-based generator chooses are started (api-freeze.md §2.2).
  • Method Details

    • generators

      public List<RuntimePlan.Generator> generators()
      The generators in name order.
      Returns:
      the generators
    • stores

      public List<String> stores()
      The stores to open, in name order.
      Returns:
      the store names
    • machines

      public List<RuntimePlan.Machine> machines()
      The machines to start, in start order: the default machine, then the named ones in name order.
      Returns:
      the machines
    • storeOptions

      public Map<String,Object> storeOptions(String store)
      The options of a store to open, keyed as its provider declares them (StoreOptions).
      Parameters:
      store - the store name, one of stores()
      Returns:
      the options
    • of

      public static RuntimePlan of(RuntimeSpec spec, RuntimeOptions options, StoreProviders providers)
      Checks spec and builds its codecs.
      Parameters:
      spec - the spec
      options - the options
      providers - the store providers
      Returns:
      the plan
      Throws:
      CosIdException - listing every problem of the spec
    • deriveOwnerKey

      public static String deriveOwnerKey(Optional<String> configured, HostResolver host, OptionalInt port)
      Derives the owner key (07-runtime-and-spring.md §1.1): the configured key, else host:port, else host:pid.
      Parameters:
      configured - the configured owner key
      host - the host resolver
      port - the port
      Returns:
      the owner key