com.amazonaws.services.kinesis.model
Class GetShardIteratorRequest

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

public class GetShardIteratorRequest
extends AmazonWebServiceRequest
implements Serializable

Container for the parameters to the GetShardIterator operation.

This operation returns a shard iterator in ShardIterator . 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 a shard. A sequence number is the identifier associated with every record ingested in the Amazon Kinesis stream. The sequence number is assigned by the Amazon Kinesis service when a record is put into the stream.

You must specify the shard iterator type in the GetShardIterator request. For example, you can set the ShardIteratorType parameter to read exactly from the position denoted by a specific sequence number by using the AT_SEQUENCE_NUMBER shard iterator type, or right after the sequence number by using the AFTER_SEQUENCE_NUMBER shard iterator type, using sequence numbers returned by earlier PutRecord, GetRecords or DescribeStream requests. You can specify the shard iterator type TRIM_HORIZON in the request to cause ShardIterator to point to the last untrimmed record in the shard in the system, which is the oldest data record in the shard. Or you can point to just after the most recent record in the shard, by using the shard iterator type LATEST, so that you always read the most recent data in the shard.

Note: Each shard iterator expires five minutes after it is returned to the requester.

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

If a GetShardIterator request is made too often, you will receive a ProvisionedThroughputExceededException . For more information about throughput limits, see the Amazon Kinesis Developer Guide .

GetShardIterator can return null for its ShardIterator to indicate that the shard has been closed and that the requested iterator will return no more data. A shard can be closed by a SplitShard or MergeShards operation.

GetShardIterator has a limit of 5 transactions per second per account per open shard.

See Also:
AmazonKinesis.getShardIterator(GetShardIteratorRequest), Serialized Form

Constructor Summary
GetShardIteratorRequest()
           
 
Method Summary
 boolean equals(Object obj)
           
 String getShardId()
          The shard ID of the shard to get the iterator for.
 String getShardIteratorType()
          Determines how the shard iterator is used to start reading data records from the shard.
 String getStartingSequenceNumber()
          The sequence number of the data record in the shard from which to start reading from.
 String getStreamName()
          The name of the stream.
 int hashCode()
           
 void setShardId(String shardId)
          The shard ID of the shard to get the iterator for.
 void setShardIteratorType(ShardIteratorType shardIteratorType)
          Determines how the shard iterator is used to start reading data records from the shard.
 void setShardIteratorType(String shardIteratorType)
          Determines how the shard iterator is used to start reading data records from the shard.
 void setStartingSequenceNumber(String startingSequenceNumber)
          The sequence number of the data record in the shard from which to start reading from.
 void setStreamName(String streamName)
          The name of the stream.
 String toString()
          Returns a string representation of this object; useful for testing and debugging.
 GetShardIteratorRequest withShardId(String shardId)
          The shard ID of the shard to get the iterator for.
 GetShardIteratorRequest withShardIteratorType(ShardIteratorType shardIteratorType)
          Determines how the shard iterator is used to start reading data records from the shard.
 GetShardIteratorRequest withShardIteratorType(String shardIteratorType)
          Determines how the shard iterator is used to start reading data records from the shard.
 GetShardIteratorRequest withStartingSequenceNumber(String startingSequenceNumber)
          The sequence number of the data record in the shard from which to start reading from.
 GetShardIteratorRequest withStreamName(String streamName)
          The name of the stream.
 
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

GetShardIteratorRequest

public GetShardIteratorRequest()
Method Detail

getStreamName

public String getStreamName()
The name of the stream.

Constraints:
Length: 1 - 128
Pattern: [a-zA-Z0-9_.-]+

Returns:
The name of the stream.

setStreamName

public void setStreamName(String streamName)
The name of the stream.

Constraints:
Length: 1 - 128
Pattern: [a-zA-Z0-9_.-]+

Parameters:
streamName - The name of the stream.

withStreamName

public GetShardIteratorRequest withStreamName(String streamName)
The name of the stream.

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

Constraints:
Length: 1 - 128
Pattern: [a-zA-Z0-9_.-]+

Parameters:
streamName - The name of the stream.
Returns:
A reference to this updated object so that method calls can be chained together.

getShardId

public String getShardId()
The shard ID of the shard to get the iterator for.

Constraints:
Length: 1 - 128
Pattern: [a-zA-Z0-9_.-]+

Returns:
The shard ID of the shard to get the iterator for.

setShardId

public void setShardId(String shardId)
The shard ID of the shard to get the iterator for.

Constraints:
Length: 1 - 128
Pattern: [a-zA-Z0-9_.-]+

Parameters:
shardId - The shard ID of the shard to get the iterator for.

withShardId

public GetShardIteratorRequest withShardId(String shardId)
The shard ID of the shard to get the iterator for.

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

Constraints:
Length: 1 - 128
Pattern: [a-zA-Z0-9_.-]+

Parameters:
shardId - The shard ID of the shard to get the iterator for.
Returns:
A reference to this updated object so that method calls can be chained together.

getShardIteratorType

public String getShardIteratorType()
Determines how the shard iterator is used to start reading data records from the shard.

The following are the valid shard iterator types:

Constraints:
Allowed Values: AT_SEQUENCE_NUMBER, AFTER_SEQUENCE_NUMBER, TRIM_HORIZON, LATEST

Returns:
Determines how the shard iterator is used to start reading data records from the shard.

The following are the valid shard iterator types:

  • AT_SEQUENCE_NUMBER - Start reading exactly from the position denoted by a specific sequence number.
  • AFTER_SEQUENCE_NUMBER - Start reading right after the position denoted by a specific sequence number.
  • TRIM_HORIZON - Start reading at the last untrimmed record in the shard in the system, which is the oldest data record in the shard.
  • LATEST - Start reading just after the most recent record in the shard, so that you always read the most recent data in the shard.
See Also:
ShardIteratorType

setShardIteratorType

public void setShardIteratorType(String shardIteratorType)
Determines how the shard iterator is used to start reading data records from the shard.

The following are the valid shard iterator types:

Constraints:
Allowed Values: AT_SEQUENCE_NUMBER, AFTER_SEQUENCE_NUMBER, TRIM_HORIZON, LATEST

Parameters:
shardIteratorType - Determines how the shard iterator is used to start reading data records from the shard.

The following are the valid shard iterator types:

  • AT_SEQUENCE_NUMBER - Start reading exactly from the position denoted by a specific sequence number.
  • AFTER_SEQUENCE_NUMBER - Start reading right after the position denoted by a specific sequence number.
  • TRIM_HORIZON - Start reading at the last untrimmed record in the shard in the system, which is the oldest data record in the shard.
  • LATEST - Start reading just after the most recent record in the shard, so that you always read the most recent data in the shard.
See Also:
ShardIteratorType

withShardIteratorType

public GetShardIteratorRequest withShardIteratorType(String shardIteratorType)
Determines how the shard iterator is used to start reading data records from the shard.

The following are the valid shard iterator types:

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

Constraints:
Allowed Values: AT_SEQUENCE_NUMBER, AFTER_SEQUENCE_NUMBER, TRIM_HORIZON, LATEST

Parameters:
shardIteratorType - Determines how the shard iterator is used to start reading data records from the shard.

The following are the valid shard iterator types:

  • AT_SEQUENCE_NUMBER - Start reading exactly from the position denoted by a specific sequence number.
  • AFTER_SEQUENCE_NUMBER - Start reading right after the position denoted by a specific sequence number.
  • TRIM_HORIZON - Start reading at the last untrimmed record in the shard in the system, which is the oldest data record in the shard.
  • LATEST - Start reading just after the most recent record in the shard, so that you always read the most recent data in the shard.
Returns:
A reference to this updated object so that method calls can be chained together.
See Also:
ShardIteratorType

setShardIteratorType

public void setShardIteratorType(ShardIteratorType shardIteratorType)
Determines how the shard iterator is used to start reading data records from the shard.

The following are the valid shard iterator types:

Constraints:
Allowed Values: AT_SEQUENCE_NUMBER, AFTER_SEQUENCE_NUMBER, TRIM_HORIZON, LATEST

Parameters:
shardIteratorType - Determines how the shard iterator is used to start reading data records from the shard.

The following are the valid shard iterator types:

  • AT_SEQUENCE_NUMBER - Start reading exactly from the position denoted by a specific sequence number.
  • AFTER_SEQUENCE_NUMBER - Start reading right after the position denoted by a specific sequence number.
  • TRIM_HORIZON - Start reading at the last untrimmed record in the shard in the system, which is the oldest data record in the shard.
  • LATEST - Start reading just after the most recent record in the shard, so that you always read the most recent data in the shard.
See Also:
ShardIteratorType

withShardIteratorType

public GetShardIteratorRequest withShardIteratorType(ShardIteratorType shardIteratorType)
Determines how the shard iterator is used to start reading data records from the shard.

The following are the valid shard iterator types:

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

Constraints:
Allowed Values: AT_SEQUENCE_NUMBER, AFTER_SEQUENCE_NUMBER, TRIM_HORIZON, LATEST

Parameters:
shardIteratorType - Determines how the shard iterator is used to start reading data records from the shard.

The following are the valid shard iterator types:

  • AT_SEQUENCE_NUMBER - Start reading exactly from the position denoted by a specific sequence number.
  • AFTER_SEQUENCE_NUMBER - Start reading right after the position denoted by a specific sequence number.
  • TRIM_HORIZON - Start reading at the last untrimmed record in the shard in the system, which is the oldest data record in the shard.
  • LATEST - Start reading just after the most recent record in the shard, so that you always read the most recent data in the shard.
Returns:
A reference to this updated object so that method calls can be chained together.
See Also:
ShardIteratorType

getStartingSequenceNumber

public String getStartingSequenceNumber()
The sequence number of the data record in the shard from which to start reading from.

Constraints:
Pattern: 0|([1-9]\d{0,128})

Returns:
The sequence number of the data record in the shard from which to start reading from.

setStartingSequenceNumber

public void setStartingSequenceNumber(String startingSequenceNumber)
The sequence number of the data record in the shard from which to start reading from.

Constraints:
Pattern: 0|([1-9]\d{0,128})

Parameters:
startingSequenceNumber - The sequence number of the data record in the shard from which to start reading from.

withStartingSequenceNumber

public GetShardIteratorRequest withStartingSequenceNumber(String startingSequenceNumber)
The sequence number of the data record in the shard from which to start reading from.

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

Constraints:
Pattern: 0|([1-9]\d{0,128})

Parameters:
startingSequenceNumber - The sequence number of the data record in the shard from which to start reading from.
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.