swagle commented on a change in pull request #2040:
URL: https://github.com/apache/ozone/pull/2040#discussion_r595618158



##########
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:
       As a general practice classpath scan and reflective class loading is 
done statically so that classpath configuration errors can be thrown before 
initializing the application.




----------------------------------------------------------------
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]

Reply via email to