HBASE-20232 [LOGGING] Formatting around close and flush

This commit is contained in:
Michael Stack 2018-03-20 10:33:07 -07:00
parent 7ba86d056c
commit 75ff2504ec
8 changed files with 23 additions and 27 deletions

View File

@ -495,8 +495,8 @@ public class ChunkCreator {
" must be between 0.0 and 1.0"); " must be between 0.0 and 1.0");
} }
int initialCount = (int) (initialCountPercentage * maxCount); int initialCount = (int) (initialCountPercentage * maxCount);
LOG.info("{} allocating {} MemStoreChunkPool with chunk size {}, max count {}, " + LOG.info("Allocating {} MemStoreChunkPool with chunk size {}, max count {}, initial count {}",
"initial count {}", label, StringUtils.byteDesc(chunkSize), maxCount, initialCount); label, StringUtils.byteDesc(chunkSize), maxCount, initialCount);
MemStoreChunkPool memStoreChunkPool = new MemStoreChunkPool(label, chunkSize, maxCount, MemStoreChunkPool memStoreChunkPool = new MemStoreChunkPool(label, chunkSize, maxCount,
initialCount, poolSizePercentage); initialCount, poolSizePercentage);
if (heapMemoryManager != null && memStoreChunkPool != null) { if (heapMemoryManager != null && memStoreChunkPool != null) {

View File

@ -198,11 +198,8 @@ public class CompactingMemStore extends AbstractMemStore {
LOG.warn("Snapshot called again without clearing previous. " + LOG.warn("Snapshot called again without clearing previous. " +
"Doing nothing. Another ongoing flush or did we fail last attempt?"); "Doing nothing. Another ongoing flush or did we fail last attempt?");
} else { } else {
if (LOG.isDebugEnabled()) { LOG.debug("FLUSHING TO DISK {}, store={}",
LOG.debug("FLUSHING TO DISK: region " getRegionServices().getRegionInfo().getEncodedName(), getFamilyName());
+ getRegionServices().getRegionInfo().getRegionNameAsString() + "store: "
+ getFamilyName());
}
stopCompaction(); stopCompaction();
pushActiveToPipeline(this.active); pushActiveToPipeline(this.active);
snapshotId = EnvironmentEdgeManager.currentTime(); snapshotId = EnvironmentEdgeManager.currentTime();

View File

@ -82,10 +82,9 @@ public class DefaultStoreFlusher extends StoreFlusher {
} finally { } finally {
scanner.close(); scanner.close();
} }
LOG.info("Flushed, sequenceid=" + cacheFlushId +", memsize=" LOG.info("Flushed memstore data size={} at sequenceid={} (bloomFilter={}), to={}",
+ StringUtils.TraditionalBinaryPrefix.long2String(snapshot.getDataSize(), "", 1) + StringUtils.byteDesc(snapshot.getDataSize()), cacheFlushId, writer.hasGeneralBloom(),
", hasBloomFilter=" + writer.hasGeneralBloom() + writer.getPath());
", into tmp file " + writer.getPath());
result.add(writer.getPath()); result.add(writer.getPath());
return result; return result;
} }

View File

@ -1444,7 +1444,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
// Only allow one thread to close at a time. Serialize them so dual // Only allow one thread to close at a time. Serialize them so dual
// threads attempting to close will run up against each other. // threads attempting to close will run up against each other.
MonitoredTask status = TaskMonitor.get().createStatus( MonitoredTask status = TaskMonitor.get().createStatus(
"Closing region " + this + "Closing region " + this.getRegionInfo().getEncodedName() +
(abort ? " due to abort" : "")); (abort ? " due to abort" : ""));
status.setStatus("Waiting for close lock"); status.setStatus("Waiting for close lock");
@ -1496,7 +1496,8 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
// region. // region.
canFlush = !writestate.readOnly; canFlush = !writestate.readOnly;
writestate.writesEnabled = false; writestate.writesEnabled = false;
LOG.debug("Closing " + this + ": disabling compactions & flushes"); LOG.debug("Closing {}, disabling compactions & flushes",
this.getRegionInfo().getEncodedName());
waitForFlushesAndCompactions(); waitForFlushesAndCompactions();
} }
// If we were not just flushing, is it worth doing a preflush...one // If we were not just flushing, is it worth doing a preflush...one
@ -1504,7 +1505,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
// the close flag? // the close flag?
if (!abort && worthPreFlushing() && canFlush) { if (!abort && worthPreFlushing() && canFlush) {
status.setStatus("Pre-flushing region before close"); status.setStatus("Pre-flushing region before close");
LOG.info("Running close preflush of " + this); LOG.info("Running close preflush of {}" + this.getRegionInfo().getEncodedName());
try { try {
internalFlushcache(status); internalFlushcache(status);
} catch (IOException ioe) { } catch (IOException ioe) {
@ -2719,11 +2720,11 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
long flushableDataSize = prepareResult.totalFlushableSize.getDataSize(); long flushableDataSize = prepareResult.totalFlushableSize.getDataSize();
long flushableHeapSize = prepareResult.totalFlushableSize.getHeapSize(); long flushableHeapSize = prepareResult.totalFlushableSize.getHeapSize();
long memstoresize = this.memStoreSize.getDataSize(); long memstoresize = this.memStoreSize.getDataSize();
String msg = "Finished memstore flush." String msg = "Finished memstore flush;"
+ " Flushed data size ~" + StringUtils.byteDesc(flushableDataSize) + "/" + flushableDataSize + " data size ~" + StringUtils.byteDesc(flushableDataSize) + "/" + flushableDataSize
+ " Flushed Heap size ~" + StringUtils.byteDesc(flushableHeapSize) + "/" + flushableHeapSize + ", heap size ~" + StringUtils.byteDesc(flushableHeapSize) + "/" + flushableHeapSize
+ ", currentsize=" + StringUtils.byteDesc(memstoresize) + "/" + memstoresize + ", currentsize=" + StringUtils.byteDesc(memstoresize) + "/" + memstoresize
+ " for region " + this + " in " + time + "ms, sequenceid=" + " for " + this.getRegionInfo().getEncodedName() + " in " + time + "ms, sequenceid="
+ flushOpSeqId + ", compaction requested=" + compactionRequested + flushOpSeqId + ", compaction requested=" + compactionRequested
+ ((wal == null) ? "; wal=null" : ""); + ((wal == null) ? "; wal=null" : "");
LOG.info(msg); LOG.info(msg);

View File

@ -460,7 +460,7 @@ public class HRegionFileSystem {
throw new FileNotFoundException(buildPath.toString()); throw new FileNotFoundException(buildPath.toString());
} }
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
LOG.debug("Committing store file " + buildPath + " as " + dstPath); LOG.debug("Committing " + buildPath + " as " + dstPath);
} }
return dstPath; return dstPath;
} }

View File

@ -3397,8 +3397,8 @@ public class HRegionServer extends HasThread implements
LOG.warn("Not adding moved region record: " + encodedName + " to self."); LOG.warn("Not adding moved region record: " + encodedName + " to self.");
return; return;
} }
LOG.info("Adding moved region record: " LOG.info("Adding " + encodedName + " move to " + destination + " record at close sequenceid=" +
+ encodedName + " to " + destination + " as of " + closeSeqNum); closeSeqNum);
movedRegions.put(encodedName, new MovedRegionInfo(destination, closeSeqNum)); movedRegions.put(encodedName, new MovedRegionInfo(destination, closeSeqNum));
} }

View File

@ -955,7 +955,7 @@ public class HStore implements Store, HeapSize, StoreConfigInformation, Propagat
} }
if (ioe != null) throw ioe; if (ioe != null) throw ioe;
} }
LOG.info("Closed {}", this); LOG.trace("Closed {}", this);
return result; return result;
} finally { } finally {
this.lock.writeLock().unlock(); this.lock.writeLock().unlock();

View File

@ -88,13 +88,13 @@ public class CloseRegionHandler extends EventHandler {
@Override @Override
public void process() { public void process() {
try { try {
String name = regionInfo.getRegionNameAsString(); String name = regionInfo.getEncodedName();
LOG.debug("Processing close of " + name); LOG.trace("Processing close of {}", name);
String encodedRegionName = regionInfo.getEncodedName(); String encodedRegionName = regionInfo.getEncodedName();
// Check that this region is being served here // Check that this region is being served here
HRegion region = (HRegion)rsServices.getRegion(encodedRegionName); HRegion region = (HRegion)rsServices.getRegion(encodedRegionName);
if (region == null) { if (region == null) {
LOG.warn("Received CLOSE for region " + name + " but currently not serving - ignoring"); LOG.warn("Received CLOSE for region {} but currently not serving - ignoring", name);
// TODO: do better than a simple warning // TODO: do better than a simple warning
return; return;
} }
@ -104,8 +104,7 @@ public class CloseRegionHandler extends EventHandler {
if (region.close(abort) == null) { if (region.close(abort) == null) {
// This region got closed. Most likely due to a split. // This region got closed. Most likely due to a split.
// The split message will clean up the master state. // The split message will clean up the master state.
LOG.warn("Can't close region: was already closed during close(): " + LOG.warn("Can't close region {}, was already closed during close()", name);
name);
return; return;
} }
} catch (IOException ioe) { } catch (IOException ioe) {