public class GetShardIteratorRequest extends AmazonWebServiceRequest implements Serializable
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.
NOOP
Constructor and Description |
---|
GetShardIteratorRequest() |
Modifier and Type | Method and Description |
---|---|
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.
|
copyPrivateRequestParameters, getGeneralProgressListener, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollector
public String getStreamName()
Constraints:
Length: 1 - 128
Pattern: [a-zA-Z0-9_.-]+
public void setStreamName(String streamName)
Constraints:
Length: 1 - 128
Pattern: [a-zA-Z0-9_.-]+
streamName
- The name of the stream.public GetShardIteratorRequest withStreamName(String streamName)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 128
Pattern: [a-zA-Z0-9_.-]+
streamName
- The name of the stream.public String getShardId()
Constraints:
Length: 1 - 128
Pattern: [a-zA-Z0-9_.-]+
public void setShardId(String shardId)
Constraints:
Length: 1 - 128
Pattern: [a-zA-Z0-9_.-]+
shardId
- The shard ID of the shard to get the iterator for.public GetShardIteratorRequest withShardId(String shardId)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 128
Pattern: [a-zA-Z0-9_.-]+
shardId
- The shard ID of the shard to get the iterator for.public String getShardIteratorType()
The following are the valid shard iterator types:
Constraints:
Allowed Values: AT_SEQUENCE_NUMBER, AFTER_SEQUENCE_NUMBER, TRIM_HORIZON, LATEST
The following are the valid shard iterator types:
ShardIteratorType
public void setShardIteratorType(String shardIteratorType)
The following are the valid shard iterator types:
Constraints:
Allowed Values: AT_SEQUENCE_NUMBER, AFTER_SEQUENCE_NUMBER, TRIM_HORIZON, LATEST
shardIteratorType
- Determines how the shard iterator is used to start reading data
records from the shard. The following are the valid shard iterator types:
ShardIteratorType
public GetShardIteratorRequest withShardIteratorType(String shardIteratorType)
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
shardIteratorType
- Determines how the shard iterator is used to start reading data
records from the shard. The following are the valid shard iterator types:
ShardIteratorType
public void setShardIteratorType(ShardIteratorType shardIteratorType)
The following are the valid shard iterator types:
Constraints:
Allowed Values: AT_SEQUENCE_NUMBER, AFTER_SEQUENCE_NUMBER, TRIM_HORIZON, LATEST
shardIteratorType
- Determines how the shard iterator is used to start reading data
records from the shard. The following are the valid shard iterator types:
ShardIteratorType
public GetShardIteratorRequest withShardIteratorType(ShardIteratorType shardIteratorType)
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
shardIteratorType
- Determines how the shard iterator is used to start reading data
records from the shard. The following are the valid shard iterator types:
ShardIteratorType
public String getStartingSequenceNumber()
Constraints:
Pattern: 0|([1-9]\d{0,128})
public void setStartingSequenceNumber(String startingSequenceNumber)
Constraints:
Pattern: 0|([1-9]\d{0,128})
startingSequenceNumber
- The sequence number of the data record in the shard from which to
start reading from.public GetShardIteratorRequest withStartingSequenceNumber(String startingSequenceNumber)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Pattern: 0|([1-9]\d{0,128})
startingSequenceNumber
- The sequence number of the data record in the shard from which to
start reading from.public String toString()
toString
in class Object
Object.toString()
Copyright © 2014. All rights reserved.