You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/03/17 04:56:06 UTC

[GitHub] [ozone] avijayanhwx commented on a change in pull request #2040: HDDS-4990. Introduce First upgrade startup action and Pre-finalized state validation in Layout Feature.

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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org