@InterfaceAudience.Private public class StripeCompactionPolicy extends CompactionPolicy
Modifier and Type | Class and Description |
---|---|
private static class |
StripeCompactionPolicy.BoundaryStripeCompactionRequest
Request for stripe compactor that will cause it to split the source files into several
separate files at the provided boundaries.
|
private static class |
StripeCompactionPolicy.SplitStripeCompactionRequest
Request for stripe compactor that will cause it to split the source files into several
separate files into based on key-value count, as well as file count limit.
|
static class |
StripeCompactionPolicy.StripeCompactionRequest
Stripe compaction request wrapper.
|
static interface |
StripeCompactionPolicy.StripeInformationProvider
The information about stripes that the policy needs to do its stuff
|
Modifier and Type | Field and Description |
---|---|
private StripeStoreConfig |
config |
private static org.apache.commons.logging.Log |
LOG |
private ExploringCompactionPolicy |
stripePolicy |
comConf, storeConfigInfo
Constructor and Description |
---|
StripeCompactionPolicy(org.apache.hadoop.conf.Configuration conf,
StoreConfigInformation storeConfigInfo,
StripeStoreConfig config) |
getConf, setConf
private static final org.apache.commons.logging.Log LOG
private ExploringCompactionPolicy stripePolicy
private StripeStoreConfig config
public StripeCompactionPolicy(org.apache.hadoop.conf.Configuration conf, StoreConfigInformation storeConfigInfo, StripeStoreConfig config)
public List<StoreFile> preSelectFilesForCoprocessor(StripeCompactionPolicy.StripeInformationProvider si, List<StoreFile> filesCompacting)
public StripeCompactionPolicy.StripeCompactionRequest createEmptyRequest(StripeCompactionPolicy.StripeInformationProvider si, CompactionRequest request)
public StripeStoreFlusher.StripeFlushRequest selectFlush(StripeCompactionPolicy.StripeInformationProvider si, int kvCount)
public StripeCompactionPolicy.StripeCompactionRequest selectCompaction(StripeCompactionPolicy.StripeInformationProvider si, List<StoreFile> filesCompacting, boolean isOffpeak) throws IOException
IOException
public boolean needsCompactions(StripeCompactionPolicy.StripeInformationProvider si, List<StoreFile> filesCompacting)
public boolean isMajorCompaction(Collection<StoreFile> filesToCompact) throws IOException
isMajorCompaction
in class CompactionPolicy
filesToCompact
- Files to compact. Can be null.IOException
public boolean throttleCompaction(long compactionSize)
throttleCompaction
in class CompactionPolicy
compactionSize
- Total size of some compactionprotected boolean needsSingleStripeCompaction(StripeCompactionPolicy.StripeInformationProvider si)
si
- StoreFileManager.protected StripeCompactionPolicy.StripeCompactionRequest selectSingleStripeCompaction(StripeCompactionPolicy.StripeInformationProvider si, boolean includeL0, boolean canDropDeletesWithoutL0, boolean isOffpeak) throws IOException
IOException
private List<StoreFile> selectSimpleCompaction(List<StoreFile> sfs, boolean allFilesOnly, boolean isOffpeak)
sfs
- Files.allFilesOnly
- Whether a compaction of all-or-none files is needed.private StripeCompactionPolicy.StripeCompactionRequest selectCompactionOfAllFiles(StripeCompactionPolicy.StripeInformationProvider si, int targetStripeCount, long targetSize)
si
- StoreFileManager.targetStripeCount
- Target stripe count.targetSize
- Target stripe size.private StripeCompactionPolicy.StripeCompactionRequest selectNewStripesCompaction(StripeCompactionPolicy.StripeInformationProvider si)
private StripeCompactionPolicy.StripeCompactionRequest selectExpiredMergeCompaction(StripeCompactionPolicy.StripeInformationProvider si, boolean canDropDeletesNoL0)
private static long getTotalKvCount(Collection<StoreFile> candidates)
public static long getTotalFileSize(Collection<StoreFile> candidates)
private Pair<Long,Integer> estimateTargetKvs(Collection<StoreFile> files, double splitCount)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.