library/src/main/java/com/kdgregory/aws/utils/kinesis/KinesisWriter.java
/**
     *  Attempts to send the current batch of records, calling {@link #send} with a delay
     *  until they're all sent or the passed timeout expires. Timeout is silent; call
     *  {@link #getUnsentRecords} to verify that all records were sent.
     *  <p>
     *  After calling this method, {@link #getSendResults} returns the concatentation of
     *  all results from the individual sends. This will reflect the effect of potential
     *  re-sends, so a source record may appear in the results multiple times and in
     *  arbitrary order. The results, however, are still relevant with regard to sequence
     *  numbers and error details.
     *  <p>
     *  If an exception is thrown by <code>send()</code> it will be propagated, but the
     *  list of results will reflect what has already been done.
     */
Attempts to send the current batch of records, calling  #send with a delay
until they're all sent or the passed timeout expires. Timeout is silent; call
#getUnsentRecords to verify that all records were sent.

After calling this method,  #getSendResults returns the concatentation of
all results from the individual sends. This will reflect the effect of potential
re-sends, so a source record may appear in the results multiple times and in
arbitrary order. The results, however, are still relevant with regard to sequence
numbers and error details.

If an exception is thrown by send() it will be propagated, but the
list of results will reflect what has already been done.
Attempts to send the current batch of records calling #send with a delay until they ' re all sent or the passed timeout expires . Timeout is silent ; call #getUnsentRecords to verify that all records were sent . After calling this method #getSendResults returns the concatentation of all results from the individual sends . This will reflect the effect of potential re - sends so a source record may appear in the results multiple times and in arbitrary order . The results however are still relevant with regard to sequence numbers and error details . If an exception is thrown by send () it will be propagated but the list of results will reflect what has already been done .
public void sendAll(long timeoutMillis)
    {
        List<SendResult> aggregatedSendResults = new ArrayList<KinesisWriter.SendResult>();
        long timeoutAt = System.currentTimeMillis() + timeoutMillis;
        while ((unsentRecords.size() > 0) && (System.currentTimeMillis() < timeoutAt))
        {
            try
            {
                send();
                aggregatedSendResults.addAll(lastSendResults);
            }
            catch (RuntimeException ex)
            {
                lastSendResults = aggregatedSendResults;
                throw ex;
            }
            if (unsentRecords.size() > 0)
            {
                CommonUtils.sleepQuietly(250);
            }
        }
        lastSendResults = aggregatedSendResults;
    }
public void sendAll ( long timeoutMillis ) { List < SendResult > aggregatedSendResults = new ArrayList < KinesisWriter . SendResult > ( ) ; long timeoutAt = System . currentTimeMillis ( ) + timeoutMillis ; while ( ( unsentRecords . size ( ) > 0 ) && ( System . currentTimeMillis ( ) < timeoutAt ) ) { try { send ( ) ; aggregatedSendResults . addAll ( lastSendResults ) ; } catch ( RuntimeException ex ) { lastSendResults = aggregatedSendResults ; throw ex ; } if ( unsentRecords . size ( ) > 0 ) { CommonUtils . sleepQuietly ( 250 ) ; } } lastSendResults = aggregatedSendResults ; }
Attempts to send the current batch of records, calling {@link #send} with a delay
  until they're all sent or the passed timeout expires.
Attempts to send the current batch of records calling { @link #send } with a delay until they ' re all sent or the passed timeout expires .