Commit graph

167 commits

Author SHA1 Message Date
Micah Jaffe
317dc1ae84 Update snapshot version 2019-08-07 17:15:58 -07:00
Micah Jaffe
f1a50cd14b Preparing release v1.11.0 (#581)
* Preparation for v1.11.0

* Update wording
2019-08-07 15:38:14 -07:00
Parijat Sinha
7a1d3031c5 Introducing support for periodic shard sync (#579)
* Changes to support injection of ShardSyncer, LeaseTaker, and LeaseRenewer into KCL Worker

* Additional checks around injection of LeaseRenewer and LeaseRenewerThreadPool

* Changed accessor on InitialPositionInStreamExtended to public to allow ShardSyncer injection

* Changed ShardSyncer to a public interface. Renamed implementation to KinesisShardSyncer.

* Removed wild card imports introduced in previous commit

* Minor refactoring in Worker Builder

* Added license info to ShardSyncer interface. Minor refactoring

* Changes to chain constructor in LeaseCoordinator

* Changed accessor on InitialPositionInStreamExtended factory methods. Minor changes in Worker builder.

* Changes to support periodic shard sync

* Patching changes left out in merge

* Overriding shard-sync idle time to 0 for periodic shard-sync

* Addressed PR feedback

* Addresed PR #579 review comments

* Modified constructor for DeterministicShuffleShardSyncLeaderDecider

* Addressed PR comments

* Fixed failing test

* Removed redundant member varible
2019-08-07 15:37:20 -07:00
micah-jaffe
aa3ab52cdf Preparation for v1.11.0 2019-08-06 14:20:21 -07:00
Micah Jaffe
5e4888f431 Revert "Preparation for v1.11.0"
This reverts commit 36673e0877.
2019-08-06 12:55:34 -07:00
Micah Jaffe
36673e0877 Preparation for v1.11.0 2019-08-06 12:48:09 -07:00
Anoop Garlapati
3aefdfa28a Better handling of get checkpoint object in KinesisClientLibLeaseCoordinator (#558)
Improve the handling of get checkpoint object in KinesisClientLibLeaseCoordinator
by no longer triggering a null pointer exception when lease is null.
2019-07-09 11:31:30 -07:00
Cory-Bradshaw
73dc2aaa76 1.10.1-SNAPSHOT version update (#545) 2019-04-09 12:15:06 -07:00
Cory-Bradshaw
6c066a8e6d Preparation for v1.10.0 (#540) 2019-04-08 10:47:33 -07:00
awslankakamal
bb81bfaa66 Updating license to Apache License 2.0 (#522) 2019-04-05 16:08:24 -07:00
achitojha
fbdd449759 Separated out some lease taker logic as interface implementations to … (#490)
Added interfaces to allow external users to control the lease selection, and cleanup.
2019-02-20 11:48:40 -08:00
Justin Pfifer
54e6a48a48
Advance version to, and add release notes for 1.9.3 (#460)
Advanced the version for to 1.9.3
Added release notes for version 1.9.3
2018-10-30 12:49:37 -07:00
Sahil Palvia
e1227954f5
Fixing tests that break occasionally (#455) 2018-10-25 10:39:46 -07:00
Sahil Palvia
1d5cb599fd
Upgrading commons-lang from 2.6 to 3.7 (#406) 2018-09-20 00:07:09 +05:30
Justin Pfifer
8fb01ddd08
Release notes for 1.9.2 and updated versions (#390)
Release notes for 1.9.2 and updated versions
2018-09-04 10:40:27 -07:00
Michael Scharp
cba8bf6bfa Adding Proxy support to multilang for version 1.x (#376)
* Add proxy support

Read proxy info from application.properties file first,
then java system settings, and finally from ENV vars.

* Formatted code according to AWS scheme.

Import specific classes, not *.

* Add proxy config unit tests

* Changed per @sahilpalvia comments

* Fix failing test

* Changed per @sahilpalvia comments

* Fixing missed http_proxy string

* Changed per @sahilpalvia comments
2018-08-23 13:35:03 -07:00
Justin Pfifer
f1d60ec1a6 Remove tests that no longer work (#346)
The new version of the SDK no longer returns null on an unknown
region.  There's not much we can do but run with whatever region is configured
2018-06-12 14:29:22 -07:00
Justin Pfifer
2483f8cbf8 Added cache updating behavior for GetShard (#344)
* Added cache updating behavior for GetShard

Customer are occasionally seeing messages about being unable to
retrieve shard information, which is logged as a warning.  This change
will allow the shard map to be updated even when there is no re-shard
operation.

This now triggers a shard list update if there is 1000 cache misses,
or a cache miss occurs when the cache is more than 30 seconds old.
For Kinesis the updates will use ListShards, and for DynamoDB Streams
it will continue to use DescribeStream.

* Adjust some logging, and the zeroing of cache misses a bit

Only log about cache refresh if it's the thread doing the cache
refresh.  If after synchronizing the shard is present, accept that
someone else loaded the shard map, and move on.

If the cache was reloaded, and the shard was found the current thread
will reset the cache misses.

The warnings for the cache miss was using a modulo of 1000 which is
the maximum value for cache misses, so wasn't to useful.
2018-06-07 13:25:03 -07:00
Marcin Ciszak
a84885db79 Enables property for setting AT_TIMESTAMP shard iterator initial time… (#342)
Allows setting the timestamp for InitialPositiinInStream.AT_TIMESTAMP from a properties file.
2018-05-29 09:52:08 -07:00
Sahil Palvia
be60a5507d Logging fixes for tests (#340)
* Adding log4j dependency for testing. Moving log4j.properties from test/src to test/resources.
2018-05-17 13:27:35 -07:00
Sahil Palvia
86cc068454 Fix for Worker to handle immutable clients (#305) 2018-05-04 10:06:13 -07:00
Justin Pfifer
5d183e0197 Release 1.9.1 of the Amazon Kinesis Client Library for Java (#337)
* Release 1.9.1 of the Amazon Kinesis Client Library for Java

Updated versions, and added release notes.

* Added note about the update of the AWS Java SDK
2018-04-30 13:18:41 -07:00
Sahil Palvia
a53473d536 Refactoring the Worker to make it manageable (#300)
* Reformatting the constructors to be together in the Worker class.

* Using lombok annotations to replace setters in the Worker.Builder.

* Deprecating all the public constructors for the Worker class. Recommending to use the Worker.Builder to create the Worker object.

* Including annotation usage for leaseManager in  the Worker.Builder

* Adding capability to support Immutable clients by the Worker and Worker.Builder

* Adding annotation support for WorkerStateChangeListener.
2018-03-05 10:25:41 -08:00
Walid Baruni
523cc0e2cc Fix preparing a checkpoint at SHARD_END (#301)
Fix IllegalArgumentException: Sequence number must be numeric, when preparing a checkpoint at SHARD_END
2018-02-27 08:49:20 -08:00
nyo
24916ba552 Created listener for worker state change (#291)
* Created listener for worker state change
#275
2018-02-27 06:54:16 -08:00
Felipe Gasparini
6fc148740d Allow specifying a custom LeaseManager in Worker.Builder with tests (#297)
* Allow specifying a custom LeaseManager in Worker.Builder

* Added unit tests for ILeaseManager injection in Worker Builder
2018-02-14 09:03:49 -08:00
Sahil Palvia
3ae916c5fc Introduction of Listshards API to replace DescribeStream (#293)
Use ListShards to retrieve shard information for Amazon Kinesis streams.
2018-02-06 07:35:44 -08:00
Sahil Palvia
8d6c7692cb Updating tests to fix build issues. (#286) 2018-01-26 07:16:46 -08:00
Sahil Palvia
e65e56380b Fixing issue with NullMetrics warning messages (#284)
Fixes #48 

* Fixing issue with NullMetrics warning messages when trying to checkpoint on a separate thread.

* Adding testing to validate the MetricsScope setting during checkpoiniting.
2018-01-22 10:37:46 -08:00
Sahil Palvia
71124e4055
Updating version to 1.8.10. (#283) 2018-01-16 15:58:26 -08:00
parijatsinha
222bcdaf3f Adding capability to set KinesisProxy using Worker.Builder (#274)
* Added IKinesisProxy injector in Worker.Builder to allow injecting custom proxy implementations

* Added unit tests for IKinesisProxy injection in Worker Builder

* Revert "Added unit tests for IKinesisProxy injection in Worker Builder"

This reverts commit aa944c1706.
Reverting to undo changes to import ordering.

* Added unit tests for IKinesisProxy injection in Worker Builder

Re-added unit tests after reverting changes to import ordering.

* Revert "Added unit tests for IKinesisProxy injection in Worker Builder"

This reverts commit 91e445774b.
Reverting to refactor unit tests.

* Added unit tests for Worker Builder IKinesisProxy injection validation

Refactored unit tests as per comments in the pull request.

* Added debug logs in KinesisLocalFileDataCreator

* Revert "Added debug logs in KinesisLocalFileDataCreator"

This reverts commit 1ff00d0b01.

* Edited JavaDoc for Worker Builder kinesisProxy
2018-01-15 14:31:04 -08:00
Pfifer, Justin
db72cc15f8 Advance version to 1.8.9-SNAPSHOT 2018-01-04 08:32:50 -08:00
Mike Watters
9074864027 [Issue 210] - Allow unexpected child shards to be ignored (#240)
Allow unexpected child shards to be ignored

now instead of always throwing an assertion if a child shard has an
open parent, consider worker configuration before doing so.  if
configured to ignore such shards, do not create leases for them during
shard sync.  this is intended to mitigate failing worker init when
processing dynamodb streams with many thousands of shards (which can
happen for tables with thousands of partitions).

this new behavior can be enabled by adding the following to a
configuration/properties file:

```
ignoreUnexpectedChildShards = true
```
2018-01-04 08:29:44 -08:00
Pfifer, Justin
47e6206e8d Release 1.8.8 of the Amazon Kinesis Client for Java
Release 1.8.8
* Fixed issues with leases losses due to `ExpiredIteratorException` in `PrefetchGetRecordsCache` and `AsynchronousFetchingStrategy`.
  PrefetchGetRecordsCache will request for a new iterator and start fetching data again.
  * PR#263
* Added warning message for long running tasks.
  * PR#259
* Handling spurious lease renewal failures gracefully.
  Added better handling of DynamoDB failures when updating leases.  These failures would occur when a request to DynamoDB appeared to fail, but was actually successful.
  * PR#247
* ShutdownTask gets retried if the previous attempt on the ShutdownTask fails.
  * PR#267
* Fix for using maxRecords from `KinesisClientLibConfiguration` in `GetRecordsCache` for fetching records.
  * PR#264
2017-11-15 10:44:49 -08:00
Sahil Palvia
09b312028a Unit test fixes for retrying when requesting a shutdown. (#267)
* Shutdown that throws an exception will be retried.

Without this change a transient error on shutdown with reason terminate prevents
child shards from starting.

* Fixing the tests for the Shutdown fix.
2017-11-13 09:45:40 -08:00
Sahil Palvia
1abb41dbdb Correctly Send MaxRecords to SingleRecordsFetcherFactory Fixed #262
Fixes #262 

Changing the signture of SingleRecordsFetcherFactory to no longer take maxRecords as the parameter to the constructor. Changed the createRecordsFetcher signature to take maxRecords as a parameter. (#264)
2017-11-10 06:32:16 -08:00
Sahil Palvia
5c3ff2b31e Handle Expired Iterators Correctly
Fix for the lease losses in the PrefetchCache and AsyncGetRecordsStrategy caused due to ExpiredIteratorException. (#263)
2017-11-08 12:03:09 -08:00
Sahil Palvia
3de901ea93 Adding logging for long running tasks. (#259)
Allow enabling logging for long running tasks.
2017-10-25 15:38:45 -07:00
Sahil Palvia
7032ea67ec Spurious update fix (#247)
* Handle spurious lease renewal failures gracefully.

If the request to conditionally update a lease counter in DynamoDB fails, it's
considered a failure to renew the lease. This is a good thing, except if the
request failure was just because of connectivity problems. In this case the
counter *did* update in DynamoDB, but the Dynamo client retries the request
which then fails the update condition (since the lease counter no longer
matches expected value).

To handle this gracefully we opt to get the lease record from Dynamo and
examine the lease owner and counter. If it matches what we were expecting,
then we consider renewal a success.
2017-10-25 08:11:20 -07:00
Justin Pfifer
821b0cbd0f Release Notes for 1.8.7 of the Amazon Kinesis Client Library for Java (#257)
Don't add a delay for synchronous requests to Kinesis
Removes a delay that had been added for synchronous GetRecords calls to Kinesis
2017-10-24 09:38:49 -07:00
Sahil Palvia
73426bd733 Don't Sleep for During Retrieval for the BlockingGetRecordsCache
The BlockingGetRecordsCache shouldn't sleep when retrieving records as backoff is provided in other parts of the ShardConumer.
2017-10-24 09:13:19 -07:00
Justin Pfifer
cc7e329e2f Release Note for Release 1.8.6 of the Amazon Kinesis Client for Java (#254) 2017-10-23 12:30:08 -07:00
Justin Pfifer
046e160e24 Block Fetch Thread When Retrieval Should be Paused (#252)
Block the fetching thread when the queue is considered to be full.
This ensures that the thread won't spin the CPU when it can't retrieve
more records or bytes.
2017-10-23 10:16:03 -07:00
Justin Pfifer
8ed6c81cea Revert "Shutdown that throws an exception will be retried. (#238)" (#251)
This reverts commit 44437f1361.

Reverted due to Build Failures
2017-10-19 11:40:44 -07:00
jmooreoliva
44437f1361 Shutdown that throws an exception will be retried. (#238)
Without this change a transient error on shutdown with reason terminate prevents
child shards from starting.
2017-10-18 14:16:54 -07:00
Sahil Palvia
ee3a6c24e6 Support Prefetching of Records
This adds that ability for the KCL to fetch records while the record processor is busy.  This can help smooth out delays in record process, or retrieving data from Kinesis.  Enabling this does require extra threads for background retrieval.

Settings
* dataFetchingStrategy: Which strategy to use to retrieve records.  This can be either DEFAULT or PREFETCH_CACHED
* maxCacheByteSize: Retrieval will be paused when the total number of bytes in the cache exceeds this value
* maxRecordsCount: Retrieval will be paused when the total number of records in the cache exceeds this value
* maxPendingProcessRecordsInput: Retrieval will be paused when the total number of fulfilled requests in the cache exceeds this value
2017-10-17 13:05:43 -07:00
Justin Pfifer
9720b1b249 Release 1.8.5 of the Amazon Kinesis Client for Java (#232)
* Release 1.8.5 of the Amazon Kinesis Client for Java

Release 1.8.5 (September 26, 2017)
* Only advance the shard iterator for the accepted response.  
  This fixes a race condition in the `KinesisDataFetcher` when it's being used to make asynchronous requests.  The shard iterator is now only advanced when the retriever calls `DataFetcherResult#accept()`.
  * PR #230
  * Issue #231
2017-09-26 14:31:59 -07:00
Pfifer, Justin
4b20556f37 Only advance the shard iterator when we accept a result to return
This changes the retriever strategy to only accept the shard iterator
when we have accepted a result to return.  This is for the
asynchronous retriever where multiple threads may contend for the same
iterator slot.  This ensures only the one selected for the response will
advance the shard iterator.
2017-09-26 12:39:53 -07:00
Pfifer, Justin
b1c27bd386 Recreate the completion service instead of reusing them.
This prevents cancelled tasks from being polled in subsequent calls.
2017-09-22 14:45:54 -07:00
Justin Pfifer
5558449043 Release 1.8.3 of the Amazon Kinesis Client for Java (#224)
* Call shutdown on the retriever when the record processor is being shutdown
  This fixes a bug that could leak threads if using the
  AsynchronousGetRecordsRetrievalStrategy is being used.
  The asynchronous retriever is only used when
  KinesisClientLibConfiguration#retryGetRecordsInSeconds, and
  KinesisClientLibConfiguration#maxGetRecordsThreadPool are set.
  * PR #222
2017-09-22 12:25:52 -07:00
Sahil Palvia
4dd9423170 Calling shutdown on the RetrievalStrategy (#222)
Fixes a bug where the retriever wasn't being shutdown when a record processor was being shutdown.
2017-09-22 11:43:34 -07:00
Justin Pfifer
9a82b6bd05 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-20 08:52:36 -07:00
Alex Charlton
01d2688bc6 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.
2017-09-19 08:52:31 -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
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
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
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
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
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
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
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
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
Justin Pfifer
3d18e484cf Release 1.7.3 of the Amazon Kinesis Client (#131)
* Upgrade to the newest AWS Java SDK.
  * Issue awslabs/amazon-kinesis-client-python#27
  * PR #126
  * PR #125
* Added a direct dependency on commons-logging.
  * Issue #123
  * PR #124
* Make ShardInfo public to allow for custom ShardPrioritization strategies.
  * Issue #120
  * PR #127
2017-01-20 09:05:54 -08:00
Justin Pfifer
a7b16b49d9 Make ShardInfo Public, and Update Documentation (#127)
Made the ShardInfo class public, and updated the documentation for a
number of the properties.

This will allow users to implement custom shard prioritization
strategies.

Fixes:
Issue #120
2017-01-09 08:11:01 -08:00
Justin Pfifer
5d045521ce Update MultiLangDaemon to Support New Features (#118)
Updated the MultiLangDaemon to use the v2 record processor interfaces, and added features to messages passed to MultiLangDaemon clients.

These changes will require updates to the various MultiLangDaemon clients. The changes for the Python version are complete, and other versions will be updated later.
2016-11-07 11:38:04 -08:00
Justin Pfifer
26e67a33b1 Allow for a Graceful Shutdown of the Worker (#109)
Add a new method to the worker requestShutdown that allows the worker to
gracefully shutdown all record processors.  The graceful shutdown gives
the record processors a last chance to checkpoint before they're
terminated.

To use these new features the record processor must implement
IShutdownnotificationaware.
2016-10-26 12:57:50 -07:00
Josh
db314b970b Allow for credential providers with basic arg types (#99)
* Add support for configuring DynamoDB endpoint

Adding a new field named `dynamoDBEndpoint` to the .properties file
that gets passed into the KCL multi-lang daemon. We need this ability
to point the KCL worker at a local instance of DynamoDB rather than in
AWS.

* Added the ability to use AWSCredentialsProvider's that require non-empty contructor args e.g. ProfileCredentialsProvider where you provide the profile name to use from your ~/.aws/credentials file

* Created a constructor without the dynamoDBEndpoint argument i.e. same arguments before the dynamo change, for backwards compatibility
2016-10-14 10:05:44 -07:00
Justin Pfifer
56c59f685a Allow Disabling Shard Sync at Startup (#102)
Allow disabling the shard sync at startup if the lease table already
contains leases.  This will reduce the startup load for larger streams
when restarted the Kinesis application.
2016-10-14 08:11:32 -07:00
Randy Findley
5c497d87a9 Feature/multiple cred providers (#111)
* Add ability to specify different credential providers for Kinesis, DynamoDB, and CloudWatch.  This is needed when accessing a cross-account Kineses stream using an assumed role.

* Fix copy/paste mistake.

* Update tests.

Thanks to rgfindl@
2016-10-14 08:10:38 -07:00
Pfifer, Justin
51663f96c7 Move Version to Next Development Version
Adjusted the version to 1.7.1-SNAPSHOT for current development.
2016-09-01 07:36:20 -07:00
Pfifer, Justin
4cbb6d851e Prevent Spurious Info Message on getIterator
Clean up check for ShardIteratorType to prevent emitting a spurious message for every call to GetIterator
Add missing KinesisProxyTest, and add 3 new tests for getIterator.
2016-08-22 08:26:22 -07:00
Pfifer, Justin
6ea3c0f8dd Don't Use Checkpoint for Equality in ShardInfo
Don't include checkpoint in hashCode/equality for ShardInfo, since it
changes. Checkpointing would cause the Worker to recreate the
ShardConsumer.  Add unit tests that verify the equality constraints.

Remove the equality test for checkpoint from ShardInfoTests.  Nothing
appears to rely on the checkpoint being part of ShardInfo.

Fix WorkerTest broken in overzealous simplification.
2016-08-17 14:46:51 -07:00
Pfifer, Justin
85b6b9f151 Allow Prioritization of Parent Shard Tasks
Added a new interface that allows the worker to prioritize which lease
assignment it will work on next.  When using the
ParentsFirstshardprioritization the worker will select parents for
processing before selecting children.  This will prevent ShardConsumers
from spending time sleeping in the WAITING_ON_PARENT_SHARDS state.
2016-08-17 07:45:33 -07:00
Justin Pfifer
33e37ef10a Merge pull request #94 from pfifer/time-based-iterators
Added Support for Time based iterators
2016-08-11 12:46:19 -07:00
Justin Pfifer
18fc581ceb Merge pull request #93 from pfifer/master
Move to Snapshot Version Number for Next Release
2016-08-11 12:46:10 -07:00
Justin Pfifer
bdab058394 Merge pull request #44 from raphaelfeng/master
Fix a typo in the comment of KinesisClientLibConfiguration
2016-08-11 09:54:14 -07:00
Pfifer, Justin
aa47fce30b Added Time Based Iterator Support
Added support for time based iterators.  Time based iterators are only
used if there is no current checkpoint for that shard, otherwise the
sequence number of the checkpoint is used.
2016-08-11 09:20:25 -07:00
Pfifer, Justin
38e2adb389 Move to snapshot for next release which will be 1.7.0 2016-08-11 08:41:39 -07:00
Pfifer, Justin
41832de928 Version 1.6.5 of the Amazon Kinesis Client Library 2016-07-25 12:38:54 -07:00
Pfifer, Justin
8fc5dd5862 Check if Table Exists Before Creation
Attempt to see if the lease table exists before attempting to create it.

Related/Fixes
PR#67 - https://github.com/awslabs/amazon-kinesis-client/pull/67
2016-07-21 13:42:01 -07:00
Justin Pfifer
2104f358c6 Merge pull request #86 from zdjohn/master
expose approximateArrivalTimestamp from JsonFriendlyRecord
2016-07-21 09:58:58 -07:00
Justin Pfifer
d695c0ab80 Merge pull request #84 from rankinc/lease-renewal-threads
Always shutdown leaseRenewalThreadpool on exit.
2016-07-21 09:58:26 -07:00
Justin Pfifer
c936b63808 Merge pull request #82 from rankinc/shutdown-cloudwatch-metrics
Join metrics publishing thread when shutting factory down.
2016-07-21 09:57:57 -07:00
Pfifer, Justin
586e97405e Fix Race Condition on Worker Test
The test 'testWorkerForcefulShutdown' was using Thread.sleep() to create
the conditions for an interrupted state.  It was possible for the test
to take enough time for the sleep to actually exit before the interrupt
was sent.  This would cause the test to fail.  Changing to a pair of
sempahores ensures that the test record processor will remain blocked
for the expected amount of time.
2016-07-21 08:14:20 -07:00
Pfifer, Justin
2bf45eafda Merge Changes for PR#61
Merge, and slight adjustment, of
https://github.com/awslabs/amazon-kinesis-client/pull/61.

This allows configuration to explicitly set the name of the lease
table.  The table name defaults to the application name which is the
current behavior.
2016-07-21 07:08:13 -07:00
Pfifer, Justin
33cec94530 Added Unit, and Integration Tests
Added unit tests for many of the classes in the client.  Added new
dependencies for the unit tests to the POM file.  Unit tests can be
executed the `surefire:test` goal, and are executed during the test phase.

Added integration tests for the client.  The tests require access to
credentials that can interact with Kinesis, and DynamoDB.  The
integration tests can be run by executing the
`failsafe:integration-test` goal, or are run as part of the
integration-test phase

**Resources in the integration tests are not currently released on
completion of the integration tests.**
2016-07-20 12:58:43 -07:00
Pfifer, Justin
dd14bac4e3 'Version 1.6.4 of the Amazon Kinesis Client Library' 2016-07-07 13:28:18 -07:00