HADOOP-1534. [hbase] Memcache scanner fails if start key not present

* src/contrib/hbase/src/java/org/apache/hadoop/hbase/HMemcache.java
    (findFirstRow): Change compare from startsWith -- looking for
    an 'exact' match -- to instead use compareTo and if >= 0, then
    we are at first key.
* src/contrib/hbase/src/java/org/apache/hadoop/hbase/HRegionServer.java
    Add logging of problematic directory if server won't start because
    log file exists.


git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk/src/contrib/hbase@551039 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2007-06-27 04:50:10 +00:00
parent 6455364281
commit a31d0e5f31
3 changed files with 5 additions and 5 deletions

View File

@ -39,4 +39,4 @@ Trunk (unreleased changes)
instead of private for easier extension. Also made HRegion and HRegionInfo public too.
Added an hbase-default.xml property for specifying what HRegionInterface extension to use
for proxy server connection.
24. HADOOP-1534. [hbase] Memcache scanner fails if start key not present

View File

@ -332,8 +332,8 @@ public class HMemcache {
* @return true if this is the first row
*/
boolean findFirstRow(int i, Text firstRow) {
return ((firstRow.getLength() == 0)
|| (keys[i].getRow().toString().startsWith(firstRow.toString())));
return firstRow.getLength() == 0 ||
keys[i].getRow().compareTo(firstRow) >= 0;
}
/**

View File

@ -446,7 +446,7 @@ public class HRegionServer implements HConstants, HRegionInterface, Runnable {
if(fs.exists(logdir)) {
throw new RegionServerRunningException("region server already running at " +
this.serverInfo.getServerAddress().toString() + " because logdir " +
" exists");
logdir.toString() + " exists");
}
this.log = new HLog(fs, logdir, conf);