avijayanhwx commented on a change in pull request #2040:
URL: https://github.com/apache/ozone/pull/2040#discussion_r595712699
##########
File path:
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/upgrade/HDDSLayoutVersionManager.java
##########
@@ -31,12 +43,61 @@
public class HDDSLayoutVersionManager extends
AbstractLayoutVersionManager<HDDSLayoutFeature> {
+ private static final Logger LOG =
+ LoggerFactory.getLogger(HDDSLayoutVersionManager.class);
+ private static final String[] HDDS_CLASS_UPGRADE_PACKAGES = new String[]{
+ "org.apache.hadoop.hdds.server.scm",
+ "org.apache.hadoop.ozone.container"};
+
public HDDSLayoutVersionManager(int layoutVersion) throws IOException {
init(layoutVersion, HDDSLayoutFeature.values());
+ registerUpgradeActions(HDDS_CLASS_UPGRADE_PACKAGES);
}
public static int maxLayoutVersion() {
HDDSLayoutFeature[] features = HDDSLayoutFeature.values();
return features[features.length - 1].layoutVersion();
}
+
+ /**
+ * Scan classpath and register all actions to layout features.
+ */
+ @VisibleForTesting
+ void registerUpgradeActions(String[] packageNames) {
Review comment:
Yes, I agree. But, in this case the classpath loading is more
investigative. It does not need to find any upgrade action at all. If it does
find one, we will register it.
----------------------------------------------------------------
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]