Example usage for com.amazonaws.services.kinesis.model Record Record

List of usage examples for com.amazonaws.services.kinesis.model Record Record

Introduction

In this page you can find the example usage for com.amazonaws.services.kinesis.model Record Record.

Prototype

Record

Source Link

Usage

From source file:org.apache.beam.sdk.io.kinesis.source.KinesisRecordCoder.java

License:Apache License

@Override
public KinesisRecord decode(InputStream inStream, Context context) throws CoderException, IOException {
    Context nested = context.nested();
    ByteBuffer data = ByteBuffer.wrap(byteArrayCoder.decode(inStream, nested));
    String sequenceNumber = stringCoder.decode(inStream, nested);
    String partitionKey = stringCoder.decode(inStream, nested);
    Date approximateArrivalTimestamp = instantCoder.decode(inStream, nested).toDate();
    long subSequenceNumber = varLongCoder.decode(inStream, nested);
    Date readTimestamp = instantCoder.decode(inStream, nested).toDate();
    String streamName = stringCoder.decode(inStream, nested);
    String shardId = stringCoder.decode(inStream, nested);
    Record record = new Record().withData(data).withSequenceNumber(sequenceNumber)
            .withPartitionKey(partitionKey).withApproximateArrivalTimestamp(approximateArrivalTimestamp);
    return new KinesisRecord(record, subSequenceNumber, readTimestamp, streamName, shardId);
}