Skip to content

Commit ddbd759

Browse files
authored
Merge pull request #87 from furq-aws/kclv3-release
Prepare for KCL Ruby Release 3.0.0
2 parents 08d9d76 + 0b2068f commit ddbd759

File tree

4 files changed

+212
-29
lines changed

4 files changed

+212
-29
lines changed

README.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Before running the samples, you'll want to make sure that your environment is
5151
configured to allow the samples to use your
5252
[AWS Security Credentials](http://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).
5353

54-
By default the samples use the [DefaultAWSCredentialsProviderChain][DefaultAWSCredentialsProviderChain]
54+
By default the samples use the [DefaultCredentialsProvider][DefaultCredentialsProvider]
5555
so you'll want to make your credentials available to one of the credentials providers in that
5656
provider chain. There are several ways to do this such as providing a `~/.aws/credentials` file,
5757
or if you're running on Amazon EC2, you can associate an IAM role with your instance with appropriate
@@ -187,6 +187,40 @@ all languages.
187187

188188
## Release Notes
189189

190+
### Release 3.0.0 (November 6, 2024)
191+
* New lease assignment / load balancing algorithm
192+
* KCL 3.x introduces a new lease assignment and load balancing algorithm. It assigns leases among workers based on worker utilization metrics and throughput on each lease, replacing the previous lease count-based lease assignment algorithm.
193+
* When KCL detects higher variance in CPU utilization among workers, it proactively reassigns leases from over-utilized workers to under-utilized workers for even load balancing. This ensures even CPU utilization across workers and removes the need to over-provision the stream processing compute hosts.
194+
* Optimized DynamoDB RCU usage
195+
* KCL 3.x optimizes DynamoDB read capacity unit (RCU) usage on the lease table by implementing a global secondary index with leaseOwner as the partition key. This index mirrors the leaseKey attribute from the base lease table, allowing workers to efficiently discover their assigned leases by querying the index instead of scanning the entire table.
196+
* This approach significantly reduces read operations compared to earlier KCL versions, where workers performed full table scans, resulting in higher RCU consumption.
197+
* Graceful lease handoff
198+
* KCL 3.x introduces a feature called "graceful lease handoff" to minimize data reprocessing during lease reassignments. Graceful lease handoff allows the current worker to complete checkpointing of processed records before transferring the lease to another worker. For graceful lease handoff, you should implement checkpointing logic within the existing `shutdownRequested()` method.
199+
* This feature is enabled by default in KCL 3.x, but you can turn off this feature by adjusting the configuration property `isGracefulLeaseHandoffEnabled`.
200+
* While this approach significantly reduces the probability of data reprocessing during lease transfers, it doesn't completely eliminate the possibility. To maintain data integrity and consistency, it's crucial to design your downstream consumer applications to be idempotent. This ensures that the application can handle potential duplicate record processing without adverse effects.
201+
* New DynamoDB metadata management artifacts
202+
* KCL 3.x introduces two new DynamoDB tables for improved lease management:
203+
* Worker metrics table: Records CPU utilization metrics from each worker. KCL uses these metrics for optimal lease assignments, balancing resource utilization across workers. If CPU utilization metric is not available, KCL assigns leases to balance the total sum of shard throughput per worker instead.
204+
* Coordinator state table: Stores internal state information for workers. Used to coordinate in-place migration from KCL 2.x to KCL 3.x and leader election among workers.
205+
* Follow this [documentation](https://docs.aws.amazon.com/streams/latest/dev/kcl-migration-from-2-3.html#kcl-migration-from-2-3-IAM-permissions) to add required IAM permissions for your KCL application.
206+
* Other improvements and changes
207+
* Dependency on the AWS SDK for Java 1.x has been fully removed.
208+
* The Glue Schema Registry integration functionality no longer depends on AWS SDK for Java 1.x. Previously, it required this as a transient dependency.
209+
* Multilangdaemon has been upgraded to use AWS SDK for Java 2.x. It no longer depends on AWS SDK for Java 1.x.
210+
* `idleTimeBetweenReadsInMillis` (PollingConfig) now has a minimum default value of 200.
211+
* This polling configuration property determines the [publishers](https://github.com/awslabs/amazon-kinesis-client/blob/master/amazon-kinesis-client/src/main/java/software/amazon/kinesis/retrieval/polling/PrefetchRecordsPublisher.java) wait time between GetRecords calls in both success and failure cases. Previously, setting this value below 200 caused unnecessary throttling. This is because Amazon Kinesis Data Streams supports up to five read transactions per second per shard for shared-throughput consumers.
212+
* Shard lifecycle management is improved to deal with edge cases around shard splits and merges to ensure records continue being processed as expected.
213+
* Migration
214+
* The programming interfaces of KCL 3.x remain identical with KCL 2.x for an easier migration. For detailed migration instructions, please refer to the [Migrate consumers from KCL 2.x to KCL 3.x](https://docs.aws.amazon.com/streams/latest/dev/kcl-migration-from-2-3.html) page in the Amazon Kinesis Data Streams developer guide.
215+
* Configuration properties
216+
* New configuration properties introduced in KCL 3.x are listed in this [doc](https://github.com/awslabs/amazon-kinesis-client/blob/master/docs/kcl-configurations.md#new-configurations-in-kcl-3x).
217+
* Deprecated configuration properties in KCL 3.x are listed in this [doc](https://github.com/awslabs/amazon-kinesis-client/blob/master/docs/kcl-configurations.md#discontinued-configuration-properties-in-kcl-3x). You need to keep the deprecated configuration properties during the migration from any previous KCL version to KCL 3.x.
218+
* Metrics
219+
* New CloudWatch metrics introduced in KCL 3.x are explained in the [Monitor the Kinesis Client Library with Amazon CloudWatch](https://docs.aws.amazon.com/streams/latest/dev/monitoring-with-kcl.html) in the Amazon Kinesis Data Streams developer guide. The following operations are newly added in KCL 3.x:
220+
* `LeaseAssignmentManager`
221+
* `WorkerMetricStatsReporter`
222+
* `LeaseDiscovery`
223+
190224
### Release 2.1.1 (February 21, 2023)
191225
* [#69](https://github.com/awslabs/amazon-kinesis-client-ruby/pull/69) Include `pom.xml` in the gemspec
192226

@@ -233,7 +267,7 @@ all languages.
233267
[amazon-kcl-github]: https://github.com/awslabs/amazon-kinesis-client
234268
[amazon-kinesis-python-github]: https://github.com/awslabs/amazon-kinesis-client-python
235269
[multi-lang-daemon]: https://github.com/awslabs/amazon-kinesis-client/blob/master/amazon-kinesis-client-multilang/src/main/java/software/amazon/kinesis/multilang/package-info.java
236-
[DefaultAWSCredentialsProviderChain]: http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/DefaultAWSCredentialsProviderChain.html
270+
[DefaultCredentialsProvider]: https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/auth/credentials/DefaultCredentialsProvider.html
237271
[kinesis-forum]: http://developer.amazonwebservices.com/connect/forum.jspa?forumID=169
238272
[aws-ruby-sdk-gem]: https://rubygems.org/gems/aws-sdk
239273

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.1.1
1+
3.0.0

pom.xml

Lines changed: 70 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
33
<modelVersion>4.0.0</modelVersion>
44
<properties>
5-
<awssdk.version>2.19.16</awssdk.version>
6-
<aws-java-sdk.version>1.12.370</aws-java-sdk.version>
7-
<netty.version>4.1.100.Final</netty.version>
5+
<awssdk.version>2.25.64</awssdk.version>
6+
<kcl.version>3.0.0</kcl.version>
7+
<netty.version>4.1.108.Final</netty.version>
88
<netty-reactive.version>2.0.6</netty-reactive.version>
9-
<fasterxml-jackson.version>2.14.1</fasterxml-jackson.version>
10-
<logback.version>1.3.12</logback.version>
9+
<fasterxml-jackson.version>2.13.5</fasterxml-jackson.version>
10+
<logback.version>1.3.14</logback.version>
1111
</properties>
1212
<dependencies>
1313
<dependency>
1414
<groupId>software.amazon.kinesis</groupId>
1515
<artifactId>amazon-kinesis-client-multilang</artifactId>
16-
<version>2.4.4</version>
16+
<version>${kcl.version}</version>
1717
</dependency>
1818
<dependency>
1919
<groupId>software.amazon.kinesis</groupId>
2020
<artifactId>amazon-kinesis-client</artifactId>
21-
<version>2.4.4</version>
21+
<version>${kcl.version}</version>
2222
</dependency>
2323
<dependency>
2424
<groupId>software.amazon.awssdk</groupId>
@@ -30,6 +30,18 @@
3030
<artifactId>dynamodb</artifactId>
3131
<version>${awssdk.version}</version>
3232
</dependency>
33+
<!-- https://mvnrepository.com/artifact/software.amazon.awssdk/dynamodb-enhanced -->
34+
<dependency>
35+
<groupId>software.amazon.awssdk</groupId>
36+
<artifactId>dynamodb-enhanced</artifactId>
37+
<version>${awssdk.version}</version>
38+
</dependency>
39+
<!-- https://mvnrepository.com/artifact/com.amazonaws/dynamodb-lock-client -->
40+
<dependency>
41+
<groupId>com.amazonaws</groupId>
42+
<artifactId>dynamodb-lock-client</artifactId>
43+
<version>1.3.0</version>
44+
</dependency>
3345
<dependency>
3446
<groupId>software.amazon.awssdk</groupId>
3547
<artifactId>cloudwatch</artifactId>
@@ -135,6 +147,41 @@
135147
<artifactId>apache-client</artifactId>
136148
<version>${awssdk.version}</version>
137149
</dependency>
150+
<dependency>
151+
<groupId>software.amazon.awssdk</groupId>
152+
<artifactId>arns</artifactId>
153+
<version>${awssdk.version}</version>
154+
</dependency>
155+
<dependency>
156+
<groupId>software.amazon.awssdk</groupId>
157+
<artifactId>http-auth-spi</artifactId>
158+
<version>${awssdk.version}</version>
159+
</dependency>
160+
<dependency>
161+
<groupId>software.amazon.awssdk</groupId>
162+
<artifactId>http-auth</artifactId>
163+
<version>${awssdk.version}</version>
164+
</dependency>
165+
<dependency>
166+
<groupId>software.amazon.awssdk</groupId>
167+
<artifactId>http-auth-aws</artifactId>
168+
<version>${awssdk.version}</version>
169+
</dependency>
170+
<dependency>
171+
<groupId>software.amazon.awssdk</groupId>
172+
<artifactId>checksums-spi</artifactId>
173+
<version>${awssdk.version}</version>
174+
</dependency>
175+
<dependency>
176+
<groupId>software.amazon.awssdk</groupId>
177+
<artifactId>checksums</artifactId>
178+
<version>${awssdk.version}</version>
179+
</dependency>
180+
<dependency>
181+
<groupId>software.amazon.awssdk</groupId>
182+
<artifactId>identity-spi</artifactId>
183+
<version>${awssdk.version}</version>
184+
</dependency>
138185
<dependency>
139186
<groupId>io.netty</groupId>
140187
<artifactId>netty-codec-http</artifactId>
@@ -218,7 +265,7 @@
218265
<dependency>
219266
<groupId>com.google.errorprone</groupId>
220267
<artifactId>error_prone_annotations</artifactId>
221-
<version>2.19.1</version>
268+
<version>2.7.1</version>
222269
</dependency>
223270
<dependency>
224271
<groupId>com.google.j2objc</groupId>
@@ -233,22 +280,22 @@
233280
<dependency>
234281
<groupId>com.google.protobuf</groupId>
235282
<artifactId>protobuf-java</artifactId>
236-
<version>3.23.0</version>
283+
<version>4.27.5</version>
237284
</dependency>
238285
<dependency>
239286
<groupId>org.apache.commons</groupId>
240287
<artifactId>commons-lang3</artifactId>
241-
<version>3.12.0</version>
288+
<version>3.14.0</version>
242289
</dependency>
243290
<dependency>
244291
<groupId>org.slf4j</groupId>
245292
<artifactId>slf4j-api</artifactId>
246-
<version>2.0.5</version>
293+
<version>2.0.13</version>
247294
</dependency>
248295
<dependency>
249296
<groupId>io.reactivex.rxjava3</groupId>
250297
<artifactId>rxjava</artifactId>
251-
<version>3.1.5</version>
298+
<version>3.1.8</version>
252299
</dependency>
253300
<dependency>
254301
<groupId>com.fasterxml.jackson.dataformat</groupId>
@@ -291,19 +338,20 @@
291338
<version>4.4.15</version>
292339
</dependency>
293340
<dependency>
294-
<groupId>com.amazonaws</groupId>
295-
<artifactId>aws-java-sdk-core</artifactId>
296-
<version>${aws-java-sdk.version}</version>
297-
</dependency>
298-
<dependency>
299-
<groupId>software.amazon.ion</groupId>
341+
<groupId>com.amazon.ion</groupId>
300342
<artifactId>ion-java</artifactId>
301-
<version>1.5.1</version>
343+
<version>1.11.4</version>
302344
</dependency>
303345
<dependency>
304346
<groupId>software.amazon.glue</groupId>
305347
<artifactId>schema-registry-serde</artifactId>
306-
<version>1.1.13</version>
348+
<version>1.1.19</version>
349+
<exclusions>
350+
<exclusion>
351+
<groupId>com.amazonaws</groupId>
352+
<artifactId>aws-java-sdk-sts</artifactId>
353+
</exclusion>
354+
</exclusions>
307355
</dependency>
308356
<dependency>
309357
<groupId>joda-time</groupId>
@@ -328,12 +376,12 @@
328376
<dependency>
329377
<groupId>commons-io</groupId>
330378
<artifactId>commons-io</artifactId>
331-
<version>2.11.0</version>
379+
<version>2.16.1</version>
332380
</dependency>
333381
<dependency>
334382
<groupId>commons-logging</groupId>
335383
<artifactId>commons-logging</artifactId>
336-
<version>1.2</version>
384+
<version>1.1.3</version>
337385
</dependency>
338386
<dependency>
339387
<groupId>org.apache.commons</groupId>

0 commit comments

Comments
 (0)