Skip to content

Commit

Permalink
Revert "Update azure-storage-blob to 12.15.0 (opensearch-project#2774)"
Browse files Browse the repository at this point in the history
This reverts commit 1dbeda0.

Signed-off-by: Andriy Redko <[email protected]>
  • Loading branch information
reta committed Apr 6, 2022
1 parent ce5c55d commit 0798b1b
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion plugins/repository-azure/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ dependencies {
api "io.netty:netty-resolver-dns:${versions.netty}"
api "io.netty:netty-transport-native-unix-common:${versions.netty}"
implementation project(':modules:transport-netty4')
api 'com.azure:azure-storage-blob:12.15.0'
api 'com.azure:azure-storage-blob:12.14.4'
api 'org.reactivestreams:reactive-streams:1.0.3'
api 'io.projectreactor:reactor-core:3.4.15'
api 'io.projectreactor.netty:reactor-netty:1.0.17'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2b92020693d09e4980b96d278e8038a1087afea0

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,6 @@ public void testReadBlobWithRetries() throws Exception {
exchange.getResponseHeaders().add("Content-Type", "application/octet-stream");
exchange.getResponseHeaders().add("Content-Length", String.valueOf(length));
exchange.getResponseHeaders().add("x-ms-blob-type", "blockblob");
exchange.getResponseHeaders()
.add("Content-Range", String.format("bytes %d-%d/%d", rangeStart, bytes.length, bytes.length));
exchange.sendResponseHeaders(RestStatus.OK.getStatus(), length);
exchange.getResponseBody().write(bytes, rangeStart, length);
return;
Expand All @@ -249,8 +247,7 @@ public void testReadBlobWithRetries() throws Exception {
final BlobContainer blobContainer = createBlobContainer(maxRetries);
try (InputStream inputStream = blobContainer.readBlob("read_blob_max_retries")) {
assertArrayEquals(bytes, BytesReference.toBytes(Streams.readFully(inputStream)));
// No more getProperties() calls in BlobClientBase::openInputStream(), HEAD should not be invoked
assertThat(countDownHead.isCountedDown(), is(false));
assertThat(countDownHead.isCountedDown(), is(true));
assertThat(countDownGet.isCountedDown(), is(true));
}
}
Expand Down Expand Up @@ -281,8 +278,6 @@ public void testReadRangeBlobWithRetries() throws Exception {
assertThat(length, lessThanOrEqualTo(bytes.length - rangeStart));
exchange.getResponseHeaders().add("Content-Type", "application/octet-stream");
exchange.getResponseHeaders().add("Content-Length", String.valueOf(length));
exchange.getResponseHeaders()
.add("Content-Range", String.format("bytes %d-%d/%d", rangeStart, rangeEnd.get(), bytes.length));
exchange.getResponseHeaders().add("x-ms-blob-type", "blockblob");
exchange.sendResponseHeaders(RestStatus.OK.getStatus(), length);
exchange.getResponseBody().write(bytes, rangeStart, length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,12 @@ public void handle(final HttpExchange exchange) throws IOException {
}

final int start = Integer.parseInt(matcher.group(1));
final int end = Integer.parseInt(matcher.group(2));
final int length = Math.min(end - start + 1, blob.length());
final int length = Integer.parseInt(matcher.group(2)) - start + 1;

exchange.getResponseHeaders().add("Content-Type", "application/octet-stream");
exchange.getResponseHeaders().add("Content-Length", String.valueOf(length));
exchange.getResponseHeaders().add("x-ms-blob-type", "blockblob");
exchange.getResponseHeaders().add("x-ms-request-server-encrypted", "false");
exchange.getResponseHeaders().add("Content-Range", String.format("bytes %d-%d/%d", start, Math.min(end, length), length));
exchange.sendResponseHeaders(RestStatus.OK.getStatus(), length);
exchange.getResponseBody().write(blob.toBytesRef().bytes, start, length);

Expand Down

0 comments on commit 0798b1b

Please sign in to comment.