@ThreadSafe public final class ReplicationChecker extends 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()
Cleans up any resources used by the heartbeat executor.
|
void |
heartbeat()
Implements the heartbeat logic.
|
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 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 HeartbeatExecutor
InterruptedException
- if the thread is interruptedpublic void close()
HeartbeatExecutor
close
in interface HeartbeatExecutor
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2023. All Rights Reserved.