HBASE-451 Remove HTableDescriptor from HRegionInfo -- fix for TestAdmin

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1136125 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2011-06-15 17:18:13 +00:00
parent 0c8d19c975
commit 2aade76735
1 changed files with 4 additions and 8 deletions

View File

@ -901,16 +901,10 @@ implements HMasterInterface, HMasterRegionInterface, MasterServices, Server {
if (!isMasterRunning()) { if (!isMasterRunning()) {
throw new MasterNotRunningException(); throw new MasterNotRunningException();
} }
String tableName = hTableDescriptor.getNameAsString();
if(MetaReader.tableExists(catalogTracker, tableName)) {
throw new TableExistsException(tableName);
}
if (cpHost != null) { if (cpHost != null) {
cpHost.preCreateTable(hTableDescriptor, splitKeys); cpHost.preCreateTable(hTableDescriptor, splitKeys);
} }
HRegionInfo [] newRegions = getHRegionInfos(hTableDescriptor, splitKeys); HRegionInfo [] newRegions = getHRegionInfos(hTableDescriptor, splitKeys);
storeTableDescriptor(hTableDescriptor);
int timeout = conf.getInt("hbase.client.catalog.timeout", 10000); int timeout = conf.getInt("hbase.client.catalog.timeout", 10000);
// Need META availability to create a table // Need META availability to create a table
try { try {
@ -945,9 +939,9 @@ implements HMasterInterface, HMasterRegionInterface, MasterServices, Server {
return hRegionInfos; return hRegionInfos;
} }
private void storeTableDescriptor(HTableDescriptor hTableDescriptor) { private void storeTableDescriptor(HTableDescriptor hTableDescriptor)
throws IOException {
FSUtils.createTableDescriptor(hTableDescriptor, conf); FSUtils.createTableDescriptor(hTableDescriptor, conf);
//fileSystemManager.createTableDescriptor(hTableDescriptor);
} }
private synchronized void createTable(final HTableDescriptor hTableDescriptor, private synchronized void createTable(final HTableDescriptor hTableDescriptor,
@ -958,6 +952,8 @@ implements HMasterInterface, HMasterRegionInterface, MasterServices, Server {
if(MetaReader.tableExists(catalogTracker, tableName)) { if(MetaReader.tableExists(catalogTracker, tableName)) {
throw new TableExistsException(tableName); throw new TableExistsException(tableName);
} }
storeTableDescriptor(hTableDescriptor);
for (HRegionInfo newRegion : newRegions) { for (HRegionInfo newRegion : newRegions) {
// 1. Set table enabling flag up in zk. // 1. Set table enabling flag up in zk.
try { try {