Skip to content

Commit

Permalink
Remove our custom credentials provider
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
julienrf committed Aug 30, 2024
1 parent 9253872 commit 8b251cc
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions migrator/src/main/scala/com/scylladb/migrator/DynamoUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 8b251cc

Please sign in to comment.