Meng-Shuan Tsai created HDDS-16257:
--------------------------------------
Summary: Avoid the flatten-copy in
OmMetadataManagerImpl.getExpiredOpenKeys' hsync branch
Key: HDDS-16257
URL: https://issues.apache.org/jira/browse/HDDS-16257
Project: Apache Ozone
Issue Type: Sub-task
Reporter: Meng-Shuan Tsai
Assignee: Meng-Shuan Tsai
In the hsync branch of getExpiredOpenKeys (OpenKeyCleanupService's periodic
scan, default interval 24h):
{code:java}
java.util.Optional.ofNullable(info.getLatestVersionLocations())
.map(OmKeyLocationInfoGroup::createLocationList)
.map(Collection::stream)
.orElseGet(Stream::empty)
.map(loc -> loc.getProtobuf(ClientVersion.CURRENT_VERSION))
.forEach(keyArgs::addKeyLocations);{code}
createLocationList() is documented as not O(1); it flatten-copies the
group's locationVersionMap into a throwaway List that is immediately
re-streamed once and discarded.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]