Record Class SweepOptions

java.lang.Object
java.lang.Record
com.qtsurfer.api.sdk.SweepOptions
Record Components:
onProgress - callback fired on stage transitions and after each poll (nullable)
pollInterval - initial interval between status polls; the SDK backs off exponentially up to maxPollInterval
maxPollInterval - upper bound of the exponential backoff
timeout - per-stage timeout; null disables. A sweep is many backtests, so the execute stage legitimately outlasts anything a single run would take
ranking - how to order the leaderboard the poll reads. null sends no preference and takes the platform default, which is SweepRanking.PLATEAU — so leaving this unset does not give you raw objective order. What was actually applied is reported on the result; see SweepRanking. Ignored entirely when order is SweepOrder.NATURAL, which is always ordered by runIx
order - which view of the rows to read. null takes the platform default, SweepOrder.RANKED — the sorted, display-capped leaderboard. SweepOrder.NATURAL returns every available row untruncated, and is the only way to reach rows the ranked view dropped when the result reports truncated

public record SweepOptions(Consumer<SweepProgressEvent> onProgress, Duration pollInterval, Duration maxPollInterval, Duration timeout, SweepRanking ranking, SweepOrder order) extends Record
Tuning knobs for a sweep invocation.
  • Field Details

    • DEFAULT_POLL_INTERVAL

      public static final Duration DEFAULT_POLL_INTERVAL
      Initial interval between polls when none is configured.
    • DEFAULT_MAX_POLL_INTERVAL

      public static final Duration DEFAULT_MAX_POLL_INTERVAL
      Upper bound of the exponential backoff when none is configured.
  • Constructor Details

  • Method Details

    • defaults

      public static SweepOptions defaults()
      Defaults: no progress callback, no stage timeout, and whatever ordering the platform defaults to.

      The poll intervals are longer than a single backtest's, because a sweep is many backtests and its leaderboard changes on the timescale of shards finishing rather than ticks.

      Returns:
      the default options
    • builder

      public static SweepOptions.Builder builder()
      Start building options.
      Returns:
      a fresh 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.
    • onProgress

      public Consumer<SweepProgressEvent> onProgress()
      Returns the value of the onProgress record component.
      Returns:
      the value of the onProgress record component
    • pollInterval

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

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

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

      public SweepRanking ranking()
      Returns the value of the ranking record component.
      Returns:
      the value of the ranking record component
    • order

      public SweepOrder order()
      Returns the value of the order record component.
      Returns:
      the value of the order record component