@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()
Returns The store compaction priority.
|
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)
StoreFileManager
loadFiles
in interface StoreFileManager
storeFiles
- The files to load.public final Collection<HStoreFile> getStorefiles()
StoreFileManager
getStorefiles
in interface StoreFileManager
public Collection<HStoreFile> getCompactedfiles()
StoreFileManager
getCompactedfiles
in interface StoreFileManager
public void insertNewFiles(Collection<HStoreFile> sfs)
StoreFileManager
insertNewFiles
in interface StoreFileManager
sfs
- New store files.public org.apache.hbase.thirdparty.com.google.common.collect.ImmutableCollection<HStoreFile> clearFiles()
StoreFileManager
clearFiles
in interface StoreFileManager
public Collection<HStoreFile> clearCompactedFiles()
StoreFileManager
clearCompactedFiles
in interface StoreFileManager
public final int getStorefileCount()
StoreFileManager
getStorefileCount
in interface StoreFileManager
public final int getCompactedFilesCount()
StoreFileManager
getCompactedFilesCount
in interface StoreFileManager
public void addCompactionResults(Collection<HStoreFile> newCompactedfiles, Collection<HStoreFile> results)
StoreFileManager
addCompactionResults
in interface StoreFileManager
newCompactedfiles
- The input files for the compaction.results
- The resulting files for the compaction.public void removeCompactedFiles(Collection<HStoreFile> removedCompactedfiles)
StoreFileManager
removeCompactedFiles
in interface StoreFileManager
removedCompactedfiles
- the list of compacted filespublic final Iterator<HStoreFile> getCandidateFilesForRowKeyBefore(KeyValue targetKey)
StoreFileManager
getCandidateFilesForRowKeyBefore
in interface StoreFileManager
targetKey
- The key that is the basis of the search.public Iterator<HStoreFile> updateCandidateFilesForRowKeyBefore(Iterator<HStoreFile> 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 Optional<byte[]> getSplitPoint() throws IOException
StoreFileManager
getSplitPoint
in interface StoreFileManager
IOException
public final Collection<HStoreFile> getFilesForScan(byte[] startRow, boolean includeStartRow, byte[] stopRow, boolean includeStopRow)
StoreFileManager
getFilesForScan
in interface StoreFileManager
startRow
- Start row of the request.stopRow
- Stop row of the request.public int getStoreCompactionPriority()
StoreFileManager
getStoreCompactionPriority
in interface StoreFileManager
public Collection<HStoreFile> getUnneededFiles(long maxTs, List<HStoreFile> filesCompacting)
getUnneededFiles
in interface StoreFileManager
maxTs
- Maximum expired timestamp.filesCompacting
- Files that are currently compacting.public double getCompactionPressure()
getCompactionPressure
in interface StoreFileManager
HStore.getCompactionPressure()
public Comparator<HStoreFile> getStoreFileComparator()
getStoreFileComparator
in interface StoreFileManager
HStoreFile.getMaxSequenceId()
is the first priority.Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.