Class PutRecordRequest
- java.lang.Object
-
- com.amazonaws.AmazonWebServiceRequest
-
- com.amazonaws.services.kinesis.model.PutRecordRequest
-
- All Implemented Interfaces:
ReadLimitInfo
,Serializable
,Cloneable
public class PutRecordRequest extends AmazonWebServiceRequest implements Serializable, Cloneable
Represents the input for
PutRecord
.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.amazonaws.AmazonWebServiceRequest
NOOP
-
-
Constructor Summary
Constructors Constructor Description PutRecordRequest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PutRecordRequest
clone()
Creates a shallow clone of this request.boolean
equals(Object obj)
ByteBuffer
getData()
The data blob to put into the record, which is base64-encoded when the blob is serialized.String
getExplicitHashKey()
The hash value used to explicitly determine the shard the data record is assigned to by overriding the partition key hash.String
getPartitionKey()
Determines which shard in the stream the data record is assigned to.String
getSequenceNumberForOrdering()
Guarantees strictly increasing sequence numbers, for puts from the same client and to the same partition key.String
getStreamName()
The name of the stream to put the data record into.int
hashCode()
void
setData(ByteBuffer data)
The data blob to put into the record, which is base64-encoded when the blob is serialized.void
setExplicitHashKey(String explicitHashKey)
The hash value used to explicitly determine the shard the data record is assigned to by overriding the partition key hash.void
setPartitionKey(String partitionKey)
Determines which shard in the stream the data record is assigned to.void
setSequenceNumberForOrdering(String sequenceNumberForOrdering)
Guarantees strictly increasing sequence numbers, for puts from the same client and to the same partition key.void
setStreamName(String streamName)
The name of the stream to put the data record into.String
toString()
Returns a string representation of this object; useful for testing and debugging.PutRecordRequest
withData(ByteBuffer data)
The data blob to put into the record, which is base64-encoded when the blob is serialized.PutRecordRequest
withExplicitHashKey(String explicitHashKey)
The hash value used to explicitly determine the shard the data record is assigned to by overriding the partition key hash.PutRecordRequest
withPartitionKey(String partitionKey)
Determines which shard in the stream the data record is assigned to.PutRecordRequest
withSequenceNumberForOrdering(String sequenceNumberForOrdering)
Guarantees strictly increasing sequence numbers, for puts from the same client and to the same partition key.PutRecordRequest
withStreamName(String streamName)
The name of the stream to put the data record into.-
Methods inherited from class com.amazonaws.AmazonWebServiceRequest
copyBaseTo, getCloneRoot, getCloneSource, getCustomQueryParameters, getCustomRequestHeaders, getGeneralProgressListener, getReadLimit, getRequestClientOptions, getRequestCredentials, getRequestCredentialsProvider, getRequestMetricCollector, getSdkClientExecutionTimeout, getSdkRequestTimeout, putCustomQueryParameter, putCustomRequestHeader, setGeneralProgressListener, setRequestCredentials, setRequestCredentialsProvider, setRequestMetricCollector, setSdkClientExecutionTimeout, setSdkRequestTimeout, withGeneralProgressListener, withRequestMetricCollector, withSdkClientExecutionTimeout, withSdkRequestTimeout
-
-
-
-
Method Detail
-
setStreamName
public void setStreamName(String streamName)
The name of the stream to put the data record into.
- Parameters:
streamName
- The name of the stream to put the data record into.
-
getStreamName
public String getStreamName()
The name of the stream to put the data record into.
- Returns:
- The name of the stream to put the data record into.
-
withStreamName
public PutRecordRequest withStreamName(String streamName)
The name of the stream to put the data record into.
- Parameters:
streamName
- The name of the stream to put the data record into.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setData
public void setData(ByteBuffer data)
The data blob to put into the record, which is base64-encoded when the blob is serialized. 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).
AWS SDK for Java performs a Base64 encoding on this field before sending this request to AWS service by default. 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.
- Parameters:
data
- The data blob to put into the record, which is base64-encoded when the blob is serialized. 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).
-
getData
public ByteBuffer getData()
The data blob to put into the record, which is base64-encoded when the blob is serialized. 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).
ByteBuffer
s are stateful. Calling theirget
methods changes theirposition
. We recommend usingByteBuffer.asReadOnlyBuffer()
to create a read-only view of the buffer with an independentposition
, and callingget
methods on this rather than directly on the returnedByteBuffer
. Doing so will ensure that anyone else using theByteBuffer
will not be affected by changes to theposition
.- Returns:
- The data blob to put into the record, which is base64-encoded when the blob is serialized. 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).
-
withData
public PutRecordRequest withData(ByteBuffer data)
The data blob to put into the record, which is base64-encoded when the blob is serialized. 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).
- Parameters:
data
- The data blob to put into the record, which is base64-encoded when the blob is serialized. 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).- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setPartitionKey
public void setPartitionKey(String partitionKey)
Determines which shard in the stream the data record is assigned to. Partition keys are Unicode strings with a maximum length limit of 256 characters for each key. Amazon Kinesis uses the partition key as input to a hash function that maps the partition key and associated data to a specific shard. Specifically, an MD5 hash function is used to map partition keys to 128-bit integer values and to map associated data records to shards. As a result of this hashing mechanism, all data records with the same partition key map to the same shard within the stream.
- Parameters:
partitionKey
- Determines which shard in the stream the data record is assigned to. Partition keys are Unicode strings with a maximum length limit of 256 characters for each key. Amazon Kinesis uses the partition key as input to a hash function that maps the partition key and associated data to a specific shard. Specifically, an MD5 hash function is used to map partition keys to 128-bit integer values and to map associated data records to shards. As a result of this hashing mechanism, all data records with the same partition key map to the same shard within the stream.
-
getPartitionKey
public String getPartitionKey()
Determines which shard in the stream the data record is assigned to. Partition keys are Unicode strings with a maximum length limit of 256 characters for each key. Amazon Kinesis uses the partition key as input to a hash function that maps the partition key and associated data to a specific shard. Specifically, an MD5 hash function is used to map partition keys to 128-bit integer values and to map associated data records to shards. As a result of this hashing mechanism, all data records with the same partition key map to the same shard within the stream.
- Returns:
- Determines which shard in the stream the data record is assigned to. Partition keys are Unicode strings with a maximum length limit of 256 characters for each key. Amazon Kinesis uses the partition key as input to a hash function that maps the partition key and associated data to a specific shard. Specifically, an MD5 hash function is used to map partition keys to 128-bit integer values and to map associated data records to shards. As a result of this hashing mechanism, all data records with the same partition key map to the same shard within the stream.
-
withPartitionKey
public PutRecordRequest withPartitionKey(String partitionKey)
Determines which shard in the stream the data record is assigned to. Partition keys are Unicode strings with a maximum length limit of 256 characters for each key. Amazon Kinesis uses the partition key as input to a hash function that maps the partition key and associated data to a specific shard. Specifically, an MD5 hash function is used to map partition keys to 128-bit integer values and to map associated data records to shards. As a result of this hashing mechanism, all data records with the same partition key map to the same shard within the stream.
- Parameters:
partitionKey
- Determines which shard in the stream the data record is assigned to. Partition keys are Unicode strings with a maximum length limit of 256 characters for each key. Amazon Kinesis uses the partition key as input to a hash function that maps the partition key and associated data to a specific shard. Specifically, an MD5 hash function is used to map partition keys to 128-bit integer values and to map associated data records to shards. As a result of this hashing mechanism, all data records with the same partition key map to the same shard within the stream.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setExplicitHashKey
public void setExplicitHashKey(String explicitHashKey)
The hash value used to explicitly determine the shard the data record is assigned to by overriding the partition key hash.
- Parameters:
explicitHashKey
- The hash value used to explicitly determine the shard the data record is assigned to by overriding the partition key hash.
-
getExplicitHashKey
public String getExplicitHashKey()
The hash value used to explicitly determine the shard the data record is assigned to by overriding the partition key hash.
- Returns:
- The hash value used to explicitly determine the shard the data record is assigned to by overriding the partition key hash.
-
withExplicitHashKey
public PutRecordRequest withExplicitHashKey(String explicitHashKey)
The hash value used to explicitly determine the shard the data record is assigned to by overriding the partition key hash.
- Parameters:
explicitHashKey
- The hash value used to explicitly determine the shard the data record is assigned to by overriding the partition key hash.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setSequenceNumberForOrdering
public void setSequenceNumberForOrdering(String sequenceNumberForOrdering)
Guarantees strictly increasing sequence numbers, for puts from the same client and to the same partition key. Usage: set the
SequenceNumberForOrdering
of record n to the sequence number of record n-1 (as returned in the result when putting record n-1). If this parameter is not set, records will be coarsely ordered based on arrival time.- Parameters:
sequenceNumberForOrdering
- Guarantees strictly increasing sequence numbers, for puts from the same client and to the same partition key. Usage: set theSequenceNumberForOrdering
of record n to the sequence number of record n-1 (as returned in the result when putting record n-1). If this parameter is not set, records will be coarsely ordered based on arrival time.
-
getSequenceNumberForOrdering
public String getSequenceNumberForOrdering()
Guarantees strictly increasing sequence numbers, for puts from the same client and to the same partition key. Usage: set the
SequenceNumberForOrdering
of record n to the sequence number of record n-1 (as returned in the result when putting record n-1). If this parameter is not set, records will be coarsely ordered based on arrival time.- Returns:
- Guarantees strictly increasing sequence numbers, for puts from
the same client and to the same partition key. Usage: set the
SequenceNumberForOrdering
of record n to the sequence number of record n-1 (as returned in the result when putting record n-1). If this parameter is not set, records will be coarsely ordered based on arrival time.
-
withSequenceNumberForOrdering
public PutRecordRequest withSequenceNumberForOrdering(String sequenceNumberForOrdering)
Guarantees strictly increasing sequence numbers, for puts from the same client and to the same partition key. Usage: set the
SequenceNumberForOrdering
of record n to the sequence number of record n-1 (as returned in the result when putting record n-1). If this parameter is not set, records will be coarsely ordered based on arrival time.- Parameters:
sequenceNumberForOrdering
- Guarantees strictly increasing sequence numbers, for puts from the same client and to the same partition key. Usage: set theSequenceNumberForOrdering
of record n to the sequence number of record n-1 (as returned in the result when putting record n-1). If this parameter is not set, records will be coarsely ordered based on arrival time.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
toString
public String toString()
Returns a string representation of this object; useful for testing and debugging.- Overrides:
toString
in classObject
- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
clone
public PutRecordRequest clone()
Description copied from class:AmazonWebServiceRequest
Creates a shallow clone of this request. Explicitly does not clone the deep structure of the request object.- Overrides:
clone
in classAmazonWebServiceRequest
- See Also:
Object.clone()
-
-