Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ public class KinesisClientLibConfiguration {


private String applicationName;
private String tableName;
private String streamName;
private String kinesisEndpoint;
private InitialPositionInStream initialPositionInStream;
Expand Down Expand Up @@ -300,6 +301,7 @@ public KinesisClientLibConfiguration(String applicationName,
checkIsValuePositive("MetricsMaxQueueSize", (long) metricsMaxQueueSize);
checkIsRegionNameValid(regionName);
this.applicationName = applicationName;
this.tableName = applicationName;
this.streamName = streamName;
this.kinesisEndpoint = kinesisEndpoint;
this.initialPositionInStream = initialPositionInStream;
Expand Down Expand Up @@ -366,6 +368,13 @@ public String getApplicationName() {
return applicationName;
}

/**
* @return Name of the table to use in DynamoDB
*/
public String getTableName() {
return tableName;
}

/**
* @return Time within which a worker should renew a lease (else it is assumed dead)
*/
Expand Down Expand Up @@ -572,6 +581,15 @@ public int getInitialLeaseTableWriteCapacity() {
}

// CHECKSTYLE:IGNORE HiddenFieldCheck FOR NEXT 190 LINES
/**
* @param tableName name of the lease table in DynamoDB
* @return KinesisClientLibConfiguration
*/
public KinesisClientLibConfiguration withTableName(String tableName) {
this.tableName = tableName;
return this;
}

/**
* @param kinesisEndpoint Kinesis endpoint
* @return KinesisClientLibConfiguration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public Worker(
config.shouldCleanupLeasesUponShardCompletion(),
null,
new KinesisClientLibLeaseCoordinator(
new KinesisClientLeaseManager(config.getApplicationName(), dynamoDBClient),
new KinesisClientLeaseManager(config.getTableName(), config.getApplicationName(), dynamoDBClient),
config.getWorkerIdentifier(),
config.getFailoverTimeMillis(),
config.getEpsilonMillis(),
Expand Down Expand Up @@ -952,7 +952,7 @@ public Worker build() {
config.getShardSyncIntervalMillis(),
config.shouldCleanupLeasesUponShardCompletion(),
null,
new KinesisClientLibLeaseCoordinator(new KinesisClientLeaseManager(config.getApplicationName(),
new KinesisClientLibLeaseCoordinator(new KinesisClientLeaseManager(config.getTableName(),
dynamoDBClient),
config.getWorkerIdentifier(),
config.getFailoverTimeMillis(),
Expand Down