Skip to content

Commit 5cfeb6e

Browse files
committed
SpotlessApply post Conflict resolution
1 parent 7a7e240 commit 5cfeb6e

File tree

3 files changed

+70
-56
lines changed

3 files changed

+70
-56
lines changed

plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3BlobContainer.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,10 @@ public void asyncBlobUploadConditionally(
233233
writeContext.getExpectedChecksum(),
234234
blobStore.isUploadRetryEnabled(),
235235
writeContext.getMetadata(),
236-
options,
236+
options,
237237
blobStore.serverSideEncryptionType(),
238238
blobStore.serverSideEncryptionKmsKey(),
239-
blobStore.serverSideEncryptionBucketKey(),
239+
blobStore.serverSideEncryptionBucketKey(),
240240
blobStore.serverSideEncryptionEncryptionContext(),
241241
blobStore.expectedBucketOwner()
242242
);
@@ -338,21 +338,21 @@ public void asyncBlobUploadConditionally(
338338
@Override
339339
public void asyncBlobUpload(WriteContext writeContext, ActionListener<Void> completionListener) throws IOException {
340340
UploadRequest uploadRequest = new UploadRequest(
341-
blobStore.bucket(),
342-
buildKey(writeContext.getFileName()),
343-
writeContext.getFileSize(),
344-
writeContext.getWritePriority(),
345-
writeContext.getUploadFinalizer(),
346-
writeContext.doRemoteDataIntegrityCheck(),
347-
writeContext.getExpectedChecksum(),
348-
blobStore.isUploadRetryEnabled(),
349-
writeContext.getMetadata(),
350-
null,
351-
blobStore.serverSideEncryptionType(),
352-
blobStore.serverSideEncryptionKmsKey(),
353-
blobStore.serverSideEncryptionBucketKey(),
354-
blobStore.serverSideEncryptionEncryptionContext(),
355-
blobStore.expectedBucketOwner()
341+
blobStore.bucket(),
342+
buildKey(writeContext.getFileName()),
343+
writeContext.getFileSize(),
344+
writeContext.getWritePriority(),
345+
writeContext.getUploadFinalizer(),
346+
writeContext.doRemoteDataIntegrityCheck(),
347+
writeContext.getExpectedChecksum(),
348+
blobStore.isUploadRetryEnabled(),
349+
writeContext.getMetadata(),
350+
null,
351+
blobStore.serverSideEncryptionType(),
352+
blobStore.serverSideEncryptionKmsKey(),
353+
blobStore.serverSideEncryptionBucketKey(),
354+
blobStore.serverSideEncryptionEncryptionContext(),
355+
blobStore.expectedBucketOwner()
356356
);
357357
try {
358358
// If file size is greater than the queue capacity than SizeBasedBlockingQ will always reject the upload.

plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/async/UploadRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,4 @@ public String getServerSideEncryptionEncryptionContext() {
154154
public String getExpectedBucketOwner() {
155155
return expectedBucketOwner;
156156
}
157-
}
157+
}

plugins/repository-s3/src/test/java/org/opensearch/repositories/s3/async/AsyncTransferManagerTests.java

Lines changed: 52 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,9 @@ public void testOneChunkUpload() {
9999
CompletableFuture<Void> resultFuture = asyncTransferManager.uploadObject(
100100
s3AsyncClient,
101101
new UploadRequest("bucket", "key", ByteSizeUnit.MB.toBytes(1), WritePriority.HIGH, uploadSuccess -> {
102-
103-
}, false, null, true, metadata, null , ServerSideEncryption.AWS_KMS.toString(), randomAlphaOfLength(10), true, null, null),
104102

105-
103+
}, false, null, true, metadata, null, ServerSideEncryption.AWS_KMS.toString(), randomAlphaOfLength(10), true, null, null),
104+
106105
new StreamContext((partIdx, partSize, position) -> {
107106
streamRef.set(new ZeroInputStream(partSize));
108107
return new InputStreamContainer(streamRef.get(), partSize, position);
@@ -146,11 +145,26 @@ public void testOneChunkUploadCorruption() {
146145
Map<String, String> metadata = new HashMap<>();
147146
metadata.put("key1", "value1");
148147
metadata.put("key2", "value2");
149-
148+
150149
CompletableFuture<Void> resultFuture = asyncTransferManager.uploadObject(
151150
s3AsyncClient,
152-
new UploadRequest("bucket", "key", ByteSizeUnit.MB.toBytes(1), WritePriority.HIGH, uploadSuccess -> {
153-
}, false, null, true, metadata, null, ServerSideEncryption.AWS_KMS.toString(), randomAlphaOfLength(10), true, null, null),
151+
new UploadRequest(
152+
"bucket",
153+
"key",
154+
ByteSizeUnit.MB.toBytes(1),
155+
WritePriority.HIGH,
156+
uploadSuccess -> {},
157+
false,
158+
null,
159+
true,
160+
metadata,
161+
null,
162+
ServerSideEncryption.AWS_KMS.toString(),
163+
randomAlphaOfLength(10),
164+
true,
165+
null,
166+
null
167+
),
154168
new StreamContext(
155169
(partIdx, partSize, position) -> new InputStreamContainer(new ZeroInputStream(partSize), partSize, position),
156170
ByteSizeUnit.MB.toBytes(1),
@@ -206,7 +220,7 @@ public void testMultipartUpload() {
206220
CompletableFuture<Void> resultFuture = asyncTransferManager.uploadObject(
207221
s3AsyncClient,
208222
new UploadRequest("bucket", "key", ByteSizeUnit.MB.toBytes(5), WritePriority.HIGH, uploadSuccess -> {
209-
223+
210224
}, true, 3376132981L, true, metadata, null, ServerSideEncryption.AWS_KMS.toString(), randomAlphaOfLength(10), true, null, null),
211225

212226
new StreamContext((partIdx, partSize, position) -> {
@@ -323,12 +337,12 @@ public void testConditionalOneChunkUpload() {
323337
null,
324338
true,
325339
metadata,
326-
options,
327-
null,
328-
null,
329-
false,
330-
null,
331-
null
340+
options,
341+
null,
342+
null,
343+
false,
344+
null,
345+
null
332346
),
333347
new StreamContext((partIdx, partSize, position) -> {
334348
streamRef.set(new ZeroInputStream(partSize));
@@ -381,12 +395,12 @@ public void testConditionalOneChunkUploadPreconditionFailed() {
381395
null,
382396
true,
383397
null,
384-
options,
385-
null,
386-
null,
387-
false,
388-
null,
389-
null
398+
options,
399+
null,
400+
null,
401+
false,
402+
null,
403+
null
390404
),
391405
new StreamContext((partIdx, partSize, position) -> {
392406
streamRef.set(new ZeroInputStream(partSize));
@@ -451,12 +465,12 @@ public void testConditionalOneChunkUploadCorruption() {
451465
null,
452466
true,
453467
null,
454-
options,
455-
null,
456-
null,
457-
false,
458-
null,
459-
null
468+
options,
469+
null,
470+
null,
471+
false,
472+
null,
473+
null
460474
),
461475
new StreamContext((partIdx, partSize, position) -> {
462476
streamRef.set(new ZeroInputStream(partSize));
@@ -528,12 +542,12 @@ public void testConditionalMultipartUploadPreconditionFailed() {
528542
3376132981L,
529543
true,
530544
null,
531-
options,
532-
null,
533-
null,
534-
false,
535-
null,
536-
null
545+
options,
546+
null,
547+
null,
548+
false,
549+
null,
550+
null
537551
),
538552
new StreamContext((partIdx, partSize, position) -> {
539553
InputStream stream = new ZeroInputStream(partSize);
@@ -604,13 +618,13 @@ public void testConditionalMultipartUploadCorruption() {
604618
0L,
605619
true,
606620
null,
607-
options,
608-
null,
609-
null,
610-
false,
611-
null,
612-
null
613-
),
621+
options,
622+
null,
623+
null,
624+
false,
625+
null,
626+
null
627+
),
614628
new StreamContext((partIdx, partSize, position) -> {
615629
InputStream stream = new ZeroInputStream(partSize);
616630
streams.add(stream);

0 commit comments

Comments
 (0)