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; default1. 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.-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionDebounceBatchConfig(String key, Duration debounceTime, Duration maxWaitTime, int maxBatchSize) Creates a configuration withmaxConcurrentFlushesof 1.DebounceBatchConfig(String key, Duration debounceTime, Duration maxWaitTime, int maxBatchSize, int maxConcurrentFlushes) Validates the configuration. -
Method Summary
Modifier and TypeMethodDescriptionstatic DebounceBatchConfig.Builderbuilder()Creates a builder.static DebounceBatchConfigcreateDefault(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.Returns the value of thedebounceTimerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.key()Returns the value of thekeyrecord component.intReturns the value of themaxBatchSizerecord component.intReturns the value of themaxConcurrentFlushesrecord component.Returns the value of themaxWaitTimerecord component.final StringtoString()Returns a string representation of this record class.
-
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- ifdebounceTimeormaxWaitTimeis not positive,debounceTimeexceedsmaxWaitTime, ormaxBatchSizeormaxConcurrentFlushesis less than 1.
-
DebounceBatchConfig
-
-
Method Details
-
builder
-
createDefault
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
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
key
-
debounceTime
Returns the value of thedebounceTimerecord component.- Returns:
- the value of the
debounceTimerecord component
-
maxWaitTime
Returns the value of themaxWaitTimerecord component.- Returns:
- the value of the
maxWaitTimerecord component
-
maxBatchSize
public int maxBatchSize()Returns the value of themaxBatchSizerecord component.- Returns:
- the value of the
maxBatchSizerecord component
-
maxConcurrentFlushes
public int maxConcurrentFlushes()Returns the value of themaxConcurrentFlushesrecord component.- Returns:
- the value of the
maxConcurrentFlushesrecord component
-