PB - The type of PdbBatch that this config class applies to.SELF - The concrete type of concrete BatchConfig overriding this abstract class.public abstract class AbstractBatchConfig<PB extends PdbBatch,SELF extends AbstractBatchConfig<PB,SELF>> extends Object implements BatchConfig<PB>
PdbBatch implementations, containing common properties.| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractBatchConfig.Builder<PB extends PdbBatch,BC extends AbstractBatchConfig<PB,?>,SELF extends AbstractBatchConfig.Builder<PB,BC,SELF>>
A builder for the
AbstractBatchConfig. |
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_BATCH_SIZE
Constant representing the default batch size.
|
static Duration |
DEFAULT_BATCH_TIMEOUT
Constant representing the default batch timeout.
|
static Duration |
DEFAULT_RETRY_INTERVAL
Constant representing the default time interval to wait between batch flush retries.
|
String |
defaultBatchName
The default name of the batch, when a name isn't explicitly provided in the config builder.
|
static int |
NO_RETRY
Constant representing that no retries should be attempted on batch flush failures.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractBatchConfig(AbstractBatchConfig.Builder<PB,SELF,?> builder)
Constructor for this
AbstractBatchConfig. |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
checkArgument(boolean condition,
String errorMessageFormat,
Object errorMessageArg)
Checks that configuration arguments pass the verification specified in the condition expression.
|
BatchListener |
getBatchListener()
The listener that will be invoked whenever some batch operation fail or succeeds to persist.
|
int |
getBatchSize()
Gets the size of the batch; when the number of pending entries reaches this number, the batch should flush.
|
Duration |
getBatchTimeout()
Gets the batch timeout.
|
Optional<org.slf4j.Logger> |
getConfidentialLogger()
Gets an optional logger to log messages potentially containing sensitive data.
|
Duration |
getFlushRetryDelay()
Gets the time interval to wait between batch flush retries.
|
Duration |
getMaxAwaitTimeShutdown()
Gets the maximum time to wait for the batch to shutdown.
|
int |
getMaxFlushRetries()
Gets the number of times to retry a batch flush upon failure.
|
MetricsListener |
getMetricsListener()
The listener that will be invoked whenever some measurable event occurs, so that it can be captured and reported
in monitoring metrics.
|
String |
getName()
Gets the name to use for the batch.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetBatchClasspublic final String defaultBatchName
public static final int DEFAULT_BATCH_SIZE
getBatchSize(),
Constant Field Valuespublic static final Duration DEFAULT_BATCH_TIMEOUT
getBatchTimeout()public static final int NO_RETRY
getMaxFlushRetries(),
Constant Field Valuespublic static final Duration DEFAULT_RETRY_INTERVAL
getFlushRetryDelay()protected AbstractBatchConfig(AbstractBatchConfig.Builder<PB,SELF,?> builder)
AbstractBatchConfig.builder - The AbstractBatchConfig.Builder for this config.protected static void checkArgument(boolean condition,
String errorMessageFormat,
Object errorMessageArg)
condition - A boolean expression for verification of the configuration arguments.errorMessageFormat - An error message to include in the exception when the verification fails (supports
String.format(java.lang.String, java.lang.Object...) parameters).errorMessageArg - Arguments for the error message template specified in errorMessageFormat.IllegalArgumentException - if expression is falsepublic String getName()
BatchConfiggetName in interface BatchConfig<PB extends PdbBatch>public int getBatchSize()
BatchConfiggetBatchSize in interface BatchConfig<PB extends PdbBatch>public Duration getBatchTimeout()
BatchConfig
Each time there aren't enough pending entries as specified in the BatchConfig.getBatchSize() to trigger a flush,
then a flush should be triggered by timeout, when the time specified by this setting has elapsed since the last
flush.
getBatchTimeout in interface BatchConfig<PB extends PdbBatch>public Duration getMaxAwaitTimeShutdown()
BatchConfiggetMaxAwaitTimeShutdown in interface BatchConfig<PB extends PdbBatch>public int getMaxFlushRetries()
BatchConfiggetMaxFlushRetries in interface BatchConfig<PB extends PdbBatch>public Duration getFlushRetryDelay()
BatchConfiggetFlushRetryDelay in interface BatchConfig<PB extends PdbBatch>public BatchListener getBatchListener()
BatchConfiggetBatchListener in interface BatchConfig<PB extends PdbBatch>BatchListener.public MetricsListener getMetricsListener()
BatchConfiggetMetricsListener in interface BatchConfig<PB extends PdbBatch>MetricsListener.public Optional<org.slf4j.Logger> getConfidentialLogger()
BatchConfiggetConfidentialLogger in interface BatchConfig<PB extends PdbBatch>Optional confidential logger.Copyright © 2023 Feedzai. All rights reserved.