From e9230096ee3698e601d746259dbb0ab75190401e Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Sat, 2 Feb 2008 00:53:48 +0000 Subject: [PATCH] HADOOP-2599 Some minor improvements to changes in HADOOP-2443 git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk/src/contrib/hbase@617725 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 2 ++ src/java/org/apache/hadoop/hbase/HConnectionManager.java | 4 ++-- src/java/org/apache/hadoop/hbase/HConstants.java | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 1e60afff71f..15e5d823117 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -16,6 +16,8 @@ Trunk (unreleased changes) HADOOP-2731 Under load, regions become extremely large and eventually cause region servers to become unresponsive HADOOP-2693 NPE in getClosestRowBefore (Bryan Duxbury & Stack) + HADOOP-2599 Some minor improvements to changes in HADOOP-2443 + (Bryan Duxbury & Stack) IMPROVEMENTS HADOOP-2555 Refactor the HTable#get and HTable#getRow methods to avoid diff --git a/src/java/org/apache/hadoop/hbase/HConnectionManager.java b/src/java/org/apache/hadoop/hbase/HConnectionManager.java index 842070f15ba..66bce74fff5 100644 --- a/src/java/org/apache/hadoop/hbase/HConnectionManager.java +++ b/src/java/org/apache/hadoop/hbase/HConnectionManager.java @@ -257,7 +257,7 @@ public class HConnectionManager implements HConstants { // open a scanner over the meta region scannerId = server.openScanner( metaLocation.getRegionInfo().getRegionName(), - COLUMN_FAMILY_ARRAY, EMPTY_START_ROW, LATEST_TIMESTAMP, + COLUMN_FAMILY_ARRAY, startRow, LATEST_TIMESTAMP, null); // iterate through the scanner, accumulating unique table names @@ -296,7 +296,7 @@ public class HConnectionManager implements HConstants { server.close(scannerId); } } - } while (startRow.compareTo(EMPTY_START_ROW) != 0); + } while (startRow.compareTo(LAST_ROW) != 0); return uniqueTables.toArray(new HTableDescriptor[uniqueTables.size()]); } diff --git a/src/java/org/apache/hadoop/hbase/HConstants.java b/src/java/org/apache/hadoop/hbase/HConstants.java index d543d6fd44a..5731cdedae4 100644 --- a/src/java/org/apache/hadoop/hbase/HConstants.java +++ b/src/java/org/apache/hadoop/hbase/HConstants.java @@ -167,6 +167,12 @@ public interface HConstants { */ static final Text EMPTY_START_ROW = EMPTY_TEXT; + /** + * Used by scanners and others when they're trying to detect the end of a + * table + */ + static final Text LAST_ROW = EMPTY_TEXT; + /** When we encode strings, we always specify UTF8 encoding */ static final String UTF8_ENCODING = "UTF-8";