[
https://issues.apache.org/jira/browse/BEAM-13445?focusedWorklogId=695038&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-695038
]
ASF GitHub Bot logged work on BEAM-13445:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 13/Dec/21 13:23
Start Date: 13/Dec/21 13:23
Worklog Time Spent: 10m
Work Description: aromanenko-dev commented on a change in pull request
#16205:
URL: https://github.com/apache/beam/pull/16205#discussion_r767750483
##########
File path:
sdks/java/io/amazon-web-services/src/main/java/org/apache/beam/sdk/io/aws/s3/S3WritableByteChannel.java
##########
@@ -118,13 +118,22 @@ public int write(ByteBuffer sourceBuffer) throws
IOException {
int totalBytesWritten = 0;
while (sourceBuffer.hasRemaining()) {
+ int position = sourceBuffer.position();
int bytesWritten = Math.min(sourceBuffer.remaining(),
uploadBuffer.remaining());
totalBytesWritten += bytesWritten;
- byte[] copyBuffer = new byte[bytesWritten];
- sourceBuffer.get(copyBuffer);
- uploadBuffer.put(copyBuffer);
- md5.update(copyBuffer);
+ if (sourceBuffer.hasArray()) {
Review comment:
Could you add a Javadoc for this method about this to make it more
evident why it's needed?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 695038)
Time Spent: 0.5h (was: 20m)
> Fix chunked encoding for S3WritableButeChannel
> ----------------------------------------------
>
> Key: BEAM-13445
> URL: https://issues.apache.org/jira/browse/BEAM-13445
> Project: Beam
> Issue Type: Bug
> Components: io-java-aws
> Reporter: Moritz Mack
> Assignee: Moritz Mack
> Priority: P2
> Labels: aws, aws-sdk-v1, aws-sdk-v2
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> Currently S3WritableButeChannel may send more bytes than captured in the MD5
> content hash. AWS seems to be tolerant and ignores this. However, when
> testing with Localstack this bug surfaced ....
> Also, to improve the memory footprint & performance, there's no need to read
> the source buffer into an intermediate byte array.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)