From 5cd9770e150b74f0b5cd79a7812c531dd7b30e4d Mon Sep 17 00:00:00 2001 From: Julien Richard-Foy Date: Fri, 30 Aug 2024 14:59:28 +0200 Subject: [PATCH] Remove our custom credentials provider It is not needed now that `emr-dynamodb-connector` defaults to the same credentials provider (see awslabs/emr-dynamodb-connector#203 and scylladb/emr-dynamodb-connector#9). --- .../com/scylladb/migrator/DynamoUtils.scala | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/migrator/src/main/scala/com/scylladb/migrator/DynamoUtils.scala b/migrator/src/main/scala/com/scylladb/migrator/DynamoUtils.scala index a412020..424bc11 100644 --- a/migrator/src/main/scala/com/scylladb/migrator/DynamoUtils.scala +++ b/migrator/src/main/scala/com/scylladb/migrator/DynamoUtils.scala @@ -8,11 +8,7 @@ import org.apache.hadoop.dynamodb.write.DynamoDBOutputFormat import org.apache.hadoop.dynamodb.{ DynamoDBConstants, DynamoDbClientBuilderTransformer } import org.apache.hadoop.mapred.JobConf import org.apache.log4j.LogManager -import software.amazon.awssdk.auth.credentials.{ - AwsCredentials, - AwsCredentialsProvider, - ProfileCredentialsProvider -} +import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider import software.amazon.awssdk.services.dynamodb.{ DynamoDbClient, DynamoDbClientBuilder } import software.amazon.awssdk.services.dynamodb.model.{ BillingMode, @@ -243,9 +239,6 @@ object DynamoUtils { DynamoDBConstants.CUSTOM_CLIENT_BUILDER_TRANSFORMER, classOf[AlternatorLoadBalancingEnabler].getName) - jobConf.set( - DynamoDBConstants.CUSTOM_CREDENTIALS_PROVIDER_CONF, - classOf[ProfileCredentialsProvider].getName) jobConf.set("mapred.output.format.class", classOf[DynamoDBOutputFormat].getName) jobConf.set("mapred.input.format.class", classOf[DynamoDBInputFormat].getName) } @@ -278,13 +271,6 @@ object DynamoUtils { DynamoDBConstants.DEFAULT_CAPACITY_FOR_ON_DEMAND } - /** Reflection-friendly credentials provider used by the EMR DynamoDB connector */ - class ProfileCredentialsProvider - extends software.amazon.awssdk.auth.credentials.AwsCredentialsProvider { - private lazy val delegate = ProfileCredentialsProvider.create() - def resolveCredentials(): AwsCredentials = delegate.resolveCredentials() - } - class AlternatorLoadBalancingEnabler extends DynamoDbClientBuilderTransformer with Configurable { private var conf: Configuration = null