Package com.helix.core.bytecode
Record Class OptimizationResult
java.lang.Object
java.lang.Record
com.helix.core.bytecode.OptimizationResult
- Record Components:
ruleName- name of the optimized rulereordered- whether AST clause ordering was modifiedoriginalAst- original unoptimized AST rootoptimizedAst- reordered and optimized AST rootcompiledRule- newly compiled executable rule instancebytecode- raw class bytes of the compiled ruleclauseRatios- computed cost-to-failure ratios for evaluated clausestimestampNanos- 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 Summary
ConstructorsConstructorDescriptionOptimizationResult(String ruleName, boolean reordered, ExpressionNode originalAst, ExpressionNode optimizedAst, CompiledRule compiledRule, byte[] bytecode, Map<String, Double> clauseRatios, long timestampNanos) Creates an instance of aOptimizationResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]bytecode()Returns the value of thebytecoderecord component.Returns the value of theclauseRatiosrecord component.Returns the value of thecompiledRulerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theoptimizedAstrecord component.Returns the value of theoriginalAstrecord component.booleanReturns the value of thereorderedrecord component.ruleName()Returns the value of theruleNamerecord component.longReturns the value of thetimestampNanosrecord component.final StringtoString()Returns a string representation of this record class.
-
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 aOptimizationResultrecord class.- Parameters:
ruleName- the value for theruleNamerecord componentreordered- the value for thereorderedrecord componentoriginalAst- the value for theoriginalAstrecord componentoptimizedAst- the value for theoptimizedAstrecord componentcompiledRule- the value for thecompiledRulerecord componentbytecode- the value for thebytecoderecord componentclauseRatios- the value for theclauseRatiosrecord componenttimestampNanos- the value for thetimestampNanosrecord component
-
-
Method Details
-
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. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
ruleName
Returns the value of theruleNamerecord component.- Returns:
- the value of the
ruleNamerecord component
-
reordered
public boolean reordered()Returns the value of thereorderedrecord component.- Returns:
- the value of the
reorderedrecord component
-
originalAst
Returns the value of theoriginalAstrecord component.- Returns:
- the value of the
originalAstrecord component
-
optimizedAst
Returns the value of theoptimizedAstrecord component.- Returns:
- the value of the
optimizedAstrecord component
-
compiledRule
Returns the value of thecompiledRulerecord component.- Returns:
- the value of the
compiledRulerecord component
-
bytecode
public byte[] bytecode()Returns the value of thebytecoderecord component.- Returns:
- the value of the
bytecoderecord component
-
clauseRatios
Returns the value of theclauseRatiosrecord component.- Returns:
- the value of the
clauseRatiosrecord component
-
timestampNanos
public long timestampNanos()Returns the value of thetimestampNanosrecord component.- Returns:
- the value of the
timestampNanosrecord component
-