adoroszlai commented on code in PR #7634:
URL: https://github.com/apache/ozone/pull/7634#discussion_r1901855084
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/om/TransactionInfoRepair.java:
##########
@@ -51,8 +51,10 @@
)
public class TransactionInfoRepair extends RepairTool {
- @CommandLine.ParentCommand
- private RDBRepair parent;
+ @CommandLine.Option(names = {"--db"},
+ required = true,
+ description = "Database File Path")
Review Comment:
nit: let's keep continuation indent as 4 spaces
```suggestion
required = true,
description = "Database File Path")
```
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/om/SnapshotChainRepair.java:
##########
@@ -48,22 +48,24 @@
* Tool to repair snapshotInfoTable in case it has corrupted entries.
*/
@CommandLine.Command(
- name = "snapshot",
+ name = "chain",
description = "CLI to update global and path previous snapshot for a
snapshot in case snapshot chain is corrupted."
)
-public class SnapshotRepair extends RepairTool {
+public class SnapshotChainRepair extends RepairTool {
- protected static final Logger LOG =
LoggerFactory.getLogger(SnapshotRepair.class);
-
- @CommandLine.ParentCommand
- private RDBRepair parent;
+ protected static final Logger LOG =
LoggerFactory.getLogger(SnapshotChainRepair.class);
@CommandLine.Mixin
private BucketUri bucketUri;
@CommandLine.Parameters(description = "Snapshot name to update", index = "1")
private String snapshotName;
+ @CommandLine.Option(names = {"--db"},
+ required = true,
+ description = "Database File Path")
Review Comment:
nit: indent 4 spaces, not 8
##########
hadoop-ozone/tools/src/test/java/org/apache/hadoop/ozone/om/TestTransactionInfoRepair.java:
##########
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.hadoop.ozone.repair.ldb;
+package org.apache.hadoop.ozone.om;
Review Comment:
This should be moved to slightly different package:
```suggestion
package org.apache.hadoop.ozone.repair.om;
```
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/om/SnapshotRepair.java:
##########
@@ -16,30 +16,33 @@
* limitations under the License.
*/
-package org.apache.hadoop.ozone.repair.ldb;
+package org.apache.hadoop.ozone.repair.om;
+
+import org.apache.hadoop.hdds.cli.GenericCli;
-import org.apache.hadoop.hdds.cli.RepairSubcommand;
-import org.kohsuke.MetaInfServices;
import picocli.CommandLine;
+import picocli.CommandLine.Model.CommandSpec;
+
+import java.util.concurrent.Callable;
/**
- * Ozone Repair CLI for RocksDB.
+ * Tool to repair snapshotInfoTable in case it has corrupted entries.
*/
[email protected](name = "ldb",
[email protected](
+ name = "snapshot",
+ description = "Subcommand for all snapshot related repairs.",
subcommands = {
- SnapshotRepair.class,
- TransactionInfoRepair.class,
- },
- description = "Operational tool to repair RocksDB table.")
-@MetaInfServices(RepairSubcommand.class)
-public class RDBRepair implements RepairSubcommand {
+ SnapshotChainRepair.class
+ }
+)
+public class SnapshotRepair implements Callable<Void> {
- @CommandLine.Option(names = {"--db"},
- required = true,
- description = "Database File Path")
- private String dbPath;
+ @CommandLine.Spec
+ private static CommandSpec spec;
- public String getDbPath() {
- return dbPath;
+ @Override
+ public Void call() {
+ GenericCli.missingSubcommand(spec);
+ return null;
}
Review Comment:
Please do not implement `Callable` in intermediate commands (see HDDS-11880).
--
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]