symious commented on a change in pull request #2261:
URL: https://github.com/apache/ozone/pull/2261#discussion_r638699948
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
##########
@@ -2370,4 +2387,22 @@ void sortDatanodes(String clientMachine, OmKeyInfo...
keyInfos) {
}
return nodeSet;
}
+
+ private void slimLocationVersion(OmKeyInfo... keyInfos) {
+ if (keyInfos != null) {
+ for (OmKeyInfo keyInfo : keyInfos) {
+ OmKeyLocationInfoGroup key = keyInfo.getLatestVersionLocations();
+ if (key == null) {
+ LOG.warn("No location version for key {}", keyInfo);
+ continue;
+ }
+ int keyLocationVersionLength = keyInfo.getKeyLocationVersions().size();
+ if (keyLocationVersionLength <= 1) {
+ continue;
+ }
+ keyInfo.setKeyLocationVersions(keyInfo.getKeyLocationVersions()
Review comment:
Thanks for the review.
I think it's caused by the definition of `keyLocationVersions:
List<OmKeyLocationInfoGroup>`, the `slimLocationVersion` here is just trying to
get the last value of `keyLocationVersions`, which is an
`OmKeyLocationInfoGroup`. As for the problem that all versions are stored in
`OmKeyLocationInfoGroup.locationVersionMap`, I think we can raise another
ticket to check the design?
For subList, since `setKeyLocationVersions` accepts a List, seems we can't
return the last value directly.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]