HBASE-3241 check to see if we exceeded hbase.regionserver.maxlogs limit is

incorrect (Kannan Muthukkaruppan via JD)
HBASE-3239  Handle null regions to flush in HLog.cleanOldLogs (Kannan
            Muthukkaruppan via JD)


git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1036302 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jean-Daniel Cryans 2010-11-18 00:53:35 +00:00
parent 3dca408c49
commit 4a6d4ff453
2 changed files with 14 additions and 8 deletions

View File

@ -682,6 +682,10 @@ Release 0.90.0 - Unreleased
HBASE-3232 Fix KeyOnlyFilter + Add Value Length (Nicolas via Ryan)
HBASE-3235 Intermittent incrementColumnValue failure in TestHRegion
(Gary via Ryan)
HBASE-3241 check to see if we exceeded hbase.regionserver.maxlogs limit is
incorrect (Kannan Muthukkaruppan via JD)
HBASE-3239 Handle null regions to flush in HLog.cleanOldLogs (Kannan
Muthukkaruppan via JD)
IMPROVEMENTS

View File

@ -638,20 +638,22 @@ public class HLog implements Syncable {
// If too many log files, figure which regions we need to flush.
// Array is an array of encoded region names.
byte [][] regions = null;
int logCount = this.outputfiles.size() - logsToRemove;
int logCount = this.outputfiles.size();
if (logCount > this.maxLogs && this.outputfiles != null &&
this.outputfiles.size() > 0) {
// This is an array of encoded region names.
regions = findMemstoresWithEditsEqualOrOlderThan(this.outputfiles.firstKey(),
this.lastSeqWritten);
StringBuilder sb = new StringBuilder();
for (int i = 0; i < regions.length; i++) {
if (i > 0) sb.append(", ");
sb.append(Bytes.toStringBinary(regions[i]));
if (regions != null) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < regions.length; i++) {
if (i > 0) sb.append(", ");
sb.append(Bytes.toStringBinary(regions[i]));
}
LOG.info("Too many hlogs: logs=" + logCount + ", maxlogs=" +
this.maxLogs + "; forcing flush of " + regions.length + " regions(s): " +
sb.toString());
}
LOG.info("Too many hlogs: logs=" + logCount + ", maxlogs=" +
this.maxLogs + "; forcing flush of " + regions.length + " regions(s): " +
sb.toString());
}
return regions;
}