HBASE-2184 Calling HTable.getTableDescriptor().* on a full cluster takes a long time

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@906826 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2010-02-05 06:50:21 +00:00
parent 443686f101
commit fbc67df8b7
3 changed files with 21 additions and 2 deletions

View File

@ -194,6 +194,8 @@ Release 0.21.0 - Unreleased
HBASE-2163 ZK dependencies - explicitly add them until ZK artifacts are
published to mvn repository (Kay Kay via Stack)
HBASE-2164 Ivy nit - clean up configs (Kay Kay via Stack)
HBASE-2184 Calling HTable.getTableDescriptor().* on a full cluster takes
a long time (Cristian Ivascu via Stack)
IMPROVEMENTS
HBASE-1760 Cleanup TODOs in HTable

View File

@ -590,7 +590,7 @@ public class HConnectionManager implements HConstants {
return HTableDescriptor.META_TABLEDESC;
}
HTableDescriptorFinder finder = new HTableDescriptorFinder(tableName);
MetaScanner.metaScan(conf, finder);
MetaScanner.metaScan(conf, finder, tableName);
HTableDescriptor result = finder.getResult();
if (result == null) {
throw new TableNotFoundException(Bytes.toString(tableName));

View File

@ -415,4 +415,21 @@ public class TestAdmin {
this.admin.deleteTable(tableName);
}
}
@Test
public void testGetTableDescriptor() throws IOException {
HColumnDescriptor fam1 = new HColumnDescriptor("fam1");
HColumnDescriptor fam2 = new HColumnDescriptor("fam2");
HColumnDescriptor fam3 = new HColumnDescriptor("fam3");
HTableDescriptor htd = new HTableDescriptor("myTestTable");
htd.addFamily(fam1);
htd.addFamily(fam2);
htd.addFamily(fam3);
this.admin.createTable(htd);
HTable table = new HTable("myTestTable");
HTableDescriptor confirmedHtd = table.getTableDescriptor();
assertEquals(htd.compareTo(confirmedHtd), 0);
}
}