xichen01 commented on code in PR #5644:
URL: https://github.com/apache/ozone/pull/5644#discussion_r1405354312
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java:
##########
@@ -297,33 +304,35 @@ public Response put(
long putLength;
String eTag = null;
if (datastreamEnabled && !enableEC && length > datastreamMinLength) {
- getMetrics().updatePutKeyMetadataStats(startNanos);
+ s3GAction[0] = S3GAction.CREATE_KEY_STREAMING;
Pair<String, Long> keyWriteResult = ObjectEndpointStreaming
.put(bucket, keyPath, length, replicationConfig, chunkSize,
- customMetadata, (DigestInputStream) body);
+ customMetadata, (DigestInputStream) body, perf);
eTag = keyWriteResult.getKey();
putLength = keyWriteResult.getValue();
} else {
try (OzoneOutputStream output = getClientProtocol().createKey(
volume.getName(), bucketName, keyPath, length, replicationConfig,
customMetadata)) {
- getMetrics().updatePutKeyMetadataStats(startNanos);
+ long metadataLatency =
+ getMetrics().updatePutKeyMetadataStats(startNanos);
+ perf.put("metadataLatencyMs", nanosToMillisString(metadataLatency));
putLength = IOUtils.copyLarge(body, output);
eTag = DatatypeConverter.printHexBinary(
((DigestInputStream) body).getMessageDigest().digest())
.toLowerCase();
output.getMetadata().put(ETAG, eTag);
}
}
-
getMetrics().incPutKeySuccessLength(putLength);
+ perf.put("putLength", String.valueOf(putLength));
Review Comment:
Done.
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java:
##########
@@ -217,17 +219,19 @@ public Response put(
@QueryParam("uploadId") @DefaultValue("") String uploadID,
InputStream body) throws IOException, OS3Exception {
long startNanos = Time.monotonicNowNanos();
- S3GAction s3GAction = S3GAction.CREATE_KEY;
-
+ // Set to an Array so that S3GAction can be changed within the function.
+ final S3GAction[] s3GAction = new S3GAction[] {S3GAction.CREATE_KEY};
Review Comment:
Done.
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/ozone/audit/AuditMessage.java:
##########
@@ -109,15 +113,23 @@ public Builder withException(Throwable ex) {
return this;
}
+ public Builder setPerformance(Map<String, String> perf) {
+ this.performance = perf;
+ return this;
+ }
+
public AuditMessage build() {
- return new AuditMessage(user, ip, op, params, ret, throwable);
+ return new AuditMessage(user, ip, op, params, ret, throwable,
+ performance);
}
}
private String formMessage(String userStr, String ipStr, String opStr,
- Map<String, String> paramsMap, String retStr) {
+ Map<String, String> paramsMap, String retStr,
+ Map<String, String> performanceMap) {
Review Comment:
Using the `PerformanceStringBuilder` reduce conversion
--
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]