public class KinesisProxy extends Object implements IKinesisProxyExtended
| Constructor and Description |
|---|
KinesisProxy(String streamName,
AWSCredentialsProvider credentialProvider,
AmazonKinesis kinesisClient,
long describeStreamBackoffTimeInMillis,
int maxDescribeStreamRetryAttempts)
Public constructor.
|
KinesisProxy(String streamName,
AWSCredentialsProvider credentialProvider,
String endpoint)
Public constructor.
|
KinesisProxy(String streamName,
AWSCredentialsProvider credentialProvider,
String endpoint,
String serviceName,
String regionId,
long describeStreamBackoffTimeInMillis,
int maxDescribeStreamRetryAttempts)
Public 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 iteratorType,
String sequenceNumber)
Fetch a shard iterator from the specified position in the shard.
|
Shard |
getShard(String shardId)
Get the Shard corresponding to shardId associated with this
IKinesisProxy.
|
List<Shard> |
getShardList()
Fetch all the shards defined for the stream (e.g.
|
DescribeStreamResult |
getStreamInfo(String startShardId)
Fetch information about stream.
|
PutRecordResult |
put(String exclusiveMinimumSequenceNumber,
String explicitHashKey,
String partitionKey,
ByteBuffer data) |
public KinesisProxy(String streamName, AWSCredentialsProvider credentialProvider, String endpoint)
streamName - Data records will be fetched from this streamcredentialProvider - Provides credentials for signing Kinesis requestsendpoint - Kinesis endpointpublic KinesisProxy(String streamName, AWSCredentialsProvider credentialProvider, String endpoint, String serviceName, String regionId, long describeStreamBackoffTimeInMillis, int maxDescribeStreamRetryAttempts)
streamName - Data records will be fetched from this streamcredentialProvider - Provides credentials for signing Kinesis requestsendpoint - Kinesis endpointserviceName - service nameregionId - region iddescribeStreamBackoffTimeInMillis - Backoff time for DescribeStream calls in millisecondsmaxDescribeStreamRetryAttempts - Number of retry attempts for DescribeStream callspublic KinesisProxy(String streamName, AWSCredentialsProvider credentialProvider, AmazonKinesis kinesisClient, long describeStreamBackoffTimeInMillis, int maxDescribeStreamRetryAttempts)
streamName - Data records will be fetched from this streamcredentialProvider - Provides credentials for signing Kinesis requestskinesisClient - Kinesis client (used to fetch data from Kinesis)describeStreamBackoffTimeInMillis - Backoff time for DescribeStream calls in millisecondsmaxDescribeStreamRetryAttempts - Number of retry attempts for DescribeStream callspublic 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 startShardId) throws ResourceNotFoundException, LimitExceededException
getStreamInfo in interface IKinesisProxystartShardId - exclusive start shardId - used when paginating the list of shards.ResourceNotFoundException - The Kinesis stream was not foundLimitExceededExceptionpublic Shard getShard(String shardId)
getShard in interface IKinesisProxyExtendedshardId - Fetch the Shard with this given shardIdpublic List<Shard> getShardList()
getShardList in interface IKinesisProxypublic Set<String> getAllShardIds() throws ResourceNotFoundException
getAllShardIds in interface IKinesisProxyResourceNotFoundException - If the specified Kinesis stream was not foundpublic String getIterator(String shardId, String iteratorType, String sequenceNumber)
getIterator in interface IKinesisProxyshardId - Shard iditeratorType - 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_NUMBERpublic PutRecordResult put(String exclusiveMinimumSequenceNumber, String explicitHashKey, String partitionKey, ByteBuffer data) throws ResourceNotFoundException, InvalidArgumentException
put in interface IKinesisProxyexclusiveMinimumSequenceNumber - (optional) used for record orderingexplicitHashKey - optionally supplied transformation of partitionkeypartitionKey - for this recorddata - payloadResourceNotFoundException - The Kinesis stream was not found.InvalidArgumentException - InvalidArgumentException.