Class StoreFileTrackerBase
java.lang.Object
org.apache.hadoop.hbase.regionserver.storefiletracker.StoreFileTrackerBase
- All Implemented Interfaces:
StoreFileTracker
- Direct Known Subclasses:
DefaultStoreFileTracker,FileBasedStoreFileTracker,MigrationStoreFileTracker
Base class for all store file tracker.
Mainly used to place the common logic to skip persistent for secondary replicas.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprotected final org.apache.hadoop.conf.Configurationprotected final StoreContextprotected final booleanprivate static final org.slf4j.Logger -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedStoreFileTrackerBase(org.apache.hadoop.conf.Configuration conf, boolean isPrimaryReplica, StoreContext ctx) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidadd(Collection<StoreFileInfo> newFiles) Add new store files.private HFileContextcreateFileContext(Compression.Algorithm compression, boolean includeMVCCReadpoint, boolean includesTag, Encryption.Context encryptionContext) final StoreFileWriterCreate a writer for writing new store files.protected abstract voiddoAddCompactionResults(Collection<StoreFileInfo> compactedFiles, Collection<StoreFileInfo> newFiles) protected abstract voiddoAddNewStoreFiles(Collection<StoreFileInfo> newFiles) protected abstract List<StoreFileInfo>doLoadStoreFiles(boolean readOnly) For primary replica, we will call load once when opening a region, and the implementation could choose to do some cleanup work.protected abstract voiddoSetStoreFiles(Collection<StoreFileInfo> files) protected final Stringfinal List<StoreFileInfo>load()Load the store files list when opening a region.final voidreplace(Collection<StoreFileInfo> compactedFiles, Collection<StoreFileInfo> newFiles) Add new store files and remove compacted store files after compaction.final voidset(List<StoreFileInfo> files) Set the store files.Adds StoreFileTracker implementations specific configurations into the table descriptor.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.hbase.regionserver.storefiletracker.StoreFileTracker
requireWritingToTmpDirFirst
-
Field Details
-
LOG
-
conf
-
isPrimaryReplica
-
ctx
-
cacheOnWriteLogged
-
-
Constructor Details
-
StoreFileTrackerBase
protected StoreFileTrackerBase(org.apache.hadoop.conf.Configuration conf, boolean isPrimaryReplica, StoreContext ctx)
-
-
Method Details
-
load
Description copied from interface:StoreFileTrackerLoad the store files list when opening a region.- Specified by:
loadin interfaceStoreFileTracker- Throws:
IOException
-
add
Description copied from interface:StoreFileTrackerAdd new store files. Used for flush and bulk load.- Specified by:
addin interfaceStoreFileTracker- Throws:
IOException
-
replace
public final void replace(Collection<StoreFileInfo> compactedFiles, Collection<StoreFileInfo> newFiles) throws IOException Description copied from interface:StoreFileTrackerAdd new store files and remove compacted store files after compaction.- Specified by:
replacein interfaceStoreFileTracker- Throws:
IOException
-
set
Description copied from interface:StoreFileTrackerSet the store files.- Specified by:
setin interfaceStoreFileTracker- Throws:
IOException
-
updateWithTrackerConfigs
Description copied from interface:StoreFileTrackerAdds StoreFileTracker implementations specific configurations into the table descriptor. This is used to avoid accidentally data loss when changing the cluster level store file tracker implementation, and also possible misconfiguration between master and region servers. See HBASE-26246 for more details.- Specified by:
updateWithTrackerConfigsin interfaceStoreFileTracker- Parameters:
builder- The table descriptor builder for the given table.
-
getTrackerName
-
createFileContext
private HFileContext createFileContext(Compression.Algorithm compression, boolean includeMVCCReadpoint, boolean includesTag, Encryption.Context encryptionContext) -
createWriter
Description copied from interface:StoreFileTrackerCreate a writer for writing new store files.- Specified by:
createWriterin interfaceStoreFileTracker- Returns:
- Writer for a new StoreFile
- Throws:
IOException
-
doLoadStoreFiles
For primary replica, we will call load once when opening a region, and the implementation could choose to do some cleanup work. So here we usereadOnlyto indicate that whether you are allowed to do the cleanup work. For secondary replicas, we will setreadOnlytotrue.- Throws:
IOException
-
doAddNewStoreFiles
- Throws:
IOException
-
doAddCompactionResults
protected abstract void doAddCompactionResults(Collection<StoreFileInfo> compactedFiles, Collection<StoreFileInfo> newFiles) throws IOException - Throws:
IOException
-
doSetStoreFiles
- Throws:
IOException
-