library/src/main/java/com/kdgregory/aws/utils/kinesis/KinesisUtil.java
/**
     *  Executes a single <code>DescribeStream</code> request, returning the stream
     *  description from the response. Will return null if the stream does not exist,
     *  cannot be read within the specified timeout, or if the thread is interrupted.
     *  <p>
     *  This variant is primarily for internal use, to handle paginated shard lists.
     *  If you're interested in other parts of the description, such as stream status,
     *  it's easier to call the variant that takes a stream name.
     *
     *  @param  client          The AWS client used to make requests.
     *  @param  request         The request that's passed to the client.
     *  @param  timeout         The total number of milliseconds to attempt retries
     *                          due to throttling. The initial retry is 100 millis,
     *                          and this doubles for each retry.
     */
Executes a single DescribeStream request, returning the stream
description from the response. Will return null if the stream does not exist,
cannot be read within the specified timeout, or if the thread is interrupted.

This variant is primarily for internal use, to handle paginated shard lists.
If you're interested in other parts of the description, such as stream status,
it's easier to call the variant that takes a stream name.

@param  client          The AWS client used to make requests.
@param  request         The request that's passed to the client.
@param  timeout         The total number of milliseconds to attempt retries
due to throttling. The initial retry is 100 millis,
and this doubles for each retry.
Executes a single DescribeStream request returning the stream description from the response . Will return null if the stream does not exist cannot be read within the specified timeout or if the thread is interrupted . This variant is primarily for internal use to handle paginated shard lists . If you ' re interested in other parts of the description such as stream status it ' s easier to call the variant that takes a stream name . @param client The AWS client used to make requests . @param request The request that ' s passed to the client . @param timeout The total number of milliseconds to attempt retries due to throttling . The initial retry is 100 millis and this doubles for each retry .
public static StreamDescription describeStream(AmazonKinesis client, DescribeStreamRequest request, long timeout)
    {
        long currentSleep = 100;
        long timeoutAt = System.currentTimeMillis() + timeout;
        while (System.currentTimeMillis() < timeoutAt)
        {
            try
            {
                return client.describeStream(request).getStreamDescription();
            }
            catch (ResourceNotFoundException ex)
            {
                return null;
            }
            catch (LimitExceededException ex)
            {
                if (CommonUtils.sleepQuietly(currentSleep)) return null;
                currentSleep *= 2;
            }
        }
        logger.warn("describeStream timeout: " + request.getStreamName());
        return null;
    }
public static StreamDescription describeStream ( AmazonKinesis client , DescribeStreamRequest request , long timeout ) { long currentSleep = 100 ; long timeoutAt = System . currentTimeMillis ( ) + timeout ; while ( System . currentTimeMillis ( ) < timeoutAt ) { try { return client . describeStream ( request ) . getStreamDescription ( ) ; } catch ( ResourceNotFoundException ex ) { return null ; } catch ( LimitExceededException ex ) { if ( CommonUtils . sleepQuietly ( currentSleep ) ) return null ; currentSleep *= 2 ; } } logger . warn ( "describeStream timeout: " + request . getStreamName ( ) ) ; return null ; }
Executes a single <code>DescribeStream</code> request, returning the stream
  description from the response.
Executes a single <code > DescribeStream< / code > request returning the stream description from the response .