rishabhdaim commented on code in PR #2558:
URL: https://github.com/apache/jackrabbit-oak/pull/2558#discussion_r2416516087
##########
oak-blob-cloud/src/main/java/org/apache/jackrabbit/oak/blob/cloud/s3/S3Backend.java:
##########
@@ -236,18 +223,17 @@ public void init() throws DataStoreException {
}
String enablePresignedAccelerationStr =
properties.getProperty(S3Constants.PRESIGNED_URI_ENABLE_ACCELERATION);
-
setBinaryTransferAccelerationEnabled(enablePresignedAccelerationStr != null &&
"true".equals(enablePresignedAccelerationStr));
+
setBinaryTransferAccelerationEnabled("true".equals(enablePresignedAccelerationStr));
Review Comment:
Had to re-look, this it is not possible we because we an `s3Client` to
verify whether `accelerate` is enabled on this `bucket` or not.
If enabled, only then can we start creating accelerated presigned URLs.
```
void setBinaryTransferAccelerationEnabled(boolean enabled) {
if (enabled) {
// verify acceleration is enabled on the bucket
GetBucketAccelerateConfigurationResponse accelerateConfig =
s3Client.getBucketAccelerateConfiguration(b -> b.bucket(bucket).build());
if (Objects.equals(BucketAccelerateStatus.ENABLED,
accelerateConfig.status())) {
// If transfer acceleration is enabled for presigned URIs,
we need a separate AmazonS3Client
// instance with the acceleration mode enabled, because we
don't want the requests from the
// data store itself to S3 to use acceleration
s3PresignService =
Utils.createPresigner(Utils.openService(properties, true), properties);
LOG.info("S3 Transfer Acceleration enabled for presigned
URIs.");
} else {
LOG.warn("S3 Transfer Acceleration is not enabled on the
bucket {}. Will create normal, non-accelerated presigned URIs. To enable set
{}",
bucket, S3Constants.PRESIGNED_URI_ENABLE_ACCELERATION);
}
} else {
s3PresignService = Utils.createPresigner(s3Client, properties);
}
}
```
--
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]