[HUDI-3736] Fix null pointer when key not specified (#5167)
This commit is contained in:
@@ -156,9 +156,9 @@ public class DynamoDBBasedLockProvider implements LockProvider<LockItem> {
|
|||||||
|
|
||||||
private AmazonDynamoDB getDynamoDBClient() {
|
private AmazonDynamoDB getDynamoDBClient() {
|
||||||
String region = this.lockConfiguration.getConfig().getString(DynamoDbBasedLockConfig.DYNAMODB_LOCK_REGION.key());
|
String region = this.lockConfiguration.getConfig().getString(DynamoDbBasedLockConfig.DYNAMODB_LOCK_REGION.key());
|
||||||
String endpointURL = this.lockConfiguration.getConfig().getString(DynamoDbBasedLockConfig.DYNAMODB_ENDPOINT_URL.key()) == null
|
String endpointURL = this.lockConfiguration.getConfig().containsKey(DynamoDbBasedLockConfig.DYNAMODB_ENDPOINT_URL.key())
|
||||||
? RegionUtils.getRegion(region).getServiceEndpoint(AmazonDynamoDB.ENDPOINT_PREFIX)
|
? this.lockConfiguration.getConfig().getString(DynamoDbBasedLockConfig.DYNAMODB_ENDPOINT_URL.key())
|
||||||
: this.lockConfiguration.getConfig().getString(DynamoDbBasedLockConfig.DYNAMODB_ENDPOINT_URL.key());
|
: RegionUtils.getRegion(region).getServiceEndpoint(AmazonDynamoDB.ENDPOINT_PREFIX);
|
||||||
AwsClientBuilder.EndpointConfiguration dynamodbEndpoint =
|
AwsClientBuilder.EndpointConfiguration dynamodbEndpoint =
|
||||||
new AwsClientBuilder.EndpointConfiguration(endpointURL, region);
|
new AwsClientBuilder.EndpointConfiguration(endpointURL, region);
|
||||||
return AmazonDynamoDBClientBuilder.standard()
|
return AmazonDynamoDBClientBuilder.standard()
|
||||||
|
|||||||
Reference in New Issue
Block a user