Cleaning up all TODOs. Changing logging level for some log messages.

This commit is contained in:
Sahil Palvia 2018-01-31 14:23:47 -08:00
parent c5c408b6e2
commit 6c68675068

View file

@ -217,10 +217,10 @@ public class KinesisProxy implements IKinesisProxyExtended {
if (Class.forName("com.amazonaws.services.dynamodbv2.streamsadapter.AmazonDynamoDBStreamsAdapterClient") if (Class.forName("com.amazonaws.services.dynamodbv2.streamsadapter.AmazonDynamoDBStreamsAdapterClient")
.isAssignableFrom(client.getClass())) { .isAssignableFrom(client.getClass())) {
isKinesisClient = false; isKinesisClient = false;
LOG.info("Client is DynamoDb client, will use DescribeStream."); LOG.debug("Client is DynamoDb client, will use DescribeStream.");
} }
} catch (ClassNotFoundException e) { } catch (ClassNotFoundException e) {
LOG.info("Client is Kinesis Client, using ListShards instead of DescribeStream."); LOG.debug("Client is Kinesis Client, using ListShards instead of DescribeStream.");
} }
} }
@ -232,7 +232,6 @@ public class KinesisProxy implements IKinesisProxyExtended {
throws ResourceNotFoundException, InvalidArgumentException, ExpiredIteratorException { throws ResourceNotFoundException, InvalidArgumentException, ExpiredIteratorException {
final GetRecordsRequest getRecordsRequest = new GetRecordsRequest(); final GetRecordsRequest getRecordsRequest = new GetRecordsRequest();
// TODO: remove this once older constructors are removed
getRecordsRequest.setRequestCredentials(credentialsProvider.getCredentials()); getRecordsRequest.setRequestCredentials(credentialsProvider.getCredentials());
getRecordsRequest.setShardIterator(shardIterator); getRecordsRequest.setShardIterator(shardIterator);
getRecordsRequest.setLimit(maxRecords); getRecordsRequest.setLimit(maxRecords);
@ -249,7 +248,6 @@ public class KinesisProxy implements IKinesisProxyExtended {
public DescribeStreamResult getStreamInfo(String startShardId) public DescribeStreamResult getStreamInfo(String startShardId)
throws ResourceNotFoundException, LimitExceededException { throws ResourceNotFoundException, LimitExceededException {
final DescribeStreamRequest describeStreamRequest = new DescribeStreamRequest(); final DescribeStreamRequest describeStreamRequest = new DescribeStreamRequest();
// TODO: remove this once older constructors are removed
describeStreamRequest.setRequestCredentials(credentialsProvider.getCredentials()); describeStreamRequest.setRequestCredentials(credentialsProvider.getCredentials());
describeStreamRequest.setStreamName(streamName); describeStreamRequest.setStreamName(streamName);
describeStreamRequest.setExclusiveStartShardId(startShardId); describeStreamRequest.setExclusiveStartShardId(startShardId);
@ -292,10 +290,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");
final ListShardsRequest request = new ListShardsRequest(); final ListShardsRequest request = new ListShardsRequest();
// TODO: remove this once older constructors are removed
request.setRequestCredentials(credentialsProvider.getCredentials()); request.setRequestCredentials(credentialsProvider.getCredentials());
if (StringUtils.isEmpty(nextToken)) { if (StringUtils.isEmpty(nextToken)) {
request.setStreamName(streamName); request.setStreamName(streamName);
@ -442,7 +437,6 @@ public class KinesisProxy implements IKinesisProxyExtended {
+ "ShardIteratorTypes. For methods to use with other ShardIteratorTypes, see IKinesisProxy.java"); + "ShardIteratorTypes. For methods to use with other ShardIteratorTypes, see IKinesisProxy.java");
} }
final GetShardIteratorRequest getShardIteratorRequest = new GetShardIteratorRequest(); final GetShardIteratorRequest getShardIteratorRequest = new GetShardIteratorRequest();
// TODO: remove this once older constructors are removed
getShardIteratorRequest.setRequestCredentials(credentialsProvider.getCredentials()); getShardIteratorRequest.setRequestCredentials(credentialsProvider.getCredentials());
getShardIteratorRequest.setStreamName(streamName); getShardIteratorRequest.setStreamName(streamName);
getShardIteratorRequest.setShardId(shardId); getShardIteratorRequest.setShardId(shardId);
@ -459,7 +453,6 @@ public class KinesisProxy implements IKinesisProxyExtended {
@Override @Override
public String getIterator(String shardId, String iteratorType) { public String getIterator(String shardId, String iteratorType) {
final GetShardIteratorRequest getShardIteratorRequest = new GetShardIteratorRequest(); final GetShardIteratorRequest getShardIteratorRequest = new GetShardIteratorRequest();
// TODO: remove this once older constructors are removed
getShardIteratorRequest.setRequestCredentials(credentialsProvider.getCredentials()); getShardIteratorRequest.setRequestCredentials(credentialsProvider.getCredentials());
getShardIteratorRequest.setStreamName(streamName); getShardIteratorRequest.setStreamName(streamName);
getShardIteratorRequest.setShardId(shardId); getShardIteratorRequest.setShardId(shardId);
@ -476,7 +469,6 @@ public class KinesisProxy implements IKinesisProxyExtended {
@Override @Override
public String getIterator(String shardId, Date timestamp) { public String getIterator(String shardId, Date timestamp) {
final GetShardIteratorRequest getShardIteratorRequest = new GetShardIteratorRequest(); final GetShardIteratorRequest getShardIteratorRequest = new GetShardIteratorRequest();
// TODO: remove this once older constructors are removed
getShardIteratorRequest.setRequestCredentials(credentialsProvider.getCredentials()); getShardIteratorRequest.setRequestCredentials(credentialsProvider.getCredentials());
getShardIteratorRequest.setStreamName(streamName); getShardIteratorRequest.setStreamName(streamName);
getShardIteratorRequest.setShardId(shardId); getShardIteratorRequest.setShardId(shardId);
@ -496,7 +488,6 @@ public class KinesisProxy implements IKinesisProxyExtended {
String partitionKey, String partitionKey,
ByteBuffer data) throws ResourceNotFoundException, InvalidArgumentException { ByteBuffer data) throws ResourceNotFoundException, InvalidArgumentException {
final PutRecordRequest putRecordRequest = new PutRecordRequest(); final PutRecordRequest putRecordRequest = new PutRecordRequest();
// TODO: remove this once older constructors are removed
putRecordRequest.setRequestCredentials(credentialsProvider.getCredentials()); putRecordRequest.setRequestCredentials(credentialsProvider.getCredentials());
putRecordRequest.setStreamName(streamName); putRecordRequest.setStreamName(streamName);
putRecordRequest.setSequenceNumberForOrdering(exclusiveMinimumSequenceNumber); putRecordRequest.setSequenceNumberForOrdering(exclusiveMinimumSequenceNumber);