@InterfaceAudience.Private class DefaultStoreFileManager extends Object implements StoreFileManager
Modifier and Type | Field and Description |
---|---|
private int |
blockingFileCount |
private CompactionConfiguration |
comConf |
private KeyValue.KVComparator |
kvComparator |
private static org.apache.commons.logging.Log |
LOG |
private com.google.common.collect.ImmutableList<StoreFile> |
storefiles
List of store files inside this store.
|
Constructor and Description |
---|
DefaultStoreFileManager(KeyValue.KVComparator kvComparator,
org.apache.hadoop.conf.Configuration conf,
CompactionConfiguration comConf) |
Modifier and Type | Method and Description |
---|---|
void |
addCompactionResults(Collection<StoreFile> compactedFiles,
Collection<StoreFile> results)
Adds compaction results into the structure.
|
com.google.common.collect.ImmutableCollection<StoreFile> |
clearFiles()
Clears all the files currently in use and returns them.
|
Iterator<StoreFile> |
getCandidateFilesForRowKeyBefore(KeyValue targetKey)
Gets initial, full list of candidate store files to check for row-key-before.
|
double |
getCompactionPressure() |
Collection<StoreFile> |
getFilesForScanOrGet(boolean isGet,
byte[] startRow,
byte[] stopRow)
Gets the store files to scan for a Scan or Get request.
|
byte[] |
getSplitPoint()
Gets the split point for the split of this set of store files (approx.
|
int |
getStoreCompactionPriority() |
int |
getStorefileCount()
Returns the number of files currently in use.
|
Collection<StoreFile> |
getStorefiles()
Gets the snapshot of the store files currently in use.
|
Collection<StoreFile> |
getUnneededFiles(long maxTs,
List<StoreFile> filesCompacting) |
void |
insertNewFiles(Collection<StoreFile> sfs)
Adds new files, either for from MemStore flush or bulk insert, into the structure.
|
void |
loadFiles(List<StoreFile> storeFiles)
Loads the initial store files into empty StoreFileManager.
|
private void |
sortAndSetStoreFiles(List<StoreFile> storeFiles) |
Iterator<StoreFile> |
updateCandidateFilesForRowKeyBefore(Iterator<StoreFile> candidateFiles,
KeyValue targetKey,
Cell candidate)
Updates the candidate list for finding row key before.
|
private static final org.apache.commons.logging.Log LOG
private final KeyValue.KVComparator kvComparator
private final CompactionConfiguration comConf
private final int blockingFileCount
private volatile com.google.common.collect.ImmutableList<StoreFile> storefiles
public DefaultStoreFileManager(KeyValue.KVComparator kvComparator, org.apache.hadoop.conf.Configuration conf, CompactionConfiguration comConf)
public void loadFiles(List<StoreFile> storeFiles)
StoreFileManager
loadFiles
in interface StoreFileManager
storeFiles
- The files to load.public final Collection<StoreFile> getStorefiles()
StoreFileManager
getStorefiles
in interface StoreFileManager
public void insertNewFiles(Collection<StoreFile> sfs) throws IOException
StoreFileManager
insertNewFiles
in interface StoreFileManager
sfs
- New store files.IOException
public com.google.common.collect.ImmutableCollection<StoreFile> clearFiles()
StoreFileManager
clearFiles
in interface StoreFileManager
public final int getStorefileCount()
StoreFileManager
getStorefileCount
in interface StoreFileManager
public void addCompactionResults(Collection<StoreFile> compactedFiles, Collection<StoreFile> results)
StoreFileManager
addCompactionResults
in interface StoreFileManager
compactedFiles
- The input files for the compaction.results
- The resulting files for the compaction.public final Iterator<StoreFile> getCandidateFilesForRowKeyBefore(KeyValue targetKey)
StoreFileManager
getCandidateFilesForRowKeyBefore
in interface StoreFileManager
targetKey
- The key that is the basis of the search.public Iterator<StoreFile> updateCandidateFilesForRowKeyBefore(Iterator<StoreFile> candidateFiles, KeyValue targetKey, Cell candidate)
StoreFileManager
updateCandidateFilesForRowKeyBefore
in interface StoreFileManager
candidateFiles
- The candidate files not yet checked for better candidates - return
value from StoreFileManager.getCandidateFilesForRowKeyBefore(KeyValue)
,
with some files already removed.targetKey
- The key to search for.candidate
- The current best candidate found.public final byte[] getSplitPoint() throws IOException
StoreFileManager
getSplitPoint
in interface StoreFileManager
IOException
public final Collection<StoreFile> getFilesForScanOrGet(boolean isGet, byte[] startRow, byte[] stopRow)
StoreFileManager
getFilesForScanOrGet
in interface StoreFileManager
isGet
- Whether it's a get.startRow
- Start row of the request.stopRow
- Stop row of the request.public int getStoreCompactionPriority()
getStoreCompactionPriority
in interface StoreFileManager
public Collection<StoreFile> getUnneededFiles(long maxTs, List<StoreFile> filesCompacting)
getUnneededFiles
in interface StoreFileManager
maxTs
- Maximum expired timestamp.filesCompacting
- Files that are currently compacting.public double getCompactionPressure()
getCompactionPressure
in interface StoreFileManager
Store.getCompactionPressure()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.