Addressing comments and update the version

This commit is contained in:
Chunxue Yang 2019-10-09 18:27:43 -07:00
parent d5e6c74d77
commit afd7742c70
4 changed files with 7 additions and 7 deletions

View file

@ -21,7 +21,7 @@
<parent>
<artifactId>amazon-kinesis-client-pom</artifactId>
<groupId>software.amazon.kinesis</groupId>
<version>2.2.4</version>
<version>2.2.5</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View file

@ -22,7 +22,7 @@
<parent>
<groupId>software.amazon.kinesis</groupId>
<artifactId>amazon-kinesis-client-pom</artifactId>
<version>2.2.4</version>
<version>2.2.5</version>
</parent>
<artifactId>amazon-kinesis-client</artifactId>

View file

@ -104,7 +104,7 @@ public class ShutdownTask implements ConsumerTask {
if (localReason == ShutdownReason.SHARD_END) {
allShards = shardDetector.listShards();
if (!CollectionUtils.isNullOrEmpty(allShards) && !shardEndValidated(allShards)) {
if (!CollectionUtils.isNullOrEmpty(allShards) && !validateShardEnd(allShards)) {
localReason = ShutdownReason.LEASE_LOST;
}
}
@ -190,16 +190,16 @@ public class ShutdownTask implements ConsumerTask {
return reason;
}
private boolean shardEndValidated(List<Shard> shards) {
private boolean validateShardEnd(List<Shard> shards) {
for(Shard shard : shards) {
if (isChildShard(shard)) {
if (isChildShardOfCurrentShard(shard)) {
return true;
}
}
return false;
}
private boolean isChildShard(Shard shard) {
private boolean isChildShardOfCurrentShard(Shard shard) {
return (shard.parentShardId() != null && shard.parentShardId().equals(shardInfo.shardId())
|| shard.adjacentParentShardId() != null && shard.adjacentParentShardId().equals(shardInfo.shardId()));
}

View file

@ -22,7 +22,7 @@
<artifactId>amazon-kinesis-client-pom</artifactId>
<packaging>pom</packaging>
<name>Amazon Kinesis Client Library</name>
<version>2.2.4</version>
<version>2.2.5</version>
<description>The Amazon Kinesis Client Library for Java enables Java developers to easily consume and process data
from Amazon Kinesis.
</description>