Skip to content

Commit 9c860cd

Browse files
committed
Inline failIfAlreadyExists in executeMultipartCopy
1 parent 6979fbe commit 9c860cd

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

modules/repository-s3/qa/third-party/src/test/java/org/elasticsearch/repositories/s3/S3RepositoryThirdPartyTests.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,7 @@ public void testMultipartCopy() {
277277
(S3BlobContainer) sourceBlobContainer,
278278
sourceBlobName,
279279
destinationBlobName,
280-
blobBytes.length(),
281-
randomBoolean()
280+
blobBytes.length()
282281
);
283282

284283
return destinationBlobContainer.readBlob(randomPurpose(), destinationBlobName).readAllBytes();

modules/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3BlobContainer.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ public void copyBlob(
363363

364364
try {
365365
if (blobSize > getMaxCopySizeBeforeMultipart()) {
366-
executeMultipartCopy(purpose, s3SourceBlobContainer, sourceBlobName, blobName, blobSize, false);
366+
executeMultipartCopy(purpose, s3SourceBlobContainer, sourceBlobName, blobName, blobSize);
367367
} else {
368368
// metadata is inherited from source, but not canned ACL or storage class
369369
final var blobKey = buildKey(blobName);
@@ -708,8 +708,7 @@ void executeMultipartCopy(
708708
final S3BlobContainer sourceContainer,
709709
final String sourceBlobName,
710710
final String destinationBlobName,
711-
final long blobSize,
712-
final boolean failIfAlreadyExists
711+
final long blobSize
713712
) throws IOException {
714713
final long copyPartSize = MAX_FILE_SIZE.getBytes();
715714
final var destinationKey = buildKey(destinationBlobName);
@@ -738,7 +737,7 @@ void executeMultipartCopy(
738737
return CompletedPart.builder().partNumber(partNum).eTag(uploadPartCopyResponse.copyPartResult().eTag()).build();
739738
}
740739
}),
741-
failIfAlreadyExists
740+
false
742741
);
743742
}
744743

modules/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3BlobStoreContainerTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ void testExecuteMultipart(boolean doCopy) throws IOException {
301301
final S3BlobContainer sourceContainer = new S3BlobContainer(sourceBlobPath, sourceBlobStore);
302302

303303
if (doCopy) {
304-
blobContainer.executeMultipartCopy(randomPurpose(), sourceContainer, sourceBlobName, blobName, blobSize, false);
304+
blobContainer.executeMultipartCopy(randomPurpose(), sourceContainer, sourceBlobName, blobName, blobSize);
305305
} else {
306306
blobContainer.executeMultipartUpload(randomPurpose(), blobStore, blobName, inputStream, blobSize, failIfAlreadyExists);
307307
}

0 commit comments

Comments
 (0)