Record Class TransformationRecord

java.lang.Object
java.lang.Record
com.darkcollective.relix.optimizer.TransformationRecord
Record Components:
code - the optimization rule that produced this record
relationName - the name of the relation/query being optimized; must not be blank
detail - free-text description of what changed; must not be blank
location - source location of the transformed AST node; must not be null

public record TransformationRecord(OptimizationCode code, String relationName, String detail, SourceLocation location) extends Record
An immutable record of a single optimization transformation applied during query planning.

Each record captures exactly one rule firing:

  • The OptimizationCode identifying which rule fired.
  • The name of the relation or query being optimized at the time.
  • A short human-readable detail string describing what specifically changed (e.g. "σ (a > 0 ∧ b > 0) split into two stacked selections").
  • The SourceLocation of the original AST node that was rewritten, for traceability back to the source file.

Records are produced exclusively by OptimizationContext.record(OptimizationCode, String, String, SourceLocation) and are never mutated after creation.

  • Constructor Details

    • TransformationRecord

      public TransformationRecord(OptimizationCode code, String relationName, String detail, SourceLocation location)
      Creates an instance of a TransformationRecord record class.
      Parameters:
      code - the value for the code record component
      relationName - the value for the relationName record component
      detail - the value for the detail record component
      location - the value for the location record component
  • Method Details

    • toString

      public String toString()
      Returns a single-line summary suitable for display in logs and reports. Format: "[CODE] relationName — detail @ location.
      Specified by:
      toString in class Record
      Returns:
      formatted string; never null
    • 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.
    • code

      public OptimizationCode code()
      Returns the value of the code record component.
      Returns:
      the value of the code record component
    • relationName

      public String relationName()
      Returns the value of the relationName record component.
      Returns:
      the value of the relationName record component
    • detail

      public String detail()
      Returns the value of the detail record component.
      Returns:
      the value of the detail record component
    • location

      public SourceLocation location()
      Returns the value of the location record component.
      Returns:
      the value of the location record component