Index: src/java/org/apache/hadoop/hbase/master/HMaster.java =================================================================== --- src/java/org/apache/hadoop/hbase/master/HMaster.java (revision 633362) +++ src/java/org/apache/hadoop/hbase/master/HMaster.java (working copy) @@ -664,6 +664,11 @@ } /** {@inheritDoc} */ + public void renameTable(Text oldTableName, Text newTableName) throws IOException { + new RanamingOperation(this, oldTableName, newTableName).process(); + } + + /** {@inheritDoc} */ public void enableTable(Text tableName) throws IOException { new ChangeTableState(this, tableName, true).process(); } Index: src/java/org/apache/hadoop/hbase/master/RanamingOperation.java =================================================================== --- src/java/org/apache/hadoop/hbase/master/RanamingOperation.java (revision 0) +++ src/java/org/apache/hadoop/hbase/master/RanamingOperation.java (revision 0) @@ -0,0 +1,52 @@ +/** + * Copyright 2007 The Apache Software Foundation + * + * 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.master; + +import java.io.IOException; + +import org.apache.hadoop.hbase.HRegionInfo; +import org.apache.hadoop.hbase.ipc.HRegionInterface; +import org.apache.hadoop.io.Text; + +/** + * Renames the table R to S and columnfamilies Ai to Bi + */ +public class RanamingOperation extends TableOperation { + + protected RanamingOperation(HMaster master, Text tableName, Text newTableName) + throws IOException { + super(master, tableName); + } + + @Override + protected void postProcessMeta(MetaRegion m, HRegionInterface server) + throws IOException { + // TODO Auto-generated method stub + + } + + @Override + protected void processScanItem(String serverName, long startCode, + HRegionInfo info) throws IOException { + // TODO Auto-generated method stub + + } + +} Index: src/java/org/apache/hadoop/hbase/ipc/HMasterInterface.java =================================================================== --- src/java/org/apache/hadoop/hbase/ipc/HMasterInterface.java (revision 633362) +++ src/java/org/apache/hadoop/hbase/ipc/HMasterInterface.java (working copy) @@ -48,6 +48,7 @@ /** * Creates a new table + * * @param desc table descriptor * @throws IOException */ @@ -55,6 +56,7 @@ /** * Deletes a table + * * @param tableName * @throws IOException */ @@ -62,6 +64,7 @@ /** * Adds a column to the specified table + * * @param tableName * @param column column descriptor * @throws IOException @@ -70,6 +73,7 @@ /** * Modifies an existing column on the specified table + * * @param tableName * @param columnName name of the column to edit * @param descriptor new column descriptor @@ -82,6 +86,7 @@ /** * Deletes a column from the specified table + * * @param tableName * @param columnName * @throws IOException @@ -89,7 +94,17 @@ public void deleteColumn(Text tableName, Text columnName) throws IOException; /** + * Renames the table R to S and columnfamilies Ai to Bi + * + * @param oldTableName table name of R + * @param newTableName table name of S + * @throws IOException + */ + public void renameTable(Text oldTableName, Text newTableName) throws IOException; + + /** * Puts the table on-line (only needed if table has been previously taken offline) + * * @param tableName * @throws IOException */ @@ -102,15 +117,17 @@ * @throws IOException */ public void disableTable(Text tableName) throws IOException; - + /** * Shutdown an HBase cluster. + * * @throws IOException */ public void shutdown() throws IOException; /** * Get the location of the root region + * * @return address of server that serves the root region */ public HServerAddress findRootRegion(); Index: src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java =================================================================== --- src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (revision 633362) +++ src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (working copy) @@ -492,6 +492,19 @@ } /** + * Renames the table R to S and columnfamilies Ai to Bi + * + * @param oldTableName table name of R + * @param newTableName table name of S + * @throws IOException + */ + public void renameTable(Text oldTableName, Text newTableName) + throws IOException { + //TODO: Fill up the body -- edward + + } + + /** * Modify an existing column family on a table * * @param tableName name of table