HADOOP-2631 2443 breaks HTable.getStartKeys when there is more than one table

or table you are enumerating isn't the first table


git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk/src/contrib/hbase@616505 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2008-01-29 20:06:19 +00:00
parent f0da1b58aa
commit de2e8d5028
3 changed files with 12 additions and 8 deletions

View File

@ -155,6 +155,8 @@ Trunk (unreleased changes)
HADOOP-2718 Copy Constructor HBaseConfiguration(Configuration) will override
hbase configurations if argumant is not an instance of
HBaseConfiguration.
HADOOP-2631 2443 breaks HTable.getStartKeys when there is more than one
table or table you are enumerating isn't the first table
IMPROVEMENTS
HADOOP-2401 Add convenience put method that takes writable

View File

@ -197,7 +197,8 @@ public class HTable implements HConstants {
Text startRow = new Text(tableName.toString() + ",,999999999999999");
HRegionLocation metaLocation = null;
HRegionInterface server;
// scan over the each meta region
do {
try{
@ -206,13 +207,13 @@ public class HTable implements HConstants {
connection.locateRegion(META_TABLE_NAME, startRow);
// connect to the server hosting the .META. region
HRegionInterface server =
server =
connection.getHRegionConnection(metaLocation.getServerAddress());
// open a scanner over the meta region
scannerId = server.openScanner(
metaLocation.getRegionInfo().getRegionName(),
COLUMN_FAMILY_ARRAY, EMPTY_START_ROW, LATEST_TIMESTAMP,
COLUMN_FAMILY_ARRAY, tableName, LATEST_TIMESTAMP,
null);
// iterate through the scanner, accumulating unique table names
@ -233,19 +234,20 @@ public class HTable implements HConstants {
}
if (info.isOffline()) {
LOG.debug("Region " + info + " was offline!");
break;
continue SCANNER_LOOP;
}
if (info.isSplit()) {
LOG.debug("Region " + info + " was split!");
break;
continue SCANNER_LOOP;
}
keyList.add(info.getStartKey());
}
}
}
// close that remote scanner
server.close(scannerId);
// advance the startRow to the end key of the current region
startRow = metaLocation.getRegionInfo().getEndKey();

View File

@ -311,7 +311,7 @@ public class MultiRegionTable extends HBaseTestCase {
* @param r
* @throws IOException
*/
private static void compact(final MiniHBaseCluster cluster,
protected static void compact(final MiniHBaseCluster cluster,
final HRegionInfo r)
throws IOException {
if (r == null) {