本文整理了Java中com.amazonaws.services.kinesis.model.Record.setData
方法的一些代码示例,展示了Record.setData
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Record.setData
方法的具体详情如下:
包路径:com.amazonaws.services.kinesis.model.Record
类名称:Record
方法名:setData
[英]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).
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.
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.
[中]数据块。blob中的数据对Kinesis数据流来说既不透明又不可变,Kinesis数据流不会以任何方式检查、解释或更改blob中的数据。将数据blob(base64编码之前的有效负载)添加到分区密钥大小时,总大小不得超过最大记录大小(1MB)。
AWS SDK for Java在将此请求发送到AWS服务之前对该字段执行Base64编码。SDK用户不应在此字段上执行Base64编码。
警告:SDK返回的字节缓冲区是可变的。字节缓冲区的内容或位置的更改将被所有引用该对象的对象看到。建议致电ByteBuffer。复制()或字节缓冲。asReadOnlyBuffer()在使用或读取缓冲区之前。这种行为将在SDK的未来主要版本中更改。
代码示例来源:origin: aws/aws-sdk-java
/**
* <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;
}
代码示例来源:origin: aws/aws-sdk-java
record.setData(context.getUnmarshaller(java.nio.ByteBuffer.class).unmarshall(context));
代码示例来源:origin: aws-amplify/aws-sdk-android
.unmarshall(context));
} else if (name.equals("Data")) {
record.setData(ByteBufferJsonUnmarshaller.getInstance()
.unmarshall(context));
} else if (name.equals("PartitionKey")) {
代码示例来源:origin: com.amazonaws/aws-java-sdk-kinesis
/**
* <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;
}
代码示例来源:origin: amazon-archives/kinesis-storm-spout
/**
* 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;
}
代码示例来源:origin: com.amazonaws/aws-java-sdk-kinesis
record.setData(context.getUnmarshaller(java.nio.ByteBuffer.class).unmarshall(context));
内容来源于网络,如有侵权,请联系作者删除!