Class StreamShardHandle

  • Direct Known Subclasses:
    DynamoDBStreamsShardHandle

    @Internal
    public class StreamShardHandle
    extends Object
    A wrapper class around the information provided along with streamName and Shard, with some extra utility methods to determine whether or not a shard is closed and whether or not the shard is a result of parent shard splits or merges.
    • Constructor Detail

      • StreamShardHandle

        public StreamShardHandle​(String streamName,
                                 com.amazonaws.services.kinesis.model.Shard shard)
        Create a new StreamShardHandle.
        Parameters:
        streamName - the name of the Kinesis stream that this shard belongs to
        shard - the actual AWS Shard instance that will be wrapped within this StreamShardHandle
    • Method Detail

      • getStreamName

        public String getStreamName()
      • isClosed

        public boolean isClosed()
      • getShard

        public com.amazonaws.services.kinesis.model.Shard getShard()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • compareShardIds

        public static int compareShardIds​(String firstShardId,
                                          String secondShardId)
        Utility function to compare two shard ids.
        Parameters:
        firstShardId - first shard id to compare
        secondShardId - second shard id to compare
        Returns:
        a value less than 0 if the first shard id is smaller than the second shard id, or a value larger than 0 the first shard is larger than the second shard id, or 0 if they are equal