@InterfaceAudience.Private public class StripeStoreFileManager extends Object implements StoreFileManager, StripeCompactionPolicy.StripeInformationProvider
| Modifier and Type | Field and Description |
|---|---|
static byte[] |
OPEN_KEY
The key value used for range boundary, indicating that the boundary is open (i.e.
|
static byte[] |
STRIPE_END_KEY |
static byte[] |
STRIPE_START_KEY
The file metadata fields that contain the stripe information.
|
| Constructor and Description |
|---|
StripeStoreFileManager(KeyValue.KVComparator kvComparator,
org.apache.hadoop.conf.Configuration conf,
StripeStoreConfig config) |
| 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)
See
StoreFileManager.getCandidateFilesForRowKeyBefore(KeyValue)
for details on this methods. |
byte[] |
getEndRow(int stripeIndex)
Gets the end row for a given stripe.
|
Collection<StoreFile> |
getFilesForScanOrGet(boolean isGet,
byte[] startRow,
byte[] stopRow)
Gets the store files to scan for a Scan or Get request.
|
List<StoreFile> |
getLevel0Files() |
byte[] |
getSplitPoint()
Gets the split point for the split of this set of store files (approx.
|
byte[] |
getStartRow(int stripeIndex)
Gets the start row for a given stripe.
|
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.
|
List<byte[]> |
getStripeBoundaries() |
int |
getStripeCount() |
ArrayList<com.google.common.collect.ImmutableList<StoreFile>> |
getStripes() |
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)
See
StoreFileManager.getCandidateFilesForRowKeyBefore(KeyValue) and
StoreFileManager.updateCandidateFilesForRowKeyBefore(Iterator, KeyValue, KeyValue)
for details on this methods. |
public static final byte[] STRIPE_START_KEY
public static final byte[] STRIPE_END_KEY
public static final byte[] OPEN_KEY
public StripeStoreFileManager(KeyValue.KVComparator kvComparator, org.apache.hadoop.conf.Configuration conf, StripeStoreConfig config)
public void loadFiles(List<StoreFile> storeFiles)
StoreFileManagerloadFiles in interface StoreFileManagerstoreFiles - The files to load.public Collection<StoreFile> getStorefiles()
StoreFileManagergetStorefiles in interface StripeCompactionPolicy.StripeInformationProvidergetStorefiles in interface StoreFileManagerpublic void insertNewFiles(Collection<StoreFile> sfs) throws IOException
StoreFileManagerinsertNewFiles in interface StoreFileManagersfs - New store files.IOExceptionpublic com.google.common.collect.ImmutableCollection<StoreFile> clearFiles()
StoreFileManagerclearFiles in interface StoreFileManagerpublic int getStorefileCount()
StoreFileManagergetStorefileCount in interface StoreFileManagerpublic Iterator<StoreFile> getCandidateFilesForRowKeyBefore(KeyValue targetKey)
StoreFileManager.getCandidateFilesForRowKeyBefore(KeyValue)
for details on this methods.getCandidateFilesForRowKeyBefore in interface StoreFileManagertargetKey - The key that is the basis of the search.public Iterator<StoreFile> updateCandidateFilesForRowKeyBefore(Iterator<StoreFile> candidateFiles, KeyValue targetKey, KeyValue candidate)
StoreFileManager.getCandidateFilesForRowKeyBefore(KeyValue) and
StoreFileManager.updateCandidateFilesForRowKeyBefore(Iterator, KeyValue, KeyValue)
for details on this methods.updateCandidateFilesForRowKeyBefore 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 byte[] getSplitPoint()
throws IOException
StoreFileManagergetSplitPoint in interface StoreFileManagerIOExceptionpublic Collection<StoreFile> getFilesForScanOrGet(boolean isGet, byte[] startRow, byte[] stopRow)
StoreFileManagergetFilesForScanOrGet in interface StoreFileManagerisGet - Whether it's a get.startRow - Start row of the request.stopRow - Stop row of the request.public void addCompactionResults(Collection<StoreFile> compactedFiles, Collection<StoreFile> results) throws IOException
StoreFileManageraddCompactionResults in interface StoreFileManagercompactedFiles - The input files for the compaction.results - The resulting files for the compaction.IOExceptionpublic int getStoreCompactionPriority()
getStoreCompactionPriority in interface StoreFileManagerpublic final byte[] getStartRow(int stripeIndex)
StripeCompactionPolicy.StripeInformationProvidergetStartRow in interface StripeCompactionPolicy.StripeInformationProviderstripeIndex - Stripe index.public final byte[] getEndRow(int stripeIndex)
StripeCompactionPolicy.StripeInformationProvidergetEndRow in interface StripeCompactionPolicy.StripeInformationProviderstripeIndex - Stripe index.public List<StoreFile> getLevel0Files()
getLevel0Files in interface StripeCompactionPolicy.StripeInformationProviderpublic List<byte[]> getStripeBoundaries()
getStripeBoundaries in interface StripeCompactionPolicy.StripeInformationProviderpublic ArrayList<com.google.common.collect.ImmutableList<StoreFile>> getStripes()
getStripes in interface StripeCompactionPolicy.StripeInformationProviderpublic int getStripeCount()
getStripeCount in interface StripeCompactionPolicy.StripeInformationProviderpublic Collection<StoreFile> getUnneededFiles(long maxTs, List<StoreFile> filesCompacting)
getUnneededFiles in interface StoreFileManagermaxTs - Maximum expired timestamp.filesCompacting - Files that are currently compacting.Copyright © 2014 The Apache Software Foundation. All rights reserved.