Enum Class CostTier

java.lang.Object
java.lang.Enum<CostTier>
com.darkcollective.relix.cost.CostTier
All Implemented Interfaces:
Serializable, Comparable<CostTier>, Constable

public enum CostTier extends Enum<CostTier>
Ordinal cost tier for a relation or sub-expression, used by CostEstimator to rank data sources from cheapest to most expensive.

The natural Enum.ordinal() ordering represents increasing I/O cost: INLINE < FILE < REMOTE. Rules that compare two inputs use ordinal comparison to decide which is cheaper.

There is deliberately no VIEW tier. A named query view has no I/O of its own — its cost is entirely that of the leaves its body reads — and CostEstimator says so directly: tierFor maps a QueryRelationSymbol to a recursive estimate of body(), so no code path could ever return a VIEW constant.

The label() method returns a short lower-case string suitable for embedding in transformation detail messages.

  • Enum Constant Details

    • INLINE

      public static final CostTier INLINE
      Inline relation literal — data is embedded directly in the script and held entirely in memory at parse time. Zero I/O cost.
    • FILE

      public static final CostTier FILE
      File-backed source — local file I/O (e.g. CSV). Moderate cost.
    • REMOTE

      public static final CostTier REMOTE
      Remote database source — JDBC network round-trip. Highest cost tier.
  • Method Details

    • values

      public static CostTier[] 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

      public static CostTier valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • label

      public String label()
      Returns a short lower-case label suitable for display in transformation detail messages (e.g. "inline", "remote").
      Returns:
      the label string; never null