Commit graph

387 commits

Author SHA1 Message Date
Sachin Sundar Pungampalayam Shanmugasundaram
96e3345496
Revert commit for e638c17 and added new test (#861)
* Revert commit for e638c17.

The change caused a regression for leases without owners.
Added unit tests.
2021-10-27 16:45:04 -07:00
Ravindranath Kakarla
7503ec7105
Upgrade Glue schema registry from 1.1.4 to 1.1.5 (#860)
Co-authored-by: Ravindranath Kakarla <rnath@amazon.com>
2021-10-14 03:01:45 -04:00
Sachin Sundar Pungampalayam Shanmugasundaram
4f6691ae12
Preparing for release 2.3.7 (#859) 2021-10-11 14:41:42 -07:00
Sachin Sundar Pungampalayam Shanmugasundaram
6df221ebf2
Upgrade AWS SDK version to 2.17.52. (#858) 2021-10-08 18:05:56 -04:00
madagascar22
6fd59b326a
Fix to shutdown PrefetchRecordsPublisher in gracefull manner (#857)
* Fix to shutdown PrefetchRecordsPublisher in gracefull manner

Previously when the lease expires PrefetchRecordsPublisher shutdown
the process forecefully by interupting the threads,
which lead to leak in apache http client connection
Now changed to code to shutdown the PrefetchRecordsPublisher
process in more gracefull manager and handled interrupted exception

* Fixed failing unit test

* Add awaitTerminationTimeoutMillis as paramter for PrefetchRecordsPublisher

Since clients can configure there own awaitTerminationTimeoutMillis,
add it as sepearate parameter with default value

* Fix setting interrupot status after shutdown

Co-authored-by: Monishkumar Gajendran <monishku@amazon.com>
2021-10-06 17:35:09 -07:00
Sachin Sundar Pungampalayam Shanmugasundaram
e81969af59
Create DynamoDB tables on On-Demand billing mode by default. (#854)
* Create DynamoDB tables on On-Demand billing mode by default.

This will enable KCL to create the DynamoDB tables - Lease and
ShardProgress with the On-Demand billing mode instead of provisioned
billing mode.

* Keep previous table creation function for backward compatibility.

* Added unit tests.

* Added more unit tests.
2021-10-06 15:54:23 -07:00
Roberto Tyley
2447513de3
Fix DynamoDBLeaseTaker logging of available leases (#846)
When `DynamoDBLeaseTaker` is deciding what leases to take to satisfy the
target lease-count of it's worker, it can either take *expired* leases
that haven't been updated by any other worker for a while, or failing
that, 'steal' a limited number (by default, 1) of leases from other
workers, in order to ensure its worker is gradually getting closer to
it's target.

It turns out that the log message it prints out when taking expired
leases is misleading. For instance, in this message - the leases
weren't stolen, they were taken from the available 'expired' leases:

```
Worker xxxxxx saw 68 total leases, 0 available leases, 6 workers. Target is 12 leases, I have 2 leases, I will take 10 leases
```

...yet the message says there were 0 available leases, so how is that
possible? The truth is, there were 10 available expired leases, but the
log message was printing out the value of `expiredLeases.size()` - and
`expiredLeases` has been mutated over the course of the method, with
entries removed and added to `leasesToTake`:

0c5042dadf/amazon-kinesis-client/src/main/java/software/amazon/kinesis/leases/dynamodb/DynamoDBLeaseTaker.java (L421)

The fix to logging in this commit just records `numAvailableLeases` at
the start of the method, so we can give an accurate log message:

```
Worker xxxxxx saw 68 total leases, 10 available leases, 6 workers. Target is 12 leases, I have 2 leases, I will take 10 leases
```
2021-10-04 05:34:27 -07:00
Roberto Tyley
e638c1730a
Make use of Java 8 to simplify computeLeaseCounts() (#847)
It's possible to remove quite a few lines of code from the
method using Java 8 features (a `groupingBy` Collector, etc).

Java 8 is the minimum supported version of the KCL since
https://github.com/awslabs/amazon-kinesis-client/pull/176 was
merged in July 2017.

See also:

https://docs.oracle.com/javase/8/docs/api/java/util/stream/package-summary.html#package.description
http://cr.openjdk.java.net/~briangoetz/lambda/lambda-translation.html
2021-10-04 03:21:11 -07:00
Marcel Walden
4fe29ff444
Fixing typo is debug logs. (#842)
maxLeasesToSteatAtOneTime -> maxLeasesToStealAtOneTime
2021-10-04 03:18:09 -07:00
Ravindranath Kakarla
c5ce30f6f7
Emit Glue Schema Registry usage metrics (#855)
* Emit Glue Schema Registry usage metrics

* Append KCL version to the app string.

Co-authored-by: Ravindranath Kakarla <rnath@amazon.com>
2021-09-30 05:05:44 -07:00
rexcsn
e73a8a9f3a
Add configurable initial position for orphaned stream (#853)
* Add default `orphanedStreamInitialPositionInStream` in `MultiStreamTracker`, so a custom initial position can be passed to Scheduler to initialize the orphaned stream's config
* Renamed `getDefaultStreamConfig` to `getOrphanedStreamConfig`
* Refactored `SchedulerTest` setup and implement `TestMultiStreamTracker` to test `MultiStreamTracker` interface default methods. Note that this is a workaround for using mockito 1.x to test default interface methods. mockito >= 2.7.13 supports Spy on interface directly, which can be used to test default methods without implementing a concrete class. However, mockito 2.x has a number of breaking changes, so future work will be needed to refactor unit tests and upgrade to mockito >= 2.7.13

Signed-off-by: Rex Chen <shuningc@amazon.com>
2021-08-26 12:23:20 -07:00
ashwing
36ff9dc0b3
Merge pull request #843 from ashwing/scheduler_error_logging
Better logging for scheduler exceptions
2021-07-29 10:42:08 -07:00
Ashwin Giridharan
5857551edb Better logging for scheduler exceptions 2021-07-29 10:35:43 -07:00
Giancarlo Klemm Camilo
b98db8c1ce
Change hierarchicalShardSyncer getter to be public. (#841)
Co-authored-by: Giancarlo Klemm Camilo <camilogi@amazon.com>
2021-07-26 14:30:39 -07:00
Avinash Chowdary
1a51b0eace
Merge pull request #838 from AvinashChowdary/master
Preparing for release 2.3.6
2021-07-09 15:45:06 -07:00
Avinash Ravilla
35107a6188 Preparing for release 2.3.6 2021-07-09 13:25:39 -07:00
Avinash Chowdary
6adcbf49d5
Merge pull request #836 from AvinashChowdary/master
Bumping aws sdk version
2021-07-09 13:13:59 -07:00
Avinash Ravilla
9cc2074761 Bumping aws sdk version 2021-07-09 10:54:35 -07:00
Avinash Chowdary
3e2c6f3fdc
Merge pull request #835 from hhkkxxx133/schema_registry_upgrade
Bump up Glue Schema Registry to 1.1.1
2021-07-09 10:04:37 -07:00
Kexin Hui
75ff0ea584 Bump up Glue Schema Registry to 1.1.1 2021-07-08 18:32:24 -07:00
kmz
a25835678a
Update the Worker shutdown logic to make sure that the LeaseCleanup Manager also terminates all the threads that it has started (#817)
Co-authored-by: kmz <kmz@users.noreply.github.com>
2021-06-30 17:32:16 -07:00
Ravindranath Kakarla
f65b3fd43b
Add support for Glue Schema Registry JSON data format. (#834)
Co-authored-by: Ravindranath Kakarla <rnath@amazon.com>
2021-06-30 13:28:58 -07:00
antoshen
7f18330ebd
Merge pull request #794 from tiaanl/silence-empty-warning
Silence warning when there are no stale streams to delete
2021-06-22 14:48:01 -07:00
Avinash Chowdary
7196a41cd4
Removed wildcard imports from PR#815 (#828)
Co-authored-by: Avinash Ravilla <ravillaa@amazon.com>
2021-06-16 16:26:36 -04:00
Avinash Chowdary
7995b05943
Preparing for release 2.3.5 (#825)
* upgraded aws java sdk, qos logback and aws sdk versions

* preparing for release

* added milestone

Co-authored-by: Avinash Ravilla <ravillaa@amazon.com>
2021-06-14 19:14:43 -04:00
Avinash Chowdary
225d0884d5
upgraded aws java sdk, qos logback and aws sdk versions (#824)
Co-authored-by: Avinash Ravilla <ravillaa@amazon.com>
2021-06-14 17:52:57 -04:00
Avinash Chowdary
96c93177a4
Merge pull request #762 from vicki-c/support-web-identity-token
adding support for web identity token in multilang
2021-06-02 14:43:41 -07:00
Avinash Chowdary
4e9e86ec76
Merge pull request #804 from kevioke/init-pos-timestamp
Allow InitialPositionInStreamExtended to be specified in properties file
2021-06-01 14:58:13 -07:00
Avinash Chowdary
968b47a779
Merge pull request #815 from etspaceman/completableFuture
Convert startGracefulShutdown() to a CompletableFuture
2021-06-01 14:57:52 -07:00
ashwing
4f6882cefe
Merge pull request #802 from awslabs/dependabot/maven/amazon-kinesis-client/com.google.guava-guava-29.0-jre
Bump guava from 26.0-jre to 29.0-jre in /amazon-kinesis-client
2021-05-21 17:04:21 -07:00
ashwing
7637e2c86d
Merge pull request #810 from awslabs/dependabot/maven/amazon-kinesis-client-multilang/commons-io-commons-io-2.7
Bump commons-io from 2.6 to 2.7 in /amazon-kinesis-client-multilang
2021-05-21 17:03:34 -07:00
Eric Meisel
c5fcfc6ee1
Remove added import 2021-05-11 16:57:02 -05:00
Eric Meisel
6516c36789
Convert startGracefulShutdown() to a CompletableFuture 2021-05-11 16:50:51 -05:00
kevin
afee84d7da Add more unit tests for exception cases 2021-05-10 13:48:37 -07:00
kevin
362e086d5d Create shared timestamp for testWithInitialPositionInStreamExtended 2021-05-10 10:51:13 -07:00
dependabot[bot]
df1106dea3
Bump commons-io from 2.6 to 2.7 in /amazon-kinesis-client-multilang
Bumps commons-io from 2.6 to 2.7.

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-26 20:37:34 +00:00
ashwing
bd96580b0a
Update README.md 2021-04-20 09:06:39 -07:00
kevin
6e0cbb905d Allow InitialPositionInStreamExtended to be specified in properties file
E.g. initialPositionInStreamExtended = 1617305352
2021-04-05 12:07:30 -07:00
ashwing
668422ccbd
Merge pull request #801 from Renjuju/fix-indefinitely-blocking-leaderElectionThreadPool-bug-fix
Add acquiredLock flag to prevent unlocking when no lock is held
2021-04-02 10:57:37 -07:00
Renju Radhakrishnan
3adc1c180c Add acquiredLock flag to prevent unlocking when no lock is held 2021-04-02 10:18:27 -07:00
dependabot[bot]
6b3a6e5cb8
Bump guava from 26.0-jre to 29.0-jre in /amazon-kinesis-client
Bumps [guava](https://github.com/google/guava) from 26.0-jre to 29.0-jre.
- [Release notes](https://github.com/google/guava/releases)
- [Commits](https://github.com/google/guava/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-31 22:25:56 +00:00
Tiaan Louw
51787690d9 Silence warning when there are no stale streams to delete 2021-03-10 12:14:44 +01:00
Joshua Kim
4fde788414
v2.2.4 Release (#789)
* Adding release notes

* Release 2.2.4

* fixing duplicate entry for 2.2.3

* Fixing typo

* Approved wording.

Co-authored-by: Joshua Kim <kimjos@amazon.com>
2021-02-19 16:41:27 -08:00
Joshua Kim
5d68e65c2c
Fixing bug where ShardFilter parameter for ListShards was being passe… (#788)
* Fixing bug where ShardFilter parameter for ListShards was being passed in for paginated calls.

This resulted in a bug where all calls for ListShards when initializing
the lease table would fail, since Kinesis only requires the NextToken
parameter when making paginated calls.

* Adding some logging for listShards.

Co-authored-by: Joshua Kim <kimjos@amazon.com>
2021-02-18 18:26:24 -08:00
ashwing
d5cac07851
Update README.md 2021-01-27 17:05:57 -08:00
ashwing
e03285508e
Merge pull request #775 from Renjuju/fix-daemon-thread-exception-handling
Move throwable exception handling up a level to prevent daemon thread death
2021-01-22 13:27:19 -08:00
Renju Radhakrishnan
0064d1e5fc Move throwable exception handling up a level to prevent daemon thread death 2021-01-22 13:12:57 -08:00
yatins47
d07192c3e9
Merge pull request #768 from yatins47/master
KCL V2.3.3 release notes.
2020-12-23 14:30:26 -08:00
Yatin
1274a63fcc KCL V2.3.3 release notes. 2020-12-23 14:26:19 -08:00
yatins47
e58dffee87
Merge pull request #767 from yatins47/master
Fixing bug where idleTimeBetweenReadsInMillis property was ignored in…
2020-12-23 13:54:37 -08:00