library/src/main/java/com/kdgregory/aws/utils/kinesis/KinesisWriter.java
/**
     *  Attempts to send the current batch. This may or may not be successful: individual
     *  records may be throttled, the entire batch may be throttled, or other exceptions
     *  may occur. In the case of throttling or individual record errors, the call apears
     *  to be successful; other exceptions are propagated to the caller. In either case,
     *  unsent records are retained by the writer and may be resent.
     *  <p>
     *  After sending, you may call {@link #getSendResults} to see the raw results from
     *  Kinesis (this is useful if you need sequence numbers or want to examine error
     *  messages). Note, however, that these responses correspond to the <em>original</em>
     *  records sent; you must call {@link #getUnsentRecords} <em>before</em> sending
     *  to correlate response with request.
     */
Attempts to send the current batch. This may or may not be successful: individual
records may be throttled, the entire batch may be throttled, or other exceptions
may occur. In the case of throttling or individual record errors, the call apears
to be successful; other exceptions are propagated to the caller. In either case,
unsent records are retained by the writer and may be resent.

After sending, you may call  #getSendResults to see the raw results from
Kinesis (this is useful if you need sequence numbers or want to examine error
messages). Note, however, that these responses correspond to the original
records sent; you must call  #getUnsentRecords before sending
to correlate response with request.
Attempts to send the current batch . This may or may not be successful : individual records may be throttled the entire batch may be throttled or other exceptions may occur . In the case of throttling or individual record errors the call apears to be successful ; other exceptions are propagated to the caller . In either case unsent records are retained by the writer and may be resent . After sending you may call #getSendResults to see the raw results from Kinesis ( this is useful if you need sequence numbers or want to examine error messages ) . Note however that these responses correspond to the original records sent ; you must call #getUnsentRecords before sending to correlate response with request .
public void send()
    {
        if (unsentRecords.isEmpty())
        {
            logger.warn("attempted empty send to " + streamName);
            return;
        }
        lastSendResults = Collections.emptyList();
        try
        {
            PutRecordsRequest request = new PutRecordsRequest()
                                        .withStreamName(streamName)
                                        .withRecords(unsentRecords);
            PutRecordsResult response = client.putRecords(request);
            populateSendResults(unsentRecords, response.getRecords());
        }
        catch (ProvisionedThroughputExceededException ex)
        {
            logger.warn("provisioned throughput exceeded for stream " + streamName);
            return;
        }
        processResults();
    }
public void send ( ) { if ( unsentRecords . isEmpty ( ) ) { logger . warn ( "attempted empty send to " + streamName ) ; return ; } lastSendResults = Collections . emptyList ( ) ; try { PutRecordsRequest request = new PutRecordsRequest ( ) . withStreamName ( streamName ) . withRecords ( unsentRecords ) ; PutRecordsResult response = client . putRecords ( request ) ; populateSendResults ( unsentRecords , response . getRecords ( ) ) ; } catch ( ProvisionedThroughputExceededException ex ) { logger . warn ( "provisioned throughput exceeded for stream " + streamName ) ; return ; } processResults ( ) ; }
Attempts to send the current batch.
Attempts to send the current batch .
// this will prevent misinterpretation of results in case of exception