/** * <p> * The data blob. The data in the blob is both opaque and immutable to Kinesis Data Streams, which does not inspect, * interpret, or change the data in the blob in any way. When the data blob (the payload before base64-encoding) is * added to the partition key size, the total size must not exceed the maximum record size (1 MB). * </p> * <p> * The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service. * Users of the SDK should not perform Base64 encoding on this field. * </p> * <p> * Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will * be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or * ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future * major version of the SDK. * </p> * * @param data * The data blob. The data in the blob is both opaque and immutable to Kinesis Data Streams, which does not * inspect, interpret, or change the data in the blob in any way. When the data blob (the payload before * base64-encoding) is added to the partition key size, the total size must not exceed the maximum record * size (1 MB). * @return Returns a reference to this object so that method calls can be chained together. */ public Record withData(java.nio.ByteBuffer data) { setData(data); return this; }
record.setData(context.getUnmarshaller(java.nio.ByteBuffer.class).unmarshall(context));
.unmarshall(context)); } else if (name.equals("Data")) { record.setData(ByteBufferJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("PartitionKey")) {
/** * <p> * The data blob. The data in the blob is both opaque and immutable to Kinesis Data Streams, which does not inspect, * interpret, or change the data in the blob in any way. When the data blob (the payload before base64-encoding) is * added to the partition key size, the total size must not exceed the maximum record size (1 MB). * </p> * <p> * The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service. * Users of the SDK should not perform Base64 encoding on this field. * </p> * <p> * Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will * be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or * ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future * major version of the SDK. * </p> * * @param data * The data blob. The data in the blob is both opaque and immutable to Kinesis Data Streams, which does not * inspect, interpret, or change the data in the blob in any way. When the data blob (the payload before * base64-encoding) is added to the partition key size, the total size must not exceed the maximum record * size (1 MB). * @return Returns a reference to this object so that method calls can be chained together. */ public Record withData(java.nio.ByteBuffer data) { setData(data); return this; }
/** * Creates a copy of the record so we don't get interference from bolts that execute in the same JVM. * We invoke ByteBuffer.duplicate() so the ByteBuffer state is decoupled. * * @param record Kinesis record * @return Copied record. */ private Record copyRecord(Record record) { Record duplicate = new Record(); duplicate.setPartitionKey(record.getPartitionKey()); duplicate.setSequenceNumber(record.getSequenceNumber()); duplicate.setData(record.getData().duplicate()); return duplicate; }
record.setData(context.getUnmarshaller(java.nio.ByteBuffer.class).unmarshall(context));