Record Class TransformationRecord
java.lang.Object
java.lang.Record
com.darkcollective.relix.optimizer.TransformationRecord
- Record Components:
code- the optimization rule that produced this recordrelationName- the name of the relation/query being optimized; must not be blankdetail- free-text description of what changed; must not be blanklocation- 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
OptimizationCodeidentifying which rule fired. - The name of the relation or query being optimized at the time.
- A short human-readable
detailstring describing what specifically changed (e.g."σ (a > 0 ∧ b > 0) split into two stacked selections"). - The
SourceLocationof 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 Summary
ConstructorsConstructorDescriptionTransformationRecord(OptimizationCode code, String relationName, String detail, SourceLocation location) Creates an instance of aTransformationRecordrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncode()Returns the value of thecoderecord component.detail()Returns the value of thedetailrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.location()Returns the value of thelocationrecord component.Returns the value of therelationNamerecord component.toString()Returns a single-line summary suitable for display in logs and reports.
-
Constructor Details
-
TransformationRecord
public TransformationRecord(OptimizationCode code, String relationName, String detail, SourceLocation location) Creates an instance of aTransformationRecordrecord class.- Parameters:
code- the value for thecoderecord componentrelationName- the value for therelationNamerecord componentdetail- the value for thedetailrecord componentlocation- the value for thelocationrecord component
-
-
Method Details
-
toString
Returns a single-line summary suitable for display in logs and reports. Format:"[CODE] relationName — detail @ location. -
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. -
equals
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 withObjects::equals(Object,Object). -
code
Returns the value of thecoderecord component.- Returns:
- the value of the
coderecord component
-
relationName
Returns the value of therelationNamerecord component.- Returns:
- the value of the
relationNamerecord component
-
detail
Returns the value of thedetailrecord component.- Returns:
- the value of the
detailrecord component
-
location
Returns the value of thelocationrecord component.- Returns:
- the value of the
locationrecord component
-