public class KinesisClientLibConfiguration
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_CLEANUP_LEASES_UPON_SHARDS_COMPLETION
Cleanup leases upon shards completion (don't wait until they expire in Kinesis).
|
static boolean |
DEFAULT_DONT_CALL_PROCESS_RECORDS_FOR_EMPTY_RECORD_LIST
Don't call processRecords() on the record processor for empty record lists.
|
static long |
DEFAULT_FAILOVER_TIME_MILLIS
Fail over time in milliseconds.
|
static long |
DEFAULT_IDLETIME_BETWEEN_READS_MILLIS
Idle time between record reads in milliseconds.
|
static InitialPositionInStream |
DEFAULT_INITIAL_POSITION_IN_STREAM
The location in the shard from which the KinesisClientLibrary will start fetching records from
when the application starts for the first time and there is no checkpoint for the shard.
|
static int |
DEFAULT_MAX_RECORDS
Max records to fetch from Kinesis in a single GetRecords call.
|
static long |
DEFAULT_METRICS_BUFFER_TIME_MILLIS
Buffer metrics for at most this long before publishing to CloudWatch.
|
static java.util.Set<java.lang.String> |
DEFAULT_METRICS_ENABLED_DIMENSIONS
Allowed dimensions for CloudWatch metrics.
|
static MetricsLevel |
DEFAULT_METRICS_LEVEL
Metrics level for which to enable CloudWatch metrics.
|
static int |
DEFAULT_METRICS_MAX_QUEUE_SIZE
Buffer at most this many metrics before publishing to CloudWatch.
|
static long |
DEFAULT_PARENT_SHARD_POLL_INTERVAL_MILLIS
Interval in milliseconds between polling to check for parent shard completion.
|
static long |
DEFAULT_SHARD_SYNC_INTERVAL_MILLIS
Shard sync interval in milliseconds - e.g.
|
static long |
DEFAULT_TASK_BACKOFF_TIME_MILLIS
Backoff time in milliseconds for Amazon Kinesis Client Library tasks (in the event of failures).
|
static boolean |
DEFAULT_VALIDATE_SEQUENCE_NUMBER_BEFORE_CHECKPOINTING
KCL will validate client provided sequence numbers with a call to Amazon Kinesis before checkpointing for calls
to
RecordProcessorCheckpointer#checkpoint(String) by default. |
static java.lang.String |
KINESIS_CLIENT_LIB_USER_AGENT
User agent set when Amazon Kinesis Client Library makes AWS requests.
|
static java.util.Set<java.lang.String> |
METRICS_ALWAYS_ENABLED_DIMENSIONS
Metrics dimensions that always will be enabled regardless of the config provided by user.
|
static java.util.Set<java.lang.String> |
METRICS_DIMENSIONS_ALL
Metrics dimensions that signify all possible dimensions.
|
Constructor and Description |
---|
KinesisClientLibConfiguration(java.lang.String applicationName,
java.lang.String streamName,
AWSCredentialsProvider kinesisCredentialsProvider,
AWSCredentialsProvider dynamoDBCredentialsProvider,
AWSCredentialsProvider cloudWatchCredentialsProvider,
java.lang.String workerId)
Constructor.
|
KinesisClientLibConfiguration(java.lang.String applicationName,
java.lang.String streamName,
AWSCredentialsProvider credentialsProvider,
java.lang.String workerId)
Constructor.
|
KinesisClientLibConfiguration(java.lang.String applicationName,
java.lang.String streamName,
java.lang.String kinesisEndpoint,
InitialPositionInStream initialPositionInStream,
AWSCredentialsProvider kinesisCredentialsProvider,
AWSCredentialsProvider dynamoDBCredentialsProvider,
AWSCredentialsProvider cloudWatchCredentialsProvider,
long failoverTimeMillis,
java.lang.String workerId,
int maxRecords,
long idleTimeBetweenReadsInMillis,
boolean callProcessRecordsEvenForEmptyRecordList,
long parentShardPollIntervalMillis,
long shardSyncIntervalMillis,
boolean cleanupTerminatedShardsBeforeExpiry,
ClientConfiguration kinesisClientConfig,
ClientConfiguration dynamoDBClientConfig,
ClientConfiguration cloudWatchClientConfig,
long taskBackoffTimeMillis,
long metricsBufferTimeMillis,
int metricsMaxQueueSize,
boolean validateSequenceNumberBeforeCheckpointing,
java.lang.String regionName) |
public static final InitialPositionInStream DEFAULT_INITIAL_POSITION_IN_STREAM
public static final long DEFAULT_FAILOVER_TIME_MILLIS
public static final int DEFAULT_MAX_RECORDS
public static final long DEFAULT_IDLETIME_BETWEEN_READS_MILLIS
public static final boolean DEFAULT_DONT_CALL_PROCESS_RECORDS_FOR_EMPTY_RECORD_LIST
public static final long DEFAULT_PARENT_SHARD_POLL_INTERVAL_MILLIS
public static final long DEFAULT_SHARD_SYNC_INTERVAL_MILLIS
public static final boolean DEFAULT_CLEANUP_LEASES_UPON_SHARDS_COMPLETION
public static final long DEFAULT_TASK_BACKOFF_TIME_MILLIS
public static final long DEFAULT_METRICS_BUFFER_TIME_MILLIS
public static final int DEFAULT_METRICS_MAX_QUEUE_SIZE
public static final MetricsLevel DEFAULT_METRICS_LEVEL
public static final java.util.Set<java.lang.String> METRICS_ALWAYS_ENABLED_DIMENSIONS
public static final java.util.Set<java.lang.String> DEFAULT_METRICS_ENABLED_DIMENSIONS
public static final java.util.Set<java.lang.String> METRICS_DIMENSIONS_ALL
public static final java.lang.String KINESIS_CLIENT_LIB_USER_AGENT
public static final boolean DEFAULT_VALIDATE_SEQUENCE_NUMBER_BEFORE_CHECKPOINTING
RecordProcessorCheckpointer#checkpoint(String)
by default.public KinesisClientLibConfiguration(java.lang.String applicationName, java.lang.String streamName, AWSCredentialsProvider credentialsProvider, java.lang.String workerId)
applicationName
- Name of the Amazon Kinesis application.
By default the application name is included in the user agent string used to make AWS requests. This
can assist with troubleshooting (e.g. distinguish requests made by separate applications).streamName
- Name of the Kinesis streamcredentialsProvider
- Provides credentials used to sign AWS requestsworkerId
- Used to distinguish different workers/processes of a Kinesis applicationpublic KinesisClientLibConfiguration(java.lang.String applicationName, java.lang.String streamName, AWSCredentialsProvider kinesisCredentialsProvider, AWSCredentialsProvider dynamoDBCredentialsProvider, AWSCredentialsProvider cloudWatchCredentialsProvider, java.lang.String workerId)
applicationName
- Name of the Amazon Kinesis application
By default the application name is included in the user agent string used to make AWS requests. This
can assist with troubleshooting (e.g. distinguish requests made by separate applications).streamName
- Name of the Kinesis streamkinesisCredentialsProvider
- Provides credentials used to access KinesisdynamoDBCredentialsProvider
- Provides credentials used to access DynamoDBcloudWatchCredentialsProvider
- Provides credentials used to access CloudWatchworkerId
- Used to distinguish different workers/processes of a Kinesis applicationpublic KinesisClientLibConfiguration(java.lang.String applicationName, java.lang.String streamName, java.lang.String kinesisEndpoint, InitialPositionInStream initialPositionInStream, AWSCredentialsProvider kinesisCredentialsProvider, AWSCredentialsProvider dynamoDBCredentialsProvider, AWSCredentialsProvider cloudWatchCredentialsProvider, long failoverTimeMillis, java.lang.String workerId, int maxRecords, long idleTimeBetweenReadsInMillis, boolean callProcessRecordsEvenForEmptyRecordList, long parentShardPollIntervalMillis, long shardSyncIntervalMillis, boolean cleanupTerminatedShardsBeforeExpiry, ClientConfiguration kinesisClientConfig, ClientConfiguration dynamoDBClientConfig, ClientConfiguration cloudWatchClientConfig, long taskBackoffTimeMillis, long metricsBufferTimeMillis, int metricsMaxQueueSize, boolean validateSequenceNumberBeforeCheckpointing, java.lang.String regionName)
applicationName
- Name of the Kinesis application
By default the application name is included in the user agent string used to make AWS requests. This
can assist with troubleshooting (e.g. distinguish requests made by separate applications).streamName
- Name of the Kinesis streamkinesisEndpoint
- Kinesis endpointinitialPositionInStream
- One of LATEST or TRIM_HORIZON. The KinesisClientLibrary will start fetching
records from that location in the stream when an application starts up for the first time and there
are no checkpoints. If there are checkpoints, then we start from the checkpoint position.kinesisCredentialsProvider
- Provides credentials used to access KinesisdynamoDBCredentialsProvider
- Provides credentials used to access DynamoDBcloudWatchCredentialsProvider
- Provides credentials used to access CloudWatchfailoverTimeMillis
- Lease duration (leases not renewed within this period will be claimed by others)workerId
- Used to distinguish different workers/processes of a Kinesis applicationmaxRecords
- Max records to read per Kinesis getRecords() callidleTimeBetweenReadsInMillis
- Idle time between calls to fetch data from KinesiscallProcessRecordsEvenForEmptyRecordList
- Call the IRecordProcessor::processRecords() API even if
GetRecords returned an empty record list.parentShardPollIntervalMillis
- Wait for this long between polls to check if parent shards are doneshardSyncIntervalMillis
- Time between tasks to sync leases and Kinesis shardscleanupTerminatedShardsBeforeExpiry
- Clean up shards we've finished processing (don't wait for expiration
in Kinesis)kinesisClientConfig
- Client Configuration used by Kinesis clientdynamoDBClientConfig
- Client Configuration used by DynamoDB clientcloudWatchClientConfig
- Client Configuration used by CloudWatch clienttaskBackoffTimeMillis
- Backoff period when tasks encounter an exceptionmetricsBufferTimeMillis
- Metrics are buffered for at most this long before publishing to CloudWatchmetricsMaxQueueSize
- Max number of metrics to buffer before publishing to CloudWatchvalidateSequenceNumberBeforeCheckpointing
- whether KCL should validate client provided sequence numbers
with a call to Amazon Kinesis before checkpointing for calls to
RecordProcessorCheckpointer#checkpoint(String)
regionName
- The region name for the servicepublic java.lang.String getApplicationName()
public long getFailoverTimeMillis()
public AWSCredentialsProvider getKinesisCredentialsProvider()
public AWSCredentialsProvider getDynamoDBCredentialsProvider()
public AWSCredentialsProvider getCloudWatchCredentialsProvider()
public java.lang.String getWorkerIdentifier()
public long getShardSyncIntervalMillis()
public int getMaxRecords()
public long getIdleTimeBetweenReadsInMillis()
public boolean shouldCallProcessRecordsEvenForEmptyRecordList()
public long getEpsilonMillis()
public java.lang.String getStreamName()
public java.lang.String getKinesisEndpoint()
public InitialPositionInStream getInitialPositionInStream()
public long getParentShardPollIntervalMillis()
public ClientConfiguration getKinesisClientConfiguration()
public ClientConfiguration getDynamoDBClientConfiguration()
public ClientConfiguration getCloudWatchClientConfiguration()
public long getTaskBackoffTimeMillis()
public long getMetricsBufferTimeMillis()
public int getMetricsMaxQueueSize()
public MetricsLevel getMetricsLevel()
public java.util.Set<java.lang.String> getMetricsEnabledDimensions()
public boolean shouldCleanupLeasesUponShardCompletion()
public boolean shouldValidateSequenceNumberBeforeCheckpointing()
RecordProcessorCheckpointer#checkpoint(String)
public java.lang.String getRegionName()
public KinesisClientLibConfiguration withKinesisEndpoint(java.lang.String kinesisEndpoint)
kinesisEndpoint
- Kinesis endpointpublic KinesisClientLibConfiguration withInitialPositionInStream(InitialPositionInStream initialPositionInStream)
initialPositionInStream
- One of LATEST or TRIM_HORIZON. The Amazon Kinesis Client Library will start
fetching records from this position when the application starts up if there are no checkpoints. If there
are checkpoints, we will process records from the checkpoint position.public KinesisClientLibConfiguration withFailoverTimeMillis(long failoverTimeMillis)
failoverTimeMillis
- Lease duration (leases not renewed within this period will be claimed by others)public KinesisClientLibConfiguration withShardSyncIntervalMillis(long shardSyncIntervalMillis)
shardSyncIntervalMillis
- Time between tasks to sync leases and Kinesis shardspublic KinesisClientLibConfiguration withMaxRecords(int maxRecords)
maxRecords
- Max records to fetch in a Kinesis getRecords() callpublic KinesisClientLibConfiguration withIdleTimeBetweenReadsInMillis(long idleTimeBetweenReadsInMillis)
idleTimeBetweenReadsInMillis
- Idle time between calls to fetch data from Kinesispublic KinesisClientLibConfiguration withCallProcessRecordsEvenForEmptyRecordList(boolean callProcessRecordsEvenForEmptyRecordList)
callProcessRecordsEvenForEmptyRecordList
- Call the RecordProcessor::processRecords() API even if
GetRecords returned an empty record listpublic KinesisClientLibConfiguration withParentShardPollIntervalMillis(long parentShardPollIntervalMillis)
parentShardPollIntervalMillis
- Wait for this long between polls to check if parent shards are donepublic KinesisClientLibConfiguration withCleanupLeasesUponShardCompletion(boolean cleanupLeasesUponShardCompletion)
cleanupLeasesUponShardCompletion
- Clean up shards we've finished processing (don't wait for expiration
in Kinesis)public KinesisClientLibConfiguration withCommonClientConfig(ClientConfiguration clientConfig)
clientConfig
- Common client configuration used by Kinesis/DynamoDB/CloudWatch clientpublic KinesisClientLibConfiguration withKinesisClientConfig(ClientConfiguration kinesisClientConfig)
kinesisClientConfig
- Client configuration used by Kinesis clientpublic KinesisClientLibConfiguration withDynamoDBClientConfig(ClientConfiguration dynamoDBClientConfig)
dynamoDBClientConfig
- Client configuration used by DynamoDB clientpublic KinesisClientLibConfiguration withCloudWatchClientConfig(ClientConfiguration cloudWatchClientConfig)
cloudWatchClientConfig
- Client configuration used by CloudWatch clientpublic KinesisClientLibConfiguration withUserAgent(java.lang.String userAgent)
userAgent
- User agent to use in AWS requestspublic KinesisClientLibConfiguration withTaskBackoffTimeMillis(long taskBackoffTimeMillis)
taskBackoffTimeMillis
- Backoff period when tasks encounter an exceptionpublic KinesisClientLibConfiguration withMetricsBufferTimeMillis(long metricsBufferTimeMillis)
metricsBufferTimeMillis
- Metrics are buffered for at most this long before publishing to CloudWatchpublic KinesisClientLibConfiguration withMetricsMaxQueueSize(int metricsMaxQueueSize)
metricsMaxQueueSize
- Max number of metrics to buffer before publishing to CloudWatchpublic KinesisClientLibConfiguration withMetricsLevel(MetricsLevel metricsLevel)
metricsLevel
- Metrics level to enable.public KinesisClientLibConfiguration withMetricsLevel(java.lang.String metricsLevel)
metricsLevel
- Metrics level to enable.public KinesisClientLibConfiguration withMetricsEnabledDimensions(java.util.Set<java.lang.String> metricsEnabledDimensions)
metricsEnabledDimensions
- Set of dimensions that are allowed.public KinesisClientLibConfiguration withValidateSequenceNumberBeforeCheckpointing(boolean validateSequenceNumberBeforeCheckpointing)
validateSequenceNumberBeforeCheckpointing
- whether KCL should validate client provided sequence numbers
with a call to Amazon Kinesis before checkpointing for calls to
RecordProcessorCheckpointer#checkpoint(String)
.public KinesisClientLibConfiguration withRegionName(java.lang.String regionName)
regionName
- The region name for the service