Record Class QueryOptions

java.lang.Object
java.lang.Record
codes.grow.packages.cloudwatchlogs.QueryOptions
Record Components:
groups - log group names or ARNs (1–50; default [config.logGroup])
start - start of the range (default one hour before end)
end - end of the range (default now)
limit - maximum rows (1–10 000)
timeout - query gives up after this long (default 60 s); the query is stopped best-effort
pollInterval - first poll interval of query (default 1 s), doubled up to 5 s
retryOnQueryLimit - StartQuery attempts of query on LimitExceededException (default 3)

public record QueryOptions(List<String> groups, Instant start, Instant end, Integer limit, Duration timeout, Duration pollInterval, Integer retryOnQueryLimit) extends Record
Options of startQuery and query (Logs Insights).

Build with builder(); unset values are null and take the documented default.

  • Constructor Details

    • QueryOptions

      public QueryOptions(List<String> groups, Instant start, Instant end, Integer limit, Duration timeout, Duration pollInterval, Integer retryOnQueryLimit)
      Applies defaults.
      Parameters:
      groups - log group names or ARNs (1–50; default [config.logGroup])
      start - start of the range (default one hour before end)
      end - end of the range (default now)
      limit - maximum rows (1–10 000)
      timeout - query gives up after this long (default 60 s); the query is stopped best-effort
      pollInterval - first poll interval of query (default 1 s), doubled up to 5 s
      retryOnQueryLimit - StartQuery attempts of query on LimitExceededException (default 3)
  • Method Details

    • defaults

      public static QueryOptions defaults()
      Options with every default.
      Returns:
      the options
    • builder

      public static QueryOptions.Builder builder()
      Starts a builder.
      Returns:
      a new builder
    • toBuilder

      public QueryOptions.Builder toBuilder()
      Returns a builder holding these values.
      Returns:
      a new builder
    • 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.
    • groups

      public List<String> groups()
      Returns the value of the groups record component.
      Returns:
      the value of the groups record component
    • start

      public Instant start()
      Returns the value of the start record component.
      Returns:
      the value of the start record component
    • end

      public Instant end()
      Returns the value of the end record component.
      Returns:
      the value of the end record component
    • limit

      public Integer limit()
      Returns the value of the limit record component.
      Returns:
      the value of the limit record component
    • timeout

      public Duration timeout()
      Returns the value of the timeout record component.
      Returns:
      the value of the timeout record component
    • pollInterval

      public Duration pollInterval()
      Returns the value of the pollInterval record component.
      Returns:
      the value of the pollInterval record component
    • retryOnQueryLimit

      public Integer retryOnQueryLimit()
      Returns the value of the retryOnQueryLimit record component.
      Returns:
      the value of the retryOnQueryLimit record component