From 98e070e6eebe8aa76fac70530a2bc1ada7cd1a77 Mon Sep 17 00:00:00 2001 From: Sarveksha Yeshavantha Raju <79865743+sarvekshayr@users.noreply.github.com> Date: Tue, 3 Dec 2024 23:57:21 +0530 Subject: [PATCH] HDDS-11728. Refactor subcommand layouts of ozone debug and repair (#7489) --- .../apache/hadoop/ozone/debug/TestLDBCli.java | 3 +++ .../ozone/dn/ratis/TestDnRatisLogParser.java | 2 +- .../parser/TestOzoneHARatisLogParser.java | 4 ++-- .../ozone/shell/TestOzoneDebugShell.java | 4 ++-- .../ozone/shell/TestOzoneRepairShell.java | 8 +++---- .../{ => chunk}/ChunkDataNodeDetails.java | 2 +- .../ozone/debug/{ => chunk}/ChunkDetails.java | 2 +- .../debug/{ => chunk}/ChunkKeyHandler.java | 3 ++- .../ozone/debug/{ => chunk}/ChunkType.java | 2 +- .../debug/{ => chunk}/ContainerChunkInfo.java | 2 +- .../ozone/debug/chunk/package-info.java | 22 +++++++++++++++++++ .../ozone/debug/{ => ldb}/DBScanner.java | 4 +++- .../ozone/debug/{ => ldb}/DropTable.java | 3 ++- .../ozone/debug/{ => ldb}/ListTables.java | 2 +- .../ozone/debug/{ => ldb}/RDBParser.java | 3 ++- .../ozone/debug/{ => ldb}/ValueSchema.java | 3 ++- .../hadoop/ozone/debug/ldb/package-info.java | 22 +++++++++++++++++++ .../segmentparser/BaseLogParser.java | 2 +- .../segmentparser/DatanodeRatisLogParser.java | 2 +- .../segmentparser/GenericRatisLogParser.java | 2 +- .../segmentparser/OMRatisLogParser.java | 2 +- .../segmentparser/RatisLogParser.java | 2 +- .../segmentparser/SCMRatisLogParser.java | 2 +- .../segmentparser/package-info.java | 2 +- .../ozone/repair/{ => ldb}/RDBRepair.java | 3 ++- .../repair/{om => ldb}/SnapshotRepair.java | 3 +-- .../{ => ldb}/TransactionInfoRepair.java | 2 +- .../hadoop/ozone/repair/ldb/package-info.java | 22 +++++++++++++++++++ .../ozone/repair/quota/package-info.java | 2 +- .../{ => ldb}/TestTransactionInfoRepair.java | 2 +- 30 files changed, 107 insertions(+), 32 deletions(-) rename hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/{ => chunk}/ChunkDataNodeDetails.java (96%) rename hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/{ => chunk}/ChunkDetails.java (96%) rename hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/{ => chunk}/ChunkKeyHandler.java (99%) rename hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/{ => chunk}/ChunkType.java (95%) rename hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/{ => chunk}/ContainerChunkInfo.java (98%) create mode 100644 hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/chunk/package-info.java rename hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/{ => ldb}/DBScanner.java (99%) rename hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/{ => ldb}/DropTable.java (96%) rename hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/{ => ldb}/ListTables.java (97%) rename hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/{ => ldb}/RDBParser.java (95%) rename hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/{ => ldb}/ValueSchema.java (98%) create mode 100644 hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ldb/package-info.java rename hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/{ => debug}/segmentparser/BaseLogParser.java (97%) rename hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/{ => debug}/segmentparser/DatanodeRatisLogParser.java (97%) rename hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/{ => debug}/segmentparser/GenericRatisLogParser.java (96%) rename hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/{ => debug}/segmentparser/OMRatisLogParser.java (96%) rename hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/{ => debug}/segmentparser/RatisLogParser.java (97%) rename hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/{ => debug}/segmentparser/SCMRatisLogParser.java (96%) rename hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/{ => debug}/segmentparser/package-info.java (94%) rename hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/{ => ldb}/RDBRepair.java (94%) rename hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/{om => ldb}/SnapshotRepair.java (98%) rename hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/{ => ldb}/TransactionInfoRepair.java (99%) create mode 100644 hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/ldb/package-info.java rename hadoop-ozone/tools/src/test/java/org/apache/hadoop/ozone/repair/{ => ldb}/TestTransactionInfoRepair.java (99%) 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 b1b073619ba..56a814da1f2 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 @@ -36,6 +36,9 @@ import org.apache.hadoop.ozone.container.common.statemachine.DatanodeConfiguration; import org.apache.hadoop.ozone.container.keyvalue.helpers.BlockUtils; import org.apache.hadoop.ozone.container.metadata.DatanodeSchemaThreeDBDefinition; +import org.apache.hadoop.ozone.debug.ldb.DBScanner; +import org.apache.hadoop.ozone.debug.ldb.RDBParser; +import org.apache.hadoop.ozone.debug.ldb.ValueSchema; import org.apache.hadoop.ozone.om.helpers.OmKeyInfo; import org.apache.hadoop.ozone.om.request.OMRequestTestUtils; import jakarta.annotation.Nonnull; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/dn/ratis/TestDnRatisLogParser.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/dn/ratis/TestDnRatisLogParser.java index 7c82633f113..c5a45da8c77 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/dn/ratis/TestDnRatisLogParser.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/dn/ratis/TestDnRatisLogParser.java @@ -26,7 +26,7 @@ import org.apache.hadoop.hdds.conf.OzoneConfiguration; import org.apache.hadoop.ozone.MiniOzoneCluster; import org.apache.hadoop.ozone.OzoneConfigKeys; -import org.apache.hadoop.ozone.segmentparser.DatanodeRatisLogParser; +import org.apache.hadoop.ozone.debug.segmentparser.DatanodeRatisLogParser; import org.apache.ozone.test.GenericTestUtils; import org.junit.jupiter.api.AfterEach; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/parser/TestOzoneHARatisLogParser.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/parser/TestOzoneHARatisLogParser.java index dff4cd046c9..3172838ab50 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/parser/TestOzoneHARatisLogParser.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/parser/TestOzoneHARatisLogParser.java @@ -29,8 +29,8 @@ import org.apache.hadoop.ozone.client.OzoneClientFactory; import org.apache.hadoop.ozone.om.helpers.OMRatisHelper; import org.apache.hadoop.ozone.MiniOzoneCluster; -import org.apache.hadoop.ozone.segmentparser.OMRatisLogParser; -import org.apache.hadoop.ozone.segmentparser.SCMRatisLogParser; +import org.apache.hadoop.ozone.debug.segmentparser.OMRatisLogParser; +import org.apache.hadoop.ozone.debug.segmentparser.SCMRatisLogParser; import org.apache.ozone.test.GenericTestUtils; import org.apache.ozone.test.tag.Flaky; import org.junit.jupiter.api.AfterEach; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneDebugShell.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneDebugShell.java index 9b1747b4c27..f4f980e340d 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneDebugShell.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneDebugShell.java @@ -36,9 +36,9 @@ import org.apache.hadoop.ozone.client.OzoneClient; import org.apache.hadoop.ozone.client.OzoneClientFactory; import org.apache.hadoop.ozone.client.OzoneSnapshot; -import org.apache.hadoop.ozone.debug.DBScanner; +import org.apache.hadoop.ozone.debug.ldb.DBScanner; import org.apache.hadoop.ozone.debug.OzoneDebug; -import org.apache.hadoop.ozone.debug.RDBParser; +import org.apache.hadoop.ozone.debug.ldb.RDBParser; import org.apache.hadoop.ozone.om.OMConfigKeys; import org.apache.hadoop.ozone.om.OMStorage; import org.apache.hadoop.ozone.om.helpers.BucketLayout; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneRepairShell.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneRepairShell.java index 9216c909ee4..1860d695f5e 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneRepairShell.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneRepairShell.java @@ -19,12 +19,12 @@ import org.apache.hadoop.hdds.conf.OzoneConfiguration; import org.apache.hadoop.ozone.MiniOzoneCluster; -import org.apache.hadoop.ozone.debug.DBScanner; -import org.apache.hadoop.ozone.debug.RDBParser; +import org.apache.hadoop.ozone.debug.ldb.DBScanner; +import org.apache.hadoop.ozone.debug.ldb.RDBParser; import org.apache.hadoop.ozone.om.OMStorage; import org.apache.hadoop.ozone.repair.OzoneRepair; -import org.apache.hadoop.ozone.repair.RDBRepair; -import org.apache.hadoop.ozone.repair.TransactionInfoRepair; +import org.apache.hadoop.ozone.repair.ldb.RDBRepair; +import org.apache.hadoop.ozone.repair.ldb.TransactionInfoRepair; import org.apache.hadoop.ozone.repair.quota.QuotaRepair; import org.apache.hadoop.ozone.repair.quota.QuotaStatus; import org.apache.hadoop.ozone.repair.quota.QuotaTrigger; diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ChunkDataNodeDetails.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/chunk/ChunkDataNodeDetails.java similarity index 96% rename from hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ChunkDataNodeDetails.java rename to hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/chunk/ChunkDataNodeDetails.java index 6019e5806dd..cf6b7d7a11d 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ChunkDataNodeDetails.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/chunk/ChunkDataNodeDetails.java @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.hadoop.ozone.debug; +package org.apache.hadoop.ozone.debug.chunk; /** * Class that gives datanode details on which the chunk is present. */ diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ChunkDetails.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/chunk/ChunkDetails.java similarity index 96% rename from hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ChunkDetails.java rename to hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/chunk/ChunkDetails.java index 278c2bf055c..4e2b5314a06 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ChunkDetails.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/chunk/ChunkDetails.java @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.hadoop.ozone.debug; +package org.apache.hadoop.ozone.debug.chunk; /** * Class that gives chunkDetails. diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ChunkKeyHandler.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/chunk/ChunkKeyHandler.java similarity index 99% rename from hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ChunkKeyHandler.java rename to hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/chunk/ChunkKeyHandler.java index fe114947f2a..af97b7135db 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ChunkKeyHandler.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/chunk/ChunkKeyHandler.java @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.hadoop.ozone.debug; +package org.apache.hadoop.ozone.debug.chunk; import java.io.File; import java.io.IOException; @@ -42,6 +42,7 @@ import org.apache.hadoop.ozone.OzoneConsts; import org.apache.hadoop.ozone.client.OzoneClient; import org.apache.hadoop.ozone.container.common.impl.ContainerLayoutVersion; +import org.apache.hadoop.ozone.debug.OzoneDebug; import org.apache.hadoop.ozone.om.helpers.OmKeyArgs; import org.apache.hadoop.ozone.om.helpers.OmKeyInfo; import org.apache.hadoop.ozone.om.helpers.OmKeyLocationInfo; diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ChunkType.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/chunk/ChunkType.java similarity index 95% rename from hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ChunkType.java rename to hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/chunk/ChunkType.java index 610eab54d6f..3af7f810402 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ChunkType.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/chunk/ChunkType.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.debug.chunk; /** * The type of chunks of an Erasure Coded key. diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ContainerChunkInfo.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/chunk/ContainerChunkInfo.java similarity index 98% rename from hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ContainerChunkInfo.java rename to hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/chunk/ContainerChunkInfo.java index 130c1bca0fc..1c5fc090b0e 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ContainerChunkInfo.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/chunk/ContainerChunkInfo.java @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.hadoop.ozone.debug; +package org.apache.hadoop.ozone.debug.chunk; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/chunk/package-info.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/chunk/package-info.java new file mode 100644 index 00000000000..d81f2276a65 --- /dev/null +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/chunk/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. + */ + +/** + * Command to debug chunk information. + */ +package org.apache.hadoop.ozone.debug.chunk; diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBScanner.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ldb/DBScanner.java similarity index 99% rename from hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBScanner.java rename to hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ldb/DBScanner.java index bd5b1ed6c1c..a2c464194b0 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBScanner.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ldb/DBScanner.java @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.hadoop.ozone.debug; +package org.apache.hadoop.ozone.debug.ldb; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonInclude; @@ -44,6 +44,8 @@ import org.apache.hadoop.ozone.OzoneConsts; import org.apache.hadoop.ozone.container.common.statemachine.DatanodeConfiguration; import org.apache.hadoop.ozone.container.metadata.DatanodeSchemaThreeDBDefinition; +import org.apache.hadoop.ozone.debug.DBDefinitionFactory; +import org.apache.hadoop.ozone.debug.RocksDBUtils; import org.apache.hadoop.ozone.utils.Filter; import org.kohsuke.MetaInfServices; import org.rocksdb.ColumnFamilyDescriptor; diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DropTable.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ldb/DropTable.java similarity index 96% rename from hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DropTable.java rename to hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ldb/DropTable.java index 745712850b9..9b944676b0d 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DropTable.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ldb/DropTable.java @@ -16,10 +16,11 @@ * limitations under the License. */ -package org.apache.hadoop.ozone.debug; +package org.apache.hadoop.ozone.debug.ldb; import org.apache.hadoop.hdds.cli.SubcommandWithParent; import org.apache.hadoop.hdds.utils.db.managed.ManagedRocksDB; +import org.apache.hadoop.ozone.debug.RocksDBUtils; import org.rocksdb.ColumnFamilyDescriptor; import org.rocksdb.ColumnFamilyHandle; import picocli.CommandLine; diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ListTables.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ldb/ListTables.java similarity index 97% rename from hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ListTables.java rename to hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ldb/ListTables.java index 494f42e5877..c3d9bc4651e 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ListTables.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ldb/ListTables.java @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.hadoop.ozone.debug; +package org.apache.hadoop.ozone.debug.ldb; import java.nio.charset.StandardCharsets; import java.util.List; diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/RDBParser.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ldb/RDBParser.java similarity index 95% rename from hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/RDBParser.java rename to hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ldb/RDBParser.java index f133386ab13..da3ff5f3030 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/RDBParser.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ldb/RDBParser.java @@ -16,13 +16,14 @@ * limitations under the License. */ -package org.apache.hadoop.ozone.debug; +package org.apache.hadoop.ozone.debug.ldb; import java.util.concurrent.Callable; import org.apache.hadoop.hdds.cli.GenericCli; import org.apache.hadoop.hdds.cli.SubcommandWithParent; +import org.apache.hadoop.ozone.debug.OzoneDebug; import org.kohsuke.MetaInfServices; import picocli.CommandLine; import picocli.CommandLine.Model.CommandSpec; diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ValueSchema.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ldb/ValueSchema.java similarity index 98% rename from hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ValueSchema.java rename to hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ldb/ValueSchema.java index b06be2aff53..9c4ce4e0ebe 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ValueSchema.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ldb/ValueSchema.java @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.hadoop.ozone.debug; +package org.apache.hadoop.ozone.debug.ldb; import org.apache.hadoop.hdds.cli.SubcommandWithParent; import org.apache.hadoop.hdds.conf.OzoneConfiguration; @@ -24,6 +24,7 @@ import org.apache.hadoop.hdds.utils.db.DBColumnFamilyDefinition; import org.apache.hadoop.hdds.utils.db.DBDefinition; import org.apache.hadoop.ozone.OzoneConsts; +import org.apache.hadoop.ozone.debug.DBDefinitionFactory; import org.kohsuke.MetaInfServices; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ldb/package-info.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ldb/package-info.java new file mode 100644 index 00000000000..d69d92e6f1b --- /dev/null +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/ldb/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. + */ + +/** + * RDB debug related commands. + */ +package org.apache.hadoop.ozone.debug.ldb; diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/segmentparser/BaseLogParser.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/segmentparser/BaseLogParser.java similarity index 97% rename from hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/segmentparser/BaseLogParser.java rename to hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/segmentparser/BaseLogParser.java index a3ea9f6a1f6..4d2fb4b23c2 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/segmentparser/BaseLogParser.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/segmentparser/BaseLogParser.java @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.ozone.segmentparser; +package org.apache.hadoop.ozone.debug.segmentparser; import com.google.common.annotations.VisibleForTesting; import org.apache.ratis.proto.RaftProtos; diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/segmentparser/DatanodeRatisLogParser.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/segmentparser/DatanodeRatisLogParser.java similarity index 97% rename from hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/segmentparser/DatanodeRatisLogParser.java rename to hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/segmentparser/DatanodeRatisLogParser.java index 9f35e8b3c31..3f0f70c281b 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/segmentparser/DatanodeRatisLogParser.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/segmentparser/DatanodeRatisLogParser.java @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.ozone.segmentparser; +package org.apache.hadoop.ozone.debug.segmentparser; import org.apache.hadoop.hdds.cli.HddsVersionProvider; import org.apache.hadoop.ozone.container.common.transport.server diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/segmentparser/GenericRatisLogParser.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/segmentparser/GenericRatisLogParser.java similarity index 96% rename from hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/segmentparser/GenericRatisLogParser.java rename to hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/segmentparser/GenericRatisLogParser.java index d989527c341..8bd0d0ff5a8 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/segmentparser/GenericRatisLogParser.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/segmentparser/GenericRatisLogParser.java @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.ozone.segmentparser; +package org.apache.hadoop.ozone.debug.segmentparser; import org.apache.hadoop.hdds.cli.HddsVersionProvider; import picocli.CommandLine; diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/segmentparser/OMRatisLogParser.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/segmentparser/OMRatisLogParser.java similarity index 96% rename from hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/segmentparser/OMRatisLogParser.java rename to hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/segmentparser/OMRatisLogParser.java index 1ce8b63dab1..eb6214e6471 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/segmentparser/OMRatisLogParser.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/segmentparser/OMRatisLogParser.java @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.hadoop.ozone.segmentparser; +package org.apache.hadoop.ozone.debug.segmentparser; import org.apache.hadoop.hdds.cli.HddsVersionProvider; import org.apache.hadoop.ozone.om.helpers.OMRatisHelper; diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/segmentparser/RatisLogParser.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/segmentparser/RatisLogParser.java similarity index 97% rename from hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/segmentparser/RatisLogParser.java rename to hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/segmentparser/RatisLogParser.java index d41ee2dec16..d80b6d31a11 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/segmentparser/RatisLogParser.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/segmentparser/RatisLogParser.java @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.ozone.segmentparser; +package org.apache.hadoop.ozone.debug.segmentparser; import org.apache.hadoop.hdds.cli.GenericCli; import org.apache.hadoop.hdds.cli.HddsVersionProvider; diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/segmentparser/SCMRatisLogParser.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/segmentparser/SCMRatisLogParser.java similarity index 96% rename from hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/segmentparser/SCMRatisLogParser.java rename to hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/segmentparser/SCMRatisLogParser.java index db0cd8bd14e..dfdbdd2d847 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/segmentparser/SCMRatisLogParser.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/segmentparser/SCMRatisLogParser.java @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.hadoop.ozone.segmentparser; +package org.apache.hadoop.ozone.debug.segmentparser; import org.apache.hadoop.hdds.cli.HddsVersionProvider; import org.apache.hadoop.hdds.scm.ha.SCMRatisRequest; diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/segmentparser/package-info.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/segmentparser/package-info.java similarity index 94% rename from hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/segmentparser/package-info.java rename to hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/segmentparser/package-info.java index 727bb8aa4e0..d5c1027bfe4 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/segmentparser/package-info.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/segmentparser/package-info.java @@ -15,8 +15,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.ozone.segmentparser; /** * Command line utility for dump ratis log files. */ +package org.apache.hadoop.ozone.debug.segmentparser; diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/RDBRepair.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/ldb/RDBRepair.java similarity index 94% rename from hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/RDBRepair.java rename to hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/ldb/RDBRepair.java index 0f36934ec14..fcf7201978d 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/RDBRepair.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/ldb/RDBRepair.java @@ -16,10 +16,11 @@ * limitations under the License. */ -package org.apache.hadoop.ozone.repair; +package org.apache.hadoop.ozone.repair.ldb; import org.apache.hadoop.hdds.cli.GenericCli; import org.apache.hadoop.hdds.cli.SubcommandWithParent; +import org.apache.hadoop.ozone.repair.OzoneRepair; import org.kohsuke.MetaInfServices; import picocli.CommandLine; diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/om/SnapshotRepair.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/ldb/SnapshotRepair.java similarity index 98% rename from hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/om/SnapshotRepair.java rename to hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/ldb/SnapshotRepair.java index d07fc13be8a..f746e99fe78 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/om/SnapshotRepair.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/ldb/SnapshotRepair.java @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.hadoop.ozone.repair.om; +package org.apache.hadoop.ozone.repair.ldb; import org.apache.hadoop.hdds.cli.SubcommandWithParent; import org.apache.hadoop.hdds.utils.IOUtils; @@ -25,7 +25,6 @@ import org.apache.hadoop.hdds.utils.db.managed.ManagedRocksIterator; import org.apache.hadoop.ozone.debug.RocksDBUtils; import org.apache.hadoop.ozone.om.helpers.SnapshotInfo; -import org.apache.hadoop.ozone.repair.RDBRepair; import org.apache.hadoop.ozone.shell.bucket.BucketUri; import org.kohsuke.MetaInfServices; import org.rocksdb.ColumnFamilyDescriptor; diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/TransactionInfoRepair.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/ldb/TransactionInfoRepair.java similarity index 99% rename from hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/TransactionInfoRepair.java rename to hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/ldb/TransactionInfoRepair.java index f2a63317378..369ae3d9a61 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/TransactionInfoRepair.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/ldb/TransactionInfoRepair.java @@ -19,7 +19,7 @@ * permissions and * limitations under the License. */ -package org.apache.hadoop.ozone.repair; +package org.apache.hadoop.ozone.repair.ldb; import org.apache.hadoop.hdds.cli.HddsVersionProvider; import org.apache.hadoop.hdds.cli.SubcommandWithParent; diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/ldb/package-info.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/ldb/package-info.java new file mode 100644 index 00000000000..388d4b7dcea --- /dev/null +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/ldb/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. + */ + +/** + * RDB related repair tools. + */ +package org.apache.hadoop.ozone.repair.ldb; diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/quota/package-info.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/quota/package-info.java index 9a433b24397..40c0abcb916 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/quota/package-info.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/quota/package-info.java @@ -17,6 +17,6 @@ */ /** - * Ozone Repair tools. + * Ozone Quota Repair tools. */ package org.apache.hadoop.ozone.repair.quota; diff --git a/hadoop-ozone/tools/src/test/java/org/apache/hadoop/ozone/repair/TestTransactionInfoRepair.java b/hadoop-ozone/tools/src/test/java/org/apache/hadoop/ozone/repair/ldb/TestTransactionInfoRepair.java similarity index 99% rename from hadoop-ozone/tools/src/test/java/org/apache/hadoop/ozone/repair/TestTransactionInfoRepair.java rename to hadoop-ozone/tools/src/test/java/org/apache/hadoop/ozone/repair/ldb/TestTransactionInfoRepair.java index a581e1d29d6..8a768d0f696 100644 --- a/hadoop-ozone/tools/src/test/java/org/apache/hadoop/ozone/repair/TestTransactionInfoRepair.java +++ b/hadoop-ozone/tools/src/test/java/org/apache/hadoop/ozone/repair/ldb/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; +package org.apache.hadoop.ozone.repair.ldb; import org.apache.hadoop.hdds.utils.TransactionInfo; import org.apache.hadoop.hdds.utils.db.Codec;