HBASE-743 bin/hbase migrate upgrade fails when redo logs exists

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@678581 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2008-07-21 21:54:44 +00:00
parent 3d8fc40fbb
commit 27f37b6365
3 changed files with 13 additions and 13 deletions

View File

@ -197,6 +197,7 @@ Trunk (unreleased changes)
HBASE-424 Should be able to enable/disable .META. table
HBASE-679 Regionserver addresses are still not right in the new tables page
HBASE-758 Throwing IOE read-only when should be throwing NSRE
HBASE-743 bin/hbase migrate upgrade fails when redo logs exists
IMPROVEMENTS
HBASE-559 MR example job to count table rows

View File

@ -172,7 +172,7 @@ abstract class BaseScanner extends Chore implements HConstants {
String serverName = Writables.cellToString(values.get(COL_SERVER));
long startCode = Writables.cellToLong(values.get(COL_STARTCODE));
if (LOG.isDebugEnabled()) {
LOG.debug(Thread.currentThread().getName() + info.toString() +
LOG.debug(Thread.currentThread().getName() + " " + info.toString() +
"}, SERVER => '" + serverName + "', STARTCODE => " + startCode);
}
@ -261,25 +261,17 @@ abstract class BaseScanner extends Chore implements HConstants {
RowResult rowContent)
throws IOException {
boolean result = false;
boolean hasReferencesA = hasReferences(metaRegionName, srvr,
parent.getRegionName(), rowContent, COL_SPLITA);
boolean hasReferencesB = hasReferences(metaRegionName, srvr,
parent.getRegionName(), rowContent, COL_SPLITB);
if (!hasReferencesA && !hasReferencesB) {
LOG.info("Deleting region " + parent.getRegionNameAsString() +
" because daughter splits no longer hold references");
HRegion.deleteRegion(master.fs, master.rootdir, parent);
HRegion.removeRegionFromMETA(srvr, metaRegionName,
parent.getRegionName());
result = true;
} else if (LOG.isDebugEnabled()) {
// If debug, note we checked and current state of daughters.
LOG.debug("Checked " + parent.getRegionNameAsString() +
" for references: splitA: " + hasReferencesA + ", splitB: "+
hasReferencesB);
}
return result;
}

View File

@ -73,6 +73,10 @@ class ServerManager implements HConstants {
private HMaster master;
private final Leases serverLeases;
// Last time we logged average load.
private volatile long lastLogOfAverageLaod = 0;
private final long loggingPeriodForAverageLoad;
/**
* @param master
@ -82,6 +86,8 @@ class ServerManager implements HConstants {
serverLeases = new Leases(master.leaseTimeout,
master.getConfiguration().getInt("hbase.master.lease.thread.wakefrequency",
15 * 1000));
this.loggingPeriodForAverageLoad = master.getConfiguration().
getLong("hbase.master.avgload.logging.period", 15000);
}
/**
@ -557,18 +563,19 @@ class ServerManager implements HConstants {
int totalLoad = 0;
int numServers = 0;
double averageLoad = 0.0;
synchronized (serversToLoad) {
numServers = serversToLoad.size();
for (HServerLoad load : serversToLoad.values()) {
totalLoad += load.getNumberOfRegions();
}
averageLoad = Math.ceil((double)totalLoad / (double)numServers);
if (LOG.isDebugEnabled()) {
// Only log on a period, not on every invocation of this method.
long now = System.currentTimeMillis();
if (LOG.isDebugEnabled() &&
(now > (this.loggingPeriodForAverageLoad + this.lastLogOfAverageLaod))) {
LOG.debug("Total Load: " + totalLoad + ", Num Servers: " + numServers
+ ", Avg Load: " + averageLoad);
this.lastLogOfAverageLaod = now;
}
}
return averageLoad;