joerghoh commented on code in PR #2621:
URL: https://github.com/apache/jackrabbit-oak/pull/2621#discussion_r2556973037
##########
oak-blob-cloud/src/main/java/org/apache/jackrabbit/oak/blob/cloud/s3/S3Backend.java:
##########
@@ -513,12 +516,55 @@ public void addMetadataRecord(final InputStream input,
final String name) throws
final ExecutorService executor = Executors.newSingleThreadExecutor();
try {
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
+ final PutObjectRequest.Builder putObjectRequestBuilder =
PutObjectRequest.builder()
+ .bucket(bucket)
+ .contentType("application/octet-stream")
+ .key(addMetaKeyPrefix(name));
+
// Specify `null` for the content length when you don't know the
content length.
- final AsyncRequestBody body =
AsyncRequestBody.fromInputStream(input, null, executor);
+ final AsyncRequestBody body;
+ if (Objects.equals(RemoteStorageMode.S3,
properties.get(S3Constants.MODE))) {
+ body = AsyncRequestBody.fromInputStream(input, null, executor);
+ } else {
Review Comment:
Can you refactor that code into a dedicated method? Having all of these
different cases inline makes the method very long and also harder to understand
and test.
--
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]