Record Class OptimizationResult

java.lang.Object
java.lang.Record
com.helix.core.bytecode.OptimizationResult
Record Components:
ruleName - name of the optimized rule
reordered - whether AST clause ordering was modified
originalAst - original unoptimized AST root
optimizedAst - reordered and optimized AST root
compiledRule - newly compiled executable rule instance
bytecode - raw class bytes of the compiled rule
clauseRatios - computed cost-to-failure ratios for evaluated clauses
timestampNanos - timestamp when the optimization occurred

public record OptimizationResult(String ruleName, boolean reordered, ExpressionNode originalAst, ExpressionNode optimizedAst, CompiledRule compiledRule, byte[] bytecode, Map<String,Double> clauseRatios, long timestampNanos) extends Record
Immutable snapshot of an adaptive AST optimization and hot-swap operation.
  • Constructor Details

    • OptimizationResult

      public OptimizationResult(String ruleName, boolean reordered, ExpressionNode originalAst, ExpressionNode optimizedAst, CompiledRule compiledRule, byte[] bytecode, Map<String,Double> clauseRatios, long timestampNanos)
      Creates an instance of a OptimizationResult record class.
      Parameters:
      ruleName - the value for the ruleName record component
      reordered - the value for the reordered record component
      originalAst - the value for the originalAst record component
      optimizedAst - the value for the optimizedAst record component
      compiledRule - the value for the compiledRule record component
      bytecode - the value for the bytecode record component
      clauseRatios - the value for the clauseRatios record component
      timestampNanos - the value for the timestampNanos record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • ruleName

      public String ruleName()
      Returns the value of the ruleName record component.
      Returns:
      the value of the ruleName record component
    • reordered

      public boolean reordered()
      Returns the value of the reordered record component.
      Returns:
      the value of the reordered record component
    • originalAst

      public ExpressionNode originalAst()
      Returns the value of the originalAst record component.
      Returns:
      the value of the originalAst record component
    • optimizedAst

      public ExpressionNode optimizedAst()
      Returns the value of the optimizedAst record component.
      Returns:
      the value of the optimizedAst record component
    • compiledRule

      public CompiledRule compiledRule()
      Returns the value of the compiledRule record component.
      Returns:
      the value of the compiledRule record component
    • bytecode

      public byte[] bytecode()
      Returns the value of the bytecode record component.
      Returns:
      the value of the bytecode record component
    • clauseRatios

      public Map<String,Double> clauseRatios()
      Returns the value of the clauseRatios record component.
      Returns:
      the value of the clauseRatios record component
    • timestampNanos

      public long timestampNanos()
      Returns the value of the timestampNanos record component.
      Returns:
      the value of the timestampNanos record component