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/15 03:51:20 UTC

[GitHub] [ozone] avijayanhwx opened a new pull request #2040: Introduce First upgrade action and pre-finalized state validation in Layout Feature.

avijayanhwx opened a new pull request #2040:
URL: https://github.com/apache/ozone/pull/2040


   
   
   ## What changes were proposed in this pull request?
   
   (Please fill in changes proposed in this fix)
   
   ## What is the link to the Apache JIRA
   
   (Please create an issue in ASF JIRA before opening a pull request,
   and you need to set the title of the pull request which starts with
   the corresponding JIRA issue number. (e.g. HDDS-XXXX. Fix a typo in YYY.)
   
   Please replace this section with the link to the Apache JIRA)
   
   ## How was this patch tested?
   
   (Please explain how this patch was tested. Ex: unit tests, manual tests)
   (If this patch involves UI changes, please attach a screen-shot; otherwise, remove this)
   


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


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

Posted by GitBox <gi...@apache.org>.
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 from static methods 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:
users@infra.apache.org



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


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

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



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


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

Posted by GitBox <gi...@apache.org>.
avijayanhwx commented on pull request #2040:
URL: https://github.com/apache/ozone/pull/2040#issuecomment-807469528


   Thanks for the review @errose28 and @swagle.


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


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

Posted by GitBox <gi...@apache.org>.
avijayanhwx commented on pull request #2040:
URL: https://github.com/apache/ozone/pull/2040#issuecomment-801635600


   cc @errose28 for review.


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


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

Posted by GitBox <gi...@apache.org>.
avijayanhwx merged pull request #2040:
URL: https://github.com/apache/ozone/pull/2040


   


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


[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.

Posted by GitBox <gi...@apache.org>.
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