HBASE-16155 Compacting Memstore : Few log improvements.
This commit is contained in:
parent
d1d8cc71c9
commit
139f0ed53c
|
@ -92,7 +92,7 @@ public class CompactingMemStore extends AbstractMemStore {
|
||||||
double factor = conf.getDouble(IN_MEMORY_FLUSH_THRESHOLD_FACTOR_KEY,
|
double factor = conf.getDouble(IN_MEMORY_FLUSH_THRESHOLD_FACTOR_KEY,
|
||||||
IN_MEMORY_FLUSH_THRESHOLD_FACTOR_DEFAULT);
|
IN_MEMORY_FLUSH_THRESHOLD_FACTOR_DEFAULT);
|
||||||
inmemoryFlushSize *= factor;
|
inmemoryFlushSize *= factor;
|
||||||
LOG.debug("Setting in-memory flush size threshold to " + inmemoryFlushSize);
|
LOG.info("Setting in-memory flush size threshold to " + inmemoryFlushSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static long getSegmentSize(Segment segment) {
|
public static long getSegmentSize(Segment segment) {
|
||||||
|
@ -150,8 +150,11 @@ 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 {
|
||||||
LOG.info("FLUSHING TO DISK: region "+ getRegionServices().getRegionInfo()
|
if (LOG.isDebugEnabled()) {
|
||||||
.getRegionNameAsString() + "store: "+ getFamilyName());
|
LOG.debug("FLUSHING TO DISK: region "
|
||||||
|
+ getRegionServices().getRegionInfo().getRegionNameAsString() + "store: "
|
||||||
|
+ getFamilyName());
|
||||||
|
}
|
||||||
stopCompaction();
|
stopCompaction();
|
||||||
pushActiveToPipeline(active);
|
pushActiveToPipeline(active);
|
||||||
snapshotId = EnvironmentEdgeManager.currentTime();
|
snapshotId = EnvironmentEdgeManager.currentTime();
|
||||||
|
@ -275,8 +278,10 @@ public class CompactingMemStore extends AbstractMemStore {
|
||||||
getRegionServices().blockUpdates();
|
getRegionServices().blockUpdates();
|
||||||
try {
|
try {
|
||||||
MutableSegment active = getActive();
|
MutableSegment active = getActive();
|
||||||
LOG.info("IN-MEMORY FLUSH: Pushing active segment into compaction pipeline, " +
|
if (LOG.isDebugEnabled()) {
|
||||||
"and initiating compaction.");
|
LOG.debug("IN-MEMORY FLUSH: Pushing active segment into compaction pipeline, "
|
||||||
|
+ "and initiating compaction.");
|
||||||
|
}
|
||||||
pushActiveToPipeline(active);
|
pushActiveToPipeline(active);
|
||||||
} finally {
|
} finally {
|
||||||
getRegionServices().unblockUpdates();
|
getRegionServices().unblockUpdates();
|
||||||
|
@ -398,13 +403,4 @@ public class CompactingMemStore extends AbstractMemStore {
|
||||||
}
|
}
|
||||||
return lowest;
|
return lowest;
|
||||||
}
|
}
|
||||||
|
|
||||||
// debug method
|
|
||||||
private void debug() {
|
|
||||||
String msg = "active size="+getActive().getSize();
|
|
||||||
msg += " threshold="+IN_MEMORY_FLUSH_THRESHOLD_FACTOR_DEFAULT* inmemoryFlushSize;
|
|
||||||
msg += " allow compaction is "+ (allowCompaction.get() ? "true" : "false");
|
|
||||||
msg += " inMemoryFlushInProgress is "+ (inMemoryFlushInProgress.get() ? "true" : "false");
|
|
||||||
LOG.debug(msg);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,10 +95,12 @@ public class CompactionPipeline {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
suffix = versionedList.getStoreSegments();
|
suffix = versionedList.getStoreSegments();
|
||||||
LOG.info("Swapping pipeline suffix with compacted item. "
|
if (LOG.isDebugEnabled()) {
|
||||||
+"Just before the swap the number of segments in pipeline is:"
|
LOG.debug("Swapping pipeline suffix with compacted item. "
|
||||||
+versionedList.getStoreSegments().size()
|
+ "Just before the swap the number of segments in pipeline is:"
|
||||||
+", and the number of cells in new segment is:"+segment.getCellsCount());
|
+ versionedList.getStoreSegments().size()
|
||||||
|
+ ", and the number of cells in new segment is:" + segment.getCellsCount());
|
||||||
|
}
|
||||||
swapSuffix(suffix,segment);
|
swapSuffix(suffix,segment);
|
||||||
}
|
}
|
||||||
if(region != null) {
|
if(region != null) {
|
||||||
|
@ -107,8 +109,10 @@ public class CompactionPipeline {
|
||||||
long newSize = CompactingMemStore.getSegmentSize(segment);
|
long newSize = CompactingMemStore.getSegmentSize(segment);
|
||||||
long delta = suffixSize - newSize;
|
long delta = suffixSize - newSize;
|
||||||
long globalMemstoreSize = region.addAndGetGlobalMemstoreSize(-delta);
|
long globalMemstoreSize = region.addAndGetGlobalMemstoreSize(-delta);
|
||||||
LOG.info("Suffix size: "+ suffixSize+" compacted item size: "+newSize+
|
if (LOG.isDebugEnabled()) {
|
||||||
" globalMemstoreSize: "+globalMemstoreSize);
|
LOG.debug("Suffix size: " + suffixSize + " compacted item size: " + newSize
|
||||||
|
+ " globalMemstoreSize: " + globalMemstoreSize);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,8 +84,10 @@ class MemStoreCompactor {
|
||||||
smallestReadPoint = compactingMemStore.getSmallestReadPoint();
|
smallestReadPoint = compactingMemStore.getSmallestReadPoint();
|
||||||
compactingScanner = createScanner(compactingMemStore.getStore());
|
compactingScanner = createScanner(compactingMemStore.getStore());
|
||||||
|
|
||||||
LOG.info("Starting the MemStore in-memory compaction for store " +
|
if (LOG.isDebugEnabled()) {
|
||||||
compactingMemStore.getStore().getColumnFamilyName());
|
LOG.debug("Starting the MemStore in-memory compaction for store "
|
||||||
|
+ compactingMemStore.getStore().getColumnFamilyName());
|
||||||
|
}
|
||||||
|
|
||||||
doCompaction();
|
doCompaction();
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -23,7 +23,6 @@ import java.util.SortedSet;
|
||||||
import java.util.concurrent.atomic.AtomicLong;
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
|
||||||
import org.apache.hadoop.hbase.Cell;
|
import org.apache.hadoop.hbase.Cell;
|
||||||
import org.apache.hadoop.hbase.CellComparator;
|
import org.apache.hadoop.hbase.CellComparator;
|
||||||
import org.apache.hadoop.hbase.KeyValue;
|
import org.apache.hadoop.hbase.KeyValue;
|
||||||
|
@ -42,7 +41,6 @@ import org.apache.hadoop.hbase.util.ByteRange;
|
||||||
@InterfaceAudience.Private
|
@InterfaceAudience.Private
|
||||||
public abstract class Segment {
|
public abstract class Segment {
|
||||||
|
|
||||||
private static final Log LOG = LogFactory.getLog(Segment.class);
|
|
||||||
private volatile CellSet cellSet;
|
private volatile CellSet cellSet;
|
||||||
private final CellComparator comparator;
|
private final CellComparator comparator;
|
||||||
private long minSequenceId;
|
private long minSequenceId;
|
||||||
|
|
Loading…
Reference in New Issue