private Shard getUniqueShard() {
    """
	Returns the single created shard (stream has a single shard).
    """
        DescribeStreamRequest describeStreamRequest = new DescribeStreamRequest().withStreamName(m_streamName).withLimit(1);
        DescribeStreamResult describeStreamResult = performAmazonActionWithRetry("describe stream " + m_streamName,
                                                                                 () -> m_kinesis.describeStream(describeStreamRequest), DEFAULT_RETRY_COUNT,
                                                                                 DEFAULT_RETRY_DURATION_IN_MILLIS);
        String streamStatus = describeStreamResult.getStreamDescription().getStreamStatus();
        if (streamStatus == null || !streamStatus.equals(ACTIVE_STREAM_STATUS)) {
            throw new AwsKinesisException("Stream does not exist", args -> args.add("streamName", m_streamName));
        }
        List<Shard> shards = describeStreamResult.getStreamDescription().getShards();
        checkState(shards.size() == 1, "Kinesis Stream should contain only one shard",
                   args -> args.add("streamName", m_streamName).add("shardCount", shards.size()));
        return shards.get(0);
    }
private Shard getUniqueShard() {
        DescribeStreamRequest describeStreamRequest = new DescribeStreamRequest().withStreamName(m_streamName).withLimit(1);
        DescribeStreamResult describeStreamResult = performAmazonActionWithRetry("describe stream " + m_streamName,
                                                                                 () -> m_kinesis.describeStream(describeStreamRequest), DEFAULT_RETRY_COUNT,
                                                                                 DEFAULT_RETRY_DURATION_IN_MILLIS);
        String streamStatus = describeStreamResult.getStreamDescription().getStreamStatus();
        if (streamStatus == null || !streamStatus.equals(ACTIVE_STREAM_STATUS)) {
            throw new AwsKinesisException("Stream does not exist", args -> args.add("streamName", m_streamName));
        }
        List<Shard> shards = describeStreamResult.getStreamDescription().getShards();
        checkState(shards.size() == 1, "Kinesis Stream should contain only one shard",
                   args -> args.add("streamName", m_streamName).add("shardCount", shards.size()));
        return shards.get(0);
    }
private Shard getUniqueShard ( ) { DescribeStreamRequest describeStreamRequest = new DescribeStreamRequest ( ) . withStreamName ( m_streamName ) . withLimit ( 1 ) ; DescribeStreamResult describeStreamResult = performAmazonActionWithRetry ( "describe stream " + m_streamName , ( ) -> m_kinesis . describeStream ( describeStreamRequest ) , DEFAULT_RETRY_COUNT , DEFAULT_RETRY_DURATION_IN_MILLIS ) ; String streamStatus = describeStreamResult . getStreamDescription ( ) . getStreamStatus ( ) ; if ( streamStatus == null || ! streamStatus . equals ( ACTIVE_STREAM_STATUS ) ) { throw new AwsKinesisException ( "Stream does not exist" , args -> args . add ( "streamName" , m_streamName ) ) ; } List < Shard > shards = describeStreamResult . getStreamDescription ( ) . getShards ( ) ; checkState ( shards . size ( ) == 1 , "Kinesis Stream should contain only one shard" , args -> args . add ( "streamName" , m_streamName ) . add ( "shardCount" , shards . size ( ) ) ) ; return shards . get ( 0 ) ; }
Returns the single created shard (stream has a single shard).
Returns the single created shard ( stream has a single shard ) .