Class DynamoDBStreamsShardHandle


  • public class DynamoDBStreamsShardHandle
    extends StreamShardHandle
    DynamoDB streams shard handle format and utilities.
    • Field Detail

      • SHARDID_PREFIX_LEN

        public static final int SHARDID_PREFIX_LEN
    • Constructor Detail

      • DynamoDBStreamsShardHandle

        public DynamoDBStreamsShardHandle​(String streamName,
                                          com.amazonaws.services.kinesis.model.Shard shard)
    • Method Detail

      • compareShardIds

        public static int compareShardIds​(String firstShardId,
                                          String secondShardId)
      • isValidShardId

        public static boolean isValidShardId​(String shardId)
        Dynamodb streams shard ID is a char string ranging from 28 characters to 65 characters. (See https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_Shard.html)

        The shardId observed usually takes the format of: "shardId-00000001536805703746-69688cb1", where "shardId-" is a prefix, followed by a 20-digit timestamp string and 0-36 or more characters, separated by '-'. Following this format, it is expected the child shards created during a re-sharding event have shardIds bigger than their parents.

        Parameters:
        shardId - shard Id
        Returns:
        boolean indicate if the given shard Id is valid