public class KinesisProxy extends Object implements IKinesisProxyExtended
| Constructor and Description |
|---|
KinesisProxy(String streamName,
com.amazonaws.auth.AWSCredentialsProvider credentialProvider,
com.amazonaws.services.kinesis.AmazonKinesis kinesisClient,
long describeStreamBackoffTimeInMillis,
int maxDescribeStreamRetryAttempts)
Public constructor.
|
KinesisProxy(String streamName,
com.amazonaws.auth.AWSCredentialsProvider credentialProvider,
String endpoint)
Public constructor.
|
KinesisProxy(String streamName,
com.amazonaws.auth.AWSCredentialsProvider credentialProvider,
String endpoint,
String serviceName,
String regionId,
long describeStreamBackoffTimeInMillis,
int maxDescribeStreamRetryAttempts)
Public constructor.
|
| Modifier and Type | Method and Description |
|---|---|
com.amazonaws.services.kinesis.model.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,
Date timestamp)
Fetch a shard iterator from the specified position in the shard.
|
String |
getIterator(String shardId,
String iteratorType)
Fetch a shard iterator from the specified position in the shard.
|
String |
getIterator(String shardId,
String iteratorType,
String sequenceNumber)
Fetch a shard iterator from the specified position in the shard.
|
com.amazonaws.services.kinesis.model.Shard |
getShard(String shardId)
Get the Shard corresponding to shardId associated with this
IKinesisProxy.
|
List<com.amazonaws.services.kinesis.model.Shard> |
getShardList()
Fetch all the shards defined for the stream (e.g.
|
com.amazonaws.services.kinesis.model.DescribeStreamResult |
getStreamInfo(String startShardId)
Fetch information about stream.
|
com.amazonaws.services.kinesis.model.PutRecordResult |
put(String exclusiveMinimumSequenceNumber,
String explicitHashKey,
String partitionKey,
ByteBuffer data) |
public KinesisProxy(String streamName, com.amazonaws.auth.AWSCredentialsProvider credentialProvider, String endpoint)
streamName - Data records will be fetched from this streamcredentialProvider - Provides credentials for signing Kinesis requestsendpoint - Kinesis endpointpublic KinesisProxy(String streamName, com.amazonaws.auth.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, com.amazonaws.auth.AWSCredentialsProvider credentialProvider, com.amazonaws.services.kinesis.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 com.amazonaws.services.kinesis.model.GetRecordsResult get(String shardIterator, int maxRecords) throws com.amazonaws.services.kinesis.model.ResourceNotFoundException, com.amazonaws.services.kinesis.model.InvalidArgumentException, com.amazonaws.services.kinesis.model.ExpiredIteratorException
get in interface IKinesisProxyshardIterator - Fetch data records using this shard iteratormaxRecords - Fetch at most this many recordscom.amazonaws.services.kinesis.model.ResourceNotFoundException - The Kinesis stream or shard was not foundcom.amazonaws.services.kinesis.model.InvalidArgumentException - Invalid input parameterscom.amazonaws.services.kinesis.model.ExpiredIteratorException - The iterator has expiredpublic com.amazonaws.services.kinesis.model.DescribeStreamResult getStreamInfo(String startShardId) throws com.amazonaws.services.kinesis.model.ResourceNotFoundException, com.amazonaws.services.kinesis.model.LimitExceededException
getStreamInfo in interface IKinesisProxystartShardId - exclusive start shardId - used when paginating the list of shards.com.amazonaws.services.kinesis.model.ResourceNotFoundException - The Kinesis stream was not foundcom.amazonaws.services.kinesis.model.LimitExceededExceptionpublic com.amazonaws.services.kinesis.model.Shard getShard(String shardId)
getShard in interface IKinesisProxyExtendedshardId - Fetch the Shard with this given shardIdpublic List<com.amazonaws.services.kinesis.model.Shard> getShardList()
getShardList in interface IKinesisProxypublic Set<String> getAllShardIds() throws com.amazonaws.services.kinesis.model.ResourceNotFoundException
getAllShardIds in interface IKinesisProxycom.amazonaws.services.kinesis.model.ResourceNotFoundException - 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 String getIterator(String shardId, String iteratorType)
getIterator in interface IKinesisProxyshardId - Shard iditeratorType - Either TRIM_HORIZON or LATEST.public String getIterator(String shardId, Date timestamp)
getIterator in interface IKinesisProxyshardId - Shard idtimestamp - The timestamp.public com.amazonaws.services.kinesis.model.PutRecordResult put(String exclusiveMinimumSequenceNumber, String explicitHashKey, String partitionKey, ByteBuffer data) throws com.amazonaws.services.kinesis.model.ResourceNotFoundException, com.amazonaws.services.kinesis.model.InvalidArgumentException
put in interface IKinesisProxyexclusiveMinimumSequenceNumber - (optional) used for record orderingexplicitHashKey - optionally supplied transformation of partitionkeypartitionKey - for this recorddata - payloadcom.amazonaws.services.kinesis.model.ResourceNotFoundException - The Kinesis stream was not found.com.amazonaws.services.kinesis.model.InvalidArgumentException - InvalidArgumentException.Copyright © 2018. All rights reserved.