Skip to content

Commit 6ef9ecd

Browse files
committed
HDDS-11838. Top-level shell to allow access to admin/debug/sh commands
1 parent 998f5b6 commit 6ef9ecd

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

hadoop-ozone/cli-shell/src/main/java/org/apache/hadoop/ozone/shell/OzoneInteractiveShell.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
package org.apache.hadoop.ozone.shell;
1919

2020
import org.apache.hadoop.hdds.cli.GenericCli;
21+
import org.slf4j.Logger;
22+
import org.slf4j.LoggerFactory;
23+
2124
import picocli.CommandLine;
2225
import picocli.CommandLine.Command;
2326
import picocli.shell.jline3.PicocliCommands.PicocliCommandsFactory;
@@ -27,6 +30,8 @@
2730
*/
2831
public final class OzoneInteractiveShell {
2932

33+
private static final Logger LOG = LoggerFactory.getLogger(OzoneInteractiveShell.class);
34+
3035
private OzoneInteractiveShell() {
3136
}
3237

@@ -66,15 +71,16 @@ private static void addDynamicSubcommand(CommandLine topCmd, String name, String
6671
GenericCli instance = (GenericCli) clazz.getDeclaredConstructor().newInstance();
6772
topCmd.addSubcommand(name, instance.getCmd());
6873
} catch (Exception e) {
69-
// Ignore if the class is not present in the classpath
74+
LOG.debug("Subcommand {} not loaded: class {} not found or could not be instantiated",
75+
name, className, e);
7076
}
7177
}
7278

7379
@Command(name = "ozone", description = "Interactive Shell for all Ozone commands", mixinStandardHelpOptions = true)
7480
private static class TopCommand implements Runnable {
7581
@Override
7682
public void run() {
77-
// Top level command doesn't do anything by itself in REPL
83+
// The top-level command is only used to group subcommands and has no execution logic itself.
7884
}
7985
}
8086
}

0 commit comments

Comments
 (0)