Class StreamsLeaseCleanupValidator
java.lang.Object
com.amazonaws.services.dynamodbv2.streamsadapter.util.StreamsLeaseCleanupValidator
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisCandidateForCleanup(software.amazon.kinesis.leases.Lease lease, Set<String> currentKinesisShardIds) Overloaded method that defaults to single-stream mode for backward compatibility.static booleanisCandidateForCleanup(software.amazon.kinesis.leases.Lease lease, Set<String> currentKinesisShardIds, boolean isMultiStreamMode) Validates if a lease is candidate for cleanup in multi-stream mode.
-
Method Details
-
isCandidateForCleanup
public static boolean isCandidateForCleanup(software.amazon.kinesis.leases.Lease lease, Set<String> currentKinesisShardIds, boolean isMultiStreamMode) throws software.amazon.kinesis.exceptions.internal.KinesisClientLibIOException Validates if a lease is candidate for cleanup in multi-stream mode.- Parameters:
lease- Candidate shard we are considering for deletion.currentKinesisShardIds- List of leases currently held by the worker.isMultiStreamMode- Whether running in multi-stream mode- Returns:
- true if neither the shard (corresponding to the lease), nor its parents are present in currentKinesisShardIds
- Throws:
software.amazon.kinesis.exceptions.internal.KinesisClientLibIOException- Thrown if currentKinesisShardIds contains a parent shard but not the child shard (we are evaluating for deletion).
-
isCandidateForCleanup
public static boolean isCandidateForCleanup(software.amazon.kinesis.leases.Lease lease, Set<String> currentKinesisShardIds) throws software.amazon.kinesis.exceptions.internal.KinesisClientLibIOException Overloaded method that defaults to single-stream mode for backward compatibility.- Throws:
software.amazon.kinesis.exceptions.internal.KinesisClientLibIOException
-