Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
Signed-off-by: Sandeep Kumawat <[email protected]>
  • Loading branch information
skumawat2025 committed Apr 11, 2024
1 parent 349c1c0 commit d454a2c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public long readBlobPreferredLength() {
*/
@Override
public void writeBlob(String blobName, InputStream inputStream, long blobSize, boolean failIfAlreadyExists) throws IOException {
writeBlobWithMetadata(blobName, inputStream, null, blobSize, failIfAlreadyExists);
writeBlobWithMetadata(blobName, inputStream, blobSize, failIfAlreadyExists, null);
}

/**
Expand All @@ -188,9 +188,9 @@ public void writeBlob(String blobName, InputStream inputStream, long blobSize, b
public void writeBlobWithMetadata(
String blobName,
InputStream inputStream,
@Nullable Map<String, String> metadata,
long blobSize,
boolean failIfAlreadyExists
boolean failIfAlreadyExists,
@Nullable Map<String, String> metadata
) throws IOException {
assert inputStream.markSupported() : "No mark support on inputStream breaks the S3 SDK's ability to retry requests";
SocketAccess.doPrivilegedIOException(() -> {
Expand Down Expand Up @@ -334,18 +334,6 @@ public void writeBlobAtomic(String blobName, InputStream inputStream, long blobS
writeBlob(blobName, inputStream, blobSize, failIfAlreadyExists);
}

@ExperimentalApi
@Override
public void writeBlobAtomicWithMetadata(
String blobName,
InputStream inputStream,
Map<String, String> metadata,
long blobSize,
boolean failIfAlreadyExists
) throws IOException {
writeBlobWithMetadata(blobName, inputStream, metadata, blobSize, failIfAlreadyExists);
}

@Override
public DeleteResult delete() throws IOException {
final AtomicLong deletedBlobs = new AtomicLong();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public void writeBlobWithRetriesHelper(Map<String, String> metadata) throws Exce
final BlobContainer blobContainer = createBlobContainer(maxRetries, null, true, null);
try (InputStream stream = new ByteArrayInputStream(bytes)) {
if (metadata != null) {
blobContainer.writeBlobWithMetadata("write_blob_max_retries", stream, metadata, bytes.length, false);
blobContainer.writeBlobWithMetadata("write_blob_max_retries", stream, bytes.length, false, metadata);
} else {
blobContainer.writeBlob("write_blob_max_retries", stream, bytes.length, false);
}
Expand Down Expand Up @@ -404,7 +404,7 @@ public void writeBlobWithReadTimeoutsHelper(Map<String, String> metadata) {
Exception exception = expectThrows(IOException.class, () -> {
try (InputStream stream = new InputStreamIndexInput(new ByteArrayIndexInput("desc", bytes), bytes.length)) {
if (metadata != null) {
blobContainer.writeBlobWithMetadata("write_blob_timeout", stream, metadata, bytes.length, false);
blobContainer.writeBlobWithMetadata("write_blob_timeout", stream, bytes.length, false, metadata);
} else {
blobContainer.writeBlob("write_blob_timeout", stream, bytes.length, false);
}
Expand Down Expand Up @@ -520,7 +520,7 @@ public void WriteLargeBlobHelper(Map<String, String> metadata) throws Exception
});

if (metadata != null) {
blobContainer.writeBlobWithMetadata("write_large_blob", new ZeroInputStream(blobSize), metadata, blobSize, false);
blobContainer.writeBlobWithMetadata("write_large_blob", new ZeroInputStream(blobSize), blobSize, false, metadata);
} else {
blobContainer.writeBlob("write_large_blob", new ZeroInputStream(blobSize), blobSize, false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ default long readBlobPreferredLength() {
default void writeBlobWithMetadata(
String blobName,
InputStream inputStream,
@Nullable Map<String, String> metadata,
long blobSize,
boolean failIfAlreadyExists
boolean failIfAlreadyExists,
@Nullable Map<String, String> metadata
) throws IOException {
throw new UnsupportedOperationException("writeBlobWithMetadata is not implemented yet");
};
Expand Down

0 comments on commit d454a2c

Please sign in to comment.