public class MetricsCollectingKinesisProxyDecorator extends Object implements IKinesisProxy
| Constructor and Description |
|---|
MetricsCollectingKinesisProxyDecorator(String prefix,
IKinesisProxy other,
String shardId)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
GetRecordsResult |
get(String shardIterator,
int maxRecords)
Get records from stream.
|
Set<String> |
getAllShardIds()
Fetch the shardIds of all shards in the stream.
|
String |
getIterator(String shardId,
String iteratorEnum,
String sequenceNumber)
Fetch a shard iterator from the specified position in the shard.
|
List<Shard> |
getShardList()
Fetch all the shards defined for the stream (e.g.
|
DescribeStreamResult |
getStreamInfo(String startingShardId)
Fetch information about stream.
|
PutRecordResult |
put(String sequenceNumberForOrdering,
String explicitHashKey,
String partitionKey,
ByteBuffer data) |
public MetricsCollectingKinesisProxyDecorator(String prefix, IKinesisProxy other, String shardId)
prefix - prefix for generated metricsother - Kinesis proxy to decorateshardId - shardId will be included in the metrics.public GetRecordsResult get(String shardIterator, int maxRecords) throws ResourceNotFoundException, InvalidArgumentException, ExpiredIteratorException
get in interface IKinesisProxyshardIterator - Fetch data records using this shard iteratormaxRecords - Fetch at most this many recordsResourceNotFoundException - The Kinesis stream or shard was not foundInvalidArgumentException - Invalid input parametersExpiredIteratorException - The iterator has expiredpublic DescribeStreamResult getStreamInfo(String startingShardId) throws ResourceNotFoundException
getStreamInfo in interface IKinesisProxystartingShardId - exclusive start shardId - used when paginating the list of shards.ResourceNotFoundException - The Kinesis stream was not foundpublic Set<String> getAllShardIds() throws ResourceNotFoundException
getAllShardIds in interface IKinesisProxyResourceNotFoundException - If the specified Kinesis stream was not foundpublic String getIterator(String shardId, String iteratorEnum, String sequenceNumber) throws ResourceNotFoundException, InvalidArgumentException
getIterator in interface IKinesisProxyshardId - Shard iditeratorEnum - one of: TRIM_HORIZON, LATEST, AT_SEQUENCE_NUMBER, AFTER_SEQUENCE_NUMBERsequenceNumber - the sequence number - must be null unless iteratorEnum is AT_SEQUENCE_NUMBER or
AFTER_SEQUENCE_NUMBERResourceNotFoundException - The Kinesis stream or shard was not foundInvalidArgumentException - Invalid input parameterspublic List<Shard> getShardList() throws ResourceNotFoundException
getShardList in interface IKinesisProxyResourceNotFoundException - The Kinesis stream was not found.public PutRecordResult put(String sequenceNumberForOrdering, String explicitHashKey, String partitionKey, ByteBuffer data) throws ResourceNotFoundException, InvalidArgumentException
put in interface IKinesisProxysequenceNumberForOrdering - (optional) used for record orderingexplicitHashKey - optionally supplied transformation of partitionkeypartitionKey - for this recorddata - payloadResourceNotFoundException - The Kinesis stream was not found.InvalidArgumentException - InvalidArgumentException.