HBASE-4127 Don't modify table's name away in HBaseAdmin

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1149764 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nicolas Spiegelberg 2011-07-22 23:38:58 +00:00
parent 25c43285bd
commit 81897bd47f
2 changed files with 7 additions and 1 deletions

View File

@ -168,6 +168,7 @@ Release 0.91.0 - Unreleased
cannot be changed (fulin wang via Ted Yu)
HBASE-4118 method regionserver.MemStore#updateColumnValue: the check for
qualifier and family is missing (N Keywal via Ted Yu)
HBASE-4127 Don't modify table's name away in HBaseAdmin
IMPROVEMENTS
HBASE-3290 Max Compaction Size (Nicolas Spiegelberg via Stack)

View File

@ -26,6 +26,7 @@ import org.apache.hadoop.hbase.HRegionInfo;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.Server;
import org.apache.hadoop.hbase.master.MasterServices;
import org.apache.hadoop.hbase.util.Bytes;
public class ModifyTableHandler extends TableEventHandler {
private final HTableDescriptor htd;
@ -35,6 +36,10 @@ public class ModifyTableHandler extends TableEventHandler {
final MasterServices masterServices) throws IOException {
super(EventType.C_M_MODIFY_TABLE, tableName, server, masterServices);
this.htd = htd;
if (!Bytes.equals(tableName, htd.getName())) {
throw new IOException("TableDescriptor name & tableName must match: "
+ htd.getNameAsString() + " vs " + Bytes.toString(tableName));
}
}
@Override
@ -52,4 +57,4 @@ public class ModifyTableHandler extends TableEventHandler {
}
return getClass().getSimpleName() + "-" + name + "-" + getSeqid() + "-" + tableNameStr;
}
}
}