kuenishi commented on a change in pull request #2433:
URL: https://github.com/apache/ozone/pull/2433#discussion_r685752616
##########
File path:
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyLocationInfoGroup.java
##########
@@ -143,16 +143,22 @@ public static OmKeyLocationInfoGroup getFromProtobuf(
}
/**
- * Given a new block location, generate a new version list based upon this
- * one.
+ * Given a new block location, generate a new version list based upon the
+ * version number of this object. Keep the blocks to when keepVersions is
+ * on for object versioning.
*
* @param newLocationList a list of new location to be added.
+ * @param keepVersions a knob to carry current locations to the next version.
* @return newly generated OmKeyLocationInfoGroup
*/
OmKeyLocationInfoGroup generateNextVersion(
- List<OmKeyLocationInfo> newLocationList) {
- Map<Long, List<OmKeyLocationInfo>> newMap =
- new HashMap<>();
+ List<OmKeyLocationInfo> newLocationList, boolean keepVersions) {
+ Map<Long, List<OmKeyLocationInfo>> newMap = null;
+ if (keepVersions) {
+ newMap = new HashMap<>(locationVersionMap);
Review comment:
Thank you for the review. I updated the commented part so that it does
keep past location version map and also added option 3 of my idea in this issue
to the @symious document.
I'm sorry that I don't have much time to add necessary unit tests and make
integration tests passing for now, but will try in a few days.
--
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]