com.amazonaws.services.kinesis.model
Class GetRecordsRequest

java.lang.Object
  extended by com.amazonaws.AmazonWebServiceRequest
      extended by com.amazonaws.services.kinesis.model.GetRecordsRequest
All Implemented Interfaces:
Serializable

public class GetRecordsRequest
extends AmazonWebServiceRequest
implements Serializable

Container for the parameters to the GetRecords operation.

This operation returns one or more data records from a shard. A GetRecords operation request can retrieve up to 10 MB of data.

You specify a shard iterator for the shard that you want to read data from in the ShardIterator parameter. The shard iterator specifies the position in the shard from which you want to start reading data records sequentially. A shard iterator specifies this position using the sequence number of a data record in the shard. For more information about the shard iterator, see GetShardIterator.

GetRecords may return a partial result if the response size limit is exceeded. You will get an error, but not a partial result if the shard's provisioned throughput is exceeded, the shard iterator has expired, or an internal processing failure has occurred. Clients can request a smaller amount of data by specifying a maximum number of returned records using the Limit parameter. The Limit parameter can be set to an integer value of up to 10,000. If you set the value to an integer greater than 10,000, you will receive InvalidArgumentException .

A new shard iterator is returned by every GetRecords request in NextShardIterator , which you use in the ShardIterator parameter of the next GetRecords request. When you repeatedly read from an Amazon Kinesis stream use a GetShardIterator request to get the first shard iterator to use in your first GetRecords request and then use the shard iterator returned in NextShardIterator for subsequent reads.

GetRecords can return null for the NextShardIterator to reflect that the shard has been closed and that the requested shard iterator would never have returned more data.

If no items can be processed because of insufficient provisioned throughput on the shard involved in the request, GetRecords throws ProvisionedThroughputExceededException .

See Also:
AmazonKinesis.getRecords(GetRecordsRequest), Serialized Form

Constructor Summary
GetRecordsRequest()
           
 
Method Summary
 boolean equals(Object obj)
           
 Integer getLimit()
          The maximum number of records to return, which can be set to a value of up to 10,000.
 String getShardIterator()
          The position in the shard from which you want to start sequentially reading data records.
 int hashCode()
           
 void setLimit(Integer limit)
          The maximum number of records to return, which can be set to a value of up to 10,000.
 void setShardIterator(String shardIterator)
          The position in the shard from which you want to start sequentially reading data records.
 String toString()
          Returns a string representation of this object; useful for testing and debugging.
 GetRecordsRequest withLimit(Integer limit)
          The maximum number of records to return, which can be set to a value of up to 10,000.
 GetRecordsRequest withShardIterator(String shardIterator)
          The position in the shard from which you want to start sequentially reading data records.
 
Methods inherited from class com.amazonaws.AmazonWebServiceRequest
copyPrivateRequestParameters, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setRequestCredentials, setRequestMetricCollector, withRequestMetricCollector
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GetRecordsRequest

public GetRecordsRequest()
Method Detail

getShardIterator

public String getShardIterator()
The position in the shard from which you want to start sequentially reading data records.

Constraints:
Length: 1 - 512

Returns:
The position in the shard from which you want to start sequentially reading data records.

setShardIterator

public void setShardIterator(String shardIterator)
The position in the shard from which you want to start sequentially reading data records.

Constraints:
Length: 1 - 512

Parameters:
shardIterator - The position in the shard from which you want to start sequentially reading data records.

withShardIterator

public GetRecordsRequest withShardIterator(String shardIterator)
The position in the shard from which you want to start sequentially reading data records.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 512

Parameters:
shardIterator - The position in the shard from which you want to start sequentially reading data records.
Returns:
A reference to this updated object so that method calls can be chained together.

getLimit

public Integer getLimit()
The maximum number of records to return, which can be set to a value of up to 10,000.

Constraints:
Range: 1 - 10000

Returns:
The maximum number of records to return, which can be set to a value of up to 10,000.

setLimit

public void setLimit(Integer limit)
The maximum number of records to return, which can be set to a value of up to 10,000.

Constraints:
Range: 1 - 10000

Parameters:
limit - The maximum number of records to return, which can be set to a value of up to 10,000.

withLimit

public GetRecordsRequest withLimit(Integer limit)
The maximum number of records to return, which can be set to a value of up to 10,000.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Range: 1 - 10000

Parameters:
limit - The maximum number of records to return, which can be set to a value of up to 10,000.
Returns:
A reference to this updated 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 class Object
Returns:
A string representation of this object.
See Also:
Object.toString()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2016. All rights reserved.