HBASE-510 HConnectionManger.listTables returns empty list if exception (though there may be many tables present)

-Added retry logic to listTables

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@636983 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bryan Duxbury 2008-03-14 03:44:06 +00:00
parent 4ea64897fe
commit 97d4b9fd3c
1 changed files with 37 additions and 33 deletions

View File

@ -256,6 +256,7 @@ public class HConnectionManager implements HConstants {
// scan over the each meta region
do {
for (int triesSoFar = 0; triesSoFar < numRetries; triesSoFar++) {
try{
// turn the start row into a location
metaLocation = locateRegion(META_TABLE_NAME, startRow);
@ -289,6 +290,8 @@ public class HConnectionManager implements HConstants {
// advance the startRow to the end key of the current region
startRow = metaLocation.getRegionInfo().getEndKey();
// break out of retry loop
break;
} catch (IOException e) {
// Retry once.
metaLocation = relocateRegion(META_TABLE_NAME, startRow);
@ -299,6 +302,7 @@ public class HConnectionManager implements HConstants {
server.close(scannerId);
}
}
}
} while (startRow.compareTo(LAST_ROW) != 0);
return uniqueTables.toArray(new HTableDescriptor[uniqueTables.size()]);