dannycranmer commented on code in PR #26:
URL: 
https://github.com/apache/flink-connector-aws/pull/26#discussion_r1029848582


##########
docs/content.zh/docs/connectors/datastream/dynamodb.md:
##########
@@ -0,0 +1,170 @@
+---
+title: DynamoDB
+weight: 5
+type: docs
+---
+<!--
+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.
+-->
+
+# Amazon DynamoDB Sink
+
+The DynamoDB sink writes to [Amazon DynamoDB](https://aws.amazon.com/dynamodb) 
using the [AWS v2 SDK for 
Java](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/home.html).
+
+Follow the instructions from the [Amazon DynamoDB Developer 
Guide](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/getting-started-step-1.html)
+to setup a table.
+
+To use the connector, add the following Maven dependency to your project:
+
+{{< artifact flink-connector-dynamodb >}}
+
+{{< tabs "ec24a4ae-6a47-11ed-a1eb-0242ac120002" >}}
+{{< tab "Java" >}}
+```java
+Properties sinkProperties = new Properties();
+// Required
+        sinkProperties.put(AWSConfigConstants.AWS_REGION, "eu-west-1");
+// Optional, provide via alternative routes e.g. environment variables
+        sinkProperties.put(AWSConfigConstants.AWS_ACCESS_KEY_ID, 
"aws_access_key_id");
+        sinkProperties.put(AWSConfigConstants.AWS_SECRET_ACCESS_KEY, 
"aws_secret_access_key");
+
+        ElementConverter<InputType, DynamoDbWriteRequest> elementConverter = 
new CustomElementConverter();
+
+        DynamoDbSink<String> dynamoDbSink =
+        DynamoDbSink.<InputType>builder()
+        .setDynamoDbProperties(sinkProperties)              // Required
+        .setTableName("my-dynamodb-table")                  // Required
+        .setElementConverter(elementConverter)              // Required
+        .setOverwriteByPartitionKeys(singletonList("key"))  // Optional  
+        .setFailOnError(false)                              // Optional
+        .setMaxBatchSize(25)                                // Optional
+        .setMaxInFlightRequests(50)                         // Optional
+        .setMaxBufferedRequests(10_000)                     // Optional
+        .setMaxTimeInBufferMS(5000)                         // Optional
+        .build();
+
+        flinkStream.sinkTo(dynamoDbSink);
+```
+{{< /tab >}}
+{{< tab "Scala" >}}
+```scala
+Properties sinkProperties = new Properties()
+// Required
+sinkProperties.put(AWSConfigConstants.AWS_REGION, "eu-west-1")
+// Optional, provide via alternative routes e.g. environment variables
+sinkProperties.put(AWSConfigConstants.AWS_ACCESS_KEY_ID, "aws_access_key_id")
+sinkProperties.put(AWSConfigConstants.AWS_SECRET_ACCESS_KEY, 
"aws_secret_access_key")
+
+val elementConverter = new CustomElementConverter();
+
+val dynamoDbSink =
+   DynamoDbSink.<InputType>builder()
+           .setDynamoDbProperties(sinkProperties)              // Required
+           .setTableName("my-dynamodb-table")                  // Required
+           .setElementConverter(elementConverter)              // Required
+           .setOverwriteByPartitionKeys(singletonList("key"))  // Optional    
+           .setFailOnError(false)                              // Optional
+           .setMaxBatchSize(25)                                // Optional
+           .setMaxInFlightRequests(50)                         // Optional
+           .setMaxBufferedRequests(10_000)                     // Optional
+           .setMaxTimeInBufferMS(5000)                         // Optional
+           .build()
+
+flinkStream.sinkTo(dynamoDbSink)
+```
+{{< /tab >}}
+{{< /tabs >}}
+
+## Configurations
+
+Flink's DynamoDB sink is created by using the static builder 
`DynamoDBSink.<InputType>builder()`.
+
+1. __setDynamoDbProperties(Properties sinkProperties)__
+   * Required.
+   * Supplies credentials, region and other parameters to the DynamoDB client.
+2. __setTableName(String tableName)__
+   * Required.
+   * Name of the table to sink to.
+3. __setElementConverter(ElementConverter<InputType, DynamoDbWriteRequest> 
elementConverter)__
+   * Required.
+   * Converts generic records of type `InputType` to `DynamoDbWriteRequest`.
+4. __setOverwriteByPartitionKeys(List<String> partitionKeys)__

Review Comment:
   Thanks



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to