This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 2f6e229dea HDDS-12029. Move ozone debug recover to ozone admin om 
lease recover (#7670)
2f6e229dea is described below

commit 2f6e229dea0d9ddd2645e488332acb70e9c21eab
Author: Sarveksha Yeshavantha Raju 
<[email protected]>
AuthorDate: Wed Jan 15 13:54:43 2025 +0530

    HDDS-12029. Move ozone debug recover to ozone admin om lease recover (#7670)
---
 hadoop-ozone/dist/src/main/compose/ozone/test.sh   |  2 --
 .../lease-recovery.robot}                          | 10 +++++--
 .../src/main/smoketest/compatibility/read.robot    |  2 +-
 .../src/main/smoketest/debug/ozone-debug.robot     |  5 ----
 .../om/lease}/TestLeaseRecoverer.java              |  2 +-
 .../org/apache/hadoop/ozone/admin/om/OMAdmin.java  |  4 ++-
 .../{debug => admin/om/lease}/LeaseRecoverer.java  | 13 ++++----
 .../ozone/admin/om/lease/LeaseSubCommand.java      | 35 ++++++++++++++++++++++
 .../hadoop/ozone/admin/om/lease/package-info.java  | 22 ++++++++++++++
 9 files changed, 74 insertions(+), 21 deletions(-)

diff --git a/hadoop-ozone/dist/src/main/compose/ozone/test.sh 
b/hadoop-ozone/dist/src/main/compose/ozone/test.sh
index 6477dbd097..a580fd8330 100755
--- a/hadoop-ozone/dist/src/main/compose/ozone/test.sh
+++ b/hadoop-ozone/dist/src/main/compose/ozone/test.sh
@@ -48,8 +48,6 @@ execute_robot_test scm freon
 execute_robot_test scm cli
 execute_robot_test scm admincli
 
-execute_robot_test scm debug/ozone-debug-lease-recovery.robot
-
 execute_robot_test scm -v USERNAME:httpfs httpfs
 execute_debug_tests
 
diff --git 
a/hadoop-ozone/dist/src/main/smoketest/debug/ozone-debug-lease-recovery.robot 
b/hadoop-ozone/dist/src/main/smoketest/admincli/lease-recovery.robot
similarity index 89%
rename from 
hadoop-ozone/dist/src/main/smoketest/debug/ozone-debug-lease-recovery.robot
rename to hadoop-ozone/dist/src/main/smoketest/admincli/lease-recovery.robot
index 691769dbd7..a44ceacc11 100644
--- 
a/hadoop-ozone/dist/src/main/smoketest/debug/ozone-debug-lease-recovery.robot
+++ b/hadoop-ozone/dist/src/main/smoketest/admincli/lease-recovery.robot
@@ -18,7 +18,6 @@ Documentation       Test lease recovery of ozone filesystem
 Library             OperatingSystem
 Resource            ../lib/os.robot
 Resource            ../lib/fs.robot
-Resource            ozone-debug.robot
 Test Timeout        5 minute
 Suite Setup         Create volume bucket and put key
 
@@ -35,8 +34,13 @@ Create volume bucket and put key
     Create File             ${TEMP_DIR}/${TESTFILE}
     Execute                 ozone sh key put /${VOLUME}/${BUCKET}/${TESTFILE} 
${TEMP_DIR}/${TESTFILE}
 
+Execute Lease recovery cli
+    [Arguments]             ${KEY_PATH}
+    ${result} =             Execute And Ignore Error      ozone admin om lease 
recover --path=${KEY_PATH}
+    [Return]                ${result}
+
 *** Test Cases ***
-Test ozone debug recover for o3fs
+Test ozone admin om lease recover for o3fs
     ${o3fs_path} =     Format FS URL         o3fs    ${VOLUME}    ${BUCKET}    
${TESTFILE}
     ${result} =        Execute Lease recovery cli    ${o3fs_path}
                        Should Contain    ${result}   Lease recovery SUCCEEDED
@@ -44,7 +48,7 @@ Test ozone debug recover for o3fs
     ${result} =        Execute Lease recovery cli    ${o3fs_path}
                        Should Contain    ${result}    not found
 
-Test ozone debug recover for ofs
+Test ozone admin om lease recover for ofs
     ${ofs_path} =      Format FS URL         ofs     ${VOLUME}    ${BUCKET}    
${TESTFILE}
     ${result} =        Execute Lease recovery cli    ${ofs_path}
                        Should Contain    ${result}   Lease recovery SUCCEEDED
diff --git a/hadoop-ozone/dist/src/main/smoketest/compatibility/read.robot 
b/hadoop-ozone/dist/src/main/smoketest/compatibility/read.robot
index 9061677eae..b5dfbb9739 100644
--- a/hadoop-ozone/dist/src/main/smoketest/compatibility/read.robot
+++ b/hadoop-ozone/dist/src/main/smoketest/compatibility/read.robot
@@ -154,4 +154,4 @@ HSync Lease Recover Can Be Used
     Pass Execution If    '${DATA_VERSION}' < '${FSO_VERSION}'      Skipped 
write test case
     Pass Execution If    '${CLIENT_VERSION}' < '${HSYNC_VERSION}'    Client 
does not support HSYNC
     Pass Execution If    '${CLUSTER_VERSION}' < '${HSYNC_VERSION}'   Cluster 
does not support HSYNC
-    Execute    ozone debug recover 
--path=ofs://om/vol1/fso-bucket-${DATA_VERSION}/dir/subdir/file
+    Execute    ozone admin om lease recover 
--path=ofs://om/vol1/fso-bucket-${DATA_VERSION}/dir/subdir/file
diff --git a/hadoop-ozone/dist/src/main/smoketest/debug/ozone-debug.robot 
b/hadoop-ozone/dist/src/main/smoketest/debug/ozone-debug.robot
index fa915819ee..e0964e4c16 100644
--- a/hadoop-ozone/dist/src/main/smoketest/debug/ozone-debug.robot
+++ b/hadoop-ozone/dist/src/main/smoketest/debug/ozone-debug.robot
@@ -26,11 +26,6 @@ Execute read-replicas CLI tool
     File Should Exist               ${directory}/${TESTFILE}_manifest
     [Return]                        ${directory}
 
-Execute Lease recovery cli
-    [Arguments]                     ${KEY_PATH}
-    ${result} =                     Execute And Ignore Error      ozone debug 
recover --path=${KEY_PATH}
-    [Return]                        ${result}
-
 Read Replicas Manifest
     ${manifest} =        Get File        ${DIR}/${TESTFILE}_manifest
     ${json} =            Evaluate        json.loads('''${manifest}''')        
json
diff --git 
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/debug/TestLeaseRecoverer.java
 
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/admin/om/lease/TestLeaseRecoverer.java
similarity index 99%
rename from 
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/debug/TestLeaseRecoverer.java
rename to 
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/admin/om/lease/TestLeaseRecoverer.java
index 29f91821eb..004338483b 100644
--- 
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/debug/TestLeaseRecoverer.java
+++ 
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/admin/om/lease/TestLeaseRecoverer.java
@@ -14,7 +14,7 @@
  * License for the specific language governing permissions and limitations 
under
  * the License.
  */
-package org.apache.hadoop.ozone.debug;
+package org.apache.hadoop.ozone.admin.om.lease;
 
 import java.io.IOException;
 import java.io.PrintWriter;
diff --git 
a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/OMAdmin.java
 
b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/OMAdmin.java
index 2e6eedb942..4d10132a7c 100644
--- 
a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/OMAdmin.java
+++ 
b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/OMAdmin.java
@@ -24,6 +24,7 @@ import org.apache.hadoop.hdds.conf.OzoneConfiguration;
 import org.apache.hadoop.ipc.ProtobufRpcEngine;
 import org.apache.hadoop.ipc.RPC;
 import org.apache.hadoop.ozone.OmUtils;
+import org.apache.hadoop.ozone.admin.om.lease.LeaseSubCommand;
 import org.apache.hadoop.ozone.client.OzoneClientException;
 import org.apache.hadoop.ozone.client.OzoneClientFactory;
 import org.apache.hadoop.ozone.client.protocol.ClientProtocol;
@@ -58,7 +59,8 @@ import java.util.Collection;
         DecommissionOMSubcommand.class,
         UpdateRangerSubcommand.class,
         TransferOmLeaderSubCommand.class,
-        FetchKeySubCommand.class
+        FetchKeySubCommand.class,
+        LeaseSubCommand.class
     })
 @MetaInfServices(AdminSubcommand.class)
 public class OMAdmin implements AdminSubcommand {
diff --git 
a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/LeaseRecoverer.java
 
b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/lease/LeaseRecoverer.java
similarity index 83%
rename from 
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/LeaseRecoverer.java
rename to 
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/lease/LeaseRecoverer.java
index 9c3865ae24..c62932747f 100644
--- 
a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/LeaseRecoverer.java
+++ 
b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/lease/LeaseRecoverer.java
@@ -16,7 +16,7 @@
  *  limitations under the License.
  */
 
-package org.apache.hadoop.ozone.debug;
+package org.apache.hadoop.ozone.admin.om.lease;
 
 import java.net.URI;
 import java.util.concurrent.Callable;
@@ -24,24 +24,21 @@ import java.util.concurrent.Callable;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.LeaseRecoverable;
-import org.apache.hadoop.hdds.cli.DebugSubcommand;
 import org.apache.hadoop.hdds.conf.OzoneConfiguration;
 
-import org.kohsuke.MetaInfServices;
 import picocli.CommandLine;
 import picocli.CommandLine.Model.CommandSpec;
 import picocli.CommandLine.Spec;
 
 /**
- * Tool that recover the lease of a specified file.
+ * CLI to recover the lease of a specified file.
  */
 @CommandLine.Command(
     name = "recover",
-    customSynopsis = "ozone debug recover --path=<path>",
-    description = "recover the lease of a specified file. Make sure to specify 
"
+    customSynopsis = "ozone admin om lease recover --path=<path>",
+    description = "Recover the lease of a specified file. Make sure to specify 
"
         + "file system scheme if ofs:// is not the default.")
-@MetaInfServices(DebugSubcommand.class)
-public class LeaseRecoverer implements Callable<Void>, DebugSubcommand {
+public class LeaseRecoverer implements Callable<Void> {
 
   @Spec
   private CommandSpec spec;
diff --git 
a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/lease/LeaseSubCommand.java
 
b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/lease/LeaseSubCommand.java
new file mode 100644
index 0000000000..001dccaf83
--- /dev/null
+++ 
b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/lease/LeaseSubCommand.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.hadoop.ozone.admin.om.lease;
+
+import picocli.CommandLine;
+
+/**
+ * Handler of ozone admin om lease command.
+ */
[email protected](
+    name = "lease",
+    description = "Command for all lease related queries.",
+    subcommands = {
+        LeaseRecoverer.class
+    }
+)
+public class LeaseSubCommand {
+
+}
diff --git 
a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/lease/package-info.java
 
b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/lease/package-info.java
new file mode 100644
index 0000000000..a5cb707dd9
--- /dev/null
+++ 
b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/lease/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Lease related OM Admin tools.
+ */
+package org.apache.hadoop.ozone.admin.om.lease;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to