diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/migration/Upgrade.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/migration/Upgrade.java new file mode 100644 index 0000000..8ee4509 --- /dev/null +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/migration/Upgrade.java @@ -0,0 +1,57 @@ +/** + * 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.hbase.migration; + +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.Option; +import org.apache.hadoop.hbase.util.AbstractHBaseTool; + +/** + * Script to run the 0.96 migration. + */ +public class Upgrade extends AbstractHBaseTool { + @Override + protected void addOptions() { + addOptNoArg("u", "upgrade", "Run the upgrade"); + } + + + @Override + protected void processOptions(CommandLine cmd) { + for (Option o: cmd.getOptions()) { + System.out.println(o); + } + } + + + @Override + protected int doWork() throws Exception { + NamespaceUpgrade nu = new NamespaceUpgrade(); + nu.setConf(getConf()); + String [] args = new String [] {"--upgrade"}; + return nu.run(args); + } + + /** + * @param args + * @throws Exception + */ + public static void main(String[] args) throws Exception { + new Upgrade().doStaticMain(args); + } +} \ No newline at end of file diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/AbstractHBaseTool.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/AbstractHBaseTool.java index 28b4250..6a29a38 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/AbstractHBaseTool.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/AbstractHBaseTool.java @@ -194,5 +194,4 @@ public abstract class AbstractHBaseTool implements Tool { } System.exit(ret); } - -} +} \ No newline at end of file