@ThreadSafe public final class ReplicationChecker extends java.lang.Object implements HeartbeatExecutor
| Constructor and Description |
|---|
ReplicationChecker(InodeTree inodeTree,
BlockMaster blockMaster,
SafeModeManager safeModeManager,
JobMasterClientPool jobMasterClientPool)
Constructs a new
ReplicationChecker using default (job service) handler to replicate
and evict blocks. |
ReplicationChecker(InodeTree inodeTree,
BlockMaster blockMaster,
SafeModeManager safeModeManager,
ReplicationHandler replicationHandler)
Constructs a new
ReplicationChecker with specified replicate and evict handlers (for
unit testing). |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
heartbeat()
During this heartbeat, this class will check:
|
public ReplicationChecker(InodeTree inodeTree, BlockMaster blockMaster, SafeModeManager safeModeManager, JobMasterClientPool jobMasterClientPool)
ReplicationChecker using default (job service) handler to replicate
and evict blocks.inodeTree - inode tree of the filesystem masterblockMaster - block mastersafeModeManager - manager of master safe mode statejobMasterClientPool - job master client poolpublic ReplicationChecker(InodeTree inodeTree, BlockMaster blockMaster, SafeModeManager safeModeManager, ReplicationHandler replicationHandler)
ReplicationChecker with specified replicate and evict handlers (for
unit testing).inodeTree - inode tree of the filesystem masterblockMaster - block mastersafeModeManager - manager of master safe mode statereplicationHandler - handler to replicate blockspublic void heartbeat()
throws java.lang.InterruptedException
(1) Is there any block from the pinned files becomes under replicated (i.e., the number of existing copies is smaller than the target replication min for this file, possibly due to node failures), and schedule replicate jobs to increase the replication level when found; (2) Is there any blocks over replicated, schedule evict jobs to reduce the replication level.
heartbeat in interface HeartbeatExecutorjava.lang.InterruptedExceptionpublic void close()
close in interface HeartbeatExecutorclose in interface java.io.Closeableclose in interface java.lang.AutoCloseableCopyright © 2019. All Rights Reserved.