Record Class AppEvent

java.lang.Object
java.lang.Record
com.cockroachlabs.crdb.spi.AppEvent
Record Components:
kind - event kind (e.g. retry, retry_exhausted, circuit_open)
source - logical source of the event
attrs - arbitrary attributes (defensively copied; immutable)
epochMillis - event time in epoch milliseconds, supplied by the caller

public record AppEvent(String kind, String source, Map<String,Object> attrs, long epochMillis) extends Record
An application-level operational signal emitted to Cockroach Aegis (the "exhaust"). The timestamp is supplied explicitly (never read from the wall clock inside this type) so producers stay deterministic and testable.
  • Constructor Details

    • AppEvent

      public AppEvent(String kind, String source, Map<String,Object> attrs, long epochMillis)
      Creates an instance of a AppEvent record class.
      Parameters:
      kind - the value for the kind record component
      source - the value for the source record component
      attrs - the value for the attrs record component
      epochMillis - the value for the epochMillis record component
  • Method Details

    • of

      public static AppEvent of(String kind, String source, Map<String,Object> attrs, long epochMillis)
      Convenience factory that defensively copies attrs.
    • 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 the compare method from their corresponding wrapper classes.
      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.
    • kind

      public String kind()
      Returns the value of the kind record component.
      Returns:
      the value of the kind record component
    • source

      public String source()
      Returns the value of the source record component.
      Returns:
      the value of the source record component
    • attrs

      public Map<String,Object> attrs()
      Returns the value of the attrs record component.
      Returns:
      the value of the attrs record component
    • epochMillis

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