You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/01/26 09:54:03 UTC

[GitHub] [flink] YuriGusev opened a new pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

YuriGusev opened a new pull request #18518:
URL: https://github.com/apache/flink/pull/18518


   <!--
   *Thank you very much for contributing to Apache Flink - we are happy that you want to help us improve Flink. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.*
   
   *Please understand that we do not do this to make contributions to Flink a hassle. In order to uphold a high standard of quality for code contributions, while at the same time managing a large number of contributions, we need contributors to prepare the contributions well, and give reviewers enough contextual information for the review. Please also understand that contributions that do not follow this guide will take longer to review and thus typically be picked up with lower priority by the community.*
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [JIRA issue](https://issues.apache.org/jira/projects/FLINK/issues). Exceptions are made for typos in JavaDoc or documentation files, which need no JIRA issue.
     
     - Name the pull request in the form "[FLINK-XXXX] [component] Title of the pull request", where *FLINK-XXXX* should be replaced by the actual issue number. Skip *component* if you are unsure about which is the best component.
     Typo fixes that have no associated JIRA issue should be named following this pattern: `[hotfix] [docs] Fix typo in event time introduction` or `[hotfix] [javadocs] Expand JavaDoc for PuncuatedWatermarkGenerator`.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Make sure that the change passes the automated tests, i.e., `mvn clean verify` passes. You can set up Azure Pipelines CI to do that following [this guide](https://cwiki.apache.org/confluence/display/FLINK/Azure+Pipelines#AzurePipelines-Tutorial:SettingupAzurePipelinesforaforkoftheFlinkrepository).
   
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message (including the JIRA id)
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   
   
   **(The sections below can be removed for hotfixes of typos)**
   -->
   
   ## What is the purpose of the change
   
   _User stories:_
   
   As a Flink user, I’d like to use DynamoDB as sink for my data pipeline.
   
   _Scope:_
   
   * Implement an asynchronous sink for DynamoDB by inheriting the AsyncSinkBase class. 
   * The implementation can for now reside in its own module in flink-connectors.
   * Implement an asynchornous sink writer for DynamoDB by extending the AsyncSinkWriter. The implementation must deal with failed requests and retry them using the requeueFailedRequestEntry method. 
   * The implementation should utilize DynamoDb batch API. 
   * The implemented Sink Writer will be used by the Sink class that is created as part of this story.
   * Java / code-level docs.
   * Unit/Integration testing.
   
   
   ## Brief change log
   
   - Added new DynamoDB Sink into a new module flink-connectors/flink-connector-dynamodb
   
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
   - Integration tests in org.apache.flink.streaming.connectors.dynamodb.sink.DynamoDbSinkITCase
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no
     - The serializers: no
     - The runtime per-record code paths (performance sensitive): yes
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
     - The S3 file system connector: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? yes
     - If yes, how is the feature documented? JavaDocs
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * df0af668680a0672e293083239809cfec66c572d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331) 
   * 1101c210e2389dc36876faf69d5cd52a77c882a6 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1101c210e2389dc36876faf69d5cd52a77c882a6 Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393) 
   * 0c073f2b0cec8b9e8bfda51f408181fce949c287 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] YuriGusev commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
YuriGusev commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r793711778



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSink.java
##########
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Experimental;
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.api.connector.sink.SinkWriter;
+import org.apache.flink.connector.base.sink.AsyncSinkBase;
+import org.apache.flink.connector.base.sink.writer.ElementConverter;
+import org.apache.flink.core.io.SimpleVersionedSerializer;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Optional;
+import java.util.Properties;
+
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
+/**
+ * A DynamoDB Sink that performs async requests against a destination stream using the buffering
+ * protocol specified in {@link AsyncSinkBase}.
+ *
+ * <p>The sink internally uses a {@link
+ * software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient} to communicate with the AWS
+ * endpoint.
+ *
+ * <p>The behaviour of the buffering may be specified by providing configuration during the sink
+ * build time.
+ *
+ * <ul>
+ *   <li>{@code maxBatchSize}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb.
+ *   <li>{@code maxInFlightRequests}: the maximum number of in flight requests that may exist, if
+ *       any more in flight requests need to be initiated once the maximum has been reached, then it
+ *       will be blocked until some have completed
+ *   <li>{@code maxBufferedRequests}: the maximum number of elements held in the buffer, requests to
+ *       add elements will be blocked while the number of elements in the buffer is at the maximum
+ *   <li>{@code maxBatchSizeInBytes}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb measured in bytes
+ *   <li>{@code maxTimeInBufferMS}: the maximum amount of time an entry is allowed to live in the
+ *       buffer, if any element reaches this age, the entire buffer will be flushed immediately
+ *   <li>{@code maxRecordSizeInBytes}: the maximum size of a record the sink will accept into the
+ *       buffer, a record of size larger than this will be rejected when passed to the sink
+ *   <li>{@code failOnError}: when an exception is encountered while persisting to DynamoDb, the job
+ *       will fail immediately if failOnError is set
+ *   <li>{@code dynamoDbTablesConfig}: if provided for the table, the DynamoDb sink will attempt to
+ *       deduplicate records with the same primary and/or secondary keys in the same batch request.
+ *       Only the latest record with the same combination of key attributes is preserved in the
+ *       request.
+ * </ul>
+ *
+ * <p>Please see the writer implementation in {@link DynamoDbSinkWriter}
+ *
+ * @param <InputT> Type of the elements handled by this sink
+ */
+@PublicEvolving
+public class DynamoDbSink<InputT> extends AsyncSinkBase<InputT, DynamoDbWriteRequest> {
+
+    private final Properties dynamoDbClientProperties;
+    private final DynamoDbTablesConfig dynamoDbTablesConfig;
+    private final boolean failOnError;
+
+    protected DynamoDbSink(
+            ElementConverter<InputT, DynamoDbWriteRequest> elementConverter,
+            int maxBatchSize,
+            int maxInFlightRequests,
+            int maxBufferedRequests,
+            long maxBatchSizeInBytes,
+            long maxTimeInBufferMS,
+            long maxRecordSizeInBytes,
+            boolean failOnError,
+            DynamoDbTablesConfig dynamoDbTablesConfig,
+            Properties dynamoDbClientProperties) {
+        super(
+                elementConverter,
+                maxBatchSize,
+                maxInFlightRequests,
+                maxBufferedRequests,
+                maxBatchSizeInBytes,
+                maxTimeInBufferMS,
+                maxRecordSizeInBytes);
+        checkNotNull(dynamoDbTablesConfig, "Missing dynamoDbTablesConfig");
+        checkNotNull(dynamoDbClientProperties, "Missing dynamoDbClientProperties");
+        this.failOnError = failOnError;
+        this.dynamoDbTablesConfig = dynamoDbTablesConfig;
+        this.dynamoDbClientProperties = dynamoDbClientProperties;
+    }
+
+    /**
+     * Create a {@link DynamoDbSinkBuilder} to construct a new {@link DynamoDbSink}.
+     *
+     * @param <InputT> type of incoming records
+     * @return {@link DynamoDbSinkBuilder}
+     */
+    public static <InputT> DynamoDbSinkBuilder<InputT> builder() {
+        return new DynamoDbSinkBuilder<>();
+    }
+
+    @Experimental

Review comment:
       I can see how it is useful for the KinesisSink, as we do not leak Kinesis Put request to the user, but I think it would be more complicated to implement for the DynamoDB Sink. 
   
   We will have to implement something that would look exactly like DynamoDB WriteRequest with all its attributes, types, request types, etc. and translate it internally into the WriteRequest object (by the converter). I can not see any other solution for that.
   
   It will be a lot of functionality we will have to "repeat" that dynamodb provides.
   
   Do you think it worth doing it, instead of letting user to define the converter themselves? @CrynetLogistics 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8ec1f57053a8f98ca61b1ff7ad090d789476d45b Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1ed40f830db68d828612207897418a868e6b55f7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476",
       "triggerID" : "1ed40f830db68d828612207897418a868e6b55f7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30498",
       "triggerID" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34130",
       "triggerID" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34133",
       "triggerID" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f92d95336aa9111d7cc2c7c47497677ad3e9c2de Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34133) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] YuriGusev commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
YuriGusev commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r840818880



##########
File path: flink-connectors/flink-connector-dynamodb/pom.xml
##########
@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<parent>
+		<groupId>org.apache.flink</groupId>
+		<artifactId>flink-connectors</artifactId>
+		<version>1.15-SNAPSHOT</version>
+		<relativePath>..</relativePath>
+	</parent>
+
+	<modelVersion>4.0.0</modelVersion>
+
+	<artifactId>flink-connector-dynamodb</artifactId>

Review comment:
       done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9e25df6a205db5206574d6cdee111d88b625cba2",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "9e25df6a205db5206574d6cdee111d88b625cba2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8ec1f57053a8f98ca61b1ff7ad090d789476d45b Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220) 
   * 9c9eec7f108f056b27d417ed0ba12f098f8af714 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320) 
   * 9e25df6a205db5206574d6cdee111d88b625cba2 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] dannycranmer commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
dannycranmer commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r831969864



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSink.java
##########
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.api.connector.sink.SinkWriter;
+import org.apache.flink.connector.base.sink.AsyncSinkBase;
+import org.apache.flink.connector.base.sink.writer.ElementConverter;
+import org.apache.flink.core.io.SimpleVersionedSerializer;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Optional;
+import java.util.Properties;
+
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
+/**
+ * A DynamoDB Sink that performs async requests against a destination stream using the buffering
+ * protocol specified in {@link AsyncSinkBase}.
+ *
+ * <p>The sink internally uses a {@link
+ * software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient} to communicate with the AWS
+ * endpoint.
+ *
+ * <p>The behaviour of the buffering may be specified by providing configuration during the sink
+ * build time.
+ *
+ * <ul>
+ *   <li>{@code maxBatchSize}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb.
+ *   <li>{@code maxInFlightRequests}: the maximum number of in flight requests that may exist, if
+ *       any more in flight requests need to be initiated once the maximum has been reached, then it
+ *       will be blocked until some have completed
+ *   <li>{@code maxBufferedRequests}: the maximum number of elements held in the buffer, requests to
+ *       add elements will be blocked while the number of elements in the buffer is at the maximum
+ *   <li>{@code maxBatchSizeInBytes}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb measured in bytes
+ *   <li>{@code maxTimeInBufferMS}: the maximum amount of time an entry is allowed to live in the
+ *       buffer, if any element reaches this age, the entire buffer will be flushed immediately
+ *   <li>{@code maxRecordSizeInBytes}: the maximum size of a record the sink will accept into the
+ *       buffer, a record of size larger than this will be rejected when passed to the sink
+ *   <li>{@code failOnError}: when an exception is encountered while persisting to DynamoDb, the job
+ *       will fail immediately if failOnError is set
+ *   <li>{@code dynamoDbTablesConfig}: if provided for the table, the DynamoDb sink will attempt to
+ *       deduplicate records with the same primary and/or secondary keys in the same batch request.
+ *       Only the latest record with the same combination of key attributes is preserved in the
+ *       request.
+ * </ul>
+ *
+ * <p>Please see the writer implementation in {@link DynamoDbSinkWriter}
+ *
+ * @param <InputT> Type of the elements handled by this sink
+ */
+@PublicEvolving
+public class DynamoDbSink<InputT> extends AsyncSinkBase<InputT, DynamoDbWriteRequest> {

Review comment:
       @almogtavor I would not expect a user to care whether the connector is sync/async. This is an implementation detail of the underlying connector. What is the reason to expose `async` to the user in the classname?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] almogtavor commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
almogtavor commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r831459486



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSink.java
##########
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.api.connector.sink.SinkWriter;
+import org.apache.flink.connector.base.sink.AsyncSinkBase;
+import org.apache.flink.connector.base.sink.writer.ElementConverter;
+import org.apache.flink.core.io.SimpleVersionedSerializer;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Optional;
+import java.util.Properties;
+
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
+/**
+ * A DynamoDB Sink that performs async requests against a destination stream using the buffering
+ * protocol specified in {@link AsyncSinkBase}.
+ *
+ * <p>The sink internally uses a {@link
+ * software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient} to communicate with the AWS
+ * endpoint.
+ *
+ * <p>The behaviour of the buffering may be specified by providing configuration during the sink
+ * build time.
+ *
+ * <ul>
+ *   <li>{@code maxBatchSize}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb.
+ *   <li>{@code maxInFlightRequests}: the maximum number of in flight requests that may exist, if
+ *       any more in flight requests need to be initiated once the maximum has been reached, then it
+ *       will be blocked until some have completed
+ *   <li>{@code maxBufferedRequests}: the maximum number of elements held in the buffer, requests to
+ *       add elements will be blocked while the number of elements in the buffer is at the maximum
+ *   <li>{@code maxBatchSizeInBytes}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb measured in bytes
+ *   <li>{@code maxTimeInBufferMS}: the maximum amount of time an entry is allowed to live in the
+ *       buffer, if any element reaches this age, the entire buffer will be flushed immediately
+ *   <li>{@code maxRecordSizeInBytes}: the maximum size of a record the sink will accept into the
+ *       buffer, a record of size larger than this will be rejected when passed to the sink
+ *   <li>{@code failOnError}: when an exception is encountered while persisting to DynamoDb, the job
+ *       will fail immediately if failOnError is set
+ *   <li>{@code dynamoDbTablesConfig}: if provided for the table, the DynamoDb sink will attempt to
+ *       deduplicate records with the same primary and/or secondary keys in the same batch request.
+ *       Only the latest record with the same combination of key attributes is preserved in the
+ *       request.
+ * </ul>
+ *
+ * <p>Please see the writer implementation in {@link DynamoDbSinkWriter}
+ *
+ * @param <InputT> Type of the elements handled by this sink
+ */
+@PublicEvolving
+public class DynamoDbSink<InputT> extends AsyncSinkBase<InputT, DynamoDbWriteRequest> {

Review comment:
       @dannycranmer So how would you expect a user to know if a connector is sync /async without looking at the underlying code? It should at least be added to the docs. Somewhere it needs to be specified.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] almogtavor commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
almogtavor commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r831461607



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSink.java
##########
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.api.connector.sink.SinkWriter;
+import org.apache.flink.connector.base.sink.AsyncSinkBase;
+import org.apache.flink.connector.base.sink.writer.ElementConverter;
+import org.apache.flink.core.io.SimpleVersionedSerializer;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Optional;
+import java.util.Properties;
+
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
+/**
+ * A DynamoDB Sink that performs async requests against a destination stream using the buffering
+ * protocol specified in {@link AsyncSinkBase}.
+ *
+ * <p>The sink internally uses a {@link
+ * software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient} to communicate with the AWS
+ * endpoint.
+ *
+ * <p>The behaviour of the buffering may be specified by providing configuration during the sink
+ * build time.
+ *
+ * <ul>
+ *   <li>{@code maxBatchSize}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb.
+ *   <li>{@code maxInFlightRequests}: the maximum number of in flight requests that may exist, if
+ *       any more in flight requests need to be initiated once the maximum has been reached, then it
+ *       will be blocked until some have completed
+ *   <li>{@code maxBufferedRequests}: the maximum number of elements held in the buffer, requests to
+ *       add elements will be blocked while the number of elements in the buffer is at the maximum
+ *   <li>{@code maxBatchSizeInBytes}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb measured in bytes
+ *   <li>{@code maxTimeInBufferMS}: the maximum amount of time an entry is allowed to live in the
+ *       buffer, if any element reaches this age, the entire buffer will be flushed immediately
+ *   <li>{@code maxRecordSizeInBytes}: the maximum size of a record the sink will accept into the
+ *       buffer, a record of size larger than this will be rejected when passed to the sink
+ *   <li>{@code failOnError}: when an exception is encountered while persisting to DynamoDb, the job
+ *       will fail immediately if failOnError is set
+ *   <li>{@code dynamoDbTablesConfig}: if provided for the table, the DynamoDb sink will attempt to
+ *       deduplicate records with the same primary and/or secondary keys in the same batch request.
+ *       Only the latest record with the same combination of key attributes is preserved in the
+ *       request.
+ * </ul>
+ *
+ * <p>Please see the writer implementation in {@link DynamoDbSinkWriter}
+ *
+ * @param <InputT> Type of the elements handled by this sink
+ */
+@PublicEvolving
+public class DynamoDbSink<InputT> extends AsyncSinkBase<InputT, DynamoDbWriteRequest> {

Review comment:
       @nirtsruya what other async connectors aren't specified with `async` in their names? Can you give some examples?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1ed40f830db68d828612207897418a868e6b55f7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476",
       "triggerID" : "1ed40f830db68d828612207897418a868e6b55f7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30498",
       "triggerID" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34130",
       "triggerID" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34133",
       "triggerID" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f92d95336aa9111d7cc2c7c47497677ad3e9c2de Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34133) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] YuriGusev commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
YuriGusev commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r836187182



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSinkWriter.java
##########
@@ -0,0 +1,168 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.api.connector.sink.Sink;
+import org.apache.flink.connector.base.sink.writer.AsyncSinkWriter;
+import org.apache.flink.connector.base.sink.writer.ElementConverter;
+import org.apache.flink.metrics.Counter;
+import org.apache.flink.metrics.groups.SinkWriterMetricGroup;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+import org.apache.flink.streaming.connectors.dynamodb.util.AWSDynamoDbUtil;
+import org.apache.flink.streaming.connectors.dynamodb.util.DynamoDbExceptionUtils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient;
+import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemRequest;
+import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemResponse;
+import software.amazon.awssdk.services.dynamodb.model.WriteRequest;
+
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.CompletableFuture;
+import java.util.function.Consumer;
+
+/**
+ * Sink writer created by {@link DynamoDbSink} to write to DynamoDB. More details on the operation
+ * of this sink writer may be found in the doc for {@link DynamoDbSink}. More details on the
+ * internals of this sink writer may be found in {@link AsyncSinkWriter}.
+ *
+ * <p>The {@link DynamoDbAsyncClient} used here may be configured in the standard way for the AWS
+ * SDK 2.x. e.g. the provision of {@code AWS_REGION}, {@code AWS_ACCESS_KEY_ID} and {@code
+ * AWS_SECRET_ACCESS_KEY} through environment variables etc.
+ */
+@Internal
+class DynamoDbSinkWriter<InputT> extends AsyncSinkWriter<InputT, DynamoDbWriteRequest> {
+    private static final Logger LOG = LoggerFactory.getLogger(DynamoDbSinkWriter.class);
+
+    /* A counter for the total number of records that have encountered an error during put */
+    private final Counter numRecordsOutErrorsCounter;
+
+    /* The sink writer metric group */
+    private final SinkWriterMetricGroup metrics;
+
+    private final DynamoDbTablesConfig tablesConfig;
+    private final DynamoDbAsyncClient client;
+    private final boolean failOnError;
+
+    public DynamoDbSinkWriter(
+            ElementConverter<InputT, DynamoDbWriteRequest> elementConverter,
+            Sink.InitContext context,
+            int maxBatchSize,
+            int maxInFlightRequests,
+            int maxBufferedRequests,
+            long maxBatchSizeInBytes,
+            long maxTimeInBufferMS,
+            long maxRecordSizeInBytes,
+            boolean failOnError,
+            DynamoDbTablesConfig tablesConfig,
+            Properties dynamoDbClientProperties) {
+        super(
+                elementConverter,
+                context,
+                maxBatchSize,
+                maxInFlightRequests,
+                maxBufferedRequests,
+                maxBatchSizeInBytes,
+                maxTimeInBufferMS,
+                maxRecordSizeInBytes);
+        this.failOnError = failOnError;
+        this.tablesConfig = tablesConfig;
+        this.metrics = context.metricGroup();
+        this.numRecordsOutErrorsCounter = metrics.getNumRecordsOutErrorsCounter();
+        this.client = AWSDynamoDbUtil.createClient(dynamoDbClientProperties);
+    }
+
+    @Override
+    protected void submitRequestEntries(
+            List<DynamoDbWriteRequest> requestEntries,
+            Consumer<Collection<DynamoDbWriteRequest>> requestResultConsumer) {
+
+        TableRequestsContainer container = new TableRequestsContainer(tablesConfig);
+        requestEntries.forEach(container::put);

Review comment:
       yes good point, this is the same how boto3 behaves. May be we should rename batch size property to MAX batch size




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1ed40f830db68d828612207897418a868e6b55f7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476",
       "triggerID" : "1ed40f830db68d828612207897418a868e6b55f7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30498",
       "triggerID" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34130",
       "triggerID" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34133",
       "triggerID" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f92d95336aa9111d7cc2c7c47497677ad3e9c2de Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34133) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1ed40f830db68d828612207897418a868e6b55f7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476",
       "triggerID" : "1ed40f830db68d828612207897418a868e6b55f7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30498",
       "triggerID" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34130",
       "triggerID" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34133",
       "triggerID" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bb92395129797263b775f9a81e89dbcbab94391b",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34135",
       "triggerID" : "bb92395129797263b775f9a81e89dbcbab94391b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdfc807c14de7b1dfcc6776547373b863b4aa545",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "bdfc807c14de7b1dfcc6776547373b863b4aa545",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * bb92395129797263b775f9a81e89dbcbab94391b Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34135) 
   * bdfc807c14de7b1dfcc6776547373b863b4aa545 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] almogtavor commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
almogtavor commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r830664570



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSink.java
##########
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.api.connector.sink.SinkWriter;
+import org.apache.flink.connector.base.sink.AsyncSinkBase;
+import org.apache.flink.connector.base.sink.writer.ElementConverter;
+import org.apache.flink.core.io.SimpleVersionedSerializer;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Optional;
+import java.util.Properties;
+
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
+/**
+ * A DynamoDB Sink that performs async requests against a destination stream using the buffering
+ * protocol specified in {@link AsyncSinkBase}.
+ *
+ * <p>The sink internally uses a {@link
+ * software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient} to communicate with the AWS
+ * endpoint.
+ *
+ * <p>The behaviour of the buffering may be specified by providing configuration during the sink
+ * build time.
+ *
+ * <ul>
+ *   <li>{@code maxBatchSize}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb.
+ *   <li>{@code maxInFlightRequests}: the maximum number of in flight requests that may exist, if
+ *       any more in flight requests need to be initiated once the maximum has been reached, then it
+ *       will be blocked until some have completed
+ *   <li>{@code maxBufferedRequests}: the maximum number of elements held in the buffer, requests to
+ *       add elements will be blocked while the number of elements in the buffer is at the maximum
+ *   <li>{@code maxBatchSizeInBytes}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb measured in bytes
+ *   <li>{@code maxTimeInBufferMS}: the maximum amount of time an entry is allowed to live in the
+ *       buffer, if any element reaches this age, the entire buffer will be flushed immediately
+ *   <li>{@code maxRecordSizeInBytes}: the maximum size of a record the sink will accept into the
+ *       buffer, a record of size larger than this will be rejected when passed to the sink
+ *   <li>{@code failOnError}: when an exception is encountered while persisting to DynamoDb, the job
+ *       will fail immediately if failOnError is set
+ *   <li>{@code dynamoDbTablesConfig}: if provided for the table, the DynamoDb sink will attempt to
+ *       deduplicate records with the same primary and/or secondary keys in the same batch request.
+ *       Only the latest record with the same combination of key attributes is preserved in the
+ *       request.
+ * </ul>
+ *
+ * <p>Please see the writer implementation in {@link DynamoDbSinkWriter}
+ *
+ * @param <InputT> Type of the elements handled by this sink
+ */
+@PublicEvolving
+public class DynamoDbSink<InputT> extends AsyncSinkBase<InputT, DynamoDbWriteRequest> {

Review comment:
       Why didn't you name it `DynamoDbAsyncSink`? Shouldn't users be aware of this?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] nirtsruya commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
nirtsruya commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r830933767



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSink.java
##########
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.api.connector.sink.SinkWriter;
+import org.apache.flink.connector.base.sink.AsyncSinkBase;
+import org.apache.flink.connector.base.sink.writer.ElementConverter;
+import org.apache.flink.core.io.SimpleVersionedSerializer;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Optional;
+import java.util.Properties;
+
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
+/**
+ * A DynamoDB Sink that performs async requests against a destination stream using the buffering
+ * protocol specified in {@link AsyncSinkBase}.
+ *
+ * <p>The sink internally uses a {@link
+ * software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient} to communicate with the AWS
+ * endpoint.
+ *
+ * <p>The behaviour of the buffering may be specified by providing configuration during the sink
+ * build time.
+ *
+ * <ul>
+ *   <li>{@code maxBatchSize}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb.
+ *   <li>{@code maxInFlightRequests}: the maximum number of in flight requests that may exist, if
+ *       any more in flight requests need to be initiated once the maximum has been reached, then it
+ *       will be blocked until some have completed
+ *   <li>{@code maxBufferedRequests}: the maximum number of elements held in the buffer, requests to
+ *       add elements will be blocked while the number of elements in the buffer is at the maximum
+ *   <li>{@code maxBatchSizeInBytes}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb measured in bytes
+ *   <li>{@code maxTimeInBufferMS}: the maximum amount of time an entry is allowed to live in the
+ *       buffer, if any element reaches this age, the entire buffer will be flushed immediately
+ *   <li>{@code maxRecordSizeInBytes}: the maximum size of a record the sink will accept into the
+ *       buffer, a record of size larger than this will be rejected when passed to the sink
+ *   <li>{@code failOnError}: when an exception is encountered while persisting to DynamoDb, the job
+ *       will fail immediately if failOnError is set
+ *   <li>{@code dynamoDbTablesConfig}: if provided for the table, the DynamoDb sink will attempt to
+ *       deduplicate records with the same primary and/or secondary keys in the same batch request.
+ *       Only the latest record with the same combination of key attributes is preserved in the
+ *       request.
+ * </ul>
+ *
+ * <p>Please see the writer implementation in {@link DynamoDbSinkWriter}
+ *
+ * @param <InputT> Type of the elements handled by this sink
+ */
+@PublicEvolving
+public class DynamoDbSink<InputT> extends AsyncSinkBase<InputT, DynamoDbWriteRequest> {

Review comment:
       Thanks for the comment, makes sense, I was looking at other sinks in the project already inheriting from the AsyncSinkBase, and they are not using the Async naming convention. 
   @CrynetLogistics @dannycranmer it makes sense to me, is that something we want to do moving forward? 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] YuriGusev commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
YuriGusev commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r792479047



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/util/AWSDynamoDbUtil.java
##########
@@ -0,0 +1,184 @@
+/*

Review comment:
       As an alternative we could let user to construct the client themselves and pass it via a provider:
   
   `
   interface DynamoDbClientProvider {
      DynamoDbAsyncClient getClient(); 
   }
   `
   
   Then we do not have to create the wrapper util class and give full flexibility to the user on what configuration options to set.
   
   The downside will be that we leak DynamoDB SDK interfaces. 
   
   In the end I took same approach as we use in other places. But may be we should consider this option.
   
   What do you think @CrynetLogistics ?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * df0af668680a0672e293083239809cfec66c572d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331) 
   * 1101c210e2389dc36876faf69d5cd52a77c882a6 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] YuriGusev commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
YuriGusev commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r793873719



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSink.java
##########
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Experimental;
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.api.connector.sink.SinkWriter;
+import org.apache.flink.connector.base.sink.AsyncSinkBase;
+import org.apache.flink.connector.base.sink.writer.ElementConverter;
+import org.apache.flink.core.io.SimpleVersionedSerializer;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Optional;
+import java.util.Properties;
+
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
+/**
+ * A DynamoDB Sink that performs async requests against a destination stream using the buffering
+ * protocol specified in {@link AsyncSinkBase}.
+ *
+ * <p>The sink internally uses a {@link
+ * software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient} to communicate with the AWS
+ * endpoint.
+ *
+ * <p>The behaviour of the buffering may be specified by providing configuration during the sink
+ * build time.
+ *
+ * <ul>
+ *   <li>{@code maxBatchSize}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb.
+ *   <li>{@code maxInFlightRequests}: the maximum number of in flight requests that may exist, if
+ *       any more in flight requests need to be initiated once the maximum has been reached, then it
+ *       will be blocked until some have completed
+ *   <li>{@code maxBufferedRequests}: the maximum number of elements held in the buffer, requests to
+ *       add elements will be blocked while the number of elements in the buffer is at the maximum
+ *   <li>{@code maxBatchSizeInBytes}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb measured in bytes
+ *   <li>{@code maxTimeInBufferMS}: the maximum amount of time an entry is allowed to live in the
+ *       buffer, if any element reaches this age, the entire buffer will be flushed immediately
+ *   <li>{@code maxRecordSizeInBytes}: the maximum size of a record the sink will accept into the
+ *       buffer, a record of size larger than this will be rejected when passed to the sink
+ *   <li>{@code failOnError}: when an exception is encountered while persisting to DynamoDb, the job
+ *       will fail immediately if failOnError is set
+ *   <li>{@code dynamoDbTablesConfig}: if provided for the table, the DynamoDb sink will attempt to
+ *       deduplicate records with the same primary and/or secondary keys in the same batch request.
+ *       Only the latest record with the same combination of key attributes is preserved in the
+ *       request.
+ * </ul>
+ *
+ * <p>Please see the writer implementation in {@link DynamoDbSinkWriter}
+ *
+ * @param <InputT> Type of the elements handled by this sink
+ */
+@PublicEvolving
+public class DynamoDbSink<InputT> extends AsyncSinkBase<InputT, DynamoDbWriteRequest> {
+
+    private final Properties dynamoDbClientProperties;
+    private final DynamoDbTablesConfig dynamoDbTablesConfig;
+    private final boolean failOnError;
+
+    protected DynamoDbSink(
+            ElementConverter<InputT, DynamoDbWriteRequest> elementConverter,
+            int maxBatchSize,
+            int maxInFlightRequests,
+            int maxBufferedRequests,
+            long maxBatchSizeInBytes,
+            long maxTimeInBufferMS,
+            long maxRecordSizeInBytes,
+            boolean failOnError,
+            DynamoDbTablesConfig dynamoDbTablesConfig,
+            Properties dynamoDbClientProperties) {
+        super(
+                elementConverter,
+                maxBatchSize,
+                maxInFlightRequests,
+                maxBufferedRequests,
+                maxBatchSizeInBytes,
+                maxTimeInBufferMS,
+                maxRecordSizeInBytes);
+        checkNotNull(dynamoDbTablesConfig, "Missing dynamoDbTablesConfig");
+        checkNotNull(dynamoDbClientProperties, "Missing dynamoDbClientProperties");
+        this.failOnError = failOnError;
+        this.dynamoDbTablesConfig = dynamoDbTablesConfig;
+        this.dynamoDbClientProperties = dynamoDbClientProperties;
+    }
+
+    /**
+     * Create a {@link DynamoDbSinkBuilder} to construct a new {@link DynamoDbSink}.
+     *
+     * @param <InputT> type of incoming records
+     * @return {@link DynamoDbSinkBuilder}
+     */
+    public static <InputT> DynamoDbSinkBuilder<InputT> builder() {
+        return new DynamoDbSinkBuilder<>();
+    }
+
+    @Experimental
+    @Override
+    public SinkWriter<InputT, Void, Collection<DynamoDbWriteRequest>> createWriter(
+            InitContext context, List<Collection<DynamoDbWriteRequest>> states) {
+        return new DynamoDbSinkWriter<>(
+                getElementConverter(),
+                context,
+                getMaxBatchSize(),
+                getMaxInFlightRequests(),
+                getMaxBufferedRequests(),
+                getMaxBatchSizeInBytes(),
+                getMaxTimeInBufferMS(),
+                getMaxRecordSizeInBytes(),
+                failOnError,
+                dynamoDbTablesConfig,
+                dynamoDbClientProperties);
+    }
+
+    @Experimental

Review comment:
       fixed

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSinkBuilder.java
##########
@@ -0,0 +1,123 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.connector.base.sink.AsyncSinkBaseBuilder;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+
+import java.util.Optional;
+import java.util.Properties;
+
+/**
+ * Builder to construct {@link DynamoDbSink}.
+ *
+ * <p>The following example shows the minimum setup to create a {@link DynamoDbSink} that writes
+ * records into DynamoDb
+ *
+ * <pre>{@code
+ * private static class DummyElementConverter
+ *         implements ElementConverter<String, DynamoDbWriteRequest> {
+ *
+ *     @Override
+ *     public DynamoDbWriteRequest apply(String element, SinkWriter.Context context) {
+ *         final Map<String, AttributeValue> map = new HashMap<>();
+ *         map.put("your-key", AttributeValue.builder().s(element).build());
+ *         return new DynamoDbWriteRequest(
+ *                 "your-table-name",
+ *                 WriteRequest.builder()
+ *                         .putRequest(PutRequest.builder().item(map).build())
+ *                         .build());
+ *      }
+ * }
+ * DynamoDbSink<String> dynamoDbSink = DynamoDbSink.<String>builder()
+ *                                          .setElementConverter(new DummyElementConverter())
+ *                                       .build();
+ * }</pre>
+ *
+ * <p>If the following parameters are not set in this builder, the following defaults will be used:
+ *
+ * <ul>
+ *   <li>{@code maxBatchSize} will be 25
+ *   <li>{@code maxInFlightRequests} will be 10

Review comment:
       fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * df0af668680a0672e293083239809cfec66c572d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331) 
   * 1101c210e2389dc36876faf69d5cd52a77c882a6 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] YuriGusev commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
YuriGusev commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r793711778



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSink.java
##########
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Experimental;
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.api.connector.sink.SinkWriter;
+import org.apache.flink.connector.base.sink.AsyncSinkBase;
+import org.apache.flink.connector.base.sink.writer.ElementConverter;
+import org.apache.flink.core.io.SimpleVersionedSerializer;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Optional;
+import java.util.Properties;
+
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
+/**
+ * A DynamoDB Sink that performs async requests against a destination stream using the buffering
+ * protocol specified in {@link AsyncSinkBase}.
+ *
+ * <p>The sink internally uses a {@link
+ * software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient} to communicate with the AWS
+ * endpoint.
+ *
+ * <p>The behaviour of the buffering may be specified by providing configuration during the sink
+ * build time.
+ *
+ * <ul>
+ *   <li>{@code maxBatchSize}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb.
+ *   <li>{@code maxInFlightRequests}: the maximum number of in flight requests that may exist, if
+ *       any more in flight requests need to be initiated once the maximum has been reached, then it
+ *       will be blocked until some have completed
+ *   <li>{@code maxBufferedRequests}: the maximum number of elements held in the buffer, requests to
+ *       add elements will be blocked while the number of elements in the buffer is at the maximum
+ *   <li>{@code maxBatchSizeInBytes}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb measured in bytes
+ *   <li>{@code maxTimeInBufferMS}: the maximum amount of time an entry is allowed to live in the
+ *       buffer, if any element reaches this age, the entire buffer will be flushed immediately
+ *   <li>{@code maxRecordSizeInBytes}: the maximum size of a record the sink will accept into the
+ *       buffer, a record of size larger than this will be rejected when passed to the sink
+ *   <li>{@code failOnError}: when an exception is encountered while persisting to DynamoDb, the job
+ *       will fail immediately if failOnError is set
+ *   <li>{@code dynamoDbTablesConfig}: if provided for the table, the DynamoDb sink will attempt to
+ *       deduplicate records with the same primary and/or secondary keys in the same batch request.
+ *       Only the latest record with the same combination of key attributes is preserved in the
+ *       request.
+ * </ul>
+ *
+ * <p>Please see the writer implementation in {@link DynamoDbSinkWriter}
+ *
+ * @param <InputT> Type of the elements handled by this sink
+ */
+@PublicEvolving
+public class DynamoDbSink<InputT> extends AsyncSinkBase<InputT, DynamoDbWriteRequest> {
+
+    private final Properties dynamoDbClientProperties;
+    private final DynamoDbTablesConfig dynamoDbTablesConfig;
+    private final boolean failOnError;
+
+    protected DynamoDbSink(
+            ElementConverter<InputT, DynamoDbWriteRequest> elementConverter,
+            int maxBatchSize,
+            int maxInFlightRequests,
+            int maxBufferedRequests,
+            long maxBatchSizeInBytes,
+            long maxTimeInBufferMS,
+            long maxRecordSizeInBytes,
+            boolean failOnError,
+            DynamoDbTablesConfig dynamoDbTablesConfig,
+            Properties dynamoDbClientProperties) {
+        super(
+                elementConverter,
+                maxBatchSize,
+                maxInFlightRequests,
+                maxBufferedRequests,
+                maxBatchSizeInBytes,
+                maxTimeInBufferMS,
+                maxRecordSizeInBytes);
+        checkNotNull(dynamoDbTablesConfig, "Missing dynamoDbTablesConfig");
+        checkNotNull(dynamoDbClientProperties, "Missing dynamoDbClientProperties");
+        this.failOnError = failOnError;
+        this.dynamoDbTablesConfig = dynamoDbTablesConfig;
+        this.dynamoDbClientProperties = dynamoDbClientProperties;
+    }
+
+    /**
+     * Create a {@link DynamoDbSinkBuilder} to construct a new {@link DynamoDbSink}.
+     *
+     * @param <InputT> type of incoming records
+     * @return {@link DynamoDbSinkBuilder}
+     */
+    public static <InputT> DynamoDbSinkBuilder<InputT> builder() {
+        return new DynamoDbSinkBuilder<>();
+    }
+
+    @Experimental

Review comment:
       I can see how it is useful for the KinesisSink, as we do not leak Kinesis Put request to the user, but I think it would be more complicated to implement for the DynamoDB Sink. 
   
   We will have to implement something that would look exactly like DynamoDB WriteRequest with all its attributes, types, request types, etc. and translate it internally into the WriteRequest object (by the converter). I can not see any other solution for that at the moment. Do you have any ideas?
   
   It will be a lot of functionality we will have to "repeat" that dynamodb provides and limit the user if dynamoDb client evolves in the future.
   
   Do you think it worth doing it, instead of letting user to define the converter themselves? @CrynetLogistics 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * df0af668680a0672e293083239809cfec66c572d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331) 
   * 1101c210e2389dc36876faf69d5cd52a77c882a6 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * df0af668680a0672e293083239809cfec66c572d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331) 
   * 1101c210e2389dc36876faf69d5cd52a77c882a6 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393) 
   * 0c073f2b0cec8b9e8bfda51f408181fce949c287 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] vahmed-hamdy commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
vahmed-hamdy commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r792693997



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/key/PrimaryKey.java
##########
@@ -0,0 +1,168 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink.key;
+
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+import org.apache.flink.streaming.connectors.dynamodb.sink.InvalidRequestException;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import software.amazon.awssdk.services.dynamodb.model.AttributeValue;
+import software.amazon.awssdk.services.dynamodb.model.WriteRequest;
+
+import javax.annotation.Nullable;
+
+import java.util.Map;
+import java.util.UUID;
+
+/** Represents DynamoDB primary key. */
+public class PrimaryKey {
+
+    private final String partitionKeyValue;
+    @Nullable private final String sortKeyValue;
+
+    private PrimaryKey(String partitionKeyValue) {
+        this.partitionKeyValue = partitionKeyValue;
+        this.sortKeyValue = null;
+    }
+
+    private PrimaryKey(String partitionKeyValue, @Nullable String sortKeyValue) {
+        this.partitionKeyValue = partitionKeyValue;
+        this.sortKeyValue = sortKeyValue;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+
+        PrimaryKey that = (PrimaryKey) o;
+
+        return new EqualsBuilder()
+                .append(partitionKeyValue, that.partitionKeyValue)
+                .append(sortKeyValue, that.sortKeyValue)
+                .isEquals();
+    }
+
+    @Override
+    public int hashCode() {
+        return new HashCodeBuilder(17, 37)
+                .append(partitionKeyValue)
+                .append(sortKeyValue)
+                .toHashCode();
+    }
+
+    @Override
+    public String toString() {
+        return "PrimaryKey{"
+                + "partitionKeyValue='"
+                + partitionKeyValue
+                + '\''
+                + ", sortKeyValue='"
+                + sortKeyValue
+                + '\''
+                + '}';
+    }
+
+    public static PrimaryKey build(DynamoDbTablesConfig.TableConfig config, WriteRequest request) {
+        if (config != null) {

Review comment:
       Are we expecting a nullable parameter?
   might be worth adding a `@Nullable` annotation

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSinkException.java
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+/** Exception is thrown when DynamoDb sink failed to write data. */
+public class DynamoDbSinkException extends RuntimeException {

Review comment:
       Missing compatibility annotation

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/TableRequestsContainer.java
##########
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+import org.apache.flink.streaming.connectors.dynamodb.sink.key.PrimaryKey;
+
+import org.apache.flink.shaded.guava30.com.google.common.collect.ImmutableList;
+
+import software.amazon.awssdk.services.dynamodb.model.WriteRequest;
+
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Container to accumulate requests in batches per table. De-duplicates batch request entities as
+ * per PrimaryKey definition. DynamoDB Batch API rejects the whole batch request if the request
+ * contains at least two items with identical hash and range keys (which essentially is two put
+ * operations).
+ */
+class TableRequestsContainer {
+
+    private final DynamoDbTablesConfig tablesConfig;
+    private final LinkedHashMap<String, Map<PrimaryKey, WriteRequest>> container;

Review comment:
       nit: Do we need `container` to be a `LinkedHashMap`?

##########
File path: flink-connectors/flink-connector-dynamodb/src/test/java/org/apache/flink/streaming/connectors/dynamodb/sink/TableRequestsContainerTest.java
##########
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+
+import org.apache.flink.shaded.guava30.com.google.common.collect.ImmutableMap;
+
+import org.junit.Test;
+import software.amazon.awssdk.services.dynamodb.model.AttributeValue;
+import software.amazon.awssdk.services.dynamodb.model.PutRequest;
+import software.amazon.awssdk.services.dynamodb.model.WriteRequest;
+
+import static org.junit.Assert.assertEquals;

Review comment:
       Can we use `assertj` instead to match the [guidelines](https://flink.apache.org/contributing/code-style-and-quality-common.html#testing)?
   

##########
File path: flink-connectors/flink-connector-dynamodb/src/test/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSinkBuilderTest.java
##########
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.assertj.core.api.Assertions;
+import org.junit.Test;
+
+/** Tests for {@link DynamoDbSinkBuilder}. */
+public class DynamoDbSinkBuilderTest {

Review comment:
       In my opinion, I prefer having at least 1 positive test (i.e build a sink and verify it). 

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/resources/META-INF/NOTICE
##########
@@ -0,0 +1,257 @@
+flink-connector-dynamodb
+Copyright 2014-2021 The Apache Software Foundation

Review comment:
       should this be 2022?

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/key/PrimaryKey.java
##########
@@ -0,0 +1,168 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink.key;
+
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+import org.apache.flink.streaming.connectors.dynamodb.sink.InvalidRequestException;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import software.amazon.awssdk.services.dynamodb.model.AttributeValue;
+import software.amazon.awssdk.services.dynamodb.model.WriteRequest;
+
+import javax.annotation.Nullable;
+
+import java.util.Map;
+import java.util.UUID;
+
+/** Represents DynamoDB primary key. */
+public class PrimaryKey {
+
+    private final String partitionKeyValue;
+    @Nullable private final String sortKeyValue;
+
+    private PrimaryKey(String partitionKeyValue) {
+        this.partitionKeyValue = partitionKeyValue;
+        this.sortKeyValue = null;
+    }
+
+    private PrimaryKey(String partitionKeyValue, @Nullable String sortKeyValue) {
+        this.partitionKeyValue = partitionKeyValue;
+        this.sortKeyValue = sortKeyValue;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+
+        PrimaryKey that = (PrimaryKey) o;
+
+        return new EqualsBuilder()
+                .append(partitionKeyValue, that.partitionKeyValue)
+                .append(sortKeyValue, that.sortKeyValue)
+                .isEquals();
+    }
+
+    @Override
+    public int hashCode() {
+        return new HashCodeBuilder(17, 37)
+                .append(partitionKeyValue)
+                .append(sortKeyValue)
+                .toHashCode();
+    }
+
+    @Override
+    public String toString() {
+        return "PrimaryKey{"
+                + "partitionKeyValue='"
+                + partitionKeyValue
+                + '\''
+                + ", sortKeyValue='"
+                + sortKeyValue
+                + '\''
+                + '}';
+    }
+
+    public static PrimaryKey build(DynamoDbTablesConfig.TableConfig config, WriteRequest request) {
+        if (config != null) {
+            Map<String, AttributeValue> requestItems = getRequestItems(request);
+
+            AttributeValue partitionKeyAttributeValue =
+                    requestItems.get(config.getPartitionKeyName());
+            AttributeValue sortKeyAttributeValue = requestItems.get(config.getSortKeyName());
+
+            if (config.getPartitionKeyName() != null && partitionKeyAttributeValue == null) {

Review comment:
       Can `config.getPartitionKeyName()` ever be null?

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbWriteRequest.java
##########
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import software.amazon.awssdk.services.dynamodb.model.WriteRequest;
+
+import java.io.Serializable;
+import java.util.Objects;
+
+/**
+ * Represents a single DynamoDb {@link WriteRequest}. Contains the name of the DynamoDb table name
+ * to write to as well as the {@link WriteRequest}
+ */
+public class DynamoDbWriteRequest implements Serializable {

Review comment:
       Missing compatibility annotation, might be worth having a look across the whole PR

##########
File path: flink-connectors/flink-connector-dynamodb/src/test/java/org/apache/flink/streaming/connectors/dynamodb/sink/key/PrimaryKeyTest.java
##########
@@ -0,0 +1,150 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink.key;
+
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+import org.apache.flink.streaming.connectors.dynamodb.sink.InvalidRequestException;
+
+import org.apache.flink.shaded.guava30.com.google.common.collect.ImmutableMap;
+
+import org.junit.Assert;

Review comment:
       Same as above




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] CrynetLogistics commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
CrynetLogistics commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r792609714



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/util/AWSDynamoDbUtil.java
##########
@@ -0,0 +1,184 @@
+/*

Review comment:
       I like your current approach more, like you said, we'd not leak any ddb sdk interfaces.
   
   Plus, I'm not sure there is a way to pass `DynamoDbClientProvider` to the `DynamoDbSinkWriter` without first making it a field in `DynamoDbSink`. If I'm not wrong, I believe the `DynamoDbSink` will complain that `DynamoDbAsyncClient` in your `DynamoDbClientProvider` is not serialisable during runtime (it compiles ok).




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1ed40f830db68d828612207897418a868e6b55f7",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476",
       "triggerID" : "1ed40f830db68d828612207897418a868e6b55f7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1ed40f830db68d828612207897418a868e6b55f7 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476) 
   * bce4406f01127a6956ef00592014e9c5b9d00aa4 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1ed40f830db68d828612207897418a868e6b55f7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476",
       "triggerID" : "1ed40f830db68d828612207897418a868e6b55f7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30498",
       "triggerID" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34130",
       "triggerID" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * bce4406f01127a6956ef00592014e9c5b9d00aa4 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30498) 
   * 63f13beab12bbeec3e7a03751ca2943dacb41c12 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34130) 
   * f92d95336aa9111d7cc2c7c47497677ad3e9c2de UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1ed40f830db68d828612207897418a868e6b55f7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476",
       "triggerID" : "1ed40f830db68d828612207897418a868e6b55f7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30498",
       "triggerID" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34130",
       "triggerID" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34133",
       "triggerID" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "triggerType" : "PUSH"
     }, {
       "hash" : "05a1635907ec667b0c6b35ce962dc01a685cac55",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "05a1635907ec667b0c6b35ce962dc01a685cac55",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f92d95336aa9111d7cc2c7c47497677ad3e9c2de Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34133) 
   * 05a1635907ec667b0c6b35ce962dc01a685cac55 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1ed40f830db68d828612207897418a868e6b55f7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476",
       "triggerID" : "1ed40f830db68d828612207897418a868e6b55f7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30498",
       "triggerID" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34130",
       "triggerID" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34133",
       "triggerID" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 63f13beab12bbeec3e7a03751ca2943dacb41c12 Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34130) 
   * f92d95336aa9111d7cc2c7c47497677ad3e9c2de Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34133) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] YuriGusev commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
YuriGusev commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r841057538



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/TableRequestsContainer.java
##########
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+import org.apache.flink.streaming.connectors.dynamodb.sink.key.PrimaryKey;
+
+import org.apache.flink.shaded.guava30.com.google.common.collect.ImmutableList;
+
+import software.amazon.awssdk.services.dynamodb.model.WriteRequest;
+
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Container to accumulate requests in batches per table. De-duplicates batch request entities as
+ * per PrimaryKey definition. DynamoDB Batch API rejects the whole batch request if the request
+ * contains at least two items with identical hash and range keys (which essentially is two put
+ * operations).
+ */
+class TableRequestsContainer {
+
+    private final DynamoDbTablesConfig tablesConfig;
+    private final LinkedHashMap<String, Map<PrimaryKey, WriteRequest>> container;

Review comment:
       Yes, strange, probably got lost on previous re-base. It is fixed now.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1ed40f830db68d828612207897418a868e6b55f7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476",
       "triggerID" : "1ed40f830db68d828612207897418a868e6b55f7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30498",
       "triggerID" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34130",
       "triggerID" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34133",
       "triggerID" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bb92395129797263b775f9a81e89dbcbab94391b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34135",
       "triggerID" : "bb92395129797263b775f9a81e89dbcbab94391b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdfc807c14de7b1dfcc6776547373b863b4aa545",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34165",
       "triggerID" : "bdfc807c14de7b1dfcc6776547373b863b4aa545",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * bdfc807c14de7b1dfcc6776547373b863b4aa545 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34165) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1ed40f830db68d828612207897418a868e6b55f7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476",
       "triggerID" : "1ed40f830db68d828612207897418a868e6b55f7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30498",
       "triggerID" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34130",
       "triggerID" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34133",
       "triggerID" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6b0d74d684a082d026e891ca67932ae33f58806e",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "6b0d74d684a082d026e891ca67932ae33f58806e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 63f13beab12bbeec3e7a03751ca2943dacb41c12 Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34130) 
   * f92d95336aa9111d7cc2c7c47497677ad3e9c2de Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34133) 
   * 6b0d74d684a082d026e891ca67932ae33f58806e UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] YuriGusev commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
YuriGusev commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r840826701



##########
File path: flink-connectors/flink-connector-dynamodb/pom.xml
##########
@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<parent>
+		<groupId>org.apache.flink</groupId>
+		<artifactId>flink-connectors</artifactId>
+		<version>1.15-SNAPSHOT</version>
+		<relativePath>..</relativePath>
+	</parent>
+
+	<modelVersion>4.0.0</modelVersion>
+
+	<artifactId>flink-connector-dynamodb</artifactId>
+	<name>Flink : Connectors : DynamoDB</name>
+	<properties>
+		<aws.sdk.version>2.17.116</aws.sdk.version>
+		<commons-lang3.version>3.11</commons-lang3.version>
+		<testcontainers.version>1.16.2</testcontainers.version>
+	</properties>
+
+	<packaging>jar</packaging>
+
+	<dependencies>
+		<!-- Connectors -->
+
+		<dependency>
+			<groupId>org.apache.flink</groupId>
+			<artifactId>flink-connector-base</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.flink</groupId>
+			<artifactId>flink-connector-aws-base</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+
+		<!-- Amazon AWS SDK v2.x dependencies -->
+		<dependency>
+			<groupId>software.amazon.awssdk</groupId>
+			<artifactId>aws-core</artifactId>
+			<version>${aws.sdk.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>software.amazon.awssdk</groupId>
+			<artifactId>dynamodb</artifactId>
+			<version>${aws.sdk.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>software.amazon.awssdk</groupId>
+			<artifactId>profiles</artifactId>
+			<version>${aws.sdk.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>software.amazon.awssdk</groupId>
+			<artifactId>sdk-core</artifactId>
+			<version>${aws.sdk.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>software.amazon.awssdk</groupId>
+			<artifactId>auth</artifactId>
+			<version>${aws.sdk.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>software.amazon.awssdk</groupId>
+			<artifactId>regions</artifactId>
+			<version>${aws.sdk.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>software.amazon.awssdk</groupId>
+			<artifactId>sts</artifactId>
+			<version>${aws.sdk.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>software.amazon.awssdk</groupId>
+			<artifactId>http-client-spi</artifactId>
+			<version>${aws.sdk.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>software.amazon.awssdk</groupId>
+			<artifactId>netty-nio-client</artifactId>
+			<version>${aws.sdk.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>commons-lang3</artifactId>
+			<version>${commons-lang3.version}</version>
+			<scope>provided</scope>
+		</dependency>
+
+		<!-- Flink ecosystem -->
+		<dependency>
+			<groupId>org.apache.flink</groupId>
+			<artifactId>flink-streaming-java</artifactId>
+			<version>${project.version}</version>
+			<scope>provided</scope>
+		</dependency>
+
+		<!-- Test dependencies -->
+		<dependency>
+			<groupId>org.apache.flink</groupId>
+			<artifactId>flink-connector-aws-base</artifactId>
+			<version>${project.version}</version>
+			<type>test-jar</type>
+			<scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.flink</groupId>
+			<artifactId>flink-core</artifactId>
+			<version>${project.version}</version>
+			<scope>test</scope>
+			<type>test-jar</type>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.flink</groupId>
+			<artifactId>flink-streaming-java</artifactId>
+			<version>${project.version}</version>
+			<scope>test</scope>
+			<type>test-jar</type>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.flink</groupId>
+			<artifactId>flink-test-utils</artifactId>
+			<version>${project.version}</version>
+			<scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.flink</groupId>
+			<artifactId>flink-runtime</artifactId>
+			<version>${project.version}</version>
+			<type>test-jar</type>
+			<scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.testcontainers</groupId>
+			<artifactId>testcontainers</artifactId>
+			<version>${testcontainers.version}</version>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-dependency-plugin</artifactId>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-jar-plugin</artifactId>
+				<executions>
+					<execution>
+						<goals>
+							<goal>test-jar</goal>

Review comment:
       removed test jar configuration

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/util/AWSDynamoDbUtil.java
##########
@@ -0,0 +1,184 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.util;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.connector.aws.config.AWSConfigConstants;
+import org.apache.flink.connector.aws.util.AWSGeneralUtil;
+import org.apache.flink.runtime.util.EnvironmentInformation;
+import org.apache.flink.streaming.connectors.dynamodb.config.AWSDynamoDbConfigConstants;
+
+import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
+import software.amazon.awssdk.core.client.config.SdkAdvancedClientOption;
+import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
+import software.amazon.awssdk.core.client.config.SdkClientOption;
+import software.amazon.awssdk.core.retry.RetryPolicy;
+import software.amazon.awssdk.core.retry.backoff.BackoffStrategy;
+import software.amazon.awssdk.core.retry.backoff.EqualJitterBackoffStrategy;
+import software.amazon.awssdk.core.retry.backoff.FixedDelayBackoffStrategy;
+import software.amazon.awssdk.core.retry.backoff.FullJitterBackoffStrategy;
+import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient;
+import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClientBuilder;
+
+import java.net.URI;
+import java.time.Duration;
+import java.util.Optional;
+import java.util.Properties;
+
+/** Some utilities specific to Amazon Web Service. */

Review comment:
       thanks, fixed now




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1ed40f830db68d828612207897418a868e6b55f7",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476",
       "triggerID" : "1ed40f830db68d828612207897418a868e6b55f7",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 0c073f2b0cec8b9e8bfda51f408181fce949c287 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404) 
   * 1ed40f830db68d828612207897418a868e6b55f7 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8ec1f57053a8f98ca61b1ff7ad090d789476d45b Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220) 
   * 9c9eec7f108f056b27d417ed0ba12f098f8af714 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cbf7faa6e76bfdac6d4b72d981b8f6c5aa4f7a23",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "cbf7faa6e76bfdac6d4b72d981b8f6c5aa4f7a23",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8ec1f57053a8f98ca61b1ff7ad090d789476d45b Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220) 
   * 9c9eec7f108f056b27d417ed0ba12f098f8af714 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320) 
   * cbf7faa6e76bfdac6d4b72d981b8f6c5aa4f7a23 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] dannycranmer commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
dannycranmer commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r830970295



##########
File path: flink-connectors/flink-connector-dynamodb/pom.xml
##########
@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<parent>
+		<groupId>org.apache.flink</groupId>
+		<artifactId>flink-connectors</artifactId>
+		<version>1.15-SNAPSHOT</version>
+		<relativePath>..</relativePath>
+	</parent>
+
+	<modelVersion>4.0.0</modelVersion>
+
+	<artifactId>flink-connector-dynamodb</artifactId>
+	<name>Flink : Connectors : DynamoDB</name>
+	<properties>
+		<aws.sdk.version>2.17.116</aws.sdk.version>
+		<commons-lang3.version>3.11</commons-lang3.version>

Review comment:
       Can you use the managed version from parent instead? https://github.com/apache/flink/blob/master/pom.xml#L478

##########
File path: flink-connectors/flink-connector-dynamodb/pom.xml
##########
@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<parent>
+		<groupId>org.apache.flink</groupId>
+		<artifactId>flink-connectors</artifactId>
+		<version>1.15-SNAPSHOT</version>

Review comment:
       Please rebase this PR on master, which is now Flink 1.16

##########
File path: flink-connectors/flink-connector-dynamodb/pom.xml
##########
@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<parent>
+		<groupId>org.apache.flink</groupId>
+		<artifactId>flink-connectors</artifactId>
+		<version>1.15-SNAPSHOT</version>
+		<relativePath>..</relativePath>
+	</parent>
+
+	<modelVersion>4.0.0</modelVersion>
+
+	<artifactId>flink-connector-dynamodb</artifactId>

Review comment:
       Please rename inline with the other new `aws` connectors > `flink-connector-aws-dynamodb`

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSinkBuilder.java
##########
@@ -0,0 +1,123 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.connector.base.sink.AsyncSinkBaseBuilder;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+
+import java.util.Optional;
+import java.util.Properties;
+
+/**
+ * Builder to construct {@link DynamoDbSink}.
+ *
+ * <p>The following example shows the minimum setup to create a {@link DynamoDbSink} that writes
+ * records into DynamoDb
+ *
+ * <pre>{@code
+ * private static class DummyElementConverter
+ *         implements ElementConverter<String, DynamoDbWriteRequest> {

Review comment:
       There was some discussion before about exposing the `ElementConverter` to the user. For KDS/KDF we decided to hide the `ElementConverter`, since we do not need to bubble up AWS SDK classes to user code (and this causes other issues). Is there a good reason to bubble up to user for DynamoDB? I would prefer we hide if possible, look at KDS/KDS implementation for inspiration 

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSinkBuilder.java
##########
@@ -0,0 +1,123 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.connector.base.sink.AsyncSinkBaseBuilder;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+
+import java.util.Optional;
+import java.util.Properties;
+
+/**
+ * Builder to construct {@link DynamoDbSink}.
+ *
+ * <p>The following example shows the minimum setup to create a {@link DynamoDbSink} that writes
+ * records into DynamoDb
+ *
+ * <pre>{@code
+ * private static class DummyElementConverter
+ *         implements ElementConverter<String, DynamoDbWriteRequest> {
+ *
+ *     @Override
+ *     public DynamoDbWriteRequest apply(String element, SinkWriter.Context context) {
+ *         final Map<String, AttributeValue> map = new HashMap<>();
+ *         map.put("your-key", AttributeValue.builder().s(element).build());
+ *         return new DynamoDbWriteRequest(
+ *                 "your-table-name",
+ *                 WriteRequest.builder()
+ *                         .putRequest(PutRequest.builder().item(map).build())
+ *                         .build());
+ *      }
+ * }
+ * DynamoDbSink<String> dynamoDbSink = DynamoDbSink.<String>builder()
+ *                                          .setElementConverter(new DummyElementConverter())
+ *                                       .build();
+ * }</pre>
+ *
+ * <p>If the following parameters are not set in this builder, the following defaults will be used:
+ *
+ * <ul>
+ *   <li>{@code maxBatchSize} will be 25
+ *   <li>{@code maxInFlightRequests} will be 50
+ *   <li>{@code maxBufferedRequests} will be 10000
+ *   <li>{@code maxBatchSizeInBytes} will be 16 MB i.e. {@code 16 * 1000 * 1000}
+ *   <li>{@code maxTimeInBufferMS} will be 5000ms
+ *   <li>{@code maxRecordSizeInBytes} will be 400 KB i.e. {@code 400 * 1000 * 1000}
+ *   <li>{@code failOnError} will be false
+ *   <li>{@code dynamoDbTablesConfig} will be empty meaning no records deduplication will be
+ *       performed by the sink

Review comment:
       Have you done any performance testing to backup these values or are you picking sensible defaults?

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSink.java
##########
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.api.connector.sink.SinkWriter;
+import org.apache.flink.connector.base.sink.AsyncSinkBase;
+import org.apache.flink.connector.base.sink.writer.ElementConverter;
+import org.apache.flink.core.io.SimpleVersionedSerializer;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Optional;
+import java.util.Properties;
+
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
+/**
+ * A DynamoDB Sink that performs async requests against a destination stream using the buffering

Review comment:
       > against a destination stream
   
   Copy and paste error?

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSinkWriter.java
##########
@@ -0,0 +1,168 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.api.connector.sink.Sink;
+import org.apache.flink.connector.base.sink.writer.AsyncSinkWriter;
+import org.apache.flink.connector.base.sink.writer.ElementConverter;
+import org.apache.flink.metrics.Counter;
+import org.apache.flink.metrics.groups.SinkWriterMetricGroup;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+import org.apache.flink.streaming.connectors.dynamodb.util.AWSDynamoDbUtil;
+import org.apache.flink.streaming.connectors.dynamodb.util.DynamoDbExceptionUtils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient;
+import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemRequest;
+import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemResponse;
+import software.amazon.awssdk.services.dynamodb.model.WriteRequest;
+
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.CompletableFuture;
+import java.util.function.Consumer;
+
+/**
+ * Sink writer created by {@link DynamoDbSink} to write to DynamoDB. More details on the operation
+ * of this sink writer may be found in the doc for {@link DynamoDbSink}. More details on the
+ * internals of this sink writer may be found in {@link AsyncSinkWriter}.
+ *
+ * <p>The {@link DynamoDbAsyncClient} used here may be configured in the standard way for the AWS
+ * SDK 2.x. e.g. the provision of {@code AWS_REGION}, {@code AWS_ACCESS_KEY_ID} and {@code
+ * AWS_SECRET_ACCESS_KEY} through environment variables etc.
+ */
+@Internal
+class DynamoDbSinkWriter<InputT> extends AsyncSinkWriter<InputT, DynamoDbWriteRequest> {
+    private static final Logger LOG = LoggerFactory.getLogger(DynamoDbSinkWriter.class);
+
+    /* A counter for the total number of records that have encountered an error during put */
+    private final Counter numRecordsOutErrorsCounter;
+
+    /* The sink writer metric group */
+    private final SinkWriterMetricGroup metrics;
+
+    private final DynamoDbTablesConfig tablesConfig;
+    private final DynamoDbAsyncClient client;
+    private final boolean failOnError;
+
+    public DynamoDbSinkWriter(
+            ElementConverter<InputT, DynamoDbWriteRequest> elementConverter,
+            Sink.InitContext context,
+            int maxBatchSize,
+            int maxInFlightRequests,
+            int maxBufferedRequests,
+            long maxBatchSizeInBytes,
+            long maxTimeInBufferMS,
+            long maxRecordSizeInBytes,
+            boolean failOnError,
+            DynamoDbTablesConfig tablesConfig,
+            Properties dynamoDbClientProperties) {
+        super(
+                elementConverter,
+                context,
+                maxBatchSize,
+                maxInFlightRequests,
+                maxBufferedRequests,
+                maxBatchSizeInBytes,
+                maxTimeInBufferMS,
+                maxRecordSizeInBytes);
+        this.failOnError = failOnError;
+        this.tablesConfig = tablesConfig;
+        this.metrics = context.metricGroup();
+        this.numRecordsOutErrorsCounter = metrics.getNumRecordsOutErrorsCounter();
+        this.client = AWSDynamoDbUtil.createClient(dynamoDbClientProperties);
+    }
+
+    @Override
+    protected void submitRequestEntries(
+            List<DynamoDbWriteRequest> requestEntries,
+            Consumer<Collection<DynamoDbWriteRequest>> requestResultConsumer) {
+
+        TableRequestsContainer container = new TableRequestsContainer(tablesConfig);
+        requestEntries.forEach(container::put);
+
+        CompletableFuture<BatchWriteItemResponse> future =
+                client.batchWriteItem(
+                        BatchWriteItemRequest.builder()
+                                .requestItems(container.getRequestItems())
+                                .build());
+
+        future.whenComplete(
+                (response, err) -> {
+                    if (err != null) {
+                        handleFullyFailedRequest(err, requestEntries, requestResultConsumer);
+                    } else if (response.unprocessedItems() != null
+                            && !response.unprocessedItems().isEmpty()) {
+                        handlePartiallyUnprocessedRequest(response, requestResultConsumer);
+                    } else {
+                        requestResultConsumer.accept(Collections.emptyList());
+                    }
+                });
+    }
+
+    private void handlePartiallyUnprocessedRequest(
+            BatchWriteItemResponse response,
+            Consumer<Collection<DynamoDbWriteRequest>> requestResult) {
+        List<DynamoDbWriteRequest> unprocessed = new ArrayList<>();
+
+        for (String tableName : response.unprocessedItems().keySet()) {
+            for (WriteRequest request : response.unprocessedItems().get(tableName)) {
+                unprocessed.add(new DynamoDbWriteRequest(tableName, request));
+            }
+        }
+
+        LOG.warn("DynamoDB Sink failed to persist {} entries", unprocessed.size());

Review comment:
       For KDA/KDF we changed level to `debug` to prevent logs spamming during throttling when destination is under-provisioned. I think we should do the same here  since the metric (`numRecordsOutErrorsCounter`) provides the same info

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbWriteRequest.java
##########
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.PublicEvolving;
+
+import software.amazon.awssdk.services.dynamodb.model.WriteRequest;
+
+import java.io.Serializable;
+import java.util.Objects;
+
+/**
+ * Represents a single DynamoDb {@link WriteRequest}. Contains the name of the DynamoDb table name
+ * to write to as well as the {@link WriteRequest}
+ */
+@PublicEvolving
+public class DynamoDbWriteRequest implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private final String tableName;
+    private final WriteRequest writeRequest;
+
+    public DynamoDbWriteRequest(String tableName, WriteRequest writeRequest) {
+        this.tableName = tableName;
+        this.writeRequest = writeRequest;
+    }
+
+    public String getTableName() {
+        return tableName;
+    }
+
+    public WriteRequest getWriteRequest() {
+        return writeRequest;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        DynamoDbWriteRequest that = (DynamoDbWriteRequest) o;
+        return Objects.equals(tableName, that.tableName)
+                && Objects.equals(writeRequest, that.writeRequest);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(tableName, writeRequest);
+    }
+}

Review comment:
       What is the need for this? Flink coding standard say to only use when actually necessary in src code: https://flink.apache.org/contributing/code-style-and-quality-java.html#equals--hashcode

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbWriterStateSerializer.java
##########
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.core.io.SimpleVersionedSerializer;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.Collection;
+
+/** A serializer used to serialize a collection of {@link DynamoDbWriteRequest}. */
+@Internal
+public class DynamoDbWriterStateSerializer
+        implements SimpleVersionedSerializer<Collection<DynamoDbWriteRequest>> {
+
+    @Override
+    public int getVersion() {
+        return 1;
+    }
+
+    @Override
+    public byte[] serialize(Collection<DynamoDbWriteRequest> obj) throws IOException {
+        try (final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+                final ObjectOutputStream out = new ObjectOutputStream(baos)) {

Review comment:
       The Flink coding guidelines quite strongly suggest to not use Java serialisation: https://flink.apache.org/contributing/code-style-and-quality-java.html#java-serialization
   
   Other sinks have implemented this mechanism manually, can you please follow? https://github.com/apache/flink/blob/master/flink-connectors/flink-connector-aws-kinesis-streams/src/main/java/org/apache/flink/connector/kinesis/sink/KinesisStreamsStateSerializer.java

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/util/AWSDynamoDbUtil.java
##########
@@ -0,0 +1,184 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.util;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.connector.aws.config.AWSConfigConstants;
+import org.apache.flink.connector.aws.util.AWSGeneralUtil;
+import org.apache.flink.runtime.util.EnvironmentInformation;
+import org.apache.flink.streaming.connectors.dynamodb.config.AWSDynamoDbConfigConstants;
+
+import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
+import software.amazon.awssdk.core.client.config.SdkAdvancedClientOption;
+import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
+import software.amazon.awssdk.core.client.config.SdkClientOption;
+import software.amazon.awssdk.core.retry.RetryPolicy;
+import software.amazon.awssdk.core.retry.backoff.BackoffStrategy;
+import software.amazon.awssdk.core.retry.backoff.EqualJitterBackoffStrategy;
+import software.amazon.awssdk.core.retry.backoff.FixedDelayBackoffStrategy;
+import software.amazon.awssdk.core.retry.backoff.FullJitterBackoffStrategy;
+import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient;
+import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClientBuilder;
+
+import java.net.URI;
+import java.time.Duration;
+import java.util.Optional;
+import java.util.Properties;
+
+/** Some utilities specific to Amazon Web Service. */

Review comment:
       I think you meant DynamoDB utils? 

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/util/DynamoDbExceptionUtils.java
##########
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.util;
+
+import org.apache.flink.annotation.Internal;
+
+import software.amazon.awssdk.awscore.exception.AwsServiceException;
+import software.amazon.awssdk.core.exception.ApiCallAttemptTimeoutException;
+import software.amazon.awssdk.core.exception.SdkClientException;
+import software.amazon.awssdk.services.dynamodb.model.ConditionalCheckFailedException;
+import software.amazon.awssdk.services.dynamodb.model.DynamoDbException;
+import software.amazon.awssdk.services.dynamodb.model.ResourceNotFoundException;
+
+/** A collection of utility functions to simplify work with DynamoDB service exceptions. */
+@Internal
+public class DynamoDbExceptionUtils {

Review comment:
       As discussed previously, we have implemented some error handling classes in AsyncSink to help with the common things, for example https://github.com/apache/flink/blob/master/flink-connectors/flink-connector-aws-base/src/main/java/org/apache/flink/connector/aws/util/AWSCredentialFatalExceptionClassifiers.java

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/TableRequestsContainer.java
##########
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+import org.apache.flink.streaming.connectors.dynamodb.sink.key.PrimaryKey;
+
+import org.apache.flink.shaded.guava30.com.google.common.collect.ImmutableList;
+
+import software.amazon.awssdk.services.dynamodb.model.WriteRequest;
+
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Container to accumulate requests in batches per table. De-duplicates batch request entities as
+ * per PrimaryKey definition. DynamoDB Batch API rejects the whole batch request if the request
+ * contains at least two items with identical hash and range keys (which essentially is two put
+ * operations).
+ */
+class TableRequestsContainer {
+
+    private final DynamoDbTablesConfig tablesConfig;
+    private final LinkedHashMap<String, Map<PrimaryKey, WriteRequest>> container;

Review comment:
       Does not look fixed in this PR

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSink.java
##########
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.api.connector.sink.SinkWriter;
+import org.apache.flink.connector.base.sink.AsyncSinkBase;
+import org.apache.flink.connector.base.sink.writer.ElementConverter;
+import org.apache.flink.core.io.SimpleVersionedSerializer;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Optional;
+import java.util.Properties;
+
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
+/**
+ * A DynamoDB Sink that performs async requests against a destination stream using the buffering
+ * protocol specified in {@link AsyncSinkBase}.
+ *
+ * <p>The sink internally uses a {@link
+ * software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient} to communicate with the AWS
+ * endpoint.
+ *
+ * <p>The behaviour of the buffering may be specified by providing configuration during the sink
+ * build time.
+ *
+ * <ul>
+ *   <li>{@code maxBatchSize}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb.
+ *   <li>{@code maxInFlightRequests}: the maximum number of in flight requests that may exist, if
+ *       any more in flight requests need to be initiated once the maximum has been reached, then it
+ *       will be blocked until some have completed
+ *   <li>{@code maxBufferedRequests}: the maximum number of elements held in the buffer, requests to
+ *       add elements will be blocked while the number of elements in the buffer is at the maximum
+ *   <li>{@code maxBatchSizeInBytes}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb measured in bytes
+ *   <li>{@code maxTimeInBufferMS}: the maximum amount of time an entry is allowed to live in the
+ *       buffer, if any element reaches this age, the entire buffer will be flushed immediately
+ *   <li>{@code maxRecordSizeInBytes}: the maximum size of a record the sink will accept into the
+ *       buffer, a record of size larger than this will be rejected when passed to the sink
+ *   <li>{@code failOnError}: when an exception is encountered while persisting to DynamoDb, the job
+ *       will fail immediately if failOnError is set
+ *   <li>{@code dynamoDbTablesConfig}: if provided for the table, the DynamoDb sink will attempt to
+ *       deduplicate records with the same primary and/or secondary keys in the same batch request.
+ *       Only the latest record with the same combination of key attributes is preserved in the
+ *       request.
+ * </ul>
+ *
+ * <p>Please see the writer implementation in {@link DynamoDbSinkWriter}
+ *
+ * @param <InputT> Type of the elements handled by this sink
+ */
+@PublicEvolving
+public class DynamoDbSink<InputT> extends AsyncSinkBase<InputT, DynamoDbWriteRequest> {

Review comment:
       Let's keep it as `DynamoDbSink` for consistency with the code base. I do not think the underlying implementation of sync vs async is necessarily a concern to the user and therefore adding it to the class name does not add much value.

##########
File path: flink-connectors/flink-connector-dynamodb/pom.xml
##########
@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<parent>
+		<groupId>org.apache.flink</groupId>
+		<artifactId>flink-connectors</artifactId>
+		<version>1.15-SNAPSHOT</version>
+		<relativePath>..</relativePath>
+	</parent>
+
+	<modelVersion>4.0.0</modelVersion>
+
+	<artifactId>flink-connector-dynamodb</artifactId>
+	<name>Flink : Connectors : DynamoDB</name>
+	<properties>
+		<aws.sdk.version>2.17.116</aws.sdk.version>
+		<commons-lang3.version>3.11</commons-lang3.version>
+		<testcontainers.version>1.16.2</testcontainers.version>

Review comment:
       Can you use the managed version from parent instead?
   https://github.com/apache/flink/blob/master/pom.xml#L139

##########
File path: flink-connectors/flink-connector-dynamodb/pom.xml
##########
@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<parent>
+		<groupId>org.apache.flink</groupId>
+		<artifactId>flink-connectors</artifactId>
+		<version>1.15-SNAPSHOT</version>
+		<relativePath>..</relativePath>
+	</parent>
+
+	<modelVersion>4.0.0</modelVersion>
+
+	<artifactId>flink-connector-dynamodb</artifactId>
+	<name>Flink : Connectors : DynamoDB</name>
+	<properties>
+		<aws.sdk.version>2.17.116</aws.sdk.version>
+		<commons-lang3.version>3.11</commons-lang3.version>
+		<testcontainers.version>1.16.2</testcontainers.version>
+	</properties>
+
+	<packaging>jar</packaging>
+
+	<dependencies>
+		<!-- Connectors -->
+
+		<dependency>
+			<groupId>org.apache.flink</groupId>
+			<artifactId>flink-connector-base</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.flink</groupId>
+			<artifactId>flink-connector-aws-base</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+
+		<!-- Amazon AWS SDK v2.x dependencies -->
+		<dependency>
+			<groupId>software.amazon.awssdk</groupId>
+			<artifactId>aws-core</artifactId>
+			<version>${aws.sdk.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>software.amazon.awssdk</groupId>
+			<artifactId>dynamodb</artifactId>
+			<version>${aws.sdk.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>software.amazon.awssdk</groupId>
+			<artifactId>profiles</artifactId>
+			<version>${aws.sdk.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>software.amazon.awssdk</groupId>
+			<artifactId>sdk-core</artifactId>
+			<version>${aws.sdk.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>software.amazon.awssdk</groupId>
+			<artifactId>auth</artifactId>
+			<version>${aws.sdk.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>software.amazon.awssdk</groupId>
+			<artifactId>regions</artifactId>
+			<version>${aws.sdk.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>software.amazon.awssdk</groupId>
+			<artifactId>sts</artifactId>
+			<version>${aws.sdk.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>software.amazon.awssdk</groupId>
+			<artifactId>http-client-spi</artifactId>
+			<version>${aws.sdk.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>software.amazon.awssdk</groupId>
+			<artifactId>netty-nio-client</artifactId>
+			<version>${aws.sdk.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>commons-lang3</artifactId>
+			<version>${commons-lang3.version}</version>
+			<scope>provided</scope>
+		</dependency>
+
+		<!-- Flink ecosystem -->
+		<dependency>
+			<groupId>org.apache.flink</groupId>
+			<artifactId>flink-streaming-java</artifactId>
+			<version>${project.version}</version>
+			<scope>provided</scope>
+		</dependency>
+
+		<!-- Test dependencies -->
+		<dependency>
+			<groupId>org.apache.flink</groupId>
+			<artifactId>flink-connector-aws-base</artifactId>
+			<version>${project.version}</version>
+			<type>test-jar</type>
+			<scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.flink</groupId>
+			<artifactId>flink-core</artifactId>
+			<version>${project.version}</version>
+			<scope>test</scope>
+			<type>test-jar</type>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.flink</groupId>
+			<artifactId>flink-streaming-java</artifactId>
+			<version>${project.version}</version>
+			<scope>test</scope>
+			<type>test-jar</type>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.flink</groupId>
+			<artifactId>flink-test-utils</artifactId>
+			<version>${project.version}</version>
+			<scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.flink</groupId>
+			<artifactId>flink-runtime</artifactId>
+			<version>${project.version}</version>
+			<type>test-jar</type>
+			<scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.testcontainers</groupId>
+			<artifactId>testcontainers</artifactId>
+			<version>${testcontainers.version}</version>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-dependency-plugin</artifactId>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-jar-plugin</artifactId>
+				<executions>
+					<execution>
+						<goals>
+							<goal>test-jar</goal>

Review comment:
       Why are we building a test jar? I cannot see any consumers of this

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/config/AWSDynamoDbConfigConstants.java
##########
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.config;
+
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.streaming.connectors.dynamodb.util.AWSDynamoDbUtil;
+
+import software.amazon.awssdk.core.retry.backoff.EqualJitterBackoffStrategy;
+import software.amazon.awssdk.core.retry.backoff.FixedDelayBackoffStrategy;
+import software.amazon.awssdk.core.retry.backoff.FullJitterBackoffStrategy;
+
+/** Defaults for {@link AWSDynamoDbUtil}. */
+@PublicEvolving
+public class AWSDynamoDbConfigConstants {
+
+    public static final String BASE_DYNAMODB_USER_AGENT_PREFIX_FORMAT =
+            "Apache Flink %s (%s) DynamoDB Connector";
+
+    /** Identifier for user agent prefix. */
+    public static final String DYNAMODB_CLIENT_USER_AGENT_PREFIX =
+            "aws.dynamodb.client.user-agent-prefix";
+
+    public static final String AWS_DYNAMODB_CLIENT_RETRY_PREFIX = "aws.dynamodb.client.retry";
+
+    /**
+     * Possible configuration values for backoff strategy on retry when writing to DynamoDB.
+     * Internally, a corresponding implementation of {@link
+     * software.amazon.awssdk.core.retry.backoff.BackoffStrategy} will be used.
+     */
+    @PublicEvolving
+    public enum BackoffStrategy {
+
+        /**
+         * Backoff strategy that uses a full jitter strategy for computing the next backoff delay. A
+         * full jitter strategy will always compute a new random delay between and the computed
+         * exponential backoff for each subsequent request. See example: {@link
+         * FullJitterBackoffStrategy}
+         */
+        FULL_JITTER,
+
+        /**
+         * Backoff strategy that uses equal jitter for computing the delay before the next retry. An
+         * equal jitter backoff strategy will first compute an exponential delay based on the
+         * current number of retries, base delay and max delay. The final computed delay before the
+         * next retry will keep half of this computed delay plus a random delay computed as a random
+         * number between 0 and half of the exponential delay plus one. See example: {@link
+         * EqualJitterBackoffStrategy}
+         */
+        EQUAL_JITTER,
+
+        /**
+         * Simple backoff strategy that always uses a fixed delay for the delay * before the next
+         * retry attempt. See example: {@link FixedDelayBackoffStrategy}
+         */
+        FIXED_DELAY
+    }
+
+    /**
+     * The maximum number of times that a single request should be retried by the DynamoDB client,
+     * assuming it fails for a retryable error.
+     */
+    public static final String NUMBER_RETRIES =
+            AWS_DYNAMODB_CLIENT_RETRY_PREFIX + ".number-retries";
+
+    /**
+     * Backoff strategy when writing to DynamoDb on retries. Supported values: {@link
+     * BackoffStrategy}.
+     */
+    public static final String BACKOFF_STRATEGY =
+            AWS_DYNAMODB_CLIENT_RETRY_PREFIX + ".backoff-strategy";
+
+    /**
+     * Configure the backoff strategy that should be used for waiting in between retry attempts
+     * after a throttling error is encountered. If the retry is not because of throttling reasons,
+     * BACKOFF_STRATEGY is used. Supported values: {@link BackoffStrategy}.
+     */
+    public static final String THROTTLING_BACKOFF_STRATEGY =
+            AWS_DYNAMODB_CLIENT_RETRY_PREFIX + ".throttling-backoff-strategy";
+
+    public static final String FULL_JITTER_BASE_DELAY_MS =
+            AWS_DYNAMODB_CLIENT_RETRY_PREFIX + ".full-jitter.base-delay-ms";
+    public static final String FULL_JITTER_MAX_BACKOFF_TIME_MS =
+            AWS_DYNAMODB_CLIENT_RETRY_PREFIX + ".full-jitter.max-backoff-time-ms";
+
+    public static final String EQUAL_JITTER_BASE_DELAY_MS =
+            AWS_DYNAMODB_CLIENT_RETRY_PREFIX + ".equal-jitter.base-delay-ms";
+    public static final String EQUAL_JITTER_MAX_BACKOFF_TIME_MS =
+            AWS_DYNAMODB_CLIENT_RETRY_PREFIX + ".equal-jitter.max-backoff-time-ms";
+
+    public static final String FIXED_DELAY_BACKOFF_MS =
+            AWS_DYNAMODB_CLIENT_RETRY_PREFIX + ".fixed-delay.fixed-backoff-time-ms";

Review comment:
       This all looks pretty standard. Can we pull up into for reuse across other implementations? 

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/config/AWSDynamoDbConfigConstants.java
##########
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.config;

Review comment:
       Please root all your classes in a package consistent with the new KDS/KDF connector:
   - `org.apache.flink.connector.dynamodb.sink`

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSinkWriter.java
##########
@@ -0,0 +1,168 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.api.connector.sink.Sink;
+import org.apache.flink.connector.base.sink.writer.AsyncSinkWriter;
+import org.apache.flink.connector.base.sink.writer.ElementConverter;
+import org.apache.flink.metrics.Counter;
+import org.apache.flink.metrics.groups.SinkWriterMetricGroup;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+import org.apache.flink.streaming.connectors.dynamodb.util.AWSDynamoDbUtil;
+import org.apache.flink.streaming.connectors.dynamodb.util.DynamoDbExceptionUtils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient;
+import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemRequest;
+import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemResponse;
+import software.amazon.awssdk.services.dynamodb.model.WriteRequest;
+
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.CompletableFuture;
+import java.util.function.Consumer;
+
+/**
+ * Sink writer created by {@link DynamoDbSink} to write to DynamoDB. More details on the operation
+ * of this sink writer may be found in the doc for {@link DynamoDbSink}. More details on the
+ * internals of this sink writer may be found in {@link AsyncSinkWriter}.
+ *
+ * <p>The {@link DynamoDbAsyncClient} used here may be configured in the standard way for the AWS
+ * SDK 2.x. e.g. the provision of {@code AWS_REGION}, {@code AWS_ACCESS_KEY_ID} and {@code
+ * AWS_SECRET_ACCESS_KEY} through environment variables etc.
+ */
+@Internal
+class DynamoDbSinkWriter<InputT> extends AsyncSinkWriter<InputT, DynamoDbWriteRequest> {

Review comment:
       Please see https://github.com/apache/flink/blob/master/flink-connectors/flink-connector-aws-kinesis-streams/src/main/java/org/apache/flink/connector/kinesis/sink/KinesisStreamsSinkWriter.java, you are missing `close()` to cleanup client and HTTP client

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSinkException.java
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+/** Exception is thrown when DynamoDb sink failed to write data. */
+public class DynamoDbSinkException extends RuntimeException {

Review comment:
       This might need to be `@PublicEvolving` , at least it is here https://github.com/apache/flink/blob/master/flink-connectors/flink-connector-aws-kinesis-firehose/src/main/java/org/apache/flink/connector/firehose/sink/KinesisFirehoseException.java#L26

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSinkWriter.java
##########
@@ -0,0 +1,168 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.api.connector.sink.Sink;
+import org.apache.flink.connector.base.sink.writer.AsyncSinkWriter;
+import org.apache.flink.connector.base.sink.writer.ElementConverter;
+import org.apache.flink.metrics.Counter;
+import org.apache.flink.metrics.groups.SinkWriterMetricGroup;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+import org.apache.flink.streaming.connectors.dynamodb.util.AWSDynamoDbUtil;
+import org.apache.flink.streaming.connectors.dynamodb.util.DynamoDbExceptionUtils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient;
+import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemRequest;
+import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemResponse;
+import software.amazon.awssdk.services.dynamodb.model.WriteRequest;
+
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.CompletableFuture;
+import java.util.function.Consumer;
+
+/**
+ * Sink writer created by {@link DynamoDbSink} to write to DynamoDB. More details on the operation
+ * of this sink writer may be found in the doc for {@link DynamoDbSink}. More details on the
+ * internals of this sink writer may be found in {@link AsyncSinkWriter}.
+ *
+ * <p>The {@link DynamoDbAsyncClient} used here may be configured in the standard way for the AWS
+ * SDK 2.x. e.g. the provision of {@code AWS_REGION}, {@code AWS_ACCESS_KEY_ID} and {@code
+ * AWS_SECRET_ACCESS_KEY} through environment variables etc.
+ */
+@Internal
+class DynamoDbSinkWriter<InputT> extends AsyncSinkWriter<InputT, DynamoDbWriteRequest> {
+    private static final Logger LOG = LoggerFactory.getLogger(DynamoDbSinkWriter.class);
+
+    /* A counter for the total number of records that have encountered an error during put */
+    private final Counter numRecordsOutErrorsCounter;
+
+    /* The sink writer metric group */
+    private final SinkWriterMetricGroup metrics;
+
+    private final DynamoDbTablesConfig tablesConfig;
+    private final DynamoDbAsyncClient client;
+    private final boolean failOnError;
+
+    public DynamoDbSinkWriter(
+            ElementConverter<InputT, DynamoDbWriteRequest> elementConverter,
+            Sink.InitContext context,
+            int maxBatchSize,
+            int maxInFlightRequests,
+            int maxBufferedRequests,
+            long maxBatchSizeInBytes,
+            long maxTimeInBufferMS,
+            long maxRecordSizeInBytes,
+            boolean failOnError,
+            DynamoDbTablesConfig tablesConfig,
+            Properties dynamoDbClientProperties) {
+        super(
+                elementConverter,
+                context,
+                maxBatchSize,
+                maxInFlightRequests,
+                maxBufferedRequests,
+                maxBatchSizeInBytes,
+                maxTimeInBufferMS,
+                maxRecordSizeInBytes);
+        this.failOnError = failOnError;
+        this.tablesConfig = tablesConfig;
+        this.metrics = context.metricGroup();
+        this.numRecordsOutErrorsCounter = metrics.getNumRecordsOutErrorsCounter();
+        this.client = AWSDynamoDbUtil.createClient(dynamoDbClientProperties);

Review comment:
       You will also need a reference to the HTTP client in order to invoke `close()`

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSinkBuilder.java
##########
@@ -0,0 +1,123 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.connector.base.sink.AsyncSinkBaseBuilder;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+
+import java.util.Optional;
+import java.util.Properties;
+
+/**
+ * Builder to construct {@link DynamoDbSink}.
+ *
+ * <p>The following example shows the minimum setup to create a {@link DynamoDbSink} that writes
+ * records into DynamoDb
+ *
+ * <pre>{@code
+ * private static class DummyElementConverter
+ *         implements ElementConverter<String, DynamoDbWriteRequest> {
+ *
+ *     @Override
+ *     public DynamoDbWriteRequest apply(String element, SinkWriter.Context context) {
+ *         final Map<String, AttributeValue> map = new HashMap<>();
+ *         map.put("your-key", AttributeValue.builder().s(element).build());
+ *         return new DynamoDbWriteRequest(
+ *                 "your-table-name",
+ *                 WriteRequest.builder()
+ *                         .putRequest(PutRequest.builder().item(map).build())
+ *                         .build());
+ *      }
+ * }
+ * DynamoDbSink<String> dynamoDbSink = DynamoDbSink.<String>builder()
+ *                                          .setElementConverter(new DummyElementConverter())
+ *                                       .build();
+ * }</pre>
+ *
+ * <p>If the following parameters are not set in this builder, the following defaults will be used:
+ *
+ * <ul>
+ *   <li>{@code maxBatchSize} will be 25
+ *   <li>{@code maxInFlightRequests} will be 50
+ *   <li>{@code maxBufferedRequests} will be 10000
+ *   <li>{@code maxBatchSizeInBytes} will be 16 MB i.e. {@code 16 * 1000 * 1000}
+ *   <li>{@code maxTimeInBufferMS} will be 5000ms
+ *   <li>{@code maxRecordSizeInBytes} will be 400 KB i.e. {@code 400 * 1000 * 1000}
+ *   <li>{@code failOnError} will be false
+ *   <li>{@code dynamoDbTablesConfig} will be empty meaning no records deduplication will be
+ *       performed by the sink
+ * </ul>
+ *
+ * @param <InputT> type of elements that should be persisted in the destination
+ */
+@PublicEvolving
+public class DynamoDbSinkBuilder<InputT>
+        extends AsyncSinkBaseBuilder<InputT, DynamoDbWriteRequest, DynamoDbSinkBuilder<InputT>> {
+
+    private static final int DEFAULT_MAX_BATCH_SIZE = 25;
+    private static final int DEFAULT_MAX_IN_FLIGHT_REQUESTS = 50;
+    private static final int DEFAULT_MAX_BUFFERED_REQUESTS = 10000;
+    private static final long DEFAULT_MAX_BATCH_SIZE_IN_B = 16 * 1000 * 1000;
+    private static final long DEFAULT_MAX_TIME_IN_BUFFER_MS = 5000;
+    private static final long DEFAULT_MAX_RECORD_SIZE_IN_B = 400 * 1000;
+    private static final boolean DEFAULT_FAIL_ON_ERROR = false;
+
+    private boolean failOnError;
+    private DynamoDbTablesConfig dynamoDbTablesConfig;
+    private Properties dynamodbClientProperties;
+
+    public DynamoDbSinkBuilder<InputT> setDynamoDbProperties(Properties properties) {
+        this.dynamodbClientProperties = properties;
+        return this;
+    }
+
+    /**
+     * @param dynamoDbTablesConfig the {@link DynamoDbTablesConfig} if provided for the table, the
+     *     DynamoDb sink will attempt to deduplicate records with the same primary and/or secondary
+     *     keys in the same batch request. Only the latest record with the same combination of key
+     *     attributes is preserved in the request.
+     */

Review comment:
       > the DynamoDb sink will attempt to deduplicate records with the same primary and/or secondary keys in the same batch request. Only the latest record with the same combination of key attributes is preserved in the request.
   
   This comment feels out of place, how is it related to `setDynamoDbTablesConfig`? Is there a config within `setDynamoDbTablesConfig` to control this behaviour? 

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSinkWriter.java
##########
@@ -0,0 +1,168 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.api.connector.sink.Sink;
+import org.apache.flink.connector.base.sink.writer.AsyncSinkWriter;
+import org.apache.flink.connector.base.sink.writer.ElementConverter;
+import org.apache.flink.metrics.Counter;
+import org.apache.flink.metrics.groups.SinkWriterMetricGroup;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+import org.apache.flink.streaming.connectors.dynamodb.util.AWSDynamoDbUtil;
+import org.apache.flink.streaming.connectors.dynamodb.util.DynamoDbExceptionUtils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient;
+import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemRequest;
+import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemResponse;
+import software.amazon.awssdk.services.dynamodb.model.WriteRequest;
+
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.CompletableFuture;
+import java.util.function.Consumer;
+
+/**
+ * Sink writer created by {@link DynamoDbSink} to write to DynamoDB. More details on the operation
+ * of this sink writer may be found in the doc for {@link DynamoDbSink}. More details on the
+ * internals of this sink writer may be found in {@link AsyncSinkWriter}.
+ *
+ * <p>The {@link DynamoDbAsyncClient} used here may be configured in the standard way for the AWS
+ * SDK 2.x. e.g. the provision of {@code AWS_REGION}, {@code AWS_ACCESS_KEY_ID} and {@code
+ * AWS_SECRET_ACCESS_KEY} through environment variables etc.
+ */
+@Internal
+class DynamoDbSinkWriter<InputT> extends AsyncSinkWriter<InputT, DynamoDbWriteRequest> {
+    private static final Logger LOG = LoggerFactory.getLogger(DynamoDbSinkWriter.class);
+
+    /* A counter for the total number of records that have encountered an error during put */
+    private final Counter numRecordsOutErrorsCounter;
+
+    /* The sink writer metric group */
+    private final SinkWriterMetricGroup metrics;
+
+    private final DynamoDbTablesConfig tablesConfig;
+    private final DynamoDbAsyncClient client;
+    private final boolean failOnError;
+
+    public DynamoDbSinkWriter(
+            ElementConverter<InputT, DynamoDbWriteRequest> elementConverter,
+            Sink.InitContext context,
+            int maxBatchSize,
+            int maxInFlightRequests,
+            int maxBufferedRequests,
+            long maxBatchSizeInBytes,
+            long maxTimeInBufferMS,
+            long maxRecordSizeInBytes,
+            boolean failOnError,
+            DynamoDbTablesConfig tablesConfig,
+            Properties dynamoDbClientProperties) {
+        super(
+                elementConverter,
+                context,
+                maxBatchSize,
+                maxInFlightRequests,
+                maxBufferedRequests,
+                maxBatchSizeInBytes,
+                maxTimeInBufferMS,
+                maxRecordSizeInBytes);
+        this.failOnError = failOnError;
+        this.tablesConfig = tablesConfig;
+        this.metrics = context.metricGroup();
+        this.numRecordsOutErrorsCounter = metrics.getNumRecordsOutErrorsCounter();
+        this.client = AWSDynamoDbUtil.createClient(dynamoDbClientProperties);
+    }
+
+    @Override
+    protected void submitRequestEntries(
+            List<DynamoDbWriteRequest> requestEntries,
+            Consumer<Collection<DynamoDbWriteRequest>> requestResultConsumer) {
+
+        TableRequestsContainer container = new TableRequestsContainer(tablesConfig);
+        requestEntries.forEach(container::put);
+
+        CompletableFuture<BatchWriteItemResponse> future =
+                client.batchWriteItem(
+                        BatchWriteItemRequest.builder()
+                                .requestItems(container.getRequestItems())
+                                .build());
+
+        future.whenComplete(
+                (response, err) -> {
+                    if (err != null) {
+                        handleFullyFailedRequest(err, requestEntries, requestResultConsumer);
+                    } else if (response.unprocessedItems() != null
+                            && !response.unprocessedItems().isEmpty()) {
+                        handlePartiallyUnprocessedRequest(response, requestResultConsumer);
+                    } else {
+                        requestResultConsumer.accept(Collections.emptyList());
+                    }
+                });
+    }
+
+    private void handlePartiallyUnprocessedRequest(
+            BatchWriteItemResponse response,
+            Consumer<Collection<DynamoDbWriteRequest>> requestResult) {
+        List<DynamoDbWriteRequest> unprocessed = new ArrayList<>();
+
+        for (String tableName : response.unprocessedItems().keySet()) {
+            for (WriteRequest request : response.unprocessedItems().get(tableName)) {
+                unprocessed.add(new DynamoDbWriteRequest(tableName, request));
+            }
+        }
+
+        LOG.warn("DynamoDB Sink failed to persist {} entries", unprocessed.size());
+        numRecordsOutErrorsCounter.inc(unprocessed.size());
+
+        requestResult.accept(unprocessed);
+    }
+
+    private void handleFullyFailedRequest(
+            Throwable err,
+            List<DynamoDbWriteRequest> requestEntries,
+            Consumer<Collection<DynamoDbWriteRequest>> requestResult) {
+        LOG.warn("DynamoDB Sink failed to persist {} entries", requestEntries.size(), err);
+        numRecordsOutErrorsCounter.inc(requestEntries.size());
+
+        if (DynamoDbExceptionUtils.isNotRetryableException(err.getCause())) {

Review comment:
       We added an exception classifier chaining mechanism for KDS/KDF that you can reuse here to appropriately handle things like `InterruptedException` etc: https://github.com/apache/flink/blob/master/flink-connectors/flink-connector-aws-kinesis-streams/src/main/java/org/apache/flink/connector/kinesis/sink/KinesisStreamsSinkWriter.java#L246

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSinkWriter.java
##########
@@ -0,0 +1,168 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.api.connector.sink.Sink;

Review comment:
       This needs to be migrated to sinkV2 `org.apache.flink.api.connector.sink2.Sink`

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSinkWriter.java
##########
@@ -0,0 +1,168 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.api.connector.sink.Sink;
+import org.apache.flink.connector.base.sink.writer.AsyncSinkWriter;
+import org.apache.flink.connector.base.sink.writer.ElementConverter;
+import org.apache.flink.metrics.Counter;
+import org.apache.flink.metrics.groups.SinkWriterMetricGroup;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+import org.apache.flink.streaming.connectors.dynamodb.util.AWSDynamoDbUtil;
+import org.apache.flink.streaming.connectors.dynamodb.util.DynamoDbExceptionUtils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient;
+import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemRequest;
+import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemResponse;
+import software.amazon.awssdk.services.dynamodb.model.WriteRequest;
+
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.CompletableFuture;
+import java.util.function.Consumer;
+
+/**
+ * Sink writer created by {@link DynamoDbSink} to write to DynamoDB. More details on the operation
+ * of this sink writer may be found in the doc for {@link DynamoDbSink}. More details on the
+ * internals of this sink writer may be found in {@link AsyncSinkWriter}.
+ *
+ * <p>The {@link DynamoDbAsyncClient} used here may be configured in the standard way for the AWS
+ * SDK 2.x. e.g. the provision of {@code AWS_REGION}, {@code AWS_ACCESS_KEY_ID} and {@code
+ * AWS_SECRET_ACCESS_KEY} through environment variables etc.
+ */
+@Internal
+class DynamoDbSinkWriter<InputT> extends AsyncSinkWriter<InputT, DynamoDbWriteRequest> {
+    private static final Logger LOG = LoggerFactory.getLogger(DynamoDbSinkWriter.class);
+
+    /* A counter for the total number of records that have encountered an error during put */
+    private final Counter numRecordsOutErrorsCounter;
+
+    /* The sink writer metric group */
+    private final SinkWriterMetricGroup metrics;
+
+    private final DynamoDbTablesConfig tablesConfig;
+    private final DynamoDbAsyncClient client;
+    private final boolean failOnError;
+
+    public DynamoDbSinkWriter(
+            ElementConverter<InputT, DynamoDbWriteRequest> elementConverter,
+            Sink.InitContext context,
+            int maxBatchSize,
+            int maxInFlightRequests,
+            int maxBufferedRequests,
+            long maxBatchSizeInBytes,
+            long maxTimeInBufferMS,
+            long maxRecordSizeInBytes,
+            boolean failOnError,
+            DynamoDbTablesConfig tablesConfig,
+            Properties dynamoDbClientProperties) {
+        super(
+                elementConverter,
+                context,
+                maxBatchSize,
+                maxInFlightRequests,
+                maxBufferedRequests,
+                maxBatchSizeInBytes,
+                maxTimeInBufferMS,
+                maxRecordSizeInBytes);
+        this.failOnError = failOnError;
+        this.tablesConfig = tablesConfig;
+        this.metrics = context.metricGroup();
+        this.numRecordsOutErrorsCounter = metrics.getNumRecordsOutErrorsCounter();
+        this.client = AWSDynamoDbUtil.createClient(dynamoDbClientProperties);
+    }
+
+    @Override
+    protected void submitRequestEntries(
+            List<DynamoDbWriteRequest> requestEntries,
+            Consumer<Collection<DynamoDbWriteRequest>> requestResultConsumer) {
+
+        TableRequestsContainer container = new TableRequestsContainer(tablesConfig);
+        requestEntries.forEach(container::put);
+
+        CompletableFuture<BatchWriteItemResponse> future =
+                client.batchWriteItem(
+                        BatchWriteItemRequest.builder()
+                                .requestItems(container.getRequestItems())
+                                .build());
+
+        future.whenComplete(
+                (response, err) -> {
+                    if (err != null) {
+                        handleFullyFailedRequest(err, requestEntries, requestResultConsumer);
+                    } else if (response.unprocessedItems() != null
+                            && !response.unprocessedItems().isEmpty()) {
+                        handlePartiallyUnprocessedRequest(response, requestResultConsumer);
+                    } else {
+                        requestResultConsumer.accept(Collections.emptyList());
+                    }
+                });
+    }
+
+    private void handlePartiallyUnprocessedRequest(
+            BatchWriteItemResponse response,
+            Consumer<Collection<DynamoDbWriteRequest>> requestResult) {
+        List<DynamoDbWriteRequest> unprocessed = new ArrayList<>();
+
+        for (String tableName : response.unprocessedItems().keySet()) {
+            for (WriteRequest request : response.unprocessedItems().get(tableName)) {
+                unprocessed.add(new DynamoDbWriteRequest(tableName, request));
+            }
+        }
+
+        LOG.warn("DynamoDB Sink failed to persist {} entries", unprocessed.size());
+        numRecordsOutErrorsCounter.inc(unprocessed.size());
+
+        requestResult.accept(unprocessed);
+    }
+
+    private void handleFullyFailedRequest(
+            Throwable err,
+            List<DynamoDbWriteRequest> requestEntries,
+            Consumer<Collection<DynamoDbWriteRequest>> requestResult) {
+        LOG.warn("DynamoDB Sink failed to persist {} entries", requestEntries.size(), err);

Review comment:
       Same as above

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSinkException.java
##########
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Internal;
+
+/** Exception is thrown when DynamoDb sink failed to write data. */
+@Internal
+public class DynamoDbSinkException extends RuntimeException {
+    public DynamoDbSinkException(String message) {
+        super(message);
+    }
+
+    public DynamoDbSinkException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    /**
+     * When the flag {@code failOnError} is set in {@link DynamoDbSinkWriter}, this exception is
+     * raised as soon as any exception occurs or sink returns unprocessed items.
+     */
+    @Internal
+    static class DynamoDbSinkFailFastException extends DynamoDbSinkException {
+
+        public DynamoDbSinkFailFastException() {
+            super(
+                    "Encountered an exception while persisting records, not retrying due to {failOnError} being set.");

Review comment:
       nit: "Encountered an exception while persisting records, not retrying due to {failOnError} being set." is duplicated, can you dedupe

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/InvalidRequestException.java
##########
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Internal;
+
+/** Exception is thrown if a DynamoDB request was invalid. */
+@Internal
+public class InvalidRequestException extends RuntimeException {

Review comment:
       Why is this not a subclass of `DynamoDbSinkException`?

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/TableRequestsContainer.java
##########
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+import org.apache.flink.streaming.connectors.dynamodb.sink.key.PrimaryKey;
+
+import org.apache.flink.shaded.guava30.com.google.common.collect.ImmutableList;
+
+import software.amazon.awssdk.services.dynamodb.model.WriteRequest;
+
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Container to accumulate requests in batches per table. De-duplicates batch request entities as
+ * per PrimaryKey definition. DynamoDB Batch API rejects the whole batch request if the request
+ * contains at least two items with identical hash and range keys (which essentially is two put
+ * operations).
+ */
+@Internal
+class TableRequestsContainer {

Review comment:
       nit: This is really a dedupe class right? The name of this confused me until I looked up how it is used

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbWriterStateSerializer.java
##########
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.core.io.SimpleVersionedSerializer;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.Collection;
+
+/** A serializer used to serialize a collection of {@link DynamoDbWriteRequest}. */
+@Internal
+public class DynamoDbWriterStateSerializer

Review comment:
       There is an `AsyncSink` base that can help here: `AsyncSinkWriterStateSerializer`

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSinkWriter.java
##########
@@ -0,0 +1,168 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.api.connector.sink.Sink;
+import org.apache.flink.connector.base.sink.writer.AsyncSinkWriter;
+import org.apache.flink.connector.base.sink.writer.ElementConverter;
+import org.apache.flink.metrics.Counter;
+import org.apache.flink.metrics.groups.SinkWriterMetricGroup;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+import org.apache.flink.streaming.connectors.dynamodb.util.AWSDynamoDbUtil;
+import org.apache.flink.streaming.connectors.dynamodb.util.DynamoDbExceptionUtils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient;
+import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemRequest;
+import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemResponse;
+import software.amazon.awssdk.services.dynamodb.model.WriteRequest;
+
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.CompletableFuture;
+import java.util.function.Consumer;
+
+/**
+ * Sink writer created by {@link DynamoDbSink} to write to DynamoDB. More details on the operation
+ * of this sink writer may be found in the doc for {@link DynamoDbSink}. More details on the
+ * internals of this sink writer may be found in {@link AsyncSinkWriter}.
+ *
+ * <p>The {@link DynamoDbAsyncClient} used here may be configured in the standard way for the AWS
+ * SDK 2.x. e.g. the provision of {@code AWS_REGION}, {@code AWS_ACCESS_KEY_ID} and {@code
+ * AWS_SECRET_ACCESS_KEY} through environment variables etc.
+ */
+@Internal
+class DynamoDbSinkWriter<InputT> extends AsyncSinkWriter<InputT, DynamoDbWriteRequest> {
+    private static final Logger LOG = LoggerFactory.getLogger(DynamoDbSinkWriter.class);
+
+    /* A counter for the total number of records that have encountered an error during put */
+    private final Counter numRecordsOutErrorsCounter;
+
+    /* The sink writer metric group */
+    private final SinkWriterMetricGroup metrics;
+
+    private final DynamoDbTablesConfig tablesConfig;
+    private final DynamoDbAsyncClient client;
+    private final boolean failOnError;
+
+    public DynamoDbSinkWriter(
+            ElementConverter<InputT, DynamoDbWriteRequest> elementConverter,
+            Sink.InitContext context,
+            int maxBatchSize,
+            int maxInFlightRequests,
+            int maxBufferedRequests,
+            long maxBatchSizeInBytes,
+            long maxTimeInBufferMS,
+            long maxRecordSizeInBytes,
+            boolean failOnError,
+            DynamoDbTablesConfig tablesConfig,
+            Properties dynamoDbClientProperties) {
+        super(
+                elementConverter,
+                context,
+                maxBatchSize,
+                maxInFlightRequests,
+                maxBufferedRequests,
+                maxBatchSizeInBytes,
+                maxTimeInBufferMS,
+                maxRecordSizeInBytes);
+        this.failOnError = failOnError;
+        this.tablesConfig = tablesConfig;
+        this.metrics = context.metricGroup();
+        this.numRecordsOutErrorsCounter = metrics.getNumRecordsOutErrorsCounter();
+        this.client = AWSDynamoDbUtil.createClient(dynamoDbClientProperties);
+    }
+
+    @Override
+    protected void submitRequestEntries(
+            List<DynamoDbWriteRequest> requestEntries,
+            Consumer<Collection<DynamoDbWriteRequest>> requestResultConsumer) {
+
+        TableRequestsContainer container = new TableRequestsContainer(tablesConfig);
+        requestEntries.forEach(container::put);

Review comment:
       nit: Since you are deduplicating here, the actual batch size will be less than the configured batch size. I cannot see a better way to do it though

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/util/AWSDynamoDbUtil.java
##########
@@ -0,0 +1,184 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.util;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.connector.aws.config.AWSConfigConstants;
+import org.apache.flink.connector.aws.util.AWSGeneralUtil;
+import org.apache.flink.runtime.util.EnvironmentInformation;
+import org.apache.flink.streaming.connectors.dynamodb.config.AWSDynamoDbConfigConstants;
+
+import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
+import software.amazon.awssdk.core.client.config.SdkAdvancedClientOption;
+import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
+import software.amazon.awssdk.core.client.config.SdkClientOption;
+import software.amazon.awssdk.core.retry.RetryPolicy;
+import software.amazon.awssdk.core.retry.backoff.BackoffStrategy;
+import software.amazon.awssdk.core.retry.backoff.EqualJitterBackoffStrategy;
+import software.amazon.awssdk.core.retry.backoff.FixedDelayBackoffStrategy;
+import software.amazon.awssdk.core.retry.backoff.FullJitterBackoffStrategy;
+import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient;
+import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClientBuilder;
+
+import java.net.URI;
+import java.time.Duration;
+import java.util.Optional;
+import java.util.Properties;
+
+/** Some utilities specific to Amazon Web Service. */
+@Internal
+public class AWSDynamoDbUtil extends AWSGeneralUtil {
+
+    public static DynamoDbAsyncClient createClient(final Properties properties) {
+        DynamoDbAsyncClientBuilder clientBuilder = DynamoDbAsyncClient.builder();
+
+        if (properties.containsKey(AWSConfigConstants.AWS_ENDPOINT)) {
+            final URI endpointOverride =
+                    URI.create(properties.getProperty(AWSConfigConstants.AWS_ENDPOINT));
+            clientBuilder.endpointOverride(endpointOverride);
+        }
+
+        return clientBuilder
+                .httpClient(createAsyncHttpClient(properties))
+                .region(getRegion(properties))
+                .credentialsProvider(getCredentialsProvider(properties))
+                .overrideConfiguration(getOverrideConfiguration(properties))
+                .build();
+    }
+
+    @VisibleForTesting
+    static ClientOverrideConfiguration getOverrideConfiguration(Properties properties) {
+        ClientOverrideConfiguration.Builder builder = ClientOverrideConfiguration.builder();
+        SdkClientConfiguration config = SdkClientConfiguration.builder().build();
+
+        builder.putAdvancedOption(
+                        SdkAdvancedClientOption.USER_AGENT_PREFIX,
+                        getFlinkUserAgentPrefix(properties))
+                .putAdvancedOption(
+                        SdkAdvancedClientOption.USER_AGENT_SUFFIX,
+                        config.option(SdkAdvancedClientOption.USER_AGENT_SUFFIX));
+
+        Optional.ofNullable(config.option(SdkClientOption.API_CALL_ATTEMPT_TIMEOUT))
+                .ifPresent(builder::apiCallAttemptTimeout);
+
+        Optional.ofNullable(config.option(SdkClientOption.API_CALL_TIMEOUT))
+                .ifPresent(builder::apiCallTimeout);
+
+        builder.retryPolicy(getRetryPolicy(properties));
+        return builder.build();
+    }
+
+    @VisibleForTesting
+    static String getFlinkUserAgentPrefix(Properties properties) {
+        if (properties.containsKey(AWSDynamoDbConfigConstants.DYNAMODB_CLIENT_USER_AGENT_PREFIX)) {
+            return properties.getProperty(
+                    AWSDynamoDbConfigConstants.DYNAMODB_CLIENT_USER_AGENT_PREFIX);
+        }
+        return String.format(
+                AWSDynamoDbConfigConstants.BASE_DYNAMODB_USER_AGENT_PREFIX_FORMAT,
+                EnvironmentInformation.getVersion(),
+                EnvironmentInformation.getRevisionInformation().commitId);
+    }
+
+    @VisibleForTesting
+    static RetryPolicy getRetryPolicy(Properties properties) {
+        if (hasRetryConfiguration(properties)) {
+            RetryPolicy.Builder builder = RetryPolicy.builder();
+
+            if (properties.containsKey(AWSDynamoDbConfigConstants.NUMBER_RETRIES)) {
+                builder.numRetries(
+                        Integer.parseInt(
+                                properties.getProperty(AWSDynamoDbConfigConstants.NUMBER_RETRIES)));
+            }
+
+            if (properties.containsKey(AWSDynamoDbConfigConstants.BACKOFF_STRATEGY)) {
+                builder.backoffStrategy(
+                        getBackoffStrategy(
+                                properties, AWSDynamoDbConfigConstants.BACKOFF_STRATEGY));
+            }
+
+            if (properties.containsKey(AWSDynamoDbConfigConstants.THROTTLING_BACKOFF_STRATEGY)) {
+                builder.throttlingBackoffStrategy(
+                        getBackoffStrategy(
+                                properties,
+                                AWSDynamoDbConfigConstants.THROTTLING_BACKOFF_STRATEGY));
+            }
+            return builder.build();
+        }
+        return RetryPolicy.defaultRetryPolicy();
+    }
+
+    @VisibleForTesting
+    static boolean hasRetryConfiguration(Properties properties) {
+        return properties.stringPropertyNames().stream()
+                .anyMatch(
+                        name ->
+                                name.startsWith(
+                                        AWSDynamoDbConfigConstants
+                                                .AWS_DYNAMODB_CLIENT_RETRY_PREFIX));
+    }
+
+    @VisibleForTesting
+    static BackoffStrategy getBackoffStrategy(Properties properties, String strategy) {
+        AWSDynamoDbConfigConstants.BackoffStrategy backoffStrategy =
+                AWSDynamoDbConfigConstants.BackoffStrategy.valueOf(
+                        properties.getProperty(strategy));
+
+        switch (backoffStrategy) {
+            case FULL_JITTER:
+                return FullJitterBackoffStrategy.builder()
+                        .baseDelay(
+                                getDuration(
+                                        properties.getProperty(
+                                                AWSDynamoDbConfigConstants
+                                                        .FULL_JITTER_BASE_DELAY_MS)))
+                        .maxBackoffTime(
+                                getDuration(
+                                        properties.getProperty(
+                                                AWSDynamoDbConfigConstants
+                                                        .FULL_JITTER_MAX_BACKOFF_TIME_MS)))
+                        .build();
+            case EQUAL_JITTER:
+                return EqualJitterBackoffStrategy.builder()
+                        .baseDelay(
+                                getDuration(
+                                        properties.getProperty(
+                                                AWSDynamoDbConfigConstants
+                                                        .EQUAL_JITTER_BASE_DELAY_MS)))
+                        .maxBackoffTime(
+                                getDuration(
+                                        properties.getProperty(
+                                                AWSDynamoDbConfigConstants
+                                                        .EQUAL_JITTER_MAX_BACKOFF_TIME_MS)))
+                        .build();
+            case FIXED_DELAY:
+                return FixedDelayBackoffStrategy.create(
+                        getDuration(
+                                properties.getProperty(
+                                        AWSDynamoDbConfigConstants.FIXED_DELAY_BACKOFF_MS)));
+            default:
+                return BackoffStrategy.defaultStrategy();
+        }
+    }

Review comment:
        I believe these configs can be made generic and pulled in to `AWSGeneralUtil`?

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/util/AWSDynamoDbUtil.java
##########
@@ -0,0 +1,184 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.util;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.connector.aws.config.AWSConfigConstants;
+import org.apache.flink.connector.aws.util.AWSGeneralUtil;
+import org.apache.flink.runtime.util.EnvironmentInformation;
+import org.apache.flink.streaming.connectors.dynamodb.config.AWSDynamoDbConfigConstants;
+
+import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
+import software.amazon.awssdk.core.client.config.SdkAdvancedClientOption;
+import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
+import software.amazon.awssdk.core.client.config.SdkClientOption;
+import software.amazon.awssdk.core.retry.RetryPolicy;
+import software.amazon.awssdk.core.retry.backoff.BackoffStrategy;
+import software.amazon.awssdk.core.retry.backoff.EqualJitterBackoffStrategy;
+import software.amazon.awssdk.core.retry.backoff.FixedDelayBackoffStrategy;
+import software.amazon.awssdk.core.retry.backoff.FullJitterBackoffStrategy;
+import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient;
+import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClientBuilder;
+
+import java.net.URI;
+import java.time.Duration;
+import java.util.Optional;
+import java.util.Properties;
+
+/** Some utilities specific to Amazon Web Service. */
+@Internal
+public class AWSDynamoDbUtil extends AWSGeneralUtil {
+
+    public static DynamoDbAsyncClient createClient(final Properties properties) {
+        DynamoDbAsyncClientBuilder clientBuilder = DynamoDbAsyncClient.builder();
+
+        if (properties.containsKey(AWSConfigConstants.AWS_ENDPOINT)) {
+            final URI endpointOverride =
+                    URI.create(properties.getProperty(AWSConfigConstants.AWS_ENDPOINT));
+            clientBuilder.endpointOverride(endpointOverride);
+        }
+
+        return clientBuilder
+                .httpClient(createAsyncHttpClient(properties))
+                .region(getRegion(properties))
+                .credentialsProvider(getCredentialsProvider(properties))
+                .overrideConfiguration(getOverrideConfiguration(properties))
+                .build();
+    }
+
+    @VisibleForTesting
+    static ClientOverrideConfiguration getOverrideConfiguration(Properties properties) {
+        ClientOverrideConfiguration.Builder builder = ClientOverrideConfiguration.builder();
+        SdkClientConfiguration config = SdkClientConfiguration.builder().build();
+
+        builder.putAdvancedOption(
+                        SdkAdvancedClientOption.USER_AGENT_PREFIX,
+                        getFlinkUserAgentPrefix(properties))
+                .putAdvancedOption(
+                        SdkAdvancedClientOption.USER_AGENT_SUFFIX,
+                        config.option(SdkAdvancedClientOption.USER_AGENT_SUFFIX));
+
+        Optional.ofNullable(config.option(SdkClientOption.API_CALL_ATTEMPT_TIMEOUT))
+                .ifPresent(builder::apiCallAttemptTimeout);
+
+        Optional.ofNullable(config.option(SdkClientOption.API_CALL_TIMEOUT))
+                .ifPresent(builder::apiCallTimeout);
+
+        builder.retryPolicy(getRetryPolicy(properties));
+        return builder.build();
+    }
+
+    @VisibleForTesting
+    static String getFlinkUserAgentPrefix(Properties properties) {
+        if (properties.containsKey(AWSDynamoDbConfigConstants.DYNAMODB_CLIENT_USER_AGENT_PREFIX)) {
+            return properties.getProperty(
+                    AWSDynamoDbConfigConstants.DYNAMODB_CLIENT_USER_AGENT_PREFIX);
+        }
+        return String.format(
+                AWSDynamoDbConfigConstants.BASE_DYNAMODB_USER_AGENT_PREFIX_FORMAT,
+                EnvironmentInformation.getVersion(),
+                EnvironmentInformation.getRevisionInformation().commitId);
+    }
+
+    @VisibleForTesting
+    static RetryPolicy getRetryPolicy(Properties properties) {
+        if (hasRetryConfiguration(properties)) {
+            RetryPolicy.Builder builder = RetryPolicy.builder();
+
+            if (properties.containsKey(AWSDynamoDbConfigConstants.NUMBER_RETRIES)) {
+                builder.numRetries(
+                        Integer.parseInt(
+                                properties.getProperty(AWSDynamoDbConfigConstants.NUMBER_RETRIES)));
+            }
+
+            if (properties.containsKey(AWSDynamoDbConfigConstants.BACKOFF_STRATEGY)) {
+                builder.backoffStrategy(
+                        getBackoffStrategy(
+                                properties, AWSDynamoDbConfigConstants.BACKOFF_STRATEGY));
+            }
+
+            if (properties.containsKey(AWSDynamoDbConfigConstants.THROTTLING_BACKOFF_STRATEGY)) {
+                builder.throttlingBackoffStrategy(
+                        getBackoffStrategy(
+                                properties,
+                                AWSDynamoDbConfigConstants.THROTTLING_BACKOFF_STRATEGY));
+            }
+            return builder.build();
+        }
+        return RetryPolicy.defaultRetryPolicy();
+    }

Review comment:
       I believe these configs can be made generic and pulled in to `AWSGeneralUtil`?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1ed40f830db68d828612207897418a868e6b55f7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476",
       "triggerID" : "1ed40f830db68d828612207897418a868e6b55f7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30498",
       "triggerID" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34130",
       "triggerID" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34133",
       "triggerID" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bb92395129797263b775f9a81e89dbcbab94391b",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34135",
       "triggerID" : "bb92395129797263b775f9a81e89dbcbab94391b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * bb92395129797263b775f9a81e89dbcbab94391b Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34135) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8ec1f57053a8f98ca61b1ff7ad090d789476d45b Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8ec1f57053a8f98ca61b1ff7ad090d789476d45b UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9e25df6a205db5206574d6cdee111d88b625cba2",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "9e25df6a205db5206574d6cdee111d88b625cba2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8ec1f57053a8f98ca61b1ff7ad090d789476d45b Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220) 
   * 9c9eec7f108f056b27d417ed0ba12f098f8af714 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320) 
   * 9e25df6a205db5206574d6cdee111d88b625cba2 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8ec1f57053a8f98ca61b1ff7ad090d789476d45b Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220) 
   * 9c9eec7f108f056b27d417ed0ba12f098f8af714 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] DMalliaros commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
DMalliaros commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r794413842



##########
File path: flink-connectors/flink-connector-dynamodb/src/test/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSinkBuilderTest.java
##########
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.assertj.core.api.Assertions;
+import org.junit.Test;
+
+/** Tests for {@link DynamoDbSinkBuilder}. */
+public class DynamoDbSinkBuilderTest {

Review comment:
       Added positive test for DynamoDbSinkBuilderTest




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * df0af668680a0672e293083239809cfec66c572d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331) 
   * 1101c210e2389dc36876faf69d5cd52a77c882a6 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1ed40f830db68d828612207897418a868e6b55f7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476",
       "triggerID" : "1ed40f830db68d828612207897418a868e6b55f7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30498",
       "triggerID" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * bce4406f01127a6956ef00592014e9c5b9d00aa4 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30498) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] YuriGusev commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
YuriGusev commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r793720699



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/resources/META-INF/NOTICE
##########
@@ -0,0 +1,257 @@
+flink-connector-dynamodb
+Copyright 2014-2021 The Apache Software Foundation

Review comment:
       fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * df0af668680a0672e293083239809cfec66c572d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * df0af668680a0672e293083239809cfec66c572d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331) 
   * 1101c210e2389dc36876faf69d5cd52a77c882a6 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393) 
   * 0c073f2b0cec8b9e8bfda51f408181fce949c287 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 0c073f2b0cec8b9e8bfda51f408181fce949c287 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1ed40f830db68d828612207897418a868e6b55f7",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476",
       "triggerID" : "1ed40f830db68d828612207897418a868e6b55f7",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1ed40f830db68d828612207897418a868e6b55f7 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] YuriGusev commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
YuriGusev commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r792833935



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSink.java
##########
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Experimental;
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.api.connector.sink.SinkWriter;
+import org.apache.flink.connector.base.sink.AsyncSinkBase;
+import org.apache.flink.connector.base.sink.writer.ElementConverter;
+import org.apache.flink.core.io.SimpleVersionedSerializer;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Optional;
+import java.util.Properties;
+
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
+/**
+ * A DynamoDB Sink that performs async requests against a destination stream using the buffering
+ * protocol specified in {@link AsyncSinkBase}.
+ *
+ * <p>The sink internally uses a {@link
+ * software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient} to communicate with the AWS
+ * endpoint.
+ *
+ * <p>The behaviour of the buffering may be specified by providing configuration during the sink
+ * build time.
+ *
+ * <ul>
+ *   <li>{@code maxBatchSize}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb.
+ *   <li>{@code maxInFlightRequests}: the maximum number of in flight requests that may exist, if
+ *       any more in flight requests need to be initiated once the maximum has been reached, then it
+ *       will be blocked until some have completed
+ *   <li>{@code maxBufferedRequests}: the maximum number of elements held in the buffer, requests to
+ *       add elements will be blocked while the number of elements in the buffer is at the maximum
+ *   <li>{@code maxBatchSizeInBytes}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb measured in bytes
+ *   <li>{@code maxTimeInBufferMS}: the maximum amount of time an entry is allowed to live in the
+ *       buffer, if any element reaches this age, the entire buffer will be flushed immediately
+ *   <li>{@code maxRecordSizeInBytes}: the maximum size of a record the sink will accept into the
+ *       buffer, a record of size larger than this will be rejected when passed to the sink
+ *   <li>{@code failOnError}: when an exception is encountered while persisting to DynamoDb, the job
+ *       will fail immediately if failOnError is set
+ *   <li>{@code dynamoDbTablesConfig}: if provided for the table, the DynamoDb sink will attempt to
+ *       deduplicate records with the same primary and/or secondary keys in the same batch request.
+ *       Only the latest record with the same combination of key attributes is preserved in the
+ *       request.
+ * </ul>
+ *
+ * <p>Please see the writer implementation in {@link DynamoDbSinkWriter}
+ *
+ * @param <InputT> Type of the elements handled by this sink
+ */
+@PublicEvolving
+public class DynamoDbSink<InputT> extends AsyncSinkBase<InputT, DynamoDbWriteRequest> {
+
+    private final Properties dynamoDbClientProperties;
+    private final DynamoDbTablesConfig dynamoDbTablesConfig;
+    private final boolean failOnError;
+
+    protected DynamoDbSink(
+            ElementConverter<InputT, DynamoDbWriteRequest> elementConverter,
+            int maxBatchSize,
+            int maxInFlightRequests,
+            int maxBufferedRequests,
+            long maxBatchSizeInBytes,
+            long maxTimeInBufferMS,
+            long maxRecordSizeInBytes,
+            boolean failOnError,
+            DynamoDbTablesConfig dynamoDbTablesConfig,
+            Properties dynamoDbClientProperties) {
+        super(
+                elementConverter,
+                maxBatchSize,
+                maxInFlightRequests,
+                maxBufferedRequests,
+                maxBatchSizeInBytes,
+                maxTimeInBufferMS,
+                maxRecordSizeInBytes);
+        checkNotNull(dynamoDbTablesConfig, "Missing dynamoDbTablesConfig");
+        checkNotNull(dynamoDbClientProperties, "Missing dynamoDbClientProperties");
+        this.failOnError = failOnError;
+        this.dynamoDbTablesConfig = dynamoDbTablesConfig;
+        this.dynamoDbClientProperties = dynamoDbClientProperties;
+    }
+
+    /**
+     * Create a {@link DynamoDbSinkBuilder} to construct a new {@link DynamoDbSink}.
+     *
+     * @param <InputT> type of incoming records
+     * @return {@link DynamoDbSinkBuilder}
+     */
+    public static <InputT> DynamoDbSinkBuilder<InputT> builder() {
+        return new DynamoDbSinkBuilder<>();
+    }
+
+    @Experimental

Review comment:
       Can you please give me a reference to the changes for the elements converter?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1ed40f830db68d828612207897418a868e6b55f7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476",
       "triggerID" : "1ed40f830db68d828612207897418a868e6b55f7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30498",
       "triggerID" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34130",
       "triggerID" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * bce4406f01127a6956ef00592014e9c5b9d00aa4 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30498) 
   * 63f13beab12bbeec3e7a03751ca2943dacb41c12 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34130) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] YuriGusev commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
YuriGusev commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r840826494



##########
File path: flink-connectors/flink-connector-dynamodb/pom.xml
##########
@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<parent>
+		<groupId>org.apache.flink</groupId>
+		<artifactId>flink-connectors</artifactId>
+		<version>1.15-SNAPSHOT</version>
+		<relativePath>..</relativePath>
+	</parent>
+
+	<modelVersion>4.0.0</modelVersion>
+
+	<artifactId>flink-connector-dynamodb</artifactId>
+	<name>Flink : Connectors : DynamoDB</name>
+	<properties>
+		<aws.sdk.version>2.17.116</aws.sdk.version>
+		<commons-lang3.version>3.11</commons-lang3.version>

Review comment:
       thanks, fixed now

##########
File path: flink-connectors/flink-connector-dynamodb/pom.xml
##########
@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<parent>
+		<groupId>org.apache.flink</groupId>
+		<artifactId>flink-connectors</artifactId>
+		<version>1.15-SNAPSHOT</version>
+		<relativePath>..</relativePath>
+	</parent>
+
+	<modelVersion>4.0.0</modelVersion>
+
+	<artifactId>flink-connector-dynamodb</artifactId>
+	<name>Flink : Connectors : DynamoDB</name>
+	<properties>
+		<aws.sdk.version>2.17.116</aws.sdk.version>
+		<commons-lang3.version>3.11</commons-lang3.version>
+		<testcontainers.version>1.16.2</testcontainers.version>

Review comment:
       thanks, fixed now




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1ed40f830db68d828612207897418a868e6b55f7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476",
       "triggerID" : "1ed40f830db68d828612207897418a868e6b55f7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30498",
       "triggerID" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34130",
       "triggerID" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 63f13beab12bbeec3e7a03751ca2943dacb41c12 Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34130) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1ed40f830db68d828612207897418a868e6b55f7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476",
       "triggerID" : "1ed40f830db68d828612207897418a868e6b55f7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30498",
       "triggerID" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34130",
       "triggerID" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 63f13beab12bbeec3e7a03751ca2943dacb41c12 Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34130) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1ed40f830db68d828612207897418a868e6b55f7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476",
       "triggerID" : "1ed40f830db68d828612207897418a868e6b55f7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30498",
       "triggerID" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34130",
       "triggerID" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34133",
       "triggerID" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bb92395129797263b775f9a81e89dbcbab94391b",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "bb92395129797263b775f9a81e89dbcbab94391b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f92d95336aa9111d7cc2c7c47497677ad3e9c2de Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34133) 
   * bb92395129797263b775f9a81e89dbcbab94391b UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] nirtsruya commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
nirtsruya commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r799306670



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSink.java
##########
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Experimental;
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.api.connector.sink.SinkWriter;
+import org.apache.flink.connector.base.sink.AsyncSinkBase;
+import org.apache.flink.connector.base.sink.writer.ElementConverter;
+import org.apache.flink.core.io.SimpleVersionedSerializer;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Optional;
+import java.util.Properties;
+
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
+/**
+ * A DynamoDB Sink that performs async requests against a destination stream using the buffering
+ * protocol specified in {@link AsyncSinkBase}.
+ *
+ * <p>The sink internally uses a {@link
+ * software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient} to communicate with the AWS
+ * endpoint.
+ *
+ * <p>The behaviour of the buffering may be specified by providing configuration during the sink
+ * build time.
+ *
+ * <ul>
+ *   <li>{@code maxBatchSize}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb.
+ *   <li>{@code maxInFlightRequests}: the maximum number of in flight requests that may exist, if
+ *       any more in flight requests need to be initiated once the maximum has been reached, then it
+ *       will be blocked until some have completed
+ *   <li>{@code maxBufferedRequests}: the maximum number of elements held in the buffer, requests to
+ *       add elements will be blocked while the number of elements in the buffer is at the maximum
+ *   <li>{@code maxBatchSizeInBytes}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb measured in bytes
+ *   <li>{@code maxTimeInBufferMS}: the maximum amount of time an entry is allowed to live in the
+ *       buffer, if any element reaches this age, the entire buffer will be flushed immediately
+ *   <li>{@code maxRecordSizeInBytes}: the maximum size of a record the sink will accept into the
+ *       buffer, a record of size larger than this will be rejected when passed to the sink
+ *   <li>{@code failOnError}: when an exception is encountered while persisting to DynamoDb, the job
+ *       will fail immediately if failOnError is set
+ *   <li>{@code dynamoDbTablesConfig}: if provided for the table, the DynamoDb sink will attempt to
+ *       deduplicate records with the same primary and/or secondary keys in the same batch request.
+ *       Only the latest record with the same combination of key attributes is preserved in the
+ *       request.
+ * </ul>
+ *
+ * <p>Please see the writer implementation in {@link DynamoDbSinkWriter}
+ *
+ * @param <InputT> Type of the elements handled by this sink
+ */
+@PublicEvolving
+public class DynamoDbSink<InputT> extends AsyncSinkBase<InputT, DynamoDbWriteRequest> {
+
+    private final Properties dynamoDbClientProperties;
+    private final DynamoDbTablesConfig dynamoDbTablesConfig;
+    private final boolean failOnError;
+
+    protected DynamoDbSink(
+            ElementConverter<InputT, DynamoDbWriteRequest> elementConverter,
+            int maxBatchSize,
+            int maxInFlightRequests,
+            int maxBufferedRequests,
+            long maxBatchSizeInBytes,
+            long maxTimeInBufferMS,
+            long maxRecordSizeInBytes,
+            boolean failOnError,
+            DynamoDbTablesConfig dynamoDbTablesConfig,
+            Properties dynamoDbClientProperties) {
+        super(
+                elementConverter,
+                maxBatchSize,
+                maxInFlightRequests,
+                maxBufferedRequests,
+                maxBatchSizeInBytes,
+                maxTimeInBufferMS,
+                maxRecordSizeInBytes);
+        checkNotNull(dynamoDbTablesConfig, "Missing dynamoDbTablesConfig");
+        checkNotNull(dynamoDbClientProperties, "Missing dynamoDbClientProperties");
+        this.failOnError = failOnError;
+        this.dynamoDbTablesConfig = dynamoDbTablesConfig;
+        this.dynamoDbClientProperties = dynamoDbClientProperties;
+    }
+
+    /**
+     * Create a {@link DynamoDbSinkBuilder} to construct a new {@link DynamoDbSink}.
+     *
+     * @param <InputT> type of incoming records
+     * @return {@link DynamoDbSinkBuilder}
+     */
+    public static <InputT> DynamoDbSinkBuilder<InputT> builder() {
+        return new DynamoDbSinkBuilder<>();
+    }
+
+    @Experimental

Review comment:
       @CrynetLogistics @dannycranmer apologize for ping. We have prepared a sample [PR](https://github.com/YuriGusev/flink/commit/de83346dc24367ff1101ae13934dfcf1fc649de2) in case hiding the ElementConverter is a requirement. 
   Here we don't let the user interact with the Element Converter or any class from the AWS sdk 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1ed40f830db68d828612207897418a868e6b55f7",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476",
       "triggerID" : "1ed40f830db68d828612207897418a868e6b55f7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30498",
       "triggerID" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1ed40f830db68d828612207897418a868e6b55f7 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476) 
   * bce4406f01127a6956ef00592014e9c5b9d00aa4 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30498) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8ec1f57053a8f98ca61b1ff7ad090d789476d45b Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220) 
   * 9c9eec7f108f056b27d417ed0ba12f098f8af714 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8ec1f57053a8f98ca61b1ff7ad090d789476d45b Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220) 
   * 9c9eec7f108f056b27d417ed0ba12f098f8af714 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * df0af668680a0672e293083239809cfec66c572d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331) 
   * 1101c210e2389dc36876faf69d5cd52a77c882a6 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393) 
   * 0c073f2b0cec8b9e8bfda51f408181fce949c287 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] CrynetLogistics commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
CrynetLogistics commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r792609714



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/util/AWSDynamoDbUtil.java
##########
@@ -0,0 +1,184 @@
+/*

Review comment:
       I like your current approach more, like you said, we'd not leak any ddb sdk interfaces.
   
   Plus, I'm not sure there is a way to pass `DynamoDbClientProvider` to the `DynamoDbSinkWriter` without first making it a field in `DynamoDbSink`. If I'm not wrong, I believe the `DynamoDbSink` will complain that `DynamoDbAsyncClient` in your `DynamoDbClientProvider` is not serialisable during runtime (it compiles ok). 
   
   I think all fields of the sink must be serialisable... so even if we wanted to accept a customer-ready-made `DynamoDbAsyncClient`, I'm not sure there's a good way to do it...




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] CrynetLogistics commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
CrynetLogistics commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r792652532



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSinkBuilder.java
##########
@@ -0,0 +1,123 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.connector.base.sink.AsyncSinkBaseBuilder;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+
+import java.util.Optional;
+import java.util.Properties;
+
+/**
+ * Builder to construct {@link DynamoDbSink}.
+ *
+ * <p>The following example shows the minimum setup to create a {@link DynamoDbSink} that writes
+ * records into DynamoDb
+ *
+ * <pre>{@code
+ * private static class DummyElementConverter
+ *         implements ElementConverter<String, DynamoDbWriteRequest> {
+ *
+ *     @Override
+ *     public DynamoDbWriteRequest apply(String element, SinkWriter.Context context) {
+ *         final Map<String, AttributeValue> map = new HashMap<>();
+ *         map.put("your-key", AttributeValue.builder().s(element).build());
+ *         return new DynamoDbWriteRequest(
+ *                 "your-table-name",
+ *                 WriteRequest.builder()
+ *                         .putRequest(PutRequest.builder().item(map).build())
+ *                         .build());
+ *      }
+ * }
+ * DynamoDbSink<String> dynamoDbSink = DynamoDbSink.<String>builder()
+ *                                          .setElementConverter(new DummyElementConverter())
+ *                                       .build();
+ * }</pre>
+ *
+ * <p>If the following parameters are not set in this builder, the following defaults will be used:
+ *
+ * <ul>
+ *   <li>{@code maxBatchSize} will be 25
+ *   <li>{@code maxInFlightRequests} will be 10

Review comment:
       Shall we set the `maxInFlightRequests` to 50? Since that's the default for the AWS Async Client [...](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/asynchronous.html#:~:text=threads.%20By%20default%2C-,50%20Threads,-are%20generated%20for) . 

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSink.java
##########
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Experimental;
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.api.connector.sink.SinkWriter;
+import org.apache.flink.connector.base.sink.AsyncSinkBase;
+import org.apache.flink.connector.base.sink.writer.ElementConverter;
+import org.apache.flink.core.io.SimpleVersionedSerializer;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Optional;
+import java.util.Properties;
+
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
+/**
+ * A DynamoDB Sink that performs async requests against a destination stream using the buffering
+ * protocol specified in {@link AsyncSinkBase}.
+ *
+ * <p>The sink internally uses a {@link
+ * software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient} to communicate with the AWS
+ * endpoint.
+ *
+ * <p>The behaviour of the buffering may be specified by providing configuration during the sink
+ * build time.
+ *
+ * <ul>
+ *   <li>{@code maxBatchSize}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb.
+ *   <li>{@code maxInFlightRequests}: the maximum number of in flight requests that may exist, if
+ *       any more in flight requests need to be initiated once the maximum has been reached, then it
+ *       will be blocked until some have completed
+ *   <li>{@code maxBufferedRequests}: the maximum number of elements held in the buffer, requests to
+ *       add elements will be blocked while the number of elements in the buffer is at the maximum
+ *   <li>{@code maxBatchSizeInBytes}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb measured in bytes
+ *   <li>{@code maxTimeInBufferMS}: the maximum amount of time an entry is allowed to live in the
+ *       buffer, if any element reaches this age, the entire buffer will be flushed immediately
+ *   <li>{@code maxRecordSizeInBytes}: the maximum size of a record the sink will accept into the
+ *       buffer, a record of size larger than this will be rejected when passed to the sink
+ *   <li>{@code failOnError}: when an exception is encountered while persisting to DynamoDb, the job
+ *       will fail immediately if failOnError is set
+ *   <li>{@code dynamoDbTablesConfig}: if provided for the table, the DynamoDb sink will attempt to
+ *       deduplicate records with the same primary and/or secondary keys in the same batch request.
+ *       Only the latest record with the same combination of key attributes is preserved in the
+ *       request.
+ * </ul>
+ *
+ * <p>Please see the writer implementation in {@link DynamoDbSinkWriter}
+ *
+ * @param <InputT> Type of the elements handled by this sink
+ */
+@PublicEvolving
+public class DynamoDbSink<InputT> extends AsyncSinkBase<InputT, DynamoDbWriteRequest> {
+
+    private final Properties dynamoDbClientProperties;
+    private final DynamoDbTablesConfig dynamoDbTablesConfig;
+    private final boolean failOnError;
+
+    protected DynamoDbSink(
+            ElementConverter<InputT, DynamoDbWriteRequest> elementConverter,
+            int maxBatchSize,
+            int maxInFlightRequests,
+            int maxBufferedRequests,
+            long maxBatchSizeInBytes,
+            long maxTimeInBufferMS,
+            long maxRecordSizeInBytes,
+            boolean failOnError,
+            DynamoDbTablesConfig dynamoDbTablesConfig,
+            Properties dynamoDbClientProperties) {
+        super(
+                elementConverter,
+                maxBatchSize,
+                maxInFlightRequests,
+                maxBufferedRequests,
+                maxBatchSizeInBytes,
+                maxTimeInBufferMS,
+                maxRecordSizeInBytes);
+        checkNotNull(dynamoDbTablesConfig, "Missing dynamoDbTablesConfig");
+        checkNotNull(dynamoDbClientProperties, "Missing dynamoDbClientProperties");
+        this.failOnError = failOnError;
+        this.dynamoDbTablesConfig = dynamoDbTablesConfig;
+        this.dynamoDbClientProperties = dynamoDbClientProperties;
+    }
+
+    /**
+     * Create a {@link DynamoDbSinkBuilder} to construct a new {@link DynamoDbSink}.
+     *
+     * @param <InputT> type of incoming records
+     * @return {@link DynamoDbSinkBuilder}
+     */
+    public static <InputT> DynamoDbSinkBuilder<InputT> builder() {
+        return new DynamoDbSinkBuilder<>();
+    }
+
+    @Experimental
+    @Override
+    public SinkWriter<InputT, Void, Collection<DynamoDbWriteRequest>> createWriter(
+            InitContext context, List<Collection<DynamoDbWriteRequest>> states) {
+        return new DynamoDbSinkWriter<>(
+                getElementConverter(),
+                context,
+                getMaxBatchSize(),
+                getMaxInFlightRequests(),
+                getMaxBufferedRequests(),
+                getMaxBatchSizeInBytes(),
+                getMaxTimeInBufferMS(),
+                getMaxRecordSizeInBytes(),
+                failOnError,
+                dynamoDbTablesConfig,
+                dynamoDbClientProperties);
+    }
+
+    @Experimental

Review comment:
       Same here, `@Internal` might be better.

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSink.java
##########
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Experimental;
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.api.connector.sink.SinkWriter;
+import org.apache.flink.connector.base.sink.AsyncSinkBase;
+import org.apache.flink.connector.base.sink.writer.ElementConverter;
+import org.apache.flink.core.io.SimpleVersionedSerializer;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Optional;
+import java.util.Properties;
+
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
+/**
+ * A DynamoDB Sink that performs async requests against a destination stream using the buffering
+ * protocol specified in {@link AsyncSinkBase}.
+ *
+ * <p>The sink internally uses a {@link
+ * software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient} to communicate with the AWS
+ * endpoint.
+ *
+ * <p>The behaviour of the buffering may be specified by providing configuration during the sink
+ * build time.
+ *
+ * <ul>
+ *   <li>{@code maxBatchSize}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb.
+ *   <li>{@code maxInFlightRequests}: the maximum number of in flight requests that may exist, if
+ *       any more in flight requests need to be initiated once the maximum has been reached, then it
+ *       will be blocked until some have completed
+ *   <li>{@code maxBufferedRequests}: the maximum number of elements held in the buffer, requests to
+ *       add elements will be blocked while the number of elements in the buffer is at the maximum
+ *   <li>{@code maxBatchSizeInBytes}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb measured in bytes
+ *   <li>{@code maxTimeInBufferMS}: the maximum amount of time an entry is allowed to live in the
+ *       buffer, if any element reaches this age, the entire buffer will be flushed immediately
+ *   <li>{@code maxRecordSizeInBytes}: the maximum size of a record the sink will accept into the
+ *       buffer, a record of size larger than this will be rejected when passed to the sink
+ *   <li>{@code failOnError}: when an exception is encountered while persisting to DynamoDb, the job
+ *       will fail immediately if failOnError is set
+ *   <li>{@code dynamoDbTablesConfig}: if provided for the table, the DynamoDb sink will attempt to
+ *       deduplicate records with the same primary and/or secondary keys in the same batch request.
+ *       Only the latest record with the same combination of key attributes is preserved in the
+ *       request.
+ * </ul>
+ *
+ * <p>Please see the writer implementation in {@link DynamoDbSinkWriter}
+ *
+ * @param <InputT> Type of the elements handled by this sink
+ */
+@PublicEvolving
+public class DynamoDbSink<InputT> extends AsyncSinkBase<InputT, DynamoDbWriteRequest> {
+
+    private final Properties dynamoDbClientProperties;
+    private final DynamoDbTablesConfig dynamoDbTablesConfig;
+    private final boolean failOnError;
+
+    protected DynamoDbSink(
+            ElementConverter<InputT, DynamoDbWriteRequest> elementConverter,
+            int maxBatchSize,
+            int maxInFlightRequests,
+            int maxBufferedRequests,
+            long maxBatchSizeInBytes,
+            long maxTimeInBufferMS,
+            long maxRecordSizeInBytes,
+            boolean failOnError,
+            DynamoDbTablesConfig dynamoDbTablesConfig,
+            Properties dynamoDbClientProperties) {
+        super(
+                elementConverter,
+                maxBatchSize,
+                maxInFlightRequests,
+                maxBufferedRequests,
+                maxBatchSizeInBytes,
+                maxTimeInBufferMS,
+                maxRecordSizeInBytes);
+        checkNotNull(dynamoDbTablesConfig, "Missing dynamoDbTablesConfig");
+        checkNotNull(dynamoDbClientProperties, "Missing dynamoDbClientProperties");
+        this.failOnError = failOnError;
+        this.dynamoDbTablesConfig = dynamoDbTablesConfig;
+        this.dynamoDbClientProperties = dynamoDbClientProperties;
+    }
+
+    /**
+     * Create a {@link DynamoDbSinkBuilder} to construct a new {@link DynamoDbSink}.
+     *
+     * @param <InputT> type of incoming records
+     * @return {@link DynamoDbSinkBuilder}
+     */
+    public static <InputT> DynamoDbSinkBuilder<InputT> builder() {
+        return new DynamoDbSinkBuilder<>();
+    }
+
+    @Experimental

Review comment:
       I think `@Internal` might be more appropriate here, since we're not expecting to remove this method... `flink-architecture-tests` are cool with `@Internal` here too.

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/util/AWSDynamoDbUtil.java
##########
@@ -0,0 +1,184 @@
+/*

Review comment:
       Ah good to know. Thanks, agreed.

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSinkWriter.java
##########
@@ -0,0 +1,162 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.api.connector.sink.Sink;
+import org.apache.flink.connector.base.sink.writer.AsyncSinkWriter;
+import org.apache.flink.connector.base.sink.writer.ElementConverter;
+import org.apache.flink.metrics.Counter;
+import org.apache.flink.metrics.groups.SinkWriterMetricGroup;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+import org.apache.flink.streaming.connectors.dynamodb.util.AWSDynamoDbUtil;
+import org.apache.flink.streaming.connectors.dynamodb.util.DynamoDbExceptionUtils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient;
+import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemRequest;
+import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemResponse;
+import software.amazon.awssdk.services.dynamodb.model.WriteRequest;
+
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.CompletableFuture;
+import java.util.function.Consumer;
+
+/**
+ * TODO.

Review comment:
       A short description :-)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] YuriGusev commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
YuriGusev commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r793720913



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/key/PrimaryKey.java
##########
@@ -0,0 +1,168 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink.key;
+
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+import org.apache.flink.streaming.connectors.dynamodb.sink.InvalidRequestException;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import software.amazon.awssdk.services.dynamodb.model.AttributeValue;
+import software.amazon.awssdk.services.dynamodb.model.WriteRequest;
+
+import javax.annotation.Nullable;
+
+import java.util.Map;
+import java.util.UUID;
+
+/** Represents DynamoDB primary key. */
+public class PrimaryKey {
+
+    private final String partitionKeyValue;
+    @Nullable private final String sortKeyValue;
+
+    private PrimaryKey(String partitionKeyValue) {
+        this.partitionKeyValue = partitionKeyValue;
+        this.sortKeyValue = null;
+    }
+
+    private PrimaryKey(String partitionKeyValue, @Nullable String sortKeyValue) {
+        this.partitionKeyValue = partitionKeyValue;
+        this.sortKeyValue = sortKeyValue;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+
+        PrimaryKey that = (PrimaryKey) o;
+
+        return new EqualsBuilder()
+                .append(partitionKeyValue, that.partitionKeyValue)
+                .append(sortKeyValue, that.sortKeyValue)
+                .isEquals();
+    }
+
+    @Override
+    public int hashCode() {
+        return new HashCodeBuilder(17, 37)
+                .append(partitionKeyValue)
+                .append(sortKeyValue)
+                .toHashCode();
+    }
+
+    @Override
+    public String toString() {
+        return "PrimaryKey{"
+                + "partitionKeyValue='"
+                + partitionKeyValue
+                + '\''
+                + ", sortKeyValue='"
+                + sortKeyValue
+                + '\''
+                + '}';
+    }
+
+    public static PrimaryKey build(DynamoDbTablesConfig.TableConfig config, WriteRequest request) {
+        if (config != null) {

Review comment:
       added

##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbWriteRequest.java
##########
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import software.amazon.awssdk.services.dynamodb.model.WriteRequest;
+
+import java.io.Serializable;
+import java.util.Objects;
+
+/**
+ * Represents a single DynamoDb {@link WriteRequest}. Contains the name of the DynamoDb table name
+ * to write to as well as the {@link WriteRequest}
+ */
+public class DynamoDbWriteRequest implements Serializable {

Review comment:
       added for all classes




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022040566


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit 8ec1f57053a8f98ca61b1ff7ad090d789476d45b (Wed Jan 26 09:57:33 UTC 2022)
   
   **Warnings:**
    * **3 pom.xml files were touched**: Check for build and licensing issues.
    * No documentation files were touched! Remember to keep the Flink docs up to date!
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] YuriGusev commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
YuriGusev commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r840812580



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSinkException.java
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+/** Exception is thrown when DynamoDb sink failed to write data. */
+public class DynamoDbSinkException extends RuntimeException {

Review comment:
       thanks, fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1ed40f830db68d828612207897418a868e6b55f7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476",
       "triggerID" : "1ed40f830db68d828612207897418a868e6b55f7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30498",
       "triggerID" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34130",
       "triggerID" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34133",
       "triggerID" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bb92395129797263b775f9a81e89dbcbab94391b",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "bb92395129797263b775f9a81e89dbcbab94391b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f92d95336aa9111d7cc2c7c47497677ad3e9c2de Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34133) 
   * bb92395129797263b775f9a81e89dbcbab94391b UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] nirtsruya commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
nirtsruya commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r799306670



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSink.java
##########
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Experimental;
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.api.connector.sink.SinkWriter;
+import org.apache.flink.connector.base.sink.AsyncSinkBase;
+import org.apache.flink.connector.base.sink.writer.ElementConverter;
+import org.apache.flink.core.io.SimpleVersionedSerializer;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Optional;
+import java.util.Properties;
+
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
+/**
+ * A DynamoDB Sink that performs async requests against a destination stream using the buffering
+ * protocol specified in {@link AsyncSinkBase}.
+ *
+ * <p>The sink internally uses a {@link
+ * software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient} to communicate with the AWS
+ * endpoint.
+ *
+ * <p>The behaviour of the buffering may be specified by providing configuration during the sink
+ * build time.
+ *
+ * <ul>
+ *   <li>{@code maxBatchSize}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb.
+ *   <li>{@code maxInFlightRequests}: the maximum number of in flight requests that may exist, if
+ *       any more in flight requests need to be initiated once the maximum has been reached, then it
+ *       will be blocked until some have completed
+ *   <li>{@code maxBufferedRequests}: the maximum number of elements held in the buffer, requests to
+ *       add elements will be blocked while the number of elements in the buffer is at the maximum
+ *   <li>{@code maxBatchSizeInBytes}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb measured in bytes
+ *   <li>{@code maxTimeInBufferMS}: the maximum amount of time an entry is allowed to live in the
+ *       buffer, if any element reaches this age, the entire buffer will be flushed immediately
+ *   <li>{@code maxRecordSizeInBytes}: the maximum size of a record the sink will accept into the
+ *       buffer, a record of size larger than this will be rejected when passed to the sink
+ *   <li>{@code failOnError}: when an exception is encountered while persisting to DynamoDb, the job
+ *       will fail immediately if failOnError is set
+ *   <li>{@code dynamoDbTablesConfig}: if provided for the table, the DynamoDb sink will attempt to
+ *       deduplicate records with the same primary and/or secondary keys in the same batch request.
+ *       Only the latest record with the same combination of key attributes is preserved in the
+ *       request.
+ * </ul>
+ *
+ * <p>Please see the writer implementation in {@link DynamoDbSinkWriter}
+ *
+ * @param <InputT> Type of the elements handled by this sink
+ */
+@PublicEvolving
+public class DynamoDbSink<InputT> extends AsyncSinkBase<InputT, DynamoDbWriteRequest> {
+
+    private final Properties dynamoDbClientProperties;
+    private final DynamoDbTablesConfig dynamoDbTablesConfig;
+    private final boolean failOnError;
+
+    protected DynamoDbSink(
+            ElementConverter<InputT, DynamoDbWriteRequest> elementConverter,
+            int maxBatchSize,
+            int maxInFlightRequests,
+            int maxBufferedRequests,
+            long maxBatchSizeInBytes,
+            long maxTimeInBufferMS,
+            long maxRecordSizeInBytes,
+            boolean failOnError,
+            DynamoDbTablesConfig dynamoDbTablesConfig,
+            Properties dynamoDbClientProperties) {
+        super(
+                elementConverter,
+                maxBatchSize,
+                maxInFlightRequests,
+                maxBufferedRequests,
+                maxBatchSizeInBytes,
+                maxTimeInBufferMS,
+                maxRecordSizeInBytes);
+        checkNotNull(dynamoDbTablesConfig, "Missing dynamoDbTablesConfig");
+        checkNotNull(dynamoDbClientProperties, "Missing dynamoDbClientProperties");
+        this.failOnError = failOnError;
+        this.dynamoDbTablesConfig = dynamoDbTablesConfig;
+        this.dynamoDbClientProperties = dynamoDbClientProperties;
+    }
+
+    /**
+     * Create a {@link DynamoDbSinkBuilder} to construct a new {@link DynamoDbSink}.
+     *
+     * @param <InputT> type of incoming records
+     * @return {@link DynamoDbSinkBuilder}
+     */
+    public static <InputT> DynamoDbSinkBuilder<InputT> builder() {
+        return new DynamoDbSinkBuilder<>();
+    }
+
+    @Experimental

Review comment:
       @CrynetLogistics @dannycranmer apologize for ping. We have prepared a sample [PR](https://github.com/YuriGusev/flink/commit/de83346dc24367ff1101ae13934dfcf1fc649de2) in case hiding the ElementConverter is a requirement. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] YuriGusev commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
YuriGusev commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r793720217



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/TableRequestsContainer.java
##########
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+import org.apache.flink.streaming.connectors.dynamodb.sink.key.PrimaryKey;
+
+import org.apache.flink.shaded.guava30.com.google.common.collect.ImmutableList;
+
+import software.amazon.awssdk.services.dynamodb.model.WriteRequest;
+
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Container to accumulate requests in batches per table. De-duplicates batch request entities as
+ * per PrimaryKey definition. DynamoDB Batch API rejects the whole batch request if the request
+ * contains at least two items with identical hash and range keys (which essentially is two put
+ * operations).
+ */
+class TableRequestsContainer {
+
+    private final DynamoDbTablesConfig tablesConfig;
+    private final LinkedHashMap<String, Map<PrimaryKey, WriteRequest>> container;

Review comment:
       good point, thanks, it is fixed now

##########
File path: flink-connectors/flink-connector-dynamodb/src/test/java/org/apache/flink/streaming/connectors/dynamodb/sink/key/PrimaryKeyTest.java
##########
@@ -0,0 +1,150 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink.key;
+
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+import org.apache.flink.streaming.connectors.dynamodb.sink.InvalidRequestException;
+
+import org.apache.flink.shaded.guava30.com.google.common.collect.ImmutableMap;
+
+import org.junit.Assert;

Review comment:
       changed in all tests

##########
File path: flink-connectors/flink-connector-dynamodb/src/test/java/org/apache/flink/streaming/connectors/dynamodb/sink/TableRequestsContainerTest.java
##########
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+
+import org.apache.flink.shaded.guava30.com.google.common.collect.ImmutableMap;
+
+import org.junit.Test;
+import software.amazon.awssdk.services.dynamodb.model.AttributeValue;
+import software.amazon.awssdk.services.dynamodb.model.PutRequest;
+import software.amazon.awssdk.services.dynamodb.model.WriteRequest;
+
+import static org.junit.Assert.assertEquals;

Review comment:
       changed in all tests




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * df0af668680a0672e293083239809cfec66c572d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331) 
   * 1101c210e2389dc36876faf69d5cd52a77c882a6 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393) 
   * 0c073f2b0cec8b9e8bfda51f408181fce949c287 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] YuriGusev commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
YuriGusev commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r792613054



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/util/AWSDynamoDbUtil.java
##########
@@ -0,0 +1,184 @@
+/*

Review comment:
       I tested with provider in the previous sink implementation. Marking the client field as transient on the Sink helps with the serialisation issue in runtime.
   
   But I will stick with the current approach for consistency and other reasons you mentioned




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] CrynetLogistics commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
CrynetLogistics commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r793485596



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSink.java
##########
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Experimental;
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.api.connector.sink.SinkWriter;
+import org.apache.flink.connector.base.sink.AsyncSinkBase;
+import org.apache.flink.connector.base.sink.writer.ElementConverter;
+import org.apache.flink.core.io.SimpleVersionedSerializer;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Optional;
+import java.util.Properties;
+
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
+/**
+ * A DynamoDB Sink that performs async requests against a destination stream using the buffering
+ * protocol specified in {@link AsyncSinkBase}.
+ *
+ * <p>The sink internally uses a {@link
+ * software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient} to communicate with the AWS
+ * endpoint.
+ *
+ * <p>The behaviour of the buffering may be specified by providing configuration during the sink
+ * build time.
+ *
+ * <ul>
+ *   <li>{@code maxBatchSize}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb.
+ *   <li>{@code maxInFlightRequests}: the maximum number of in flight requests that may exist, if
+ *       any more in flight requests need to be initiated once the maximum has been reached, then it
+ *       will be blocked until some have completed
+ *   <li>{@code maxBufferedRequests}: the maximum number of elements held in the buffer, requests to
+ *       add elements will be blocked while the number of elements in the buffer is at the maximum
+ *   <li>{@code maxBatchSizeInBytes}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb measured in bytes
+ *   <li>{@code maxTimeInBufferMS}: the maximum amount of time an entry is allowed to live in the
+ *       buffer, if any element reaches this age, the entire buffer will be flushed immediately
+ *   <li>{@code maxRecordSizeInBytes}: the maximum size of a record the sink will accept into the
+ *       buffer, a record of size larger than this will be rejected when passed to the sink
+ *   <li>{@code failOnError}: when an exception is encountered while persisting to DynamoDb, the job
+ *       will fail immediately if failOnError is set
+ *   <li>{@code dynamoDbTablesConfig}: if provided for the table, the DynamoDb sink will attempt to
+ *       deduplicate records with the same primary and/or secondary keys in the same batch request.
+ *       Only the latest record with the same combination of key attributes is preserved in the
+ *       request.
+ * </ul>
+ *
+ * <p>Please see the writer implementation in {@link DynamoDbSinkWriter}
+ *
+ * @param <InputT> Type of the elements handled by this sink
+ */
+@PublicEvolving
+public class DynamoDbSink<InputT> extends AsyncSinkBase<InputT, DynamoDbWriteRequest> {
+
+    private final Properties dynamoDbClientProperties;
+    private final DynamoDbTablesConfig dynamoDbTablesConfig;
+    private final boolean failOnError;
+
+    protected DynamoDbSink(
+            ElementConverter<InputT, DynamoDbWriteRequest> elementConverter,
+            int maxBatchSize,
+            int maxInFlightRequests,
+            int maxBufferedRequests,
+            long maxBatchSizeInBytes,
+            long maxTimeInBufferMS,
+            long maxRecordSizeInBytes,
+            boolean failOnError,
+            DynamoDbTablesConfig dynamoDbTablesConfig,
+            Properties dynamoDbClientProperties) {
+        super(
+                elementConverter,
+                maxBatchSize,
+                maxInFlightRequests,
+                maxBufferedRequests,
+                maxBatchSizeInBytes,
+                maxTimeInBufferMS,
+                maxRecordSizeInBytes);
+        checkNotNull(dynamoDbTablesConfig, "Missing dynamoDbTablesConfig");
+        checkNotNull(dynamoDbClientProperties, "Missing dynamoDbClientProperties");
+        this.failOnError = failOnError;
+        this.dynamoDbTablesConfig = dynamoDbTablesConfig;
+        this.dynamoDbClientProperties = dynamoDbClientProperties;
+    }
+
+    /**
+     * Create a {@link DynamoDbSinkBuilder} to construct a new {@link DynamoDbSink}.
+     *
+     * @param <InputT> type of incoming records
+     * @return {@link DynamoDbSinkBuilder}
+     */
+    public static <InputT> DynamoDbSinkBuilder<InputT> builder() {
+        return new DynamoDbSinkBuilder<>();
+    }
+
+    @Experimental

Review comment:
       > Can you please give me a reference to the changes for the elements converter?
   
   Sure, here is the link to the [commit](https://github.com/apache/flink/commit/25ecc0b9202050b340fb4d6fc95b0585a8119937) on the [master branch](https://github.com/apache/flink/commits/master). 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8ec1f57053a8f98ca61b1ff7ad090d789476d45b Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220) 
   * 9c9eec7f108f056b27d417ed0ba12f098f8af714 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320) 
   * df0af668680a0672e293083239809cfec66c572d UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8ec1f57053a8f98ca61b1ff7ad090d789476d45b Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220) 
   * 9c9eec7f108f056b27d417ed0ba12f098f8af714 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320) 
   * df0af668680a0672e293083239809cfec66c572d Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] YuriGusev commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
YuriGusev commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r793703862



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/key/PrimaryKey.java
##########
@@ -0,0 +1,168 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink.key;
+
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+import org.apache.flink.streaming.connectors.dynamodb.sink.InvalidRequestException;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import software.amazon.awssdk.services.dynamodb.model.AttributeValue;
+import software.amazon.awssdk.services.dynamodb.model.WriteRequest;
+
+import javax.annotation.Nullable;
+
+import java.util.Map;
+import java.util.UUID;
+
+/** Represents DynamoDB primary key. */
+public class PrimaryKey {
+
+    private final String partitionKeyValue;
+    @Nullable private final String sortKeyValue;
+
+    private PrimaryKey(String partitionKeyValue) {
+        this.partitionKeyValue = partitionKeyValue;
+        this.sortKeyValue = null;
+    }
+
+    private PrimaryKey(String partitionKeyValue, @Nullable String sortKeyValue) {
+        this.partitionKeyValue = partitionKeyValue;
+        this.sortKeyValue = sortKeyValue;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+
+        PrimaryKey that = (PrimaryKey) o;
+
+        return new EqualsBuilder()
+                .append(partitionKeyValue, that.partitionKeyValue)
+                .append(sortKeyValue, that.sortKeyValue)
+                .isEquals();
+    }
+
+    @Override
+    public int hashCode() {
+        return new HashCodeBuilder(17, 37)
+                .append(partitionKeyValue)
+                .append(sortKeyValue)
+                .toHashCode();
+    }
+
+    @Override
+    public String toString() {
+        return "PrimaryKey{"
+                + "partitionKeyValue='"
+                + partitionKeyValue
+                + '\''
+                + ", sortKeyValue='"
+                + sortKeyValue
+                + '\''
+                + '}';
+    }
+
+    public static PrimaryKey build(DynamoDbTablesConfig.TableConfig config, WriteRequest request) {
+        if (config != null) {
+            Map<String, AttributeValue> requestItems = getRequestItems(request);
+
+            AttributeValue partitionKeyAttributeValue =
+                    requestItems.get(config.getPartitionKeyName());
+            AttributeValue sortKeyAttributeValue = requestItems.get(config.getSortKeyName());
+
+            if (config.getPartitionKeyName() != null && partitionKeyAttributeValue == null) {

Review comment:
       no, you are right, it is mandatory in the config class. Will remove it.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8ec1f57053a8f98ca61b1ff7ad090d789476d45b Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220) 
   * 9c9eec7f108f056b27d417ed0ba12f098f8af714 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320) 
   * df0af668680a0672e293083239809cfec66c572d UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8ec1f57053a8f98ca61b1ff7ad090d789476d45b Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220) 
   * 9c9eec7f108f056b27d417ed0ba12f098f8af714 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * df0af668680a0672e293083239809cfec66c572d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331) 
   * 1101c210e2389dc36876faf69d5cd52a77c882a6 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393) 
   * 0c073f2b0cec8b9e8bfda51f408181fce949c287 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1ed40f830db68d828612207897418a868e6b55f7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476",
       "triggerID" : "1ed40f830db68d828612207897418a868e6b55f7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30498",
       "triggerID" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34130",
       "triggerID" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34133",
       "triggerID" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bb92395129797263b775f9a81e89dbcbab94391b",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "bb92395129797263b775f9a81e89dbcbab94391b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f92d95336aa9111d7cc2c7c47497677ad3e9c2de Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34133) 
   * bb92395129797263b775f9a81e89dbcbab94391b UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] YuriGusev commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
YuriGusev commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r792806733



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSink.java
##########
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Experimental;
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.api.connector.sink.SinkWriter;
+import org.apache.flink.connector.base.sink.AsyncSinkBase;
+import org.apache.flink.connector.base.sink.writer.ElementConverter;
+import org.apache.flink.core.io.SimpleVersionedSerializer;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Optional;
+import java.util.Properties;
+
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
+/**
+ * A DynamoDB Sink that performs async requests against a destination stream using the buffering
+ * protocol specified in {@link AsyncSinkBase}.
+ *
+ * <p>The sink internally uses a {@link
+ * software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient} to communicate with the AWS
+ * endpoint.
+ *
+ * <p>The behaviour of the buffering may be specified by providing configuration during the sink
+ * build time.
+ *
+ * <ul>
+ *   <li>{@code maxBatchSize}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb.
+ *   <li>{@code maxInFlightRequests}: the maximum number of in flight requests that may exist, if
+ *       any more in flight requests need to be initiated once the maximum has been reached, then it
+ *       will be blocked until some have completed
+ *   <li>{@code maxBufferedRequests}: the maximum number of elements held in the buffer, requests to
+ *       add elements will be blocked while the number of elements in the buffer is at the maximum
+ *   <li>{@code maxBatchSizeInBytes}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb measured in bytes
+ *   <li>{@code maxTimeInBufferMS}: the maximum amount of time an entry is allowed to live in the
+ *       buffer, if any element reaches this age, the entire buffer will be flushed immediately
+ *   <li>{@code maxRecordSizeInBytes}: the maximum size of a record the sink will accept into the
+ *       buffer, a record of size larger than this will be rejected when passed to the sink
+ *   <li>{@code failOnError}: when an exception is encountered while persisting to DynamoDb, the job
+ *       will fail immediately if failOnError is set
+ *   <li>{@code dynamoDbTablesConfig}: if provided for the table, the DynamoDb sink will attempt to
+ *       deduplicate records with the same primary and/or secondary keys in the same batch request.
+ *       Only the latest record with the same combination of key attributes is preserved in the
+ *       request.
+ * </ul>
+ *
+ * <p>Please see the writer implementation in {@link DynamoDbSinkWriter}
+ *
+ * @param <InputT> Type of the elements handled by this sink
+ */
+@PublicEvolving
+public class DynamoDbSink<InputT> extends AsyncSinkBase<InputT, DynamoDbWriteRequest> {
+
+    private final Properties dynamoDbClientProperties;
+    private final DynamoDbTablesConfig dynamoDbTablesConfig;
+    private final boolean failOnError;
+
+    protected DynamoDbSink(
+            ElementConverter<InputT, DynamoDbWriteRequest> elementConverter,
+            int maxBatchSize,
+            int maxInFlightRequests,
+            int maxBufferedRequests,
+            long maxBatchSizeInBytes,
+            long maxTimeInBufferMS,
+            long maxRecordSizeInBytes,
+            boolean failOnError,
+            DynamoDbTablesConfig dynamoDbTablesConfig,
+            Properties dynamoDbClientProperties) {
+        super(
+                elementConverter,
+                maxBatchSize,
+                maxInFlightRequests,
+                maxBufferedRequests,
+                maxBatchSizeInBytes,
+                maxTimeInBufferMS,
+                maxRecordSizeInBytes);
+        checkNotNull(dynamoDbTablesConfig, "Missing dynamoDbTablesConfig");
+        checkNotNull(dynamoDbClientProperties, "Missing dynamoDbClientProperties");
+        this.failOnError = failOnError;
+        this.dynamoDbTablesConfig = dynamoDbTablesConfig;
+        this.dynamoDbClientProperties = dynamoDbClientProperties;
+    }
+
+    /**
+     * Create a {@link DynamoDbSinkBuilder} to construct a new {@link DynamoDbSink}.
+     *
+     * @param <InputT> type of incoming records
+     * @return {@link DynamoDbSinkBuilder}
+     */
+    public static <InputT> DynamoDbSinkBuilder<InputT> builder() {
+        return new DynamoDbSinkBuilder<>();
+    }
+
+    @Experimental

Review comment:
       Thank you @CrynetLogistics for the review. I wasn't sure about the documentation that is published on the website. I'll read up about the process and add it in this PR if possible




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8ec1f57053a8f98ca61b1ff7ad090d789476d45b Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220) 
   * 9c9eec7f108f056b27d417ed0ba12f098f8af714 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320) 
   * df0af668680a0672e293083239809cfec66c572d UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] YuriGusev commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
YuriGusev commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r792613054



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/util/AWSDynamoDbUtil.java
##########
@@ -0,0 +1,184 @@
+/*

Review comment:
       I tested with provider in the previous sink implementation, I pass the provider to the constructor and then retrieve client when constructing the writer itself, then serialization issue is not there in runtime.
   
   But I will stick with the current approach for consistency and other reasons you mentioned




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9c9eec7f108f056b27d417ed0ba12f098f8af714 Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320) 
   * df0af668680a0672e293083239809cfec66c572d Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] YuriGusev commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
YuriGusev commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r793707917



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSinkWriter.java
##########
@@ -0,0 +1,162 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.api.connector.sink.Sink;
+import org.apache.flink.connector.base.sink.writer.AsyncSinkWriter;
+import org.apache.flink.connector.base.sink.writer.ElementConverter;
+import org.apache.flink.metrics.Counter;
+import org.apache.flink.metrics.groups.SinkWriterMetricGroup;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+import org.apache.flink.streaming.connectors.dynamodb.util.AWSDynamoDbUtil;
+import org.apache.flink.streaming.connectors.dynamodb.util.DynamoDbExceptionUtils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient;
+import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemRequest;
+import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemResponse;
+import software.amazon.awssdk.services.dynamodb.model.WriteRequest;
+
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.CompletableFuture;
+import java.util.function.Consumer;
+
+/**
+ * TODO.

Review comment:
       oh missed that :( thanks a lot! :)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8ec1f57053a8f98ca61b1ff7ad090d789476d45b Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220) 
   * 9c9eec7f108f056b27d417ed0ba12f098f8af714 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] YuriGusev commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
YuriGusev commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r793884623



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSink.java
##########
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Experimental;
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.api.connector.sink.SinkWriter;
+import org.apache.flink.connector.base.sink.AsyncSinkBase;
+import org.apache.flink.connector.base.sink.writer.ElementConverter;
+import org.apache.flink.core.io.SimpleVersionedSerializer;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Optional;
+import java.util.Properties;
+
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
+/**
+ * A DynamoDB Sink that performs async requests against a destination stream using the buffering
+ * protocol specified in {@link AsyncSinkBase}.
+ *
+ * <p>The sink internally uses a {@link
+ * software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient} to communicate with the AWS
+ * endpoint.
+ *
+ * <p>The behaviour of the buffering may be specified by providing configuration during the sink
+ * build time.
+ *
+ * <ul>
+ *   <li>{@code maxBatchSize}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb.
+ *   <li>{@code maxInFlightRequests}: the maximum number of in flight requests that may exist, if
+ *       any more in flight requests need to be initiated once the maximum has been reached, then it
+ *       will be blocked until some have completed
+ *   <li>{@code maxBufferedRequests}: the maximum number of elements held in the buffer, requests to
+ *       add elements will be blocked while the number of elements in the buffer is at the maximum
+ *   <li>{@code maxBatchSizeInBytes}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb measured in bytes
+ *   <li>{@code maxTimeInBufferMS}: the maximum amount of time an entry is allowed to live in the
+ *       buffer, if any element reaches this age, the entire buffer will be flushed immediately
+ *   <li>{@code maxRecordSizeInBytes}: the maximum size of a record the sink will accept into the
+ *       buffer, a record of size larger than this will be rejected when passed to the sink
+ *   <li>{@code failOnError}: when an exception is encountered while persisting to DynamoDb, the job
+ *       will fail immediately if failOnError is set
+ *   <li>{@code dynamoDbTablesConfig}: if provided for the table, the DynamoDb sink will attempt to
+ *       deduplicate records with the same primary and/or secondary keys in the same batch request.
+ *       Only the latest record with the same combination of key attributes is preserved in the
+ *       request.
+ * </ul>
+ *
+ * <p>Please see the writer implementation in {@link DynamoDbSinkWriter}
+ *
+ * @param <InputT> Type of the elements handled by this sink
+ */
+@PublicEvolving
+public class DynamoDbSink<InputT> extends AsyncSinkBase<InputT, DynamoDbWriteRequest> {
+
+    private final Properties dynamoDbClientProperties;
+    private final DynamoDbTablesConfig dynamoDbTablesConfig;
+    private final boolean failOnError;
+
+    protected DynamoDbSink(
+            ElementConverter<InputT, DynamoDbWriteRequest> elementConverter,
+            int maxBatchSize,
+            int maxInFlightRequests,
+            int maxBufferedRequests,
+            long maxBatchSizeInBytes,
+            long maxTimeInBufferMS,
+            long maxRecordSizeInBytes,
+            boolean failOnError,
+            DynamoDbTablesConfig dynamoDbTablesConfig,
+            Properties dynamoDbClientProperties) {
+        super(
+                elementConverter,
+                maxBatchSize,
+                maxInFlightRequests,
+                maxBufferedRequests,
+                maxBatchSizeInBytes,
+                maxTimeInBufferMS,
+                maxRecordSizeInBytes);
+        checkNotNull(dynamoDbTablesConfig, "Missing dynamoDbTablesConfig");
+        checkNotNull(dynamoDbClientProperties, "Missing dynamoDbClientProperties");
+        this.failOnError = failOnError;
+        this.dynamoDbTablesConfig = dynamoDbTablesConfig;
+        this.dynamoDbClientProperties = dynamoDbClientProperties;
+    }
+
+    /**
+     * Create a {@link DynamoDbSinkBuilder} to construct a new {@link DynamoDbSink}.
+     *
+     * @param <InputT> type of incoming records
+     * @return {@link DynamoDbSinkBuilder}
+     */
+    public static <InputT> DynamoDbSinkBuilder<InputT> builder() {
+        return new DynamoDbSinkBuilder<>();
+    }
+
+    @Experimental

Review comment:
       FYI added https://issues.apache.org/jira/browse/FLINK-25859 for documentation




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1ed40f830db68d828612207897418a868e6b55f7",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "1ed40f830db68d828612207897418a868e6b55f7",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 0c073f2b0cec8b9e8bfda51f408181fce949c287 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404) 
   * 1ed40f830db68d828612207897418a868e6b55f7 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] nirtsruya commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
nirtsruya commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r831891182



##########
File path: flink-connectors/flink-connector-dynamodb/src/main/java/org/apache/flink/streaming/connectors/dynamodb/sink/DynamoDbSink.java
##########
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.connectors.dynamodb.sink;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.api.connector.sink.SinkWriter;
+import org.apache.flink.connector.base.sink.AsyncSinkBase;
+import org.apache.flink.connector.base.sink.writer.ElementConverter;
+import org.apache.flink.core.io.SimpleVersionedSerializer;
+import org.apache.flink.streaming.connectors.dynamodb.config.DynamoDbTablesConfig;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Optional;
+import java.util.Properties;
+
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
+/**
+ * A DynamoDB Sink that performs async requests against a destination stream using the buffering
+ * protocol specified in {@link AsyncSinkBase}.
+ *
+ * <p>The sink internally uses a {@link
+ * software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient} to communicate with the AWS
+ * endpoint.
+ *
+ * <p>The behaviour of the buffering may be specified by providing configuration during the sink
+ * build time.
+ *
+ * <ul>
+ *   <li>{@code maxBatchSize}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb.
+ *   <li>{@code maxInFlightRequests}: the maximum number of in flight requests that may exist, if
+ *       any more in flight requests need to be initiated once the maximum has been reached, then it
+ *       will be blocked until some have completed
+ *   <li>{@code maxBufferedRequests}: the maximum number of elements held in the buffer, requests to
+ *       add elements will be blocked while the number of elements in the buffer is at the maximum
+ *   <li>{@code maxBatchSizeInBytes}: the maximum size of a batch of entries that may be written to
+ *       DynamoDb measured in bytes
+ *   <li>{@code maxTimeInBufferMS}: the maximum amount of time an entry is allowed to live in the
+ *       buffer, if any element reaches this age, the entire buffer will be flushed immediately
+ *   <li>{@code maxRecordSizeInBytes}: the maximum size of a record the sink will accept into the
+ *       buffer, a record of size larger than this will be rejected when passed to the sink
+ *   <li>{@code failOnError}: when an exception is encountered while persisting to DynamoDb, the job
+ *       will fail immediately if failOnError is set
+ *   <li>{@code dynamoDbTablesConfig}: if provided for the table, the DynamoDb sink will attempt to
+ *       deduplicate records with the same primary and/or secondary keys in the same batch request.
+ *       Only the latest record with the same combination of key attributes is preserved in the
+ *       request.
+ * </ul>
+ *
+ * <p>Please see the writer implementation in {@link DynamoDbSinkWriter}
+ *
+ * @param <InputT> Type of the elements handled by this sink
+ */
+@PublicEvolving
+public class DynamoDbSink<InputT> extends AsyncSinkBase<InputT, DynamoDbWriteRequest> {

Review comment:
       @almogtavor for example [KinesisStreamsSink](https://github.com/apache/flink/blob/master/flink-connectors/flink-connector-aws-kinesis-streams/src/main/java/org/apache/flink/connector/kinesis/sink/KinesisStreamsSink.java#L67)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] YuriGusev commented on a change in pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
YuriGusev commented on a change in pull request #18518:
URL: https://github.com/apache/flink/pull/18518#discussion_r840813533



##########
File path: flink-connectors/flink-connector-dynamodb/pom.xml
##########
@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<parent>
+		<groupId>org.apache.flink</groupId>
+		<artifactId>flink-connectors</artifactId>
+		<version>1.15-SNAPSHOT</version>

Review comment:
       rebased on the latest master




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1ed40f830db68d828612207897418a868e6b55f7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476",
       "triggerID" : "1ed40f830db68d828612207897418a868e6b55f7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30498",
       "triggerID" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * bce4406f01127a6956ef00592014e9c5b9d00aa4 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30498) 
   * 63f13beab12bbeec3e7a03751ca2943dacb41c12 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1ed40f830db68d828612207897418a868e6b55f7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476",
       "triggerID" : "1ed40f830db68d828612207897418a868e6b55f7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30498",
       "triggerID" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34130",
       "triggerID" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 63f13beab12bbeec3e7a03751ca2943dacb41c12 Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34130) 
   * f92d95336aa9111d7cc2c7c47497677ad3e9c2de UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1ed40f830db68d828612207897418a868e6b55f7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476",
       "triggerID" : "1ed40f830db68d828612207897418a868e6b55f7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30498",
       "triggerID" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34130",
       "triggerID" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34133",
       "triggerID" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bb92395129797263b775f9a81e89dbcbab94391b",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34135",
       "triggerID" : "bb92395129797263b775f9a81e89dbcbab94391b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f92d95336aa9111d7cc2c7c47497677ad3e9c2de Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34133) 
   * bb92395129797263b775f9a81e89dbcbab94391b Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34135) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1ed40f830db68d828612207897418a868e6b55f7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476",
       "triggerID" : "1ed40f830db68d828612207897418a868e6b55f7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30498",
       "triggerID" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34130",
       "triggerID" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 63f13beab12bbeec3e7a03751ca2943dacb41c12 Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34130) 
   * f92d95336aa9111d7cc2c7c47497677ad3e9c2de UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #18518: [FLINK-24229][connectors/dynamodb] Added DynamoDB connector

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18518:
URL: https://github.com/apache/flink/pull/18518#issuecomment-1022043829


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30220",
       "triggerID" : "8ec1f57053a8f98ca61b1ff7ad090d789476d45b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30320",
       "triggerID" : "9c9eec7f108f056b27d417ed0ba12f098f8af714",
       "triggerType" : "PUSH"
     }, {
       "hash" : "df0af668680a0672e293083239809cfec66c572d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30331",
       "triggerID" : "df0af668680a0672e293083239809cfec66c572d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30393",
       "triggerID" : "1101c210e2389dc36876faf69d5cd52a77c882a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30404",
       "triggerID" : "0c073f2b0cec8b9e8bfda51f408181fce949c287",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1ed40f830db68d828612207897418a868e6b55f7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30476",
       "triggerID" : "1ed40f830db68d828612207897418a868e6b55f7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=30498",
       "triggerID" : "bce4406f01127a6956ef00592014e9c5b9d00aa4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34130",
       "triggerID" : "63f13beab12bbeec3e7a03751ca2943dacb41c12",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34133",
       "triggerID" : "f92d95336aa9111d7cc2c7c47497677ad3e9c2de",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bb92395129797263b775f9a81e89dbcbab94391b",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34135",
       "triggerID" : "bb92395129797263b775f9a81e89dbcbab94391b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdfc807c14de7b1dfcc6776547373b863b4aa545",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34165",
       "triggerID" : "bdfc807c14de7b1dfcc6776547373b863b4aa545",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * bb92395129797263b775f9a81e89dbcbab94391b Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34135) 
   * bdfc807c14de7b1dfcc6776547373b863b4aa545 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=34165) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org