library/src/main/java/com/kdgregory/aws/utils/kinesis/KinesisUtil.java
/**
     *  Deletes a stream, retrying if throttled. Does not wait for the stream to go
     *  away; call {@link #waitForStatus} to do that.
     *
     *  @param  client      The AWS client used to make requests.
     *  @param  streamName  The name of the stream.
     *  @param  timeout     The maximum amount of time (millis) that we'll spend trying to
     *                      delete the stream.
     *
     *  @return true if the <code>deleteStream</code> request completed successfully,
     *          <code>false</code> if it failed for any reason (timed out or the stream
     *          did not exist).
     */
Deletes a stream, retrying if throttled. Does not wait for the stream to go
away; call  #waitForStatus to do that.

@param  client      The AWS client used to make requests.
@param  streamName  The name of the stream.
@param  timeout     The maximum amount of time (millis) that we'll spend trying to
delete the stream.

@return true if the deleteStream request completed successfully,
false if it failed for any reason (timed out or the stream
did not exist).
Deletes a stream retrying if throttled . Does not wait for the stream to go away ; call #waitForStatus to do that . @param client The AWS client used to make requests . @param streamName The name of the stream . @param timeout The maximum amount of time ( millis ) that we ' ll spend trying to delete the stream . @return true if the deleteStream request completed successfully false if it failed for any reason ( timed out or the stream did not exist ) .
public static boolean deleteStream(AmazonKinesis client, String streamName, long timeout)
    {
        logger.debug("deleteStream: " + streamName);
        long timeoutAt = System.currentTimeMillis() + timeout;
        long currentSleep = 100;
        while (System.currentTimeMillis() < timeoutAt)
        {
            try
            {
                client.deleteStream(new DeleteStreamRequest().withStreamName(streamName));
                return true;
            }
            catch (LimitExceededException ex)
            {
                CommonUtils.sleepQuietly(currentSleep);
                currentSleep *= 2;
            }
            catch (ResourceNotFoundException ex)
            {
                logger.warn("deleteStream called for nonexistent stream: " + streamName);
                return false;
            }
        }
        logger.warn("deleteStream timeout: " + streamName);
        return false;
    }
public static boolean deleteStream ( AmazonKinesis client , String streamName , long timeout ) { logger . debug ( "deleteStream: " + streamName ) ; long timeoutAt = System . currentTimeMillis ( ) + timeout ; long currentSleep = 100 ; while ( System . currentTimeMillis ( ) < timeoutAt ) { try { client . deleteStream ( new DeleteStreamRequest ( ) . withStreamName ( streamName ) ) ; return true ; } catch ( LimitExceededException ex ) { CommonUtils . sleepQuietly ( currentSleep ) ; currentSleep *= 2 ; } catch ( ResourceNotFoundException ex ) { logger . warn ( "deleteStream called for nonexistent stream: " + streamName ) ; return false ; } } logger . warn ( "deleteStream timeout: " + streamName ) ; return false ; }
Deletes a stream, retrying if throttled.
Deletes a stream retrying if throttled .