adoroszlai commented on code in PR #7662:
URL: https://github.com/apache/ozone/pull/7662#discussion_r1907460076


##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/om/quota/QuotaStatus.java:
##########
@@ -35,7 +35,7 @@
     mixinStandardHelpOptions = true,
     versionProvider = HddsVersionProvider.class
 )
-public class QuotaStatus implements Callable<Void>  {
+public class QuotaStatus extends RepairTool {

Review Comment:
   `QuotaStatus` just queries status, so the common repair steps (ask for 
confirmation, ensure `--dry-run` flag, etc.) do not apply.  I don't think it 
should extend `RepairTool` (but it can extend `AbstractSubcommand` if needed).
   
   `info()` will not be available, but `out()` and `err()` will be after 
HDDS-12002.  Until then, we can leave usage of `System.(out|err)` as is.



##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/om/quota/QuotaRepair.java:
##########
@@ -93,7 +86,7 @@ private String getTheOnlyConfiguredOmServiceIdOrThrow() {
   }
 
   private Collection<String> getConfiguredServiceIds() {
-    OzoneConfiguration conf = parent.getOzoneConf();
+    OzoneConfiguration conf = new OzoneConfiguration();

Review Comment:
   ```suggestion
       OzoneConfiguration conf = getOzoneConf();
   ```



##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/om/quota/QuotaRepair.java:
##########
@@ -48,18 +45,14 @@
         QuotaTrigger.class,
     },
     description = "Operational tool to repair quota in OM DB.")
-@MetaInfServices(RepairSubcommand.class)
-public class QuotaRepair implements RepairSubcommand {
-
-  @CommandLine.ParentCommand
-  private OzoneRepair parent;
+public class QuotaRepair {

Review Comment:
   ```suggestion
   public class QuotaRepair extends AbstractSubcommand {
   ```
   
   (needs import, too)



##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneRepairShell.java:
##########
@@ -128,14 +128,14 @@ private String[] parseScanOutput(String output) {
   public void testQuotaRepair() throws Exception {
     CommandLine cmd = new OzoneRepair().getCmd();
 
-    int exitCode = cmd.execute("quota", "status", "--service-host", 
conf.get(OZONE_OM_ADDRESS_KEY));
+    int exitCode = cmd.execute("om", "quota", "status", "--service-host", 
conf.get(OZONE_OM_ADDRESS_KEY));
     assertEquals(0, exitCode, err);
-    exitCode = cmd.execute("quota", "start", "--service-host", 
conf.get(OZONE_OM_ADDRESS_KEY));
+    exitCode = cmd.execute("om", "quota", "start", "--service-host", 
conf.get(OZONE_OM_ADDRESS_KEY));

Review Comment:
   This line is being changed in #7653, too, so it would be great if we could 
merge that one first.



##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/om/quota/QuotaStatus.java:
##########
@@ -35,7 +35,7 @@
     mixinStandardHelpOptions = true,
     versionProvider = HddsVersionProvider.class
 )
-public class QuotaStatus implements Callable<Void>  {
+public class QuotaStatus extends RepairTool {
   @CommandLine.Spec
   private static CommandLine.Model.CommandSpec spec;

Review Comment:
   Not new to this PR, but this can be removed.
   
   ```suggestion
   ```



##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/om/quota/QuotaRepair.java:
##########
@@ -48,18 +45,14 @@
         QuotaTrigger.class,
     },
     description = "Operational tool to repair quota in OM DB.")
-@MetaInfServices(RepairSubcommand.class)
-public class QuotaRepair implements RepairSubcommand {
-
-  @CommandLine.ParentCommand
-  private OzoneRepair parent;
+public class QuotaRepair {
 
   public OzoneManagerProtocolClientSideTranslatorPB createOmClient(
       String omServiceID,
       String omHost,
       boolean forceHA
   ) throws Exception {
-    OzoneConfiguration conf = parent.getOzoneConf();
+    OzoneConfiguration conf = new OzoneConfiguration();

Review Comment:
   ```suggestion
       OzoneConfiguration conf = getOzoneConf();
   ```



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

Reply via email to