Adding more comments, addressing CR comments.

This commit is contained in:
Sahil Palvia 2018-01-09 11:22:45 -08:00
parent b126a78fb1
commit b2c29b8a8c
6 changed files with 24 additions and 21 deletions

View file

@ -46,12 +46,13 @@ public interface IKinesisProxy {
throws ResourceNotFoundException, InvalidArgumentException, ExpiredIteratorException; throws ResourceNotFoundException, InvalidArgumentException, ExpiredIteratorException;
/** /**
* Fetch information about stream. Useful for fetching the list of shards in a stream. Going forward this method is * Fetch information about stream. Useful for fetching the list of shards in a stream.
* being deprecated. This method uses DescribeStream call, which is throttled at 10 calls per account by default.
* If possible try to use ListShards call available in the client, or use the getShardList to get shard info.
* *
* @deprecated This method uses DescribeStream calls, which is throttled at account level. The proxy will internally * @deprecated Going forward this method is
* use ListShards for KinesisStreams to get the information about the shards for a given stream. * being deprecated. This method uses DescribeStream call, which is throttled at 10 calls per account by default.
* If possible try to use ListShards call available in the client, or use the getShardList or getAllShards to get
* shard info. To make DescribeStream calls, use the AmazonKinesis client directly instead of using KinesisProxy.
* This method will be removed in the next major/minor release.
* *
* @param startShardId exclusive start shardId - used when paginating the list of shards. * @param startShardId exclusive start shardId - used when paginating the list of shards.
* @return DescribeStreamOutput object containing a description of the stream. * @return DescribeStreamOutput object containing a description of the stream.

View file

@ -14,13 +14,11 @@
*/ */
package com.amazonaws.services.kinesis.clientlibrary.proxies; package com.amazonaws.services.kinesis.clientlibrary.proxies;
import com.amazonaws.services.kinesis.AmazonKinesis;
import com.amazonaws.services.kinesis.clientlibrary.lib.worker.KinesisClientLibConfiguration;
/** /**
* Interface for a KinesisProxyFactory. * Interface for a KinesisProxyFactory.
* *
* @deprecated Deprecating since KinesisProxy is just created once, there is no use of a factory. * @deprecated Deprecating since KinesisProxy is just created once, there is no use of a factory. There is no
* replacement for this class. This class will be removed in the next major/minor release.
* *
*/ */
@Deprecated @Deprecated

View file

@ -107,7 +107,8 @@ public class KinesisProxy implements IKinesisProxyExtended {
* *
* @deprecated Deprecating constructor, this constructor doesn't use AWS best practices, moving forward please use * @deprecated Deprecating constructor, this constructor doesn't use AWS best practices, moving forward please use
* {@link #KinesisProxy(KinesisClientLibConfiguration, AmazonKinesis)} or * {@link #KinesisProxy(KinesisClientLibConfiguration, AmazonKinesis)} or
* {@link #KinesisProxy(String, AmazonKinesis, long, int, long, int)} to create the object. * {@link #KinesisProxy(String, AmazonKinesis, long, int, long, int)} to create the object. Will be removed in the
* next major/minor release.
* *
* @param streamName Data records will be fetched from this stream * @param streamName Data records will be fetched from this stream
* @param credentialProvider Provides credentials for signing Kinesis requests * @param credentialProvider Provides credentials for signing Kinesis requests
@ -126,7 +127,8 @@ public class KinesisProxy implements IKinesisProxyExtended {
* *
* @deprecated Deprecating constructor, this constructor doesn't use AWS best practices, moving forward please use * @deprecated Deprecating constructor, this constructor doesn't use AWS best practices, moving forward please use
* {@link #KinesisProxy(KinesisClientLibConfiguration, AmazonKinesis)} or * {@link #KinesisProxy(KinesisClientLibConfiguration, AmazonKinesis)} or
* {@link #KinesisProxy(String, AmazonKinesis, long, int, long, int)} to create the object. * {@link #KinesisProxy(String, AmazonKinesis, long, int, long, int)} to create the object. Will be removed in the
* next major/minor release.
* *
* @param streamName Data records will be fetched from this stream * @param streamName Data records will be fetched from this stream
* @param credentialProvider Provides credentials for signing Kinesis requests * @param credentialProvider Provides credentials for signing Kinesis requests
@ -161,7 +163,8 @@ public class KinesisProxy implements IKinesisProxyExtended {
* *
* @deprecated Deprecating constructor, this constructor doesn't use AWS best practices, moving forward please use * @deprecated Deprecating constructor, this constructor doesn't use AWS best practices, moving forward please use
* {@link #KinesisProxy(KinesisClientLibConfiguration, AmazonKinesis)} or * {@link #KinesisProxy(KinesisClientLibConfiguration, AmazonKinesis)} or
* {@link #KinesisProxy(String, AmazonKinesis, long, int, long, int)} to create the object. * {@link #KinesisProxy(String, AmazonKinesis, long, int, long, int)} to create the object. Will be removed in the
* next major/minor release.
* *
* @param streamName Data records will be fetched from this stream * @param streamName Data records will be fetched from this stream
* @param credentialProvider Provides credentials for signing Kinesis requests * @param credentialProvider Provides credentials for signing Kinesis requests
@ -245,7 +248,6 @@ public class KinesisProxy implements IKinesisProxyExtended {
@Deprecated @Deprecated
public DescribeStreamResult getStreamInfo(String startShardId) public DescribeStreamResult getStreamInfo(String startShardId)
throws ResourceNotFoundException, LimitExceededException { throws ResourceNotFoundException, LimitExceededException {
LOG.info("Using DescribeStream calls to get shards list");
final DescribeStreamRequest describeStreamRequest = new DescribeStreamRequest(); final DescribeStreamRequest describeStreamRequest = new DescribeStreamRequest();
// TODO: remove this once older constructors are removed // TODO: remove this once older constructors are removed
describeStreamRequest.setRequestCredentials(credentialsProvider.getCredentials()); describeStreamRequest.setRequestCredentials(credentialsProvider.getCredentials());
@ -290,6 +292,7 @@ public class KinesisProxy implements IKinesisProxyExtended {
} }
private ListShardsResult listShards(final String nextToken) { private ListShardsResult listShards(final String nextToken) {
// TODO: remove this before pushing code in.
LOG.info("Using ListShards to get shards information"); LOG.info("Using ListShards to get shards information");
final ListShardsRequest request = new ListShardsRequest(); final ListShardsRequest request = new ListShardsRequest();
// TODO: remove this once older constructors are removed // TODO: remove this once older constructors are removed

View file

@ -23,7 +23,8 @@ import com.amazonaws.services.kinesis.clientlibrary.lib.worker.KinesisClientLibC
/** /**
* Factory used for instantiating KinesisProxy objects (to fetch data from Kinesis). * Factory used for instantiating KinesisProxy objects (to fetch data from Kinesis).
* *
* @deprecated Will be removed since proxy is created only once, we don't need a factory. * @deprecated Will be removed since proxy is created only once, we don't need a factory. There is no replacement for
* this class. Will be removed in the next major/minor release.
*/ */
@Deprecated @Deprecated
public class KinesisProxyFactory implements IKinesisProxyFactory { public class KinesisProxyFactory implements IKinesisProxyFactory {

View file

@ -19,8 +19,8 @@ import com.amazonaws.services.kinesis.AmazonKinesis;
import com.amazonaws.services.kinesis.AmazonKinesisClient; import com.amazonaws.services.kinesis.AmazonKinesisClient;
/** /**
* * This class is only used for testing purposes, to make sure that the correct calls are made while using DynamoDB
* streams.
*/ */
public class AmazonDynamoDBStreamsAdapterClient extends AmazonKinesisClient { public class AmazonDynamoDBStreamsAdapterClient extends AmazonKinesisClient {
// This class is used for testing purposes.
} }

View file

@ -16,8 +16,8 @@
package com.amazonaws.services.dynamodbv2.streamsadapter; package com.amazonaws.services.dynamodbv2.streamsadapter;
/** /**
* * This class is only used for testing purposes, to make sure that the correct calls are made while using DynamoDB
* streams.
*/ */
public class AmazonDynamoDBStreamsAdapterClientChild extends AmazonDynamoDBStreamsAdapterClient { public class AmazonDynamoDBStreamsAdapterClientChild extends AmazonDynamoDBStreamsAdapterClient {
// Used only for testing
} }