Skip to content

Commit 5570164

Browse files
authored
Merge branch 'apache:trunk' into OAK-12097
2 parents fbbfe41 + 54b40ab commit 5570164

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureSegmentArchiveWriter.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import java.io.ByteArrayInputStream;
3535
import java.io.File;
3636
import java.io.IOException;
37+
import java.util.Arrays;
3738
import java.util.concurrent.TimeUnit;
3839

3940
import static org.apache.jackrabbit.oak.segment.azure.AzureUtilities.readBufferFully;
@@ -82,8 +83,9 @@ protected void doWriteArchiveEntry(RemoteSegmentArchiveEntry indexEntry, byte[]
8283
// Upload the binary data and set its metadata using a single HTTP call,
8384
// overwriting an existing blob if necessary. Wrapping the byte array in a
8485
// ByteArrayInputStream avoids creating a copy of the data range.
85-
BinaryData binaryData = BinaryData.fromStream(new ByteArrayInputStream(data, offset, size), (long) size);
86-
BlockBlobSimpleUploadOptions options = new BlockBlobSimpleUploadOptions(binaryData)
86+
// Note: OAK-12094 fixes an interesting regression in heap usage, which
87+
// should be read for context when making changes in the lines below.
88+
BlockBlobSimpleUploadOptions options = new BlockBlobSimpleUploadOptions(new ByteArrayInputStream(data, offset, size), size)
8789
.setMetadata(AzureBlobMetadata.toSegmentMetadata(indexEntry));
8890
blob.uploadWithResponse(options, null, Context.NONE);
8991
} catch (BlobStorageException e) {

0 commit comments

Comments
 (0)