[ 
https://issues.apache.org/jira/browse/BEAM-7043?focusedWorklogId=232837&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-232837
 ]

ASF GitHub Bot logged work on BEAM-7043:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 25/Apr/19 13:04
            Start Date: 25/Apr/19 13:04
    Worklog Time Spent: 10m 
      Work Description: iemejia commented on pull request #8390:  [BEAM-7043] 
Add DynamoDBIO
URL: https://github.com/apache/beam/pull/8390#discussion_r278510690
 
 

 ##########
 File path: 
sdks/java/io/amazon-web-services/src/main/java/org/apache/beam/sdk/io/aws/dynamodb/AttributeValueCoder.java
 ##########
 @@ -0,0 +1,179 @@
+/*
+ * 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.beam.sdk.io.aws.dynamodb;
+
+import com.amazonaws.services.dynamodbv2.model.AttributeValue;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Serializable;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.beam.sdk.coders.AtomicCoder;
+import org.apache.beam.sdk.coders.BooleanCoder;
+import org.apache.beam.sdk.coders.ByteArrayCoder;
+import org.apache.beam.sdk.coders.CoderException;
+import org.apache.beam.sdk.coders.ListCoder;
+import org.apache.beam.sdk.coders.MapCoder;
+import org.apache.beam.sdk.coders.StringUtf8Coder;
+
+/** Provide a mechanism to encode and decode AttributeValue object. */
+public class AttributeValueCoder extends AtomicCoder<AttributeValue> 
implements Serializable {
+
+  /** Data type of each value type in AttributeValue object. */
+  private enum AttributeValueType {
+    s, // for String
+    n, // for Number
+    b, // for Byte
+    sS, // for List of String
+    nS, // for List of Number
+    bS, // for List of Byte
+    m, // for Map of String and AttributeValue
+    l, // for list of AttributeValued
+    bOOL, // for Boolean
+    nULLValue, // for null
+  };
+
+  private static final AttributeValueCoder INSTANCE = new 
AttributeValueCoder();
+
+  private static final StringUtf8Coder STRING_CODER = StringUtf8Coder.of();
 
 Review comment:
   nit:: These are already singletons in their clases so use the inlined 
version to not have this private static methods. So in other words, just use 
e.g. `StringUtf8Coder.of().encode()` in the code.
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 232837)

> Add DynamoDBIO
> --------------
>
>                 Key: BEAM-7043
>                 URL: https://issues.apache.org/jira/browse/BEAM-7043
>             Project: Beam
>          Issue Type: New Feature
>          Components: io-java-aws
>            Reporter: Cam Mach
>            Assignee: Cam Mach
>            Priority: Minor
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> Currently we don't have any feature to write data to AWS DynamoDB. This 
> feature will enable us to send data to DynamoDB



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to