rich7420 commented on code in PR #11235:
URL: https://github.com/apache/ozone/pull/11235#discussion_r4000305443
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java:
##########
@@ -2312,21 +2307,26 @@ public List<? extends DatanodeDetails>
sortDatanodes(List<? extends DatanodeDeta
return clusterMap.sortByDistanceCost(client, nodes, nodes.size());
}
+ @Override
+ public Node resolveClientForWrite(String clientMachine, NetworkTopology
clusterMap) {
+ Preconditions.checkArgument(!StringUtils.isEmpty(clientMachine),
"clientMachine is empty");
+ Objects.requireNonNull(clusterMap, "clusterMap is null");
+ return captureLatencyNs(metrics.getAllocateBlockSortDatanodesLatencyNs(),
Review Comment:
Please use a separate metric for client resolution. [`ConcurrentMutableRate`
exports one `NumOps`/`AvgTime`
pair](https://github.com/apache/ozone/blob/6cecf01ec71bce1c8408de2c20fcd7fbdc6787ac/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOMPerformanceMetrics.java#L33-L39),
so recording the once-per-request lookup here and [every uncached pipeline
sort](https://github.com/apache/ozone/blob/6cecf01ec71bce1c8408de2c20fcd7fbdc6787ac/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java#L2324-L2330)
into `AllocateBlockSortDatanodesLatencyNs` makes the count and average
represent neither operation. Please add `AllocateBlockResolveClientLatencyNs`
and keep the existing metric for sorting.
--
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]