obtain ignoreUnexpectedChildShards from config where possible
instead of adding the `ignoreUnexpectedChildShards` field to various objects and passing it as an explicit parameter, refrain from adding the field except where needed and obtain the value from the already-passed `KinesisClientLibConfiguration` parameter.
This commit is contained in:
parent
8358322835
commit
f2b8f677eb
5 changed files with 18 additions and 57 deletions
|
|
@ -55,7 +55,6 @@ class ShardConsumer {
|
||||||
// Backoff time when polling to check if application has finished processing parent shards
|
// Backoff time when polling to check if application has finished processing parent shards
|
||||||
private final long parentShardPollIntervalMillis;
|
private final long parentShardPollIntervalMillis;
|
||||||
private final boolean cleanupLeasesOfCompletedShards;
|
private final boolean cleanupLeasesOfCompletedShards;
|
||||||
private final boolean ignoreUnexpectedChildShards;
|
|
||||||
private final long taskBackoffTimeMillis;
|
private final long taskBackoffTimeMillis;
|
||||||
private final boolean skipShardSyncAtWorkerInitializationIfLeasesExist;
|
private final boolean skipShardSyncAtWorkerInitializationIfLeasesExist;
|
||||||
|
|
||||||
|
|
@ -101,7 +100,7 @@ class ShardConsumer {
|
||||||
* @param metricsFactory IMetricsFactory used to construct IMetricsScopes for this shard
|
* @param metricsFactory IMetricsFactory used to construct IMetricsScopes for this shard
|
||||||
* @param backoffTimeMillis backoff interval when we encounter exceptions
|
* @param backoffTimeMillis backoff interval when we encounter exceptions
|
||||||
*/
|
*/
|
||||||
// CHECKSTYLE:IGNORE ParameterNumber FOR NEXT 11 LINES
|
// CHECKSTYLE:IGNORE ParameterNumber FOR NEXT 10 LINES
|
||||||
ShardConsumer(ShardInfo shardInfo,
|
ShardConsumer(ShardInfo shardInfo,
|
||||||
StreamConfig streamConfig,
|
StreamConfig streamConfig,
|
||||||
ICheckpoint checkpoint,
|
ICheckpoint checkpoint,
|
||||||
|
|
@ -109,7 +108,6 @@ class ShardConsumer {
|
||||||
ILeaseManager<KinesisClientLease> leaseManager,
|
ILeaseManager<KinesisClientLease> leaseManager,
|
||||||
long parentShardPollIntervalMillis,
|
long parentShardPollIntervalMillis,
|
||||||
boolean cleanupLeasesOfCompletedShards,
|
boolean cleanupLeasesOfCompletedShards,
|
||||||
boolean ignoreUnexpectedChildShards,
|
|
||||||
ExecutorService executorService,
|
ExecutorService executorService,
|
||||||
IMetricsFactory metricsFactory,
|
IMetricsFactory metricsFactory,
|
||||||
long backoffTimeMillis,
|
long backoffTimeMillis,
|
||||||
|
|
@ -122,7 +120,6 @@ class ShardConsumer {
|
||||||
leaseManager,
|
leaseManager,
|
||||||
parentShardPollIntervalMillis,
|
parentShardPollIntervalMillis,
|
||||||
cleanupLeasesOfCompletedShards,
|
cleanupLeasesOfCompletedShards,
|
||||||
ignoreUnexpectedChildShards,
|
|
||||||
executorService,
|
executorService,
|
||||||
metricsFactory,
|
metricsFactory,
|
||||||
backoffTimeMillis,
|
backoffTimeMillis,
|
||||||
|
|
@ -154,7 +151,6 @@ class ShardConsumer {
|
||||||
ILeaseManager<KinesisClientLease> leaseManager,
|
ILeaseManager<KinesisClientLease> leaseManager,
|
||||||
long parentShardPollIntervalMillis,
|
long parentShardPollIntervalMillis,
|
||||||
boolean cleanupLeasesOfCompletedShards,
|
boolean cleanupLeasesOfCompletedShards,
|
||||||
boolean ignoreUnexpectedChildShards,
|
|
||||||
ExecutorService executorService,
|
ExecutorService executorService,
|
||||||
IMetricsFactory metricsFactory,
|
IMetricsFactory metricsFactory,
|
||||||
long backoffTimeMillis,
|
long backoffTimeMillis,
|
||||||
|
|
@ -178,7 +174,6 @@ class ShardConsumer {
|
||||||
leaseManager,
|
leaseManager,
|
||||||
parentShardPollIntervalMillis,
|
parentShardPollIntervalMillis,
|
||||||
cleanupLeasesOfCompletedShards,
|
cleanupLeasesOfCompletedShards,
|
||||||
ignoreUnexpectedChildShards,
|
|
||||||
executorService,
|
executorService,
|
||||||
metricsFactory,
|
metricsFactory,
|
||||||
backoffTimeMillis,
|
backoffTimeMillis,
|
||||||
|
|
@ -216,7 +211,6 @@ class ShardConsumer {
|
||||||
ILeaseManager<KinesisClientLease> leaseManager,
|
ILeaseManager<KinesisClientLease> leaseManager,
|
||||||
long parentShardPollIntervalMillis,
|
long parentShardPollIntervalMillis,
|
||||||
boolean cleanupLeasesOfCompletedShards,
|
boolean cleanupLeasesOfCompletedShards,
|
||||||
boolean ignoreUnexpectedChildShards,
|
|
||||||
ExecutorService executorService,
|
ExecutorService executorService,
|
||||||
IMetricsFactory metricsFactory,
|
IMetricsFactory metricsFactory,
|
||||||
long backoffTimeMillis,
|
long backoffTimeMillis,
|
||||||
|
|
@ -233,7 +227,6 @@ class ShardConsumer {
|
||||||
this.leaseManager = leaseManager;
|
this.leaseManager = leaseManager;
|
||||||
this.parentShardPollIntervalMillis = parentShardPollIntervalMillis;
|
this.parentShardPollIntervalMillis = parentShardPollIntervalMillis;
|
||||||
this.cleanupLeasesOfCompletedShards = cleanupLeasesOfCompletedShards;
|
this.cleanupLeasesOfCompletedShards = cleanupLeasesOfCompletedShards;
|
||||||
this.ignoreUnexpectedChildShards = ignoreUnexpectedChildShards;
|
|
||||||
this.executorService = executorService;
|
this.executorService = executorService;
|
||||||
this.metricsFactory = metricsFactory;
|
this.metricsFactory = metricsFactory;
|
||||||
this.taskBackoffTimeMillis = backoffTimeMillis;
|
this.taskBackoffTimeMillis = backoffTimeMillis;
|
||||||
|
|
@ -492,7 +485,7 @@ class ShardConsumer {
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isIgnoreUnexpectedChildShards() {
|
boolean isIgnoreUnexpectedChildShards() {
|
||||||
return ignoreUnexpectedChildShards;
|
return config.shouldIgnoreUnexpectedChildShards();
|
||||||
}
|
}
|
||||||
|
|
||||||
long getTaskBackoffTimeMillis() {
|
long getTaskBackoffTimeMillis() {
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,6 @@ public class Worker implements Runnable {
|
||||||
// info, value is ShardConsumer.
|
// info, value is ShardConsumer.
|
||||||
private ConcurrentMap<ShardInfo, ShardConsumer> shardInfoShardConsumerMap = new ConcurrentHashMap<ShardInfo, ShardConsumer>();
|
private ConcurrentMap<ShardInfo, ShardConsumer> shardInfoShardConsumerMap = new ConcurrentHashMap<ShardInfo, ShardConsumer>();
|
||||||
private final boolean cleanupLeasesUponShardCompletion;
|
private final boolean cleanupLeasesUponShardCompletion;
|
||||||
private final boolean ignoreUnexpectedChildShards;
|
|
||||||
|
|
||||||
private final boolean skipShardSyncAtWorkerInitializationIfLeasesExist;
|
private final boolean skipShardSyncAtWorkerInitializationIfLeasesExist;
|
||||||
|
|
||||||
|
|
@ -256,8 +255,7 @@ public class Worker implements Runnable {
|
||||||
config.shouldValidateSequenceNumberBeforeCheckpointing(),
|
config.shouldValidateSequenceNumberBeforeCheckpointing(),
|
||||||
config.getInitialPositionInStreamExtended()),
|
config.getInitialPositionInStreamExtended()),
|
||||||
config.getInitialPositionInStreamExtended(), config.getParentShardPollIntervalMillis(),
|
config.getInitialPositionInStreamExtended(), config.getParentShardPollIntervalMillis(),
|
||||||
config.getShardSyncIntervalMillis(), config.shouldCleanupLeasesUponShardCompletion(),
|
config.getShardSyncIntervalMillis(), config.shouldCleanupLeasesUponShardCompletion(), null,
|
||||||
config.shouldIgnoreUnexpectedChildShards(), null,
|
|
||||||
new KinesisClientLibLeaseCoordinator(
|
new KinesisClientLibLeaseCoordinator(
|
||||||
new KinesisClientLeaseManager(config.getTableName(), dynamoDBClient),
|
new KinesisClientLeaseManager(config.getTableName(), dynamoDBClient),
|
||||||
config.getWorkerIdentifier(),
|
config.getWorkerIdentifier(),
|
||||||
|
|
@ -324,8 +322,6 @@ public class Worker implements Runnable {
|
||||||
* Time between tasks to sync leases and Kinesis shards
|
* Time between tasks to sync leases and Kinesis shards
|
||||||
* @param cleanupLeasesUponShardCompletion
|
* @param cleanupLeasesUponShardCompletion
|
||||||
* Clean up shards we've finished processing (don't wait till they expire in Kinesis)
|
* Clean up shards we've finished processing (don't wait till they expire in Kinesis)
|
||||||
* @param ignoreUnexpectedChildShards
|
|
||||||
* Ignore child shards with open parents
|
|
||||||
* @param checkpoint
|
* @param checkpoint
|
||||||
* Used to get/set checkpoints
|
* Used to get/set checkpoints
|
||||||
* @param leaseCoordinator
|
* @param leaseCoordinator
|
||||||
|
|
@ -343,14 +339,14 @@ public class Worker implements Runnable {
|
||||||
// CHECKSTYLE:IGNORE ParameterNumber FOR NEXT 10 LINES
|
// CHECKSTYLE:IGNORE ParameterNumber FOR NEXT 10 LINES
|
||||||
Worker(String applicationName, IRecordProcessorFactory recordProcessorFactory, KinesisClientLibConfiguration config,
|
Worker(String applicationName, IRecordProcessorFactory recordProcessorFactory, KinesisClientLibConfiguration config,
|
||||||
StreamConfig streamConfig, InitialPositionInStreamExtended initialPositionInStream, long parentShardPollIntervalMillis,
|
StreamConfig streamConfig, InitialPositionInStreamExtended initialPositionInStream, long parentShardPollIntervalMillis,
|
||||||
long shardSyncIdleTimeMillis, boolean cleanupLeasesUponShardCompletion, boolean ignoreUnexpectedChildShards,
|
long shardSyncIdleTimeMillis, boolean cleanupLeasesUponShardCompletion, ICheckpoint checkpoint,
|
||||||
ICheckpoint checkpoint, KinesisClientLibLeaseCoordinator leaseCoordinator, ExecutorService execService,
|
KinesisClientLibLeaseCoordinator leaseCoordinator, ExecutorService execService,
|
||||||
IMetricsFactory metricsFactory, long taskBackoffTimeMillis, long failoverTimeMillis,
|
IMetricsFactory metricsFactory, long taskBackoffTimeMillis, long failoverTimeMillis,
|
||||||
boolean skipShardSyncAtWorkerInitializationIfLeasesExist, ShardPrioritization shardPrioritization) {
|
boolean skipShardSyncAtWorkerInitializationIfLeasesExist, ShardPrioritization shardPrioritization) {
|
||||||
this(applicationName, recordProcessorFactory, config, streamConfig, initialPositionInStream, parentShardPollIntervalMillis,
|
this(applicationName, recordProcessorFactory, config, streamConfig, initialPositionInStream, parentShardPollIntervalMillis,
|
||||||
shardSyncIdleTimeMillis, cleanupLeasesUponShardCompletion, ignoreUnexpectedChildShards, checkpoint,
|
shardSyncIdleTimeMillis, cleanupLeasesUponShardCompletion, checkpoint, leaseCoordinator, execService,
|
||||||
leaseCoordinator, execService, metricsFactory, taskBackoffTimeMillis, failoverTimeMillis,
|
metricsFactory, taskBackoffTimeMillis, failoverTimeMillis, skipShardSyncAtWorkerInitializationIfLeasesExist,
|
||||||
skipShardSyncAtWorkerInitializationIfLeasesExist, shardPrioritization, Optional.empty(), Optional.empty());
|
shardPrioritization, Optional.empty(), Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -372,8 +368,6 @@ public class Worker implements Runnable {
|
||||||
* Time between tasks to sync leases and Kinesis shards
|
* Time between tasks to sync leases and Kinesis shards
|
||||||
* @param cleanupLeasesUponShardCompletion
|
* @param cleanupLeasesUponShardCompletion
|
||||||
* Clean up shards we've finished processing (don't wait till they expire in Kinesis)
|
* Clean up shards we've finished processing (don't wait till they expire in Kinesis)
|
||||||
* @param ignoreUnexpectedChildShards
|
|
||||||
* Ignore child shards with open parents
|
|
||||||
* @param checkpoint
|
* @param checkpoint
|
||||||
* Used to get/set checkpoints
|
* Used to get/set checkpoints
|
||||||
* @param leaseCoordinator
|
* @param leaseCoordinator
|
||||||
|
|
@ -395,8 +389,8 @@ public class Worker implements Runnable {
|
||||||
// CHECKSTYLE:IGNORE ParameterNumber FOR NEXT 10 LINES
|
// CHECKSTYLE:IGNORE ParameterNumber FOR NEXT 10 LINES
|
||||||
Worker(String applicationName, IRecordProcessorFactory recordProcessorFactory, KinesisClientLibConfiguration config, StreamConfig streamConfig,
|
Worker(String applicationName, IRecordProcessorFactory recordProcessorFactory, KinesisClientLibConfiguration config, StreamConfig streamConfig,
|
||||||
InitialPositionInStreamExtended initialPositionInStream, long parentShardPollIntervalMillis,
|
InitialPositionInStreamExtended initialPositionInStream, long parentShardPollIntervalMillis,
|
||||||
long shardSyncIdleTimeMillis, boolean cleanupLeasesUponShardCompletion, boolean ignoreUnexpectedChildShards,
|
long shardSyncIdleTimeMillis, boolean cleanupLeasesUponShardCompletion, ICheckpoint checkpoint,
|
||||||
ICheckpoint checkpoint, KinesisClientLibLeaseCoordinator leaseCoordinator, ExecutorService execService,
|
KinesisClientLibLeaseCoordinator leaseCoordinator, ExecutorService execService,
|
||||||
IMetricsFactory metricsFactory, long taskBackoffTimeMillis, long failoverTimeMillis,
|
IMetricsFactory metricsFactory, long taskBackoffTimeMillis, long failoverTimeMillis,
|
||||||
boolean skipShardSyncAtWorkerInitializationIfLeasesExist, ShardPrioritization shardPrioritization,
|
boolean skipShardSyncAtWorkerInitializationIfLeasesExist, ShardPrioritization shardPrioritization,
|
||||||
Optional<Integer> retryGetRecordsInSeconds, Optional<Integer> maxGetRecordsThreadPool) {
|
Optional<Integer> retryGetRecordsInSeconds, Optional<Integer> maxGetRecordsThreadPool) {
|
||||||
|
|
@ -407,15 +401,14 @@ public class Worker implements Runnable {
|
||||||
this.initialPosition = initialPositionInStream;
|
this.initialPosition = initialPositionInStream;
|
||||||
this.parentShardPollIntervalMillis = parentShardPollIntervalMillis;
|
this.parentShardPollIntervalMillis = parentShardPollIntervalMillis;
|
||||||
this.cleanupLeasesUponShardCompletion = cleanupLeasesUponShardCompletion;
|
this.cleanupLeasesUponShardCompletion = cleanupLeasesUponShardCompletion;
|
||||||
this.ignoreUnexpectedChildShards = ignoreUnexpectedChildShards;
|
|
||||||
this.checkpointTracker = checkpoint != null ? checkpoint : leaseCoordinator;
|
this.checkpointTracker = checkpoint != null ? checkpoint : leaseCoordinator;
|
||||||
this.idleTimeInMilliseconds = streamConfig.getIdleTimeInMilliseconds();
|
this.idleTimeInMilliseconds = streamConfig.getIdleTimeInMilliseconds();
|
||||||
this.executorService = execService;
|
this.executorService = execService;
|
||||||
this.leaseCoordinator = leaseCoordinator;
|
this.leaseCoordinator = leaseCoordinator;
|
||||||
this.metricsFactory = metricsFactory;
|
this.metricsFactory = metricsFactory;
|
||||||
this.controlServer = new ShardSyncTaskManager(streamConfig.getStreamProxy(), leaseCoordinator.getLeaseManager(),
|
this.controlServer = new ShardSyncTaskManager(streamConfig.getStreamProxy(), leaseCoordinator.getLeaseManager(),
|
||||||
initialPositionInStream, cleanupLeasesUponShardCompletion, ignoreUnexpectedChildShards, shardSyncIdleTimeMillis,
|
initialPositionInStream, cleanupLeasesUponShardCompletion, config.shouldIgnoreUnexpectedChildShards(),
|
||||||
metricsFactory, executorService);
|
shardSyncIdleTimeMillis, metricsFactory, executorService);
|
||||||
this.taskBackoffTimeMillis = taskBackoffTimeMillis;
|
this.taskBackoffTimeMillis = taskBackoffTimeMillis;
|
||||||
this.failoverTimeMillis = failoverTimeMillis;
|
this.failoverTimeMillis = failoverTimeMillis;
|
||||||
this.skipShardSyncAtWorkerInitializationIfLeasesExist = skipShardSyncAtWorkerInitializationIfLeasesExist;
|
this.skipShardSyncAtWorkerInitializationIfLeasesExist = skipShardSyncAtWorkerInitializationIfLeasesExist;
|
||||||
|
|
@ -507,7 +500,7 @@ public class Worker implements Runnable {
|
||||||
LOG.info("Syncing Kinesis shard info");
|
LOG.info("Syncing Kinesis shard info");
|
||||||
ShardSyncTask shardSyncTask = new ShardSyncTask(streamConfig.getStreamProxy(),
|
ShardSyncTask shardSyncTask = new ShardSyncTask(streamConfig.getStreamProxy(),
|
||||||
leaseCoordinator.getLeaseManager(), initialPosition, cleanupLeasesUponShardCompletion,
|
leaseCoordinator.getLeaseManager(), initialPosition, cleanupLeasesUponShardCompletion,
|
||||||
ignoreUnexpectedChildShards, 0L);
|
config.shouldIgnoreUnexpectedChildShards(), 0L);
|
||||||
result = new MetricsCollectingTaskDecorator(shardSyncTask, metricsFactory).call();
|
result = new MetricsCollectingTaskDecorator(shardSyncTask, metricsFactory).call();
|
||||||
} else {
|
} else {
|
||||||
LOG.info("Skipping shard sync per config setting (and lease table is not empty)");
|
LOG.info("Skipping shard sync per config setting (and lease table is not empty)");
|
||||||
|
|
@ -862,7 +855,6 @@ public class Worker implements Runnable {
|
||||||
leaseCoordinator.getLeaseManager(),
|
leaseCoordinator.getLeaseManager(),
|
||||||
parentShardPollIntervalMillis,
|
parentShardPollIntervalMillis,
|
||||||
cleanupLeasesUponShardCompletion,
|
cleanupLeasesUponShardCompletion,
|
||||||
ignoreUnexpectedChildShards,
|
|
||||||
executorService,
|
executorService,
|
||||||
metricsFactory,
|
metricsFactory,
|
||||||
taskBackoffTimeMillis,
|
taskBackoffTimeMillis,
|
||||||
|
|
@ -1281,7 +1273,6 @@ public class Worker implements Runnable {
|
||||||
config.getParentShardPollIntervalMillis(),
|
config.getParentShardPollIntervalMillis(),
|
||||||
config.getShardSyncIntervalMillis(),
|
config.getShardSyncIntervalMillis(),
|
||||||
config.shouldCleanupLeasesUponShardCompletion(),
|
config.shouldCleanupLeasesUponShardCompletion(),
|
||||||
config.shouldIgnoreUnexpectedChildShards(),
|
|
||||||
null,
|
null,
|
||||||
new KinesisClientLibLeaseCoordinator(new KinesisClientLeaseManager(config.getTableName(),
|
new KinesisClientLibLeaseCoordinator(new KinesisClientLeaseManager(config.getTableName(),
|
||||||
dynamoDBClient),
|
dynamoDBClient),
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,6 @@ public class ShardConsumerTest {
|
||||||
private final long taskBackoffTimeMillis = 500L;
|
private final long taskBackoffTimeMillis = 500L;
|
||||||
private final long parentShardPollIntervalMillis = 50L;
|
private final long parentShardPollIntervalMillis = 50L;
|
||||||
private final boolean cleanupLeasesOfCompletedShards = true;
|
private final boolean cleanupLeasesOfCompletedShards = true;
|
||||||
private final boolean ignoreUnexpectedChildShards = false;
|
|
||||||
// We don't want any of these tests to run checkpoint validation
|
// We don't want any of these tests to run checkpoint validation
|
||||||
private final boolean skipCheckpointValidationValue = false;
|
private final boolean skipCheckpointValidationValue = false;
|
||||||
private static final InitialPositionInStreamExtended INITIAL_POSITION_LATEST =
|
private static final InitialPositionInStreamExtended INITIAL_POSITION_LATEST =
|
||||||
|
|
@ -152,7 +151,6 @@ public class ShardConsumerTest {
|
||||||
null,
|
null,
|
||||||
parentShardPollIntervalMillis,
|
parentShardPollIntervalMillis,
|
||||||
cleanupLeasesOfCompletedShards,
|
cleanupLeasesOfCompletedShards,
|
||||||
ignoreUnexpectedChildShards,
|
|
||||||
executorService,
|
executorService,
|
||||||
metricsFactory,
|
metricsFactory,
|
||||||
taskBackoffTimeMillis,
|
taskBackoffTimeMillis,
|
||||||
|
|
@ -201,7 +199,6 @@ public class ShardConsumerTest {
|
||||||
null,
|
null,
|
||||||
parentShardPollIntervalMillis,
|
parentShardPollIntervalMillis,
|
||||||
cleanupLeasesOfCompletedShards,
|
cleanupLeasesOfCompletedShards,
|
||||||
ignoreUnexpectedChildShards,
|
|
||||||
spyExecutorService,
|
spyExecutorService,
|
||||||
metricsFactory,
|
metricsFactory,
|
||||||
taskBackoffTimeMillis,
|
taskBackoffTimeMillis,
|
||||||
|
|
@ -244,7 +241,6 @@ public class ShardConsumerTest {
|
||||||
null,
|
null,
|
||||||
parentShardPollIntervalMillis,
|
parentShardPollIntervalMillis,
|
||||||
cleanupLeasesOfCompletedShards,
|
cleanupLeasesOfCompletedShards,
|
||||||
ignoreUnexpectedChildShards,
|
|
||||||
executorService,
|
executorService,
|
||||||
metricsFactory,
|
metricsFactory,
|
||||||
taskBackoffTimeMillis,
|
taskBackoffTimeMillis,
|
||||||
|
|
@ -358,7 +354,6 @@ public class ShardConsumerTest {
|
||||||
leaseManager,
|
leaseManager,
|
||||||
parentShardPollIntervalMillis,
|
parentShardPollIntervalMillis,
|
||||||
cleanupLeasesOfCompletedShards,
|
cleanupLeasesOfCompletedShards,
|
||||||
ignoreUnexpectedChildShards,
|
|
||||||
executorService,
|
executorService,
|
||||||
metricsFactory,
|
metricsFactory,
|
||||||
taskBackoffTimeMillis,
|
taskBackoffTimeMillis,
|
||||||
|
|
@ -488,7 +483,6 @@ public class ShardConsumerTest {
|
||||||
leaseManager,
|
leaseManager,
|
||||||
parentShardPollIntervalMillis,
|
parentShardPollIntervalMillis,
|
||||||
cleanupLeasesOfCompletedShards,
|
cleanupLeasesOfCompletedShards,
|
||||||
ignoreUnexpectedChildShards,
|
|
||||||
executorService,
|
executorService,
|
||||||
metricsFactory,
|
metricsFactory,
|
||||||
taskBackoffTimeMillis,
|
taskBackoffTimeMillis,
|
||||||
|
|
@ -562,7 +556,6 @@ public class ShardConsumerTest {
|
||||||
null,
|
null,
|
||||||
parentShardPollIntervalMillis,
|
parentShardPollIntervalMillis,
|
||||||
cleanupLeasesOfCompletedShards,
|
cleanupLeasesOfCompletedShards,
|
||||||
ignoreUnexpectedChildShards,
|
|
||||||
executorService,
|
executorService,
|
||||||
metricsFactory,
|
metricsFactory,
|
||||||
taskBackoffTimeMillis,
|
taskBackoffTimeMillis,
|
||||||
|
|
@ -614,7 +607,6 @@ public class ShardConsumerTest {
|
||||||
null,
|
null,
|
||||||
parentShardPollIntervalMillis,
|
parentShardPollIntervalMillis,
|
||||||
cleanupLeasesOfCompletedShards,
|
cleanupLeasesOfCompletedShards,
|
||||||
ignoreUnexpectedChildShards,
|
|
||||||
executorService,
|
executorService,
|
||||||
metricsFactory,
|
metricsFactory,
|
||||||
taskBackoffTimeMillis,
|
taskBackoffTimeMillis,
|
||||||
|
|
@ -645,7 +637,6 @@ public class ShardConsumerTest {
|
||||||
null,
|
null,
|
||||||
parentShardPollIntervalMillis,
|
parentShardPollIntervalMillis,
|
||||||
cleanupLeasesOfCompletedShards,
|
cleanupLeasesOfCompletedShards,
|
||||||
ignoreUnexpectedChildShards,
|
|
||||||
executorService,
|
executorService,
|
||||||
metricsFactory,
|
metricsFactory,
|
||||||
taskBackoffTimeMillis,
|
taskBackoffTimeMillis,
|
||||||
|
|
@ -687,7 +678,6 @@ public class ShardConsumerTest {
|
||||||
null,
|
null,
|
||||||
parentShardPollIntervalMillis,
|
parentShardPollIntervalMillis,
|
||||||
cleanupLeasesOfCompletedShards,
|
cleanupLeasesOfCompletedShards,
|
||||||
ignoreUnexpectedChildShards,
|
|
||||||
mockExecutorService,
|
mockExecutorService,
|
||||||
metricsFactory,
|
metricsFactory,
|
||||||
taskBackoffTimeMillis,
|
taskBackoffTimeMillis,
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,8 @@ public class ShardSyncTaskIntegrationTest {
|
||||||
ShardSyncTask syncTask = new ShardSyncTask(kinesisProxy,
|
ShardSyncTask syncTask = new ShardSyncTask(kinesisProxy,
|
||||||
leaseManager,
|
leaseManager,
|
||||||
InitialPositionInStreamExtended.newInitialPosition(InitialPositionInStream.LATEST),
|
InitialPositionInStreamExtended.newInitialPosition(InitialPositionInStream.LATEST),
|
||||||
false, false,
|
false,
|
||||||
|
false,
|
||||||
0L);
|
0L);
|
||||||
syncTask.call();
|
syncTask.call();
|
||||||
List<KinesisClientLease> leases = leaseManager.listLeases();
|
List<KinesisClientLease> leases = leaseManager.listLeases();
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,6 @@ public class WorkerTest {
|
||||||
private final long parentShardPollIntervalMillis = 5L;
|
private final long parentShardPollIntervalMillis = 5L;
|
||||||
private final long shardSyncIntervalMillis = 5L;
|
private final long shardSyncIntervalMillis = 5L;
|
||||||
private final boolean cleanupLeasesUponShardCompletion = true;
|
private final boolean cleanupLeasesUponShardCompletion = true;
|
||||||
private final boolean ignoreUnexpectedChildShards = false;
|
|
||||||
// We don't want any of these tests to run checkpoint validation
|
// We don't want any of these tests to run checkpoint validation
|
||||||
private final boolean skipCheckpointValidationValue = false;
|
private final boolean skipCheckpointValidationValue = false;
|
||||||
private static final InitialPositionInStreamExtended INITIAL_POSITION_LATEST =
|
private static final InitialPositionInStreamExtended INITIAL_POSITION_LATEST =
|
||||||
|
|
@ -256,7 +255,6 @@ public class WorkerTest {
|
||||||
parentShardPollIntervalMillis,
|
parentShardPollIntervalMillis,
|
||||||
shardSyncIntervalMillis,
|
shardSyncIntervalMillis,
|
||||||
cleanupLeasesUponShardCompletion,
|
cleanupLeasesUponShardCompletion,
|
||||||
ignoreUnexpectedChildShards,
|
|
||||||
checkpoint,
|
checkpoint,
|
||||||
leaseCoordinator,
|
leaseCoordinator,
|
||||||
execService,
|
execService,
|
||||||
|
|
@ -308,7 +306,6 @@ public class WorkerTest {
|
||||||
parentShardPollIntervalMillis,
|
parentShardPollIntervalMillis,
|
||||||
shardSyncIntervalMillis,
|
shardSyncIntervalMillis,
|
||||||
cleanupLeasesUponShardCompletion,
|
cleanupLeasesUponShardCompletion,
|
||||||
ignoreUnexpectedChildShards,
|
|
||||||
checkpoint,
|
checkpoint,
|
||||||
leaseCoordinator,
|
leaseCoordinator,
|
||||||
execService,
|
execService,
|
||||||
|
|
@ -377,7 +374,6 @@ public class WorkerTest {
|
||||||
parentShardPollIntervalMillis,
|
parentShardPollIntervalMillis,
|
||||||
shardSyncIntervalMillis,
|
shardSyncIntervalMillis,
|
||||||
cleanupLeasesUponShardCompletion,
|
cleanupLeasesUponShardCompletion,
|
||||||
ignoreUnexpectedChildShards,
|
|
||||||
checkpoint,
|
checkpoint,
|
||||||
leaseCoordinator,
|
leaseCoordinator,
|
||||||
execService,
|
execService,
|
||||||
|
|
@ -434,7 +430,6 @@ public class WorkerTest {
|
||||||
shardPollInterval,
|
shardPollInterval,
|
||||||
shardSyncIntervalMillis,
|
shardSyncIntervalMillis,
|
||||||
cleanupLeasesUponShardCompletion,
|
cleanupLeasesUponShardCompletion,
|
||||||
ignoreUnexpectedChildShards,
|
|
||||||
leaseCoordinator,
|
leaseCoordinator,
|
||||||
leaseCoordinator,
|
leaseCoordinator,
|
||||||
execService,
|
execService,
|
||||||
|
|
@ -808,7 +803,6 @@ public class WorkerTest {
|
||||||
parentShardPollIntervalMillis,
|
parentShardPollIntervalMillis,
|
||||||
shardSyncIntervalMillis,
|
shardSyncIntervalMillis,
|
||||||
cleanupLeasesUponShardCompletion,
|
cleanupLeasesUponShardCompletion,
|
||||||
ignoreUnexpectedChildShards,
|
|
||||||
leaseCoordinator,
|
leaseCoordinator,
|
||||||
leaseCoordinator,
|
leaseCoordinator,
|
||||||
executorService,
|
executorService,
|
||||||
|
|
@ -889,8 +883,8 @@ public class WorkerTest {
|
||||||
|
|
||||||
Worker worker = new InjectableWorker("testRequestShutdown", recordProcessorFactory, config, streamConfig,
|
Worker worker = new InjectableWorker("testRequestShutdown", recordProcessorFactory, config, streamConfig,
|
||||||
INITIAL_POSITION_TRIM_HORIZON, parentShardPollIntervalMillis, shardSyncIntervalMillis,
|
INITIAL_POSITION_TRIM_HORIZON, parentShardPollIntervalMillis, shardSyncIntervalMillis,
|
||||||
cleanupLeasesUponShardCompletion, ignoreUnexpectedChildShards, leaseCoordinator, leaseCoordinator,
|
cleanupLeasesUponShardCompletion, leaseCoordinator, leaseCoordinator, executorService, metricsFactory,
|
||||||
executorService, metricsFactory, taskBackoffTimeMillis, failoverTimeMillis, false, shardPrioritization) {
|
taskBackoffTimeMillis, failoverTimeMillis, false, shardPrioritization) {
|
||||||
@Override
|
@Override
|
||||||
void postConstruct() {
|
void postConstruct() {
|
||||||
this.gracefuleShutdownStarted = true;
|
this.gracefuleShutdownStarted = true;
|
||||||
|
|
@ -967,7 +961,6 @@ public class WorkerTest {
|
||||||
parentShardPollIntervalMillis,
|
parentShardPollIntervalMillis,
|
||||||
shardSyncIntervalMillis,
|
shardSyncIntervalMillis,
|
||||||
cleanupLeasesUponShardCompletion,
|
cleanupLeasesUponShardCompletion,
|
||||||
ignoreUnexpectedChildShards,
|
|
||||||
leaseCoordinator,
|
leaseCoordinator,
|
||||||
leaseCoordinator,
|
leaseCoordinator,
|
||||||
executorService,
|
executorService,
|
||||||
|
|
@ -1042,7 +1035,6 @@ public class WorkerTest {
|
||||||
parentShardPollIntervalMillis,
|
parentShardPollIntervalMillis,
|
||||||
shardSyncIntervalMillis,
|
shardSyncIntervalMillis,
|
||||||
cleanupLeasesUponShardCompletion,
|
cleanupLeasesUponShardCompletion,
|
||||||
ignoreUnexpectedChildShards,
|
|
||||||
leaseCoordinator,
|
leaseCoordinator,
|
||||||
leaseCoordinator,
|
leaseCoordinator,
|
||||||
executorService,
|
executorService,
|
||||||
|
|
@ -1125,7 +1117,6 @@ public class WorkerTest {
|
||||||
parentShardPollIntervalMillis,
|
parentShardPollIntervalMillis,
|
||||||
shardSyncIntervalMillis,
|
shardSyncIntervalMillis,
|
||||||
cleanupLeasesUponShardCompletion,
|
cleanupLeasesUponShardCompletion,
|
||||||
ignoreUnexpectedChildShards,
|
|
||||||
leaseCoordinator,
|
leaseCoordinator,
|
||||||
leaseCoordinator,
|
leaseCoordinator,
|
||||||
executorService,
|
executorService,
|
||||||
|
|
@ -1239,7 +1230,6 @@ public class WorkerTest {
|
||||||
parentShardPollIntervalMillis,
|
parentShardPollIntervalMillis,
|
||||||
shardSyncIntervalMillis,
|
shardSyncIntervalMillis,
|
||||||
cleanupLeasesUponShardCompletion,
|
cleanupLeasesUponShardCompletion,
|
||||||
ignoreUnexpectedChildShards,
|
|
||||||
leaseCoordinator,
|
leaseCoordinator,
|
||||||
leaseCoordinator,
|
leaseCoordinator,
|
||||||
executorService,
|
executorService,
|
||||||
|
|
@ -1357,7 +1347,6 @@ public class WorkerTest {
|
||||||
parentShardPollIntervalMillis,
|
parentShardPollIntervalMillis,
|
||||||
shardSyncIntervalMillis,
|
shardSyncIntervalMillis,
|
||||||
cleanupLeasesUponShardCompletion,
|
cleanupLeasesUponShardCompletion,
|
||||||
ignoreUnexpectedChildShards,
|
|
||||||
leaseCoordinator,
|
leaseCoordinator,
|
||||||
leaseCoordinator,
|
leaseCoordinator,
|
||||||
executorService,
|
executorService,
|
||||||
|
|
@ -1442,7 +1431,6 @@ public class WorkerTest {
|
||||||
parentShardPollIntervalMillis,
|
parentShardPollIntervalMillis,
|
||||||
shardSyncIntervalMillis,
|
shardSyncIntervalMillis,
|
||||||
cleanupLeasesUponShardCompletion,
|
cleanupLeasesUponShardCompletion,
|
||||||
ignoreUnexpectedChildShards,
|
|
||||||
leaseCoordinator,
|
leaseCoordinator,
|
||||||
leaseCoordinator,
|
leaseCoordinator,
|
||||||
executorService,
|
executorService,
|
||||||
|
|
@ -1488,7 +1476,7 @@ public class WorkerTest {
|
||||||
KinesisClientLibConfiguration config, StreamConfig streamConfig,
|
KinesisClientLibConfiguration config, StreamConfig streamConfig,
|
||||||
InitialPositionInStreamExtended initialPositionInStream,
|
InitialPositionInStreamExtended initialPositionInStream,
|
||||||
long parentShardPollIntervalMillis, long shardSyncIdleTimeMillis,
|
long parentShardPollIntervalMillis, long shardSyncIdleTimeMillis,
|
||||||
boolean cleanupLeasesUponShardCompletion, boolean ignoreUnexpectedChildShards, ICheckpoint checkpoint,
|
boolean cleanupLeasesUponShardCompletion, ICheckpoint checkpoint,
|
||||||
KinesisClientLibLeaseCoordinator leaseCoordinator, ExecutorService execService,
|
KinesisClientLibLeaseCoordinator leaseCoordinator, ExecutorService execService,
|
||||||
IMetricsFactory metricsFactory, long taskBackoffTimeMillis, long failoverTimeMillis,
|
IMetricsFactory metricsFactory, long taskBackoffTimeMillis, long failoverTimeMillis,
|
||||||
boolean skipShardSyncAtWorkerInitializationIfLeasesExist, ShardPrioritization shardPrioritization) {
|
boolean skipShardSyncAtWorkerInitializationIfLeasesExist, ShardPrioritization shardPrioritization) {
|
||||||
|
|
@ -1500,7 +1488,6 @@ public class WorkerTest {
|
||||||
parentShardPollIntervalMillis,
|
parentShardPollIntervalMillis,
|
||||||
shardSyncIdleTimeMillis,
|
shardSyncIdleTimeMillis,
|
||||||
cleanupLeasesUponShardCompletion,
|
cleanupLeasesUponShardCompletion,
|
||||||
ignoreUnexpectedChildShards,
|
|
||||||
checkpoint,
|
checkpoint,
|
||||||
leaseCoordinator,
|
leaseCoordinator,
|
||||||
execService,
|
execService,
|
||||||
|
|
@ -1823,7 +1810,6 @@ public class WorkerTest {
|
||||||
parentShardPollIntervalMillis,
|
parentShardPollIntervalMillis,
|
||||||
shardSyncIntervalMillis,
|
shardSyncIntervalMillis,
|
||||||
cleanupLeasesUponShardCompletion,
|
cleanupLeasesUponShardCompletion,
|
||||||
ignoreUnexpectedChildShards,
|
|
||||||
leaseCoordinator,
|
leaseCoordinator,
|
||||||
leaseCoordinator,
|
leaseCoordinator,
|
||||||
executorService,
|
executorService,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue