@InterfaceAudience.Private class DefaultStoreFileManager extends Object implements StoreFileManager
| Modifier and Type | Field and Description |
|---|---|
private int |
blockingFileCount |
private CellComparator |
cellComparator |
private CompactionConfiguration |
comConf |
private org.apache.hbase.thirdparty.com.google.common.collect.ImmutableList<HStoreFile> |
compactedfiles
List of compacted files inside this store that needs to be excluded in reads
because further new reads will be using only the newly created files out of compaction.
|
private static org.slf4j.Logger |
LOG |
private Comparator<HStoreFile> |
storeFileComparator |
private org.apache.hbase.thirdparty.com.google.common.collect.ImmutableList<HStoreFile> |
storefiles
List of store files inside this store.
|
| Constructor and Description |
|---|
DefaultStoreFileManager(CellComparator cellComparator,
Comparator<HStoreFile> storeFileComparator,
org.apache.hadoop.conf.Configuration conf,
CompactionConfiguration comConf) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCompactionResults(Collection<HStoreFile> newCompactedfiles,
Collection<HStoreFile> results)
Adds only the new compaction results into the structure.
|
Collection<HStoreFile> |
clearCompactedFiles()
Clears all the compacted files and returns them.
|
org.apache.hbase.thirdparty.com.google.common.collect.ImmutableCollection<HStoreFile> |
clearFiles()
Clears all the files currently in use and returns them.
|
Iterator<HStoreFile> |
getCandidateFilesForRowKeyBefore(KeyValue targetKey)
Gets initial, full list of candidate store files to check for row-key-before.
|
Collection<HStoreFile> |
getCompactedfiles()
List of compacted files inside this store that needs to be excluded in reads
because further new reads will be using only the newly created files out of compaction.
|
int |
getCompactedFilesCount()
Returns the number of compacted files.
|
double |
getCompactionPressure() |
Collection<HStoreFile> |
getFilesForScan(byte[] startRow,
boolean includeStartRow,
byte[] stopRow,
boolean includeStopRow)
Gets the store files to scan for a Scan or Get request.
|
Optional<byte[]> |
getSplitPoint()
Gets the split point for the split of this set of store files (approx.
|
int |
getStoreCompactionPriority() |
Comparator<HStoreFile> |
getStoreFileComparator() |
int |
getStorefileCount()
Returns the number of files currently in use.
|
Collection<HStoreFile> |
getStorefiles()
Gets the snapshot of the store files currently in use.
|
Collection<HStoreFile> |
getUnneededFiles(long maxTs,
List<HStoreFile> filesCompacting) |
void |
insertNewFiles(Collection<HStoreFile> sfs)
Adds new files, either for from MemStore flush or bulk insert, into the structure.
|
void |
loadFiles(List<HStoreFile> storeFiles)
Loads the initial store files into empty StoreFileManager.
|
void |
removeCompactedFiles(Collection<HStoreFile> removedCompactedfiles)
Remove the compacted files
|
Iterator<HStoreFile> |
updateCandidateFilesForRowKeyBefore(Iterator<HStoreFile> candidateFiles,
KeyValue targetKey,
Cell candidate)
Updates the candidate list for finding row key before.
|
private static final org.slf4j.Logger LOG
private final CellComparator cellComparator
private final CompactionConfiguration comConf
private final int blockingFileCount
private final Comparator<HStoreFile> storeFileComparator
private volatile org.apache.hbase.thirdparty.com.google.common.collect.ImmutableList<HStoreFile> storefiles
private volatile org.apache.hbase.thirdparty.com.google.common.collect.ImmutableList<HStoreFile> compactedfiles
public DefaultStoreFileManager(CellComparator cellComparator, Comparator<HStoreFile> storeFileComparator, org.apache.hadoop.conf.Configuration conf, CompactionConfiguration comConf)
public void loadFiles(List<HStoreFile> storeFiles)
StoreFileManagerloadFiles in interface StoreFileManagerstoreFiles - The files to load.public final Collection<HStoreFile> getStorefiles()
StoreFileManagergetStorefiles in interface StoreFileManagerpublic Collection<HStoreFile> getCompactedfiles()
StoreFileManagergetCompactedfiles in interface StoreFileManagerpublic void insertNewFiles(Collection<HStoreFile> sfs) throws IOException
StoreFileManagerinsertNewFiles in interface StoreFileManagersfs - New store files.IOExceptionpublic org.apache.hbase.thirdparty.com.google.common.collect.ImmutableCollection<HStoreFile> clearFiles()
StoreFileManagerclearFiles in interface StoreFileManagerpublic Collection<HStoreFile> clearCompactedFiles()
StoreFileManagerclearCompactedFiles in interface StoreFileManagerpublic final int getStorefileCount()
StoreFileManagergetStorefileCount in interface StoreFileManagerpublic final int getCompactedFilesCount()
StoreFileManagergetCompactedFilesCount in interface StoreFileManagerpublic void addCompactionResults(Collection<HStoreFile> newCompactedfiles, Collection<HStoreFile> results)
StoreFileManageraddCompactionResults in interface StoreFileManagernewCompactedfiles - The input files for the compaction.results - The resulting files for the compaction.public void removeCompactedFiles(Collection<HStoreFile> removedCompactedfiles) throws IOException
StoreFileManagerremoveCompactedFiles in interface StoreFileManagerremovedCompactedfiles - the list of compacted filesIOExceptionpublic final Iterator<HStoreFile> getCandidateFilesForRowKeyBefore(KeyValue targetKey)
StoreFileManagergetCandidateFilesForRowKeyBefore in interface StoreFileManagertargetKey - The key that is the basis of the search.public Iterator<HStoreFile> updateCandidateFilesForRowKeyBefore(Iterator<HStoreFile> candidateFiles, KeyValue targetKey, Cell candidate)
StoreFileManagerupdateCandidateFilesForRowKeyBefore in interface StoreFileManagercandidateFiles - 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 Optional<byte[]> getSplitPoint() throws IOException
StoreFileManagergetSplitPoint in interface StoreFileManagerIOExceptionpublic final Collection<HStoreFile> getFilesForScan(byte[] startRow, boolean includeStartRow, byte[] stopRow, boolean includeStopRow)
StoreFileManagergetFilesForScan in interface StoreFileManagerstartRow - Start row of the request.stopRow - Stop row of the request.public int getStoreCompactionPriority()
getStoreCompactionPriority in interface StoreFileManagerpublic Collection<HStoreFile> getUnneededFiles(long maxTs, List<HStoreFile> filesCompacting)
getUnneededFiles in interface StoreFileManagermaxTs - Maximum expired timestamp.filesCompacting - Files that are currently compacting.public double getCompactionPressure()
getCompactionPressure in interface StoreFileManagerHStore.getCompactionPressure()public Comparator<HStoreFile> getStoreFileComparator()
getStoreFileComparator in interface StoreFileManagerHStoreFile.getMaxSequenceId() is the first priority.Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.