Record Class DebounceBatchConfig

java.lang.Object
java.lang.Record
com.inductiveautomation.historian.gateway.api.storage.strategy.DebounceBatchConfig
Record Components:
key - a unique identifier for the configuration.
debounceTime - how long submissions must go idle before a flush.
maxWaitTime - the longest the oldest point waits before a flush is forced.
maxBatchSize - the maximum points per batch.
maxConcurrentFlushes - the maximum flushes running at once; default 1. Above 1, a flush can begin while the previous one is still completing, which suits backends that can absorb concurrent producers. The engine must then be safe for concurrent calls, and listeners that need flushes to complete in order must keep it at 1.

public record DebounceBatchConfig(String key, Duration debounceTime, Duration maxWaitTime, int maxBatchSize, int maxConcurrentFlushes) extends Record
Settings for DebounceStorageStrategy: when buffered points flush and how large a batch may be.
  • Constructor Details

    • DebounceBatchConfig

      public DebounceBatchConfig(String key, Duration debounceTime, Duration maxWaitTime, int maxBatchSize, int maxConcurrentFlushes)
      Validates the configuration.
      Throws:
      NullPointerException - if a required parameter is null.
      IllegalArgumentException - if debounceTime or maxWaitTime is not positive, debounceTime exceeds maxWaitTime, or maxBatchSize or maxConcurrentFlushes is less than 1.
    • DebounceBatchConfig

      public DebounceBatchConfig(String key, Duration debounceTime, Duration maxWaitTime, int maxBatchSize)
      Creates a configuration with maxConcurrentFlushes of 1.
  • Method Details

    • builder

      public static DebounceBatchConfig.Builder builder()
      Creates a builder.
      Returns:
      a new builder.
    • createDefault

      public static DebounceBatchConfig createDefault(String key)
      Creates a configuration with default settings: 250 ms debounce, 1 s max wait, 100,000 points per batch and one flush at a time.
      Parameters:
      key - the configuration's identifier.
      Returns:
      the default configuration.
    • 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.
    • key

      public String key()
      Returns the value of the key record component.
      Returns:
      the value of the key record component
    • debounceTime

      public Duration debounceTime()
      Returns the value of the debounceTime record component.
      Returns:
      the value of the debounceTime record component
    • maxWaitTime

      public Duration maxWaitTime()
      Returns the value of the maxWaitTime record component.
      Returns:
      the value of the maxWaitTime record component
    • maxBatchSize

      public int maxBatchSize()
      Returns the value of the maxBatchSize record component.
      Returns:
      the value of the maxBatchSize record component
    • maxConcurrentFlushes

      public int maxConcurrentFlushes()
      Returns the value of the maxConcurrentFlushes record component.
      Returns:
      the value of the maxConcurrentFlushes record component