public class KinesisLogWriter extends AbstractLogWriter<KinesisWriterConfig,KinesisWriterStatistics>
Implementation note: protected instance variables are replaced by tests.
| Modifier and Type | Field and Description |
|---|---|
protected RetryManager2 |
createRetry |
protected RetryManager2 |
describeRetry |
protected RetryManager2 |
postCreateRetry |
static String |
RANDOM_PARTITION_KEY_CONFIG
This string is used in configuration to specify random partition keys.
|
protected RetryManager2 |
sendRetry |
protected Duration |
sendTimeout |
config, logger, stats| Constructor and Description |
|---|
KinesisLogWriter(KinesisWriterConfig config,
KinesisWriterStatistics stats,
InternalLogger logger,
KinesisFacade facade) |
| Modifier and Type | Method and Description |
|---|---|
protected int |
effectiveSize(LogMessage message)
Calculates the effective size of the message.
|
protected boolean |
ensureDestinationAvailable()
Verifies that the logging destination is available (which may involve
creating it).
|
int |
maxMessageSize()
Returns the maximum allowed UTF-8 message size for the destination.
|
protected List<LogMessage> |
sendBatch(List<LogMessage> currentBatch)
Sends a batch of messages.
|
protected void |
stopAWSClient()
This is called when the logwriter is stopped, to explicitly close the
AWS service client.
|
protected boolean |
withinServiceLimits(int batchBytes,
int numMessages)
Determines whether the provided batch size or number of messages would
exceed the service's limits.
|
addMessage, buildBatch, getBatchCount, getBatchDelay, initialize, isRunning, isSynchronous, keepRunning, processBatch, reportError, run, setBatchDelay, setDiscardAction, setDiscardThreshold, stop, waitUntilInitialized, waitUntilStoppedpublic static final String RANDOM_PARTITION_KEY_CONFIG
protected RetryManager2 describeRetry
protected RetryManager2 createRetry
protected RetryManager2 postCreateRetry
protected Duration sendTimeout
protected RetryManager2 sendRetry
public KinesisLogWriter(KinesisWriterConfig config, KinesisWriterStatistics stats, InternalLogger logger, KinesisFacade facade)
public int maxMessageSize()
LogWriterprotected boolean ensureDestinationAvailable()
AbstractLogWritertrue if successful, false
if not (which will cause the appender to stop running).ensureDestinationAvailable in class AbstractLogWriter<KinesisWriterConfig,KinesisWriterStatistics>protected List<LogMessage> sendBatch(List<LogMessage> currentBatch)
AbstractLogWritersendBatch in class AbstractLogWriter<KinesisWriterConfig,KinesisWriterStatistics>protected int effectiveSize(LogMessage message)
AbstractLogWritereffectiveSize in class AbstractLogWriter<KinesisWriterConfig,KinesisWriterStatistics>protected boolean withinServiceLimits(int batchBytes,
int numMessages)
AbstractLogWriterwithinServiceLimits in class AbstractLogWriter<KinesisWriterConfig,KinesisWriterStatistics>protected void stopAWSClient()
AbstractLogWriterstopAWSClient in class AbstractLogWriter<KinesisWriterConfig,KinesisWriterStatistics>Copyright © 2023. All rights reserved.