Commit graph

109 commits

Author SHA1 Message Date
Justin Pfifer
f9701f9651 Merge Release 1.8.2 (#220)
* MultiLangDaemon: Make shutdown grace configurable (#204)

Allow configuring the amount of time that the graceful shutdown process will wait for the client to complete its shutdown.

* Release 1.8.2 of the Amazon Kinesis Client for Java (#218)

* Add support for two phase checkpoints
  Applications can now set a pending checkpoint, before completing the checkpoint operation. Once the application has completed its checkpoint steps, the final checkpoint will clear the pending checkpoint.
  Should the checkpoint fail the attempted sequence number is provided in the InitializationInput#getPendingCheckpointSequenceNumber otherwise the value will be null.
  * PR #188
* Support timeouts, and retry for GetRecords calls.
  Applications can now set timeouts for GetRecord calls to Kinesis.  As part of setting the timeout, the application must also provide a thread pool size for concurrent requests.
  * PR #214
* Notification when the lease table is throttled
  When writes, or reads, to the lease table are throttled a warning will be emitted.  If you're seeing this warning you should increase the IOPs for your lease table to prevent processing delays.
  * PR #212
* Support configuring the graceful shutdown timeout for MultiLang Clients
  This adds support for setting the timeout that the Java process will wait for the MutliLang client to complete graceful shutdown.  The timeout can be configured by adding shutdownGraceMillis to the properties file set to the number of milliseconds to wait.
  * PR #204
2017-09-21 10:23:38 -07:00
Justin Pfifer
40aaece7c3 Merge pull request #216 from sahilpalvia/prefetch
Adding default caching class and fetching stratergy
2017-09-19 16:09:13 -07:00
Sahil Palvia
a8edb70552 Addressing PR comments. 2017-09-19 14:48:43 -07:00
Sahil Palvia
5172f4f936 Adding null condition to getRecords in the KinesisDataFetcher class. Changing the abstract class back to an interface. 2017-09-19 14:25:25 -07:00
Sahil Palvia
14ebfb8f0f Adding Blocking cache and spilting into blocking and prefetching cache. Changing the GetRecordsCache interface to abstract class. 2017-09-19 13:57:32 -07:00
Sahil Palvia
b6f41d21f8 Merge remote-tracking branch 'upstream/prefetch' into prefetch 2017-09-19 12:09:33 -07:00
Sahil Palvia
bcee1ae395 Adding default caching class and enum for fetching strategy. 2017-09-19 12:06:50 -07:00
Sahil Palvia
c92a5b556c Adding the cache and the retriver stubs. (#215)
* Adding the cache and the retriver stubs.

* Addressing comments and adding initial documentation and changing the retreiver from interface to class.

* Reverting back to the interface

* Fixing minor error

* Adding default cache stub
2017-09-18 16:35:31 -07:00
Sahil Palvia
66b809ef7b Adding default cache stub 2017-09-18 16:32:54 -07:00
Sahil Palvia
c70ab1fc72 Fixing minor error 2017-09-18 15:02:46 -07:00
Sahil Palvia
9def913453 Reverting back to the interface 2017-09-18 15:02:06 -07:00
Sahil Palvia
8ceb5f2492 Addressing comments and adding initial documentation and changing the retreiver from interface to class. 2017-09-18 14:59:48 -07:00
Sahil Palvia
190d8fb5aa Adding the cache and the retriver stubs. 2017-09-18 13:26:09 -07:00
Sahil Palvia
244da44d29 Allow Configuring GetRecords Calls to Timeout. (#214)
It's now possible to configure GetRecords calls to timeout if they
take to long.  This can be used to terminate a long running request to
ensure that record processors continue to make progress

This feature was added with contributions from @pfifer, @sahilpalvia,
and @BtXin.
2017-09-18 10:58:16 -07:00
Sahil Palvia
656b17ceaa Adding logging for DynamoDB ProvisionedThroughputExceededExcpetion (#212)
* Adding logging to ProvisionedThroughputExceededException.

* Addressing CR comments and changing log level from error to warn

* Updated the comments as per cr comments.
2017-09-15 11:04:30 -07:00
Walid Baruni
1ec0b656c9 Add Support for Two Phase Commit (#188)
Adds support for making two phase commits.  When a checkpoint is started, but fails to complete the next instance of the record processor will receive the attempted checkpoint position at initialization time.
2017-08-15 12:56:32 -07:00
Justin Pfifer
cdbbff31e8 Advance to 1.8.2-SNAPSHOT (#203)
Advanced the version to 1.8.2
2017-08-14 09:05:12 -07:00
Justin Pfifer
79296dad2e Release 1.8.1 of the Amazon Kinesis Client (#198)
Support timeouts for calls to the MultiLang Daemon
This adds support for setting a timeout when dispatching records to
the client record processor. If the record processor doesn't respond
within the timeout the parent Java process will be terminated. This
is a temporary fix to handle cases where the KCL becomes blocked
while waiting for a client record processor.

The timeout for the this can be set by adding
  `timeoutInSeconds = <timeout value>`.
The default for this is no timeout.

Setting this can cause the KCL to exit suddenly, before using this
ensure that you have an automated restart for your application

Related #195
Related #185
2017-08-02 10:41:14 -07:00
Pfifer, Justin
526a1fa0df Updated AWS SDK to 1.11.171 2017-08-02 10:33:23 -07:00
Sahil Palvia
e8f9ad3f0a Adding support for timeout for multilang protocol, related to issue 185 (#195)
* Adding timeout to waitForStatusMessage future call. Introducing new config properties timeoutEnabled and timeoutInSeconds. Halting the JVM if timeout is reached.

* Adding test cases for halt jvm code. Made the configuration objects for timeout optional.

* Addressing code review comments and making appropriate changes.
2017-08-01 11:37:39 -07:00
Justin Pfifer
7d56c4aef1 Advance Version to 1.8.1-SNAPSHOT (#194)
Advance version of the amazon-kinesis-client to 1.8.1-SNAPSHOT in
preparation of next release cycle.
2017-07-25 14:19:34 -07:00
Justin Pfifer
af51312307 Release 1.8.0 (#193)
* Execute graceful shutdown on its own thread
  * PR #191
  * Issue #167
* Added support for controlling the size of the lease renewer thread pool
  * PR #177
  * Issue #171
* Require Java 8 and later
  Java 8 is now required for versions 1.8.0 of the amazon-kinesis-client and later.
  * PR #176
2017-07-25 09:22:48 -07:00
Justin Pfifer
c067cefa1f Make Graceful Shutdown Run On Its Own Thread (#191)
* Initial start of fix for requested shutdown

* Execute the requested shutdown in a separate thread.

Fix for Issue #167

* Reworked some of the shutdown logic to make the relationships clearer.

* Added/Updated Copyright Statements

* Add Missing License Statements
2017-07-21 08:30:26 -07:00
Justin Pfifer
f697a094d9 Make the lease renewer thread pool size configurable (#177)
Allow configuration of the lease renewer thread pool size.  Users can
now control the size of the pool.  Additionally core threads are now
a quarter of the thread pool size, and aren't allowed to timeout.
2017-07-20 12:07:21 -07:00
Justin Pfifer
14e2413c13 Advance version, and drop Java 7 support (#176)
* Advance version, and drop Java 7 support

Advanced the version to 1.8.0 as Java 7 support is being removed.

* Remove build settings for Java 7

Removed the configuration for Java 7, and switched to trusty for access
to openjdk8.
2017-07-20 12:03:34 -07:00
Justin Pfifer
4c839a9d43 Release 1.7.6 of the Amazon Kinesis Client (#184)
* Added support for graceful shutdown in MultiLang Clients
  * PR #174
  * PR #182
* Updated documentation for `v2.IRecordProcessor#shutdown`, and `KinesisClientLibConfiguration#idleTimeBetweenReadsMillis`
  * PR #170
* Updated to version 1.11.151 of the AWS Java SDK
  * PR #183
2017-06-22 06:56:42 -07:00
Justin Pfifer
dabdc29822 Update to the Newest Version of the AWS Java SDK (#183) 2017-06-21 08:54:18 -07:00
Justin Pfifer
d7ed56d4d0 Added ShutdownRequestedMessage to the subtypes for Message (#182)
Added the ShutdownRequestedMessage to the subtypes for Message.  This ensures that the action value of the message will be correctly set.
2017-06-21 08:36:41 -07:00
Muhammad Ikramul Haq
5a8bac23c6 Trigger Graceful Shutdown for MultiLang Daemon Clients on SIGTERM (#174)
When the parent Java process receives a SIGTERM it will now trigger a graceful shutdown of the worker, which dispatches a ShutdownRequestedMessage to all of the record processors.  This will allow record processors a final chance to checkpoint before the lease is terminated.

This changes is incompatible with current versions of the MultiLang Clients.  A future change will allow older versions MultiLang clients to use newer versions of the Java KCL.
2017-06-21 07:52:30 -07:00
Pfifer, Justin
198f8afce7 Advance Version to 1.7.6 for Next Release 2017-06-21 07:46:06 -07:00
Pfifer, Justin
e121691ac2 Cleanup the Writing of the IdleTimeBetweenMillis Documentation 2017-06-01 08:26:16 -07:00
Pfifer, Justin
e12ff541f7 Enable Building Both Source, and JavaDoc jars 2017-06-01 08:26:16 -07:00
Pfifer, Justin
ddfd64e40a Update the Documentation for Shutdown to List Checkpoint Requirements
When the KCL calls shutdown with the reason TERMINATE the customer's
application must checkpoint, or the KCL will not make progress.
2017-06-01 08:26:16 -07:00
Pfifer, Justin
f0557179f1 Improved Documentation for IdleTimeBetweenReadsMillis
Updated the documentation to indicates that it is only used when
GetRecords returns an empty set of records.
2017-06-01 08:26:16 -07:00
Pfifer, Justin
8d339bdb88 Release 1.7.5 of the Amazon Kinesis Client Library
* Correctly handle throttling for DescribeStream, and save accumulated progress from individual calls.
  * PR #152
* Upgrade to version 1.11.115 of the AWS Java SDK
  * PR #155
2017-04-07 10:39:44 -07:00
Pfifer, Justin
81f3283f02 Added PR for Latest Version of SDK
Added the link to the PR for the latest version of the AWS Java SDK.
2017-04-07 10:08:02 -07:00
Pfifer, Justin
22773b2a44 Initial Release Notes for Release 1.7.5
Added the initial release notes for 1.7.5, but will update the AWS SDK
before finalizing them.
2017-04-07 10:08:02 -07:00
Pfifer, Justin
105c4f2a6b Upgrade to Version 1.11.115 of the AWS Java SDK
Upgraded to the current version.
2017-04-07 09:41:52 -07:00
Pfifer, Justin
97a29fc918 Update to a Newer Version of DynamoDB Local
Updated to a newer version of the DynamoDB Local library, and updated
the repository location.
2017-03-28 07:49:43 -07:00
Pfifer, Justin
fb4270e98b Change Shard Iterator State Reset to Recreation
Changed the shard iterator reset to simply recreate the iterator.
2017-03-28 07:49:43 -07:00
Pfifer, Justin
e45f59c73b Better Handling of Describe Stream Throttling
Improve the handling of describe stream throttling by no longer
triggering a null pointer exception when all requests are throttled.
Also store the last position reached, and always restart from
there.
2017-03-28 07:49:43 -07:00
Pfifer, Justin
92e8c28995 Advance Version to 1.7.5-SNAPSHOT
Advance the package version in preparation for development.
2017-03-20 10:05:13 -07:00
Pfifer, Justin
0a91e6faa5 Release 1.7.4 of the Amazon Kinesis Client
* Fixed an issue building JavaDoc for Java 8.
  * [Issue #18](https://github.com/awslabs/amazon-kinesis-client/issues/18)
  * [PR #141](https://github.com/awslabs/amazon-kinesis-client/pull/141)
* Reduce Throttling Messages to WARN, unless throttling occurs 6 times consecutively.
  * [Issue #4](https://github.com/awslabs/amazon-kinesis-client/issues/4)
  * [PR #140](https://github.com/awslabs/amazon-kinesis-client/pull/140)
* Fixed two bugs occurring in requestShutdown.
  * Fixed a bug that prevented the worker from shutting down, via requestShutdown, when no leases were held.
    * [Issue #128](https://github.com/awslabs/amazon-kinesis-client/issues/128)
  * Fixed a bug that could trigger a NullPointerException if leases changed during requestShutdown.
    * [Issue #129](https://github.com/awslabs/amazon-kinesis-client/issues/129)
  * [PR #139](https://github.com/awslabs/amazon-kinesis-client/pull/139)
* Upgraded the AWS SDK Version to 1.11.91
  * [PR #138](https://github.com/awslabs/amazon-kinesis-client/pull/138)
* Use an executor returned from `ExecutorService.newFixedThreadPool` instead of constructing it by hand.
  * [PR #135](https://github.com/awslabs/amazon-kinesis-client/pull/135)
* Correctly initialize DynamoDB client, when endpoint is explicitly set.
  * [PR #142](https://github.com/awslabs/amazon-kinesis-client/pull/142)
2017-02-27 08:12:17 -08:00
Christopher Chambers
4ed375b0af Add missing init for DynamoDB client in Worker (#51)
When the dynamoDBEndpoint configuration property was added, not all paths that
should have made use of it were updated.  Both paths now use the config value to
set up the DynamoDB client.
2017-02-27 07:47:15 -08:00
Sahn Lam
9113ae2e72 Use ExecutorService.newFixedThreadPool for LeaseRenewer
The existing ThreadPoolExecutor was misconfigured and caused
the thread pool to recycle idle threads continuously. VisualVM
showed that a thread got recycled about every 3 seconds, creating
and destroying several hundred threads in about 15 minutes.

Use ExecutorService.newFixedThreadPool instead, as recommended
by the javadoc for ExecutorService.
2017-02-24 05:57:59 -08:00
Justin Pfifer
030ae1cb15 Disable doclint When Building With Java 8 (#141)
Disable the JavaDoc doclint when building with Java 8.  Java 8 became
much more pedantic on bad practices, and the documentation hasn't been
cleaned up.
2017-02-17 10:32:21 -08:00
Justin Pfifer
2967f2a18c Reduce Throttling Error Reports (#140)
* Reduce Throttling Error Reports

Only report a throttling error if their are 6 consecutive throttles.
Moved the logging of throttling messages to the throttling
reporter.
2017-02-17 09:52:47 -08:00
Justin Pfifer
31615a5d18 Handle No Lease, and Lease Loss in requestShutdown. (#139)
* Handle No Lease, and Lease Loss in requestShutdown.

Ensure that the Worker is shutdown if there are no leases.  Handle the
case where a lease is lost during the notification process.

* Add some more comments around possible race conditions.
2017-02-17 09:32:26 -08:00
Justin Pfifer
bf7152475a Use the Current Version of the AWS Java SDK (#138)
Updated to the 1.11.91 version of the AWS Java SDK.
2017-02-17 09:19:31 -08:00
Pfifer, Justin
037e886a76 Advance Version to 1.7.4-SNAPSHOT
Advance the version to 1.7.4-SNAPSHOT in preparation of the next release.
2017-02-17 09:09:02 -08:00