library/src/test/java/com/kdgregory/aws/utils/kinesis/TestKinesisReader.java
/**
     *  Retrieves all records from a single iteration of the reader. Verifies
     *  that the reader's offsets are updated after each record is read.
     */
Retrieves all records from a single iteration of the reader. Verifies
that the reader's offsets are updated after each record is read.
Retrieves all records from a single iteration of the reader . Verifies that the reader ' s offsets are updated after each record is read .
private static List<String> retrieveRecords(KinesisReader reader)
    throws Exception
    {
        List<String> retrievedRecords = new ArrayList<String>();
        for (Record record : reader)
        {
            byte[] recordData = BinaryUtils.copyAllBytesFrom(record.getData());
            retrievedRecords.add(new String(recordData, "UTF-8"));
            assertEquals("offsets have been updated",
                         record.getSequenceNumber(),
                         reader.getCurrentSequenceNumbers().get(extractShardIdFromSeqnum(record.getSequenceNumber())));
        }
        return retrievedRecords;
    }
private static List < String > retrieveRecords ( KinesisReader reader ) throws Exception { List < String > retrievedRecords = new ArrayList < String > ( ) ; for ( Record record : reader ) { byte [ ] recordData = BinaryUtils . copyAllBytesFrom ( record . getData ( ) ) ; retrievedRecords . add ( new String ( recordData , "UTF-8" ) ) ; assertEquals ( "offsets have been updated" , record . getSequenceNumber ( ) , reader . getCurrentSequenceNumbers ( ) . get ( extractShardIdFromSeqnum ( record . getSequenceNumber ( ) ) ) ) ; } return retrievedRecords ; }
Retrieves all records from a single iteration of the reader.
Retrieves all records from a single iteration of the reader .