From 36f069c51a3eb09156bcfe95117c39711eaac7f2 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Thu, 16 Jan 2025 11:46:40 +0100 Subject: [PATCH] HDDS-12086. Allow --db option at leaf subcommand in debug tools --- .../test/java/org/apache/hadoop/ozone/debug/TestLDBCli.java | 4 ++-- .../java/org/apache/hadoop/ozone/debug/ldb/RDBParser.java | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/debug/TestLDBCli.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/debug/TestLDBCli.java index aac55367adc..b3ab92d87aa 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/debug/TestLDBCli.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/debug/TestLDBCli.java @@ -293,8 +293,8 @@ void testLDBScan( // Prepare scan args List completeScanArgs = new ArrayList<>(); completeScanArgs.addAll(Arrays.asList( - "--db", dbStore.getDbLocation().getAbsolutePath(), "scan", + "--db", dbStore.getDbLocation().getAbsolutePath(), "--column-family", tableName)); completeScanArgs.addAll(scanArgs); @@ -353,9 +353,9 @@ void testScanWithRecordsPerFile() throws IOException { // Prepare scan args int maxRecordsPerFile = 2; List completeScanArgs1 = new ArrayList<>(Arrays.asList( - "--db", dbStore.getDbLocation().getAbsolutePath(), "scan", "--column-family", KEY_TABLE, "--out", scanDir1 + File.separator + "keytable", + "--db", dbStore.getDbLocation().getAbsolutePath(), "--max-records-per-file", String.valueOf(maxRecordsPerFile))); File tmpDir1 = new File(scanDir1); tmpDir1.deleteOnExit(); diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ldb/RDBParser.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ldb/RDBParser.java index f07e8f35fba..1ca36c52f7f 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ldb/RDBParser.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ldb/RDBParser.java @@ -40,6 +40,7 @@ public class RDBParser implements DebugSubcommand { @CommandLine.Option(names = {"--db"}, required = true, + scope = CommandLine.ScopeType.INHERIT, description = "Database File Path") private String dbPath;