removed backward compatibility code/constructors
This commit is contained in:
parent
43063e1dd0
commit
37562aa082
4 changed files with 6 additions and 176 deletions
|
|
@ -124,34 +124,6 @@ public final class LeaseAssignmentManager {
|
|||
private int noOfContinuousFailedAttempts = 0;
|
||||
private int lamRunCounter = 0;
|
||||
|
||||
@Deprecated
|
||||
public LeaseAssignmentManager(
|
||||
final LeaseRefresher leaseRefresher,
|
||||
final WorkerMetricStatsDAO workerMetricsDAO,
|
||||
final LeaderDecider leaderDecider,
|
||||
final LeaseManagementConfig.WorkerUtilizationAwareAssignmentConfig config,
|
||||
final String workerIdentifier,
|
||||
final Long leaseDurationMillis,
|
||||
final MetricsFactory metricsFactory,
|
||||
final ScheduledExecutorService executorService,
|
||||
final Supplier<Long> nanoTimeProvider,
|
||||
final int maxLeasesForWorker,
|
||||
final LeaseManagementConfig.GracefulLeaseHandoffConfig gracefulLeaseHandoffConfig) {
|
||||
this(
|
||||
leaseRefresher,
|
||||
workerMetricsDAO,
|
||||
leaderDecider,
|
||||
config,
|
||||
workerIdentifier,
|
||||
leaseDurationMillis,
|
||||
metricsFactory,
|
||||
executorService,
|
||||
nanoTimeProvider,
|
||||
maxLeasesForWorker,
|
||||
gracefulLeaseHandoffConfig,
|
||||
leaseDurationMillis * DEFAULT_LEASE_ASSIGNMENT_MANAGER_FREQ_MULTIPLIER);
|
||||
}
|
||||
|
||||
public synchronized void start() {
|
||||
if (isNull(managerFuture)) {
|
||||
// LAM can be dynamically started/stopped and restarted during MigrationStateMachine execution
|
||||
|
|
|
|||
|
|
@ -194,41 +194,6 @@ public class DynamoDBLeaseCoordinator implements LeaseCoordinator {
|
|||
maxLeasesToStealAtOneTime);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public DynamoDBLeaseCoordinator(
|
||||
final LeaseRefresher leaseRefresher,
|
||||
final String workerIdentifier,
|
||||
final long leaseDurationMillis,
|
||||
final boolean enablePriorityLeaseAssignment,
|
||||
final long epsilonMillis,
|
||||
final int maxLeasesForWorker,
|
||||
final int maxLeasesToStealAtOneTime,
|
||||
final int maxLeaseRenewerThreadCount,
|
||||
final long initialLeaseTableReadCapacity,
|
||||
final long initialLeaseTableWriteCapacity,
|
||||
final MetricsFactory metricsFactory,
|
||||
final LeaseManagementConfig.WorkerUtilizationAwareAssignmentConfig workerUtilizationAwareAssignmentConfig,
|
||||
final LeaseManagementConfig.GracefulLeaseHandoffConfig gracefulLeaseHandoffConfig,
|
||||
final ConcurrentMap<ShardInfo, ShardConsumer> shardInfoShardConsumerMap) {
|
||||
|
||||
this(
|
||||
leaseRefresher,
|
||||
workerIdentifier,
|
||||
leaseDurationMillis,
|
||||
enablePriorityLeaseAssignment,
|
||||
epsilonMillis,
|
||||
maxLeasesForWorker,
|
||||
maxLeasesToStealAtOneTime,
|
||||
maxLeaseRenewerThreadCount,
|
||||
initialLeaseTableReadCapacity,
|
||||
initialLeaseTableWriteCapacity,
|
||||
metricsFactory,
|
||||
workerUtilizationAwareAssignmentConfig,
|
||||
gracefulLeaseHandoffConfig,
|
||||
shardInfoShardConsumerMap,
|
||||
2 * leaseDurationMillis);
|
||||
}
|
||||
|
||||
@RequiredArgsConstructor
|
||||
private class LeaseDiscoveryRunnable implements Runnable {
|
||||
private final MigrationAdaptiveLeaseAssignmentModeProvider leaseAssignmentModeProvider;
|
||||
|
|
|
|||
|
|
@ -220,116 +220,6 @@ public class DynamoDBLeaseManagementFactory implements LeaseManagementFactory {
|
|||
this.leaseAssignmentIntervalMillis = leaseAssignmentIntervalMillis;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* @param kinesisClient
|
||||
* @param dynamoDBClient
|
||||
* @param tableName
|
||||
* @param workerIdentifier
|
||||
* @param executorService
|
||||
* @param failoverTimeMillis
|
||||
* @param enablePriorityLeaseAssignment
|
||||
* @param epsilonMillis
|
||||
* @param maxLeasesForWorker
|
||||
* @param maxLeasesToStealAtOneTime
|
||||
* @param maxLeaseRenewalThreads
|
||||
* @param cleanupLeasesUponShardCompletion
|
||||
* @param ignoreUnexpectedChildShards
|
||||
* @param shardSyncIntervalMillis
|
||||
* @param consistentReads
|
||||
* @param listShardsBackoffTimeMillis
|
||||
* @param maxListShardsRetryAttempts
|
||||
* @param maxCacheMissesBeforeReload
|
||||
* @param listShardsCacheAllowedAgeInSeconds
|
||||
* @param cacheMissWarningModulus
|
||||
* @param initialLeaseTableReadCapacity
|
||||
* @param initialLeaseTableWriteCapacity
|
||||
* @param tableCreatorCallback
|
||||
* @param dynamoDbRequestTimeout
|
||||
* @param billingMode
|
||||
* @param leaseTableDeletionProtectionEnabled
|
||||
* @param leaseTablePitrEnabled
|
||||
* @param leaseSerializer
|
||||
* @param customShardDetectorProvider
|
||||
* @param isMultiStreamMode
|
||||
* @param leaseCleanupConfig
|
||||
* @param workerUtilizationAwareAssignmentConfig
|
||||
* @param gracefulLeaseHandoffConfig
|
||||
*/
|
||||
@Deprecated
|
||||
public DynamoDBLeaseManagementFactory(
|
||||
final @NotNull KinesisAsyncClient kinesisClient,
|
||||
final @NotNull DynamoDbAsyncClient dynamoDBClient,
|
||||
final @NotNull String tableName,
|
||||
final @NotNull String workerIdentifier,
|
||||
final @NotNull ExecutorService executorService,
|
||||
final long failoverTimeMillis,
|
||||
final boolean enablePriorityLeaseAssignment,
|
||||
final long epsilonMillis,
|
||||
final int maxLeasesForWorker,
|
||||
final int maxLeasesToStealAtOneTime,
|
||||
final int maxLeaseRenewalThreads,
|
||||
final boolean cleanupLeasesUponShardCompletion,
|
||||
final boolean ignoreUnexpectedChildShards,
|
||||
final long shardSyncIntervalMillis,
|
||||
final boolean consistentReads,
|
||||
final long listShardsBackoffTimeMillis,
|
||||
final int maxListShardsRetryAttempts,
|
||||
final int maxCacheMissesBeforeReload,
|
||||
final long listShardsCacheAllowedAgeInSeconds,
|
||||
final int cacheMissWarningModulus,
|
||||
final long initialLeaseTableReadCapacity,
|
||||
final long initialLeaseTableWriteCapacity,
|
||||
final TableCreatorCallback tableCreatorCallback,
|
||||
final Duration dynamoDbRequestTimeout,
|
||||
final BillingMode billingMode,
|
||||
final boolean leaseTableDeletionProtectionEnabled,
|
||||
final boolean leaseTablePitrEnabled,
|
||||
final Collection<Tag> tags,
|
||||
final @NotNull LeaseSerializer leaseSerializer,
|
||||
final Function<StreamConfig, ShardDetector> customShardDetectorProvider,
|
||||
boolean isMultiStreamMode,
|
||||
final LeaseCleanupConfig leaseCleanupConfig,
|
||||
final LeaseManagementConfig.WorkerUtilizationAwareAssignmentConfig workerUtilizationAwareAssignmentConfig,
|
||||
final LeaseManagementConfig.GracefulLeaseHandoffConfig gracefulLeaseHandoffConfig) {
|
||||
this(
|
||||
kinesisClient,
|
||||
dynamoDBClient,
|
||||
tableName,
|
||||
workerIdentifier,
|
||||
executorService,
|
||||
failoverTimeMillis,
|
||||
enablePriorityLeaseAssignment,
|
||||
epsilonMillis,
|
||||
maxLeasesForWorker,
|
||||
maxLeasesToStealAtOneTime,
|
||||
maxLeaseRenewalThreads,
|
||||
cleanupLeasesUponShardCompletion,
|
||||
ignoreUnexpectedChildShards,
|
||||
shardSyncIntervalMillis,
|
||||
consistentReads,
|
||||
listShardsBackoffTimeMillis,
|
||||
maxListShardsRetryAttempts,
|
||||
maxCacheMissesBeforeReload,
|
||||
listShardsCacheAllowedAgeInSeconds,
|
||||
cacheMissWarningModulus,
|
||||
initialLeaseTableReadCapacity,
|
||||
initialLeaseTableWriteCapacity,
|
||||
tableCreatorCallback,
|
||||
dynamoDbRequestTimeout,
|
||||
billingMode,
|
||||
leaseTableDeletionProtectionEnabled,
|
||||
leaseTablePitrEnabled,
|
||||
tags,
|
||||
leaseSerializer,
|
||||
customShardDetectorProvider,
|
||||
isMultiStreamMode,
|
||||
leaseCleanupConfig,
|
||||
workerUtilizationAwareAssignmentConfig,
|
||||
gracefulLeaseHandoffConfig,
|
||||
2 * failoverTimeMillis);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LeaseCoordinator createLeaseCoordinator(@NonNull final MetricsFactory metricsFactory) {
|
||||
return createLeaseCoordinator(metricsFactory, new ConcurrentHashMap<>());
|
||||
|
|
|
|||
|
|
@ -749,7 +749,8 @@ class LeaseAssignmentManagerTest {
|
|||
Integer.MAX_VALUE,
|
||||
LeaseManagementConfig.GracefulLeaseHandoffConfig.builder()
|
||||
.isGracefulLeaseHandoffEnabled(false)
|
||||
.build());
|
||||
.build(),
|
||||
2 * 100L);
|
||||
|
||||
leaseAssignmentManager.start();
|
||||
|
||||
|
|
@ -1153,7 +1154,8 @@ class LeaseAssignmentManagerTest {
|
|||
mockExecutor,
|
||||
System::nanoTime,
|
||||
Integer.MAX_VALUE,
|
||||
gracefulLeaseHandoffConfig);
|
||||
gracefulLeaseHandoffConfig,
|
||||
2 * failoverTimeMillis);
|
||||
|
||||
leaseAssignmentManager.start();
|
||||
|
||||
|
|
@ -1209,7 +1211,8 @@ class LeaseAssignmentManagerTest {
|
|||
scheduledExecutorService,
|
||||
nanoTimeProvider,
|
||||
maxLeasesPerWorker,
|
||||
gracefulLeaseHandoffConfig);
|
||||
gracefulLeaseHandoffConfig,
|
||||
2 * leaseDurationMillis);
|
||||
leaseAssignmentManager.start();
|
||||
return leaseAssignmentManager;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue