Skip to content

Commit

Permalink
Added OM repair command
Browse files Browse the repository at this point in the history
  • Loading branch information
sarvekshayr committed Nov 25, 2024
1 parent 9aa705f commit 561b965
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
package org.apache.hadoop.ozone.repair.om;

import org.apache.hadoop.hdds.cli.SubcommandWithParent;
import org.apache.hadoop.ozone.repair.OzoneRepair;
import org.kohsuke.MetaInfServices;
import picocli.CommandLine;

Expand All @@ -37,7 +36,7 @@
public class FSORepairCLI implements Callable<Void>, SubcommandWithParent {

@CommandLine.ParentCommand
private OzoneRepair parent;
private OMRepair parent;

@CommandLine.Option(names = {"--db"},
required = true,
Expand Down Expand Up @@ -85,6 +84,6 @@ public Void call() throws Exception {

@Override
public Class<?> getParentType() {
return OzoneRepair.class;
return OMRepair.class;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* 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.repair.om;

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;

import java.util.concurrent.Callable;

/**
* Ozone Repair CLI for OM.
*/
@CommandLine.Command(name = "om",
description = "Operational tool to repair OM.")
@MetaInfServices(SubcommandWithParent.class)
public class OMRepair implements Callable<Void>, SubcommandWithParent {

@CommandLine.Spec
private CommandLine.Model.CommandSpec spec;

@CommandLine.ParentCommand
private OzoneRepair parent;

@Override
public Void call() {
GenericCli.missingSubcommand(spec);
return null;
}

@Override
public Class<?> getParentType() {
return OzoneRepair.class;
}
}

0 comments on commit 561b965

Please sign in to comment.