ivandika3 commented on code in PR #9294:
URL: https://github.com/apache/ozone/pull/9294#discussion_r2616680809
##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECKeyOutputStream.java:
##########
@@ -85,6 +85,14 @@ public final class ECKeyOutputStream extends KeyOutputStream
// how much data has been ingested into the stream
private long writeOffset;
+ private Runnable preCommit = () -> {
+ };
+
+ @Override
+ public void setPreCommit(Runnable preCommit) {
+ this.preCommit = preCommit;
+ }
Review Comment:
Let's annotate with `@Nonnull Runnable preCommit` to ensure the `preCommit`
is not null. Or we can add nullity check on the `close` method.
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java:
##########
@@ -337,12 +349,26 @@ public Response put(
long metadataLatencyNs =
getMetrics().updatePutKeyMetadataStats(startNanos);
perf.appendMetaLatencyNanos(metadataLatencyNs);
- putLength = IOUtils.copyLarge(digestInputStream, output, 0, length,
+ putLength = IOUtils.copyLarge(multiDigestInputStream, output, 0,
length,
new byte[getIOBufferSize(length)]);
eTag = DatatypeConverter.printHexBinary(
- digestInputStream.getMessageDigest().digest())
+
multiDigestInputStream.getMessageDigest(OzoneConsts.MD5_HASH).digest())
.toLowerCase();
output.getMetadata().put(ETAG, eTag);
+
+ final String amzContentSha256Header =
+ validateSignatureHeader(headers, keyPath,
signatureInfo.isSignPayload());
Review Comment:
Let's push `validateSignatureHeader` before `IOUtils#copyLarge` to prevent
unnecessary data transfer. Should be applied to other places.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]