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:
parent
4ea64897fe
commit
97d4b9fd3c
|
@ -256,6 +256,7 @@ public class HConnectionManager implements HConstants {
|
||||||
|
|
||||||
// scan over the each meta region
|
// scan over the each meta region
|
||||||
do {
|
do {
|
||||||
|
for (int triesSoFar = 0; triesSoFar < numRetries; triesSoFar++) {
|
||||||
try{
|
try{
|
||||||
// turn the start row into a location
|
// turn the start row into a location
|
||||||
metaLocation = locateRegion(META_TABLE_NAME, startRow);
|
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
|
// advance the startRow to the end key of the current region
|
||||||
startRow = metaLocation.getRegionInfo().getEndKey();
|
startRow = metaLocation.getRegionInfo().getEndKey();
|
||||||
|
// break out of retry loop
|
||||||
|
break;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// Retry once.
|
// Retry once.
|
||||||
metaLocation = relocateRegion(META_TABLE_NAME, startRow);
|
metaLocation = relocateRegion(META_TABLE_NAME, startRow);
|
||||||
|
@ -299,6 +302,7 @@ public class HConnectionManager implements HConstants {
|
||||||
server.close(scannerId);
|
server.close(scannerId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} while (startRow.compareTo(LAST_ROW) != 0);
|
} while (startRow.compareTo(LAST_ROW) != 0);
|
||||||
|
|
||||||
return uniqueTables.toArray(new HTableDescriptor[uniqueTables.size()]);
|
return uniqueTables.toArray(new HTableDescriptor[uniqueTables.size()]);
|
||||||
|
|
Loading…
Reference in New Issue