Skip to content

Commit

Permalink
HDDS-12054. Move ozone debug prefix to ozone debug om prefix (#7674)
Browse files Browse the repository at this point in the history
  • Loading branch information
sarvekshayr authored Jan 10, 2025
1 parent 9c391bc commit da8fa24
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.apache.hadoop.ozone.OzoneConsts;
import org.apache.hadoop.ozone.TestDataUtil;
import org.apache.hadoop.ozone.client.OzoneClient;
import org.apache.hadoop.ozone.debug.PrefixParser;
import org.apache.hadoop.ozone.debug.om.PrefixParser;
import org.apache.hadoop.ozone.om.OMStorage;
import org.apache.hadoop.ozone.om.helpers.BucketLayout;
import org.junit.jupiter.api.AfterAll;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* 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.debug.om;

import org.apache.hadoop.hdds.cli.DebugSubcommand;
import org.kohsuke.MetaInfServices;
import picocli.CommandLine;

/**
* OM debug related commands.
*/
@CommandLine.Command(
name = "om",
description = "Debug commands related to OM.",
subcommands = {
PrefixParser.class
}
)
@MetaInfServices(DebugSubcommand.class)
public class OMDebug implements DebugSubcommand {
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* limitations under the License.
*/

package org.apache.hadoop.ozone.debug;
package org.apache.hadoop.ozone.debug.om;

import java.io.IOException;
import java.nio.file.Files;
Expand All @@ -26,7 +26,6 @@
import java.util.concurrent.Callable;

import java.nio.file.Path;
import org.apache.hadoop.hdds.cli.DebugSubcommand;

import org.apache.hadoop.hdds.conf.OzoneConfiguration;
import org.apache.hadoop.hdds.utils.MetadataKeyFilters;
Expand All @@ -40,10 +39,7 @@
import org.apache.hadoop.ozone.om.helpers.OmBucketInfo;
import org.apache.hadoop.ozone.om.helpers.WithParentObjectId;
import org.apache.hadoop.ozone.om.helpers.OmDirectoryInfo;
import org.kohsuke.MetaInfServices;
import picocli.CommandLine;
import picocli.CommandLine.Model.CommandSpec;
import picocli.CommandLine.Spec;

import static org.apache.hadoop.ozone.OzoneConsts.OM_KEY_PREFIX;

Expand All @@ -53,8 +49,7 @@
@CommandLine.Command(
name = "prefix",
description = "Parse prefix contents")
@MetaInfServices(DebugSubcommand.class)
public class PrefixParser implements Callable<Void>, DebugSubcommand {
public class PrefixParser implements Callable<Void> {

/**
* Types to represent the level or path component type.
Expand All @@ -70,9 +65,6 @@ public enum Types {

private final int[] parserStats = new int[Types.values().length];

@Spec
private CommandSpec spec;

@CommandLine.Option(names = {"--db"},
required = true,
description = "Database File Path")
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
*/

/**
* OM debug related commands.
*/
package org.apache.hadoop.ozone.debug.om;

0 comments on commit da8fa24

Please sign in to comment.