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

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

                Author: ASF GitHub Bot
            Created on: 02/Jul/19 20:55
            Start Date: 02/Jul/19 20:55
    Worklog Time Spent: 10m 
      Work Description: iemejia commented on pull request #8987: [BEAM-7557] - 
Migrate DynamoDBIO to AWS SDK for Java 2
URL: https://github.com/apache/beam/pull/8987#discussion_r299648891
 
 

 ##########
 File path: 
sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/dynamodb/BasicDynamoDbProvider.java
 ##########
 @@ -0,0 +1,82 @@
+/*
+ * 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.aws2.dynamodb;
+
+import static 
org.apache.beam.vendor.guava.v20_0.com.google.common.base.Preconditions.checkArgument;
+
+import java.net.URI;
+import javax.annotation.Nullable;
+import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
+import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
+import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
+import software.amazon.awssdk.regions.Region;
+import software.amazon.awssdk.services.cloudwatch.CloudWatchClient;
+import software.amazon.awssdk.services.cloudwatch.CloudWatchClientBuilder;
+import software.amazon.awssdk.services.dynamodb.DynamoDbClient;
+import software.amazon.awssdk.services.dynamodb.DynamoDbClientBuilder;
+
+/** Basic implementation of {@link AwsClientsProvider} used by default in 
{@link DynamoDBIO}. */
+public class BasicDynamoDbProvider implements AwsClientsProvider {
+  private final String accessKey;
+  private final String secretKey;
+  private final String region;
+  @Nullable private final String serviceEndpoint;
+
+  BasicDynamoDbProvider(
+      String accessKey, String secretKey, String region, @Nullable String 
serviceEndpoint) {
+    checkArgument(accessKey != null, "accessKey can not be null");
+    checkArgument(secretKey != null, "secretKey can not be null");
+    checkArgument(region != null, "region can not be null");
+    this.accessKey = accessKey;
+    this.secretKey = secretKey;
+    this.region = region;
+    this.serviceEndpoint = serviceEndpoint;
+  }
+
+  private AwsCredentialsProvider getCredentialsProvider() {
 
 Review comment:
   remove since this will be in the attribute 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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

    Worklog Id:     (was: 271205)
    Time Spent: 0.5h  (was: 20m)

> Migrate DynamoDBIO to AWS SDK for Java 2
> ----------------------------------------
>
>                 Key: BEAM-7557
>                 URL: https://issues.apache.org/jira/browse/BEAM-7557
>             Project: Beam
>          Issue Type: Sub-task
>          Components: io-java-aws
>            Reporter: Ismaël Mejía
>            Assignee: Cam Mach
>            Priority: Minor
>              Labels: backward-incompatible
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> DynamoDBIO uses the old style API ScanRequestAPI, translating into the 
> ScanSpec
>  API can bring us improvements because we can eventually align Scans and 
> Querys
>  in the DynamoDBIO API. Also this is needed for migration to AWS SDK for Java 
> 2.x.
>  We should use for this the new ScanSpec API.



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

Reply via email to