Record Class AllocatesDynamicAnnotation

java.lang.Object
java.lang.Record
org.elasticsearch.painless.spi.annotation.AllocatesDynamicAnnotation
Record Components:
estimatorClassName - fully-qualified binary class name declaring the estimator
estimatorMethodName - name of the estimator method

public record AllocatesDynamicAnnotation(String estimatorClassName, String estimatorMethodName) extends Record
Marks an allowlisted constructor or method whose allocation size depends on its arguments. An estimator — a public static long method taking the target's full Java signature (receiver first for instance methods) — is invoked at runtime and its result charged against the per-context allocation limit before the call executes. The estimator is named by its class (fully-qualified binary name; JVM $ form for inner classes) and method, resolved at allowlist load time through the annotated class's class loader so plugins may ship their own.
  • Field Details

  • Constructor Details

    • AllocatesDynamicAnnotation

      public AllocatesDynamicAnnotation(String estimatorClassName, String estimatorMethodName)
      Creates an instance of a AllocatesDynamicAnnotation record class.
      Parameters:
      estimatorClassName - the value for the estimatorClassName record component
      estimatorMethodName - the value for the estimatorMethodName 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. 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.
    • estimatorClassName

      public String estimatorClassName()
      Returns the value of the estimatorClassName record component.
      Returns:
      the value of the estimatorClassName record component
    • estimatorMethodName

      public String estimatorMethodName()
      Returns the value of the estimatorMethodName record component.
      Returns:
      the value of the estimatorMethodName record component