From aabf6ea2f692fc04f02f9a9ce74677bda203647e Mon Sep 17 00:00:00 2001 From: Lars Hofhansl Date: Thu, 30 Apr 2015 16:47:55 -0700 Subject: [PATCH] HBASE-13497 Remove MVCC stamps from HFile when that is safe. --- .../hbase/regionserver/compactions/DefaultCompactor.java | 6 ++++-- .../hbase/regionserver/compactions/StripeCompactor.java | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/DefaultCompactor.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/DefaultCompactor.java index 5d712c14f3f..bc8dd017cd8 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/DefaultCompactor.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/DefaultCompactor.java @@ -98,9 +98,11 @@ public class DefaultCompactor extends Compactor { smallestReadPoint = Math.min(fd.minSeqIdToKeep, smallestReadPoint); cleanSeqId = true; } - + + // When all MVCC readpoints are 0, don't write them. + // See HBASE-8166, HBASE-12600, and HBASE-13389. writer = store.createWriterInTmp(fd.maxKeyCount, this.compactionCompression, true, - true, fd.maxTagsLength > 0); + fd.maxMVCCReadpoint > 0, fd.maxTagsLength > 0); boolean finished = performCompaction(scanner, writer, smallestReadPoint, cleanSeqId, throughputController); if (!finished) { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/StripeCompactor.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/StripeCompactor.java index b957e16fb8f..10e3cf09c4e 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/StripeCompactor.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/StripeCompactor.java @@ -117,12 +117,14 @@ public class StripeCompactor extends Compactor { cleanSeqId = true; } + final boolean needMvcc = fd.maxMVCCReadpoint > 0; + final Compression.Algorithm compression = store.getFamily().getCompactionCompression(); StripeMultiFileWriter.WriterFactory factory = new StripeMultiFileWriter.WriterFactory() { @Override public Writer createWriter() throws IOException { return store.createWriterInTmp( - fd.maxKeyCount, compression, true, true, fd.maxTagsLength > 0); + fd.maxKeyCount, compression, true, needMvcc, fd.maxTagsLength > 0); } };