|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@InterfaceAudience.Private public interface StoreFileManager
Manages the store files and basic metadata about that that determines the logical structure (e.g. what files to return for scan, how to determine split point, and such). Does NOT affect the physical structure of files in HDFS. Example alternative structures - the default list of files by seqNum; levelDB one sorted by level and seqNum. Implementations are assumed to be not thread safe.
Method Summary | |
---|---|
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()
|
Comparator<StoreFile> |
getStoreFileComparator()
|
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. |
Iterator<StoreFile> |
updateCandidateFilesForRowKeyBefore(Iterator<StoreFile> candidateFiles,
KeyValue targetKey,
KeyValue candidate)
Updates the candidate list for finding row key before. |
Method Detail |
---|
void loadFiles(List<StoreFile> storeFiles)
storeFiles
- The files to load.void insertNewFiles(Collection<StoreFile> sfs) throws IOException
sfs
- New store files.
IOException
void addCompactionResults(Collection<StoreFile> compactedFiles, Collection<StoreFile> results) throws IOException
compactedFiles
- The input files for the compaction.results
- The resulting files for the compaction.
IOException
com.google.common.collect.ImmutableCollection<StoreFile> clearFiles()
Collection<StoreFile> getStorefiles()
int getStorefileCount()
Collection<StoreFile> getFilesForScanOrGet(boolean isGet, byte[] startRow, byte[] stopRow)
isGet
- Whether it's a get.startRow
- Start row of the request.stopRow
- Stop row of the request.
Iterator<StoreFile> getCandidateFilesForRowKeyBefore(KeyValue targetKey)
targetKey
- The key that is the basis of the search.
Iterator<StoreFile> updateCandidateFilesForRowKeyBefore(Iterator<StoreFile> candidateFiles, KeyValue targetKey, KeyValue candidate)
candidateFiles
- The candidate files not yet checked for better candidates - return
value from getCandidateFilesForRowKeyBefore(KeyValue)
,
with some files already removed.targetKey
- The key to search for.candidate
- The current best candidate found.
byte[] getSplitPoint() throws IOException
IOException
int getStoreCompactionPriority()
Collection<StoreFile> getUnneededFiles(long maxTs, List<StoreFile> filesCompacting)
maxTs
- Maximum expired timestamp.filesCompacting
- Files that are currently compacting.
double getCompactionPressure()
Store.getCompactionPressure()
Comparator<StoreFile> getStoreFileComparator()
StoreFile.getMaxSequenceId()
is the first priority.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |