public class KinesisProxy extends java.lang.Object implements IKinesisProxyExtended
| Constructor and Description |
|---|
KinesisProxy(java.lang.String streamName,
AWSCredentialsProvider credentialProvider,
AmazonKinesis kinesisClient,
long describeStreamBackoffTimeInMillis,
int maxDescribeStreamRetryAttempts)
Public constructor.
|
KinesisProxy(java.lang.String streamName,
AWSCredentialsProvider credentialProvider,
java.lang.String endpoint)
Public constructor.
|
KinesisProxy(java.lang.String streamName,
AWSCredentialsProvider credentialProvider,
java.lang.String endpoint,
java.lang.String serviceName,
java.lang.String regionId,
long describeStreamBackoffTimeInMillis,
int maxDescribeStreamRetryAttempts)
Public constructor.
|
| Modifier and Type | Method and Description |
|---|---|
GetRecordsResult |
get(java.lang.String shardIterator,
int maxRecords)
Get records from stream.
|
java.util.Set<java.lang.String> |
getAllShardIds()
Fetch the shardIds of all shards in the stream.
|
java.lang.String |
getIterator(java.lang.String shardId,
java.lang.String iteratorType,
java.lang.String sequenceNumber)
Fetch a shard iterator from the specified position in the shard.
|
Shard |
getShard(java.lang.String shardId)
Get the Shard corresponding to shardId associated with this
IKinesisProxy.
|
java.util.List<Shard> |
getShardList()
Fetch all the shards defined for the stream (e.g.
|
DescribeStreamResult |
getStreamInfo(java.lang.String startShardId)
Fetch information about stream.
|
PutRecordResult |
put(java.lang.String exclusiveMinimumSequenceNumber,
java.lang.String explicitHashKey,
java.lang.String partitionKey,
java.nio.ByteBuffer data) |
public KinesisProxy(java.lang.String streamName,
AWSCredentialsProvider credentialProvider,
java.lang.String endpoint)
streamName - Data records will be fetched from this streamcredentialProvider - Provides credentials for signing Kinesis requestsendpoint - Kinesis endpointpublic KinesisProxy(java.lang.String streamName,
AWSCredentialsProvider credentialProvider,
java.lang.String endpoint,
java.lang.String serviceName,
java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.String shardId)
getShard in interface IKinesisProxyExtendedshardId - Fetch the Shard with this given shardIdpublic java.util.List<Shard> getShardList()
getShardList in interface IKinesisProxypublic java.util.Set<java.lang.String> getAllShardIds()
throws ResourceNotFoundException
getAllShardIds in interface IKinesisProxyResourceNotFoundException - If the specified Kinesis stream was not foundpublic java.lang.String getIterator(java.lang.String shardId,
java.lang.String iteratorType,
java.lang.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(java.lang.String exclusiveMinimumSequenceNumber,
java.lang.String explicitHashKey,
java.lang.String partitionKey,
java.nio.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.