Class ReplicationLogCleaner
java.lang.Object
org.apache.hadoop.hbase.BaseConfigurable
org.apache.hadoop.hbase.master.cleaner.BaseFileCleanerDelegate
org.apache.hadoop.hbase.master.cleaner.BaseLogCleanerDelegate
org.apache.hadoop.hbase.replication.master.ReplicationLogCleaner
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable,FileCleanerDelegate,Stoppable
Implementation of a log cleaner that checks if a log is still scheduled for replication before
deleting it when its TTL is over.
The logic is a bit complicated after we switch to use table based replication queue storage, see
the design doc in HBASE-27109 and the comments in HBASE-27214 for more details.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ReplicationLogCleanerBarrierprivate booleanprivate Supplier<Set<ServerName>>private static final org.slf4j.Loggerprivate MasterServicesprivate Set<ServerName>private Map<ServerName,Map<String, Map<String, ReplicationGroupOffset>>> private ReplicationPeerManagerprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanfilterForDeadRegionServer(ServerName serverName, org.apache.hadoop.fs.FileStatus file) private booleanfilterForLiveRegionServer(ServerName serverName, org.apache.hadoop.fs.FileStatus file) Iterable<org.apache.hadoop.fs.FileStatus>getDeletableFiles(Iterable<org.apache.hadoop.fs.FileStatus> files) Determines which of the given files are safe to deleteprivate Set<ServerName>getNotFullyDeadServers(MasterServices services) voidthis method is used to pass some instance into subclassprivate booleanCheck if asyncClusterConnection is null or closed.booleanReturns True ifStoppable.stop(String)has been closed.voidWill be called after cleaner run.voidpreClean()Used to do some initialize work before every period cleanprivate booleanshouldDelete(ReplicationGroupOffset offset, org.apache.hadoop.fs.FileStatus file) voidStop this service.Methods inherited from class org.apache.hadoop.hbase.master.cleaner.BaseLogCleanerDelegate
isFileDeletableMethods inherited from class org.apache.hadoop.hbase.BaseConfigurable
getConf, setConfMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.conf.Configurable
getConf, setConfMethods inherited from interface org.apache.hadoop.hbase.master.cleaner.FileCleanerDelegate
isEmptyDirDeletable
-
Field Details
-
LOG
-
notFullyDeadServers
-
peerIds
-
replicationOffsets
-
masterService
-
barrier
-
rpm
-
getNotFullyDeadServers
-
canFilter
-
stopped
-
-
Constructor Details
-
ReplicationLogCleaner
public ReplicationLogCleaner()
-
-
Method Details
-
preClean
Description copied from interface:FileCleanerDelegateUsed to do some initialize work before every period clean -
postClean
Description copied from interface:FileCleanerDelegateWill be called after cleaner run. -
shouldDelete
-
filterForLiveRegionServer
private boolean filterForLiveRegionServer(ServerName serverName, org.apache.hadoop.fs.FileStatus file) -
filterForDeadRegionServer
private boolean filterForDeadRegionServer(ServerName serverName, org.apache.hadoop.fs.FileStatus file) -
getDeletableFiles
public Iterable<org.apache.hadoop.fs.FileStatus> getDeletableFiles(Iterable<org.apache.hadoop.fs.FileStatus> files) Description copied from interface:FileCleanerDelegateDetermines which of the given files are safe to deleteThis method can be called concurrently by multiple threads. Implementations must be thread safe.
- Specified by:
getDeletableFilesin interfaceFileCleanerDelegate- Overrides:
getDeletableFilesin classBaseFileCleanerDelegate- Parameters:
files- files to check for deletion- Returns:
- files that are ok to delete according to this cleaner
-
getNotFullyDeadServers
-
init
Description copied from interface:FileCleanerDelegatethis method is used to pass some instance into subclass- Specified by:
initin interfaceFileCleanerDelegate- Overrides:
initin classBaseFileCleanerDelegate
-
stop
Description copied from interface:StoppableStop this service. Implementers should favor logging errors over throwing RuntimeExceptions.- Parameters:
why- Why we're stopping.
-
isStopped
Description copied from interface:StoppableReturns True ifStoppable.stop(String)has been closed. -
isAsyncClusterConnectionClosedOrNull
Check if asyncClusterConnection is null or closed.- Returns:
- true if asyncClusterConnection is null or is closed, false otherwise
-