chihsuan commented on code in PR #10633:
URL: https://github.com/apache/ozone/pull/10633#discussion_r3544463617
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java:
##########
@@ -218,13 +224,27 @@ protected List< OmKeyLocationInfo >
allocateBlock(ScmClient scmClient,
}
throw ex;
}
+ // Cache the sorted order per pipeline so blocks sharing a pipeline are
+ // sorted once (mirrors the read path's per-pipeline caching).
+ final Map<List<DatanodeDetails>, List<? extends DatanodeDetails>>
sortedByNodes =
+ sortOnOm ? new HashMap<>() : null;
Review Comment:
> Any reason for this? If so, can we standardize the implementation?
> I think there is no need to get the use the DatanodeDetails::getUuidString
in KeyManagerImpl#sortedByNodes.
Agreed on both. Since `DatanodeDetails#equals/hashCode` are UUID-based,
keying by the node list is already equivalent to keying by UUIDs, so the
`getUuidString -> Set<String>` step is redundant.
I originally left the read path untouched to keep the change scoped to the
write path, but since you raised it, I've dropped getUuidString and
standardized both paths to key by the pipeline node list in 7d3bc3e. Thanks!
--
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]