Class DynamoDBStreamsShardDetector

java.lang.Object
com.amazonaws.services.dynamodbv2.streamsadapter.DynamoDBStreamsShardDetector
All Implemented Interfaces:
software.amazon.kinesis.leases.ShardDetector

public class DynamoDBStreamsShardDetector extends Object implements software.amazon.kinesis.leases.ShardDetector
Retrieves a Shard object from the cache based on the provided shardId.
 Start
   │
   ▼
 Is Cache Empty? ──Yes──► Synchronized Block
   │                         │
   No                       ▼
   │                     Initialize Cache
   ▼
 Get Shard from Cache
   │
   ▼
 Shard Found? ──No──► Increment Cache Misses
   │                         │
   Yes                      ▼
   │               Need Refresh? ──Yes──► Synchronized Block
   │                         │                │
   │                        No               ▼
   │                         │            Refresh Cache
   │                         │                │
   │                         │                ▼
   │                         │            Reset Counter
   │                         │                │
   ▼                         ▼                ▼
 Return Shard ◄────────────────────────────────
 
shardId The unique identifier of the shard to retrieve
  • Constructor Summary

    Constructors
    Constructor
    Description
    DynamoDBStreamsShardDetector(@NonNull software.amazon.awssdk.services.kinesis.KinesisAsyncClient kinesisAsyncClient, @NonNull software.amazon.kinesis.common.StreamIdentifier streamIdentifier, long listShardsCacheAllowedAgeInSeconds, int maxCacheMissesBeforeReload, int cacheMissWarningModulus, Duration kinesisRequestTimeout)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    describeStream(String lastSeenShardId, String consumerId)
     
    List<software.amazon.awssdk.services.kinesis.model.Shard>
     
    List<software.amazon.awssdk.services.kinesis.model.Shard>
    listShards(String consumerId)
     
    software.amazon.awssdk.services.kinesis.model.Shard
    shard(String shardId)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.kinesis.leases.ShardDetector

    getChildShards, getListShardsResponse, listShardsWithFilter, listShardsWithFilter, listShardsWithoutConsumingResourceNotFoundException, listShardsWithoutConsumingResourceNotFoundException, streamIdentifier
  • Constructor Details

    • DynamoDBStreamsShardDetector

      public DynamoDBStreamsShardDetector(@NonNull @NonNull software.amazon.awssdk.services.kinesis.KinesisAsyncClient kinesisAsyncClient, @NonNull @NonNull software.amazon.kinesis.common.StreamIdentifier streamIdentifier, long listShardsCacheAllowedAgeInSeconds, int maxCacheMissesBeforeReload, int cacheMissWarningModulus, Duration kinesisRequestTimeout)
  • Method Details

    • shard

      public software.amazon.awssdk.services.kinesis.model.Shard shard(String shardId)
      Specified by:
      shard in interface software.amazon.kinesis.leases.ShardDetector
    • listShards

      public List<software.amazon.awssdk.services.kinesis.model.Shard> listShards()
      Specified by:
      listShards in interface software.amazon.kinesis.leases.ShardDetector
    • listShards

      public List<software.amazon.awssdk.services.kinesis.model.Shard> listShards(String consumerId)
      Specified by:
      listShards in interface software.amazon.kinesis.leases.ShardDetector
    • describeStream

      public DescribeStreamResult describeStream(String lastSeenShardId, String consumerId)