Meng-Shuan Tsai created HDDS-16256:
--------------------------------------
Summary: Avoid the per-group list copy in
OMKeyRequest.filterOutBlocksStillInUse
Key: HDDS-16256
URL: https://issues.apache.org/jira/browse/HDDS-16256
Project: Apache Ozone
Issue Type: Sub-task
Reporter: Meng-Shuan Tsai
Assignee: Meng-Shuan Tsai
filterOutBlocksStillInUse builds a lookup map of every block in referenceKey's
location versions, but does it via:
{code:java}
Map<ContainerBlockID, OmKeyLocationInfo> cbIdSet =
referenceKey.getKeyLocationVersions()
.stream()
.flatMap(e -> e.createLocationList().stream())
.collect(Collectors.toMap(omKeyLocationInfo ->
omKeyLocationInfo.getBlockID().getContainerBlockID(),
Function.identity()));{code}
createLocationList() is documented as not O(1); it flatten-copies each
group's locationVersionMap into a throwaway List that is immediately
re-streamed and discarded. This runs on the key-commit apply-transaction
path (OMKeyCommitRequest / OMKeyCommitRequestWithFSO) whenever a key
overwrite has old versions pending deletion.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]