Record Class GrpcRetry.RetryPolicy

java.lang.Object
java.lang.Record
ai.pipestream.module.pipelineprobe.pipelinecrawl.GrpcRetry.RetryPolicy
Record Components:
maxRetries - number of retries AFTER the initial attempt (e.g., maxRetries=2 → up to 3 total calls)
baseBackoffMs - delay before the first retry
Enclosing class:
GrpcRetry

public static record GrpcRetry.RetryPolicy(int maxRetries, long baseBackoffMs) extends Record
Retry budget for a single op. Exponential backoff: attempt 0 uses baseBackoffMs, attempt N uses baseBackoffMs * 2^N.
  • Constructor Summary

    Constructors
    Constructor
    Description
    RetryPolicy(int maxRetries, long baseBackoffMs)
    Creates an instance of a RetryPolicy record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    backoffMs(int attempt)
    Computes the backoff delay before the given 0-based retry attempt, doubling baseBackoffMs for each successive attempt.
    long
    Returns the value of the baseBackoffMs record component.
    Standard policy for sidecar control-plane setup calls (account, datasource, graph bind, config registration).
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the maxRetries record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • RetryPolicy

      public RetryPolicy(int maxRetries, long baseBackoffMs)
      Creates an instance of a RetryPolicy record class.
      Parameters:
      maxRetries - the value for the maxRetries record component
      baseBackoffMs - the value for the baseBackoffMs record component
  • Method Details

    • backoffMs

      public long backoffMs(int attempt)
      Computes the backoff delay before the given 0-based retry attempt, doubling baseBackoffMs for each successive attempt.
      Parameters:
      attempt - the 0-based attempt index
      Returns:
      the backoff delay in milliseconds for that attempt
    • controlPlane

      public static GrpcRetry.RetryPolicy controlPlane()
      Standard policy for sidecar control-plane setup calls (account, datasource, graph bind, config registration). 3 total attempts, 200ms → 400ms backoff. Total worst-case retry-time ~600ms on top of whatever per-attempt deadline the caller supplies.
      Returns:
      the standard control-plane retry policy (2 retries, 200ms base backoff)
    • 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 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.
    • maxRetries

      public int maxRetries()
      Returns the value of the maxRetries record component.
      Returns:
      the value of the maxRetries record component
    • baseBackoffMs

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