yihua commented on code in PR #11728:
URL: https://github.com/apache/hudi/pull/11728#discussion_r1706047761
##########
hudi-aws/src/main/java/org/apache/hudi/aws/transaction/lock/DynamoDBBasedLockProviderBase.java:
##########
@@ -78,16 +78,15 @@ public abstract class DynamoDBBasedLockProviderBase
implements LockProvider<Lock
protected volatile LockItem lock;
protected DynamoDBBasedLockProviderBase(final LockConfiguration
lockConfiguration, final StorageConfiguration<?> conf, DynamoDbClient dynamoDB)
{
- if (dynamoDB == null) {
- dynamoDB = getDynamoDBClient();
- }
this.dynamoDbBasedLockConfig = new DynamoDbBasedLockConfig.Builder()
.fromProperties(lockConfiguration.getConfig())
.build();
this.tableName =
dynamoDbBasedLockConfig.getString(DynamoDbBasedLockConfig.DYNAMODB_LOCK_TABLE_NAME);
long leaseDuration =
dynamoDbBasedLockConfig.getInt(DynamoDbBasedLockConfig.LOCK_ACQUIRE_WAIT_TIMEOUT_MS_PROP_KEY);
dynamoDBPartitionKey = getDynamoDBPartitionKey(lockConfiguration);
-
+ if (dynamoDB == null) {
+ dynamoDB = getDynamoDBClient();
Review Comment:
Could we make `#getDynamoDBClient` static to take `dynamoDbBasedLockConfig`
so the dependency is clear and there is no confusion in the future?
--
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]