@Test public void heartbeatFileUnderReplicatedBy10() throws Exception { mFileContext.getOptions().setReplicationMin(10); long blockId = createBlockHelper(TEST_FILE_1, mFileContext, ""); mReplicationChecker.heartbeat(); Map<Long, Integer> expected = ImmutableMap.of(blockId, 10); Assert.assertEquals(EMPTY, mMockReplicationHandler.getEvictRequests()); Assert.assertEquals(expected, mMockReplicationHandler.getReplicateRequests()); }
@Override public void heartbeat() throws InterruptedException { if (mSafeModeManager.isInSafeMode()) { return; } TimeUnit.SECONDS.sleep(mQuietPeriodSeconds); Set<Long> inodes; inodes = mInodeTree.getPinIdSet(); check(inodes, mReplicationHandler, Mode.REPLICATE); inodes = mInodeTree.getReplicationLimitedFileIds(); check(inodes, mReplicationHandler, Mode.EVICT); inodes = mInodeTree.getPinIdSet(); checkMisreplicated(inodes, mReplicationHandler); }
ReplicationChecker implements HeartbeatExecutor { @Override public void heartbeat() throws InterruptedException { if (mSafeModeManager.isInSafeMode()) { return; } TimeUnit.SECONDS.sleep(mQuietPeriodSeconds); Set<Long> inodes; inodes = mInodeTree.getPinIdSet(); check(inodes, mReplicationHandler, Mode.REPLICATE); inodes = mInodeTree.getReplicationLimitedFileIds(); check(inodes, mReplicationHandler, Mode.EVICT); inodes = mInodeTree.getPinIdSet(); checkMisreplicated(inodes, mReplicationHandler); } }
ReplicationChecker implements HeartbeatExecutor { @Override public void heartbeat() throws InterruptedException { if (mSafeModeManager.isInSafeMode()) { return; } TimeUnit.SECONDS.sleep(mQuietPeriodSeconds); Set<Long> inodes; inodes = mInodeTree.getPinIdSet(); check(inodes, mReplicationHandler, Mode.REPLICATE); inodes = mInodeTree.getReplicationLimitedFileIds(); check(inodes, mReplicationHandler, Mode.EVICT); inodes = mInodeTree.getPinIdSet(); checkMisreplicated(inodes, mReplicationHandler); } ReplicationChecker(InodeTree inodeTree, BlockMaster blockMaster,
      SafeModeManager safeModeManager, JobMasterClientPool jobMasterClientPool);  ReplicationChecker(InodeTree inodeTree, BlockMaster blockMaster,
      SafeModeManager safeModeManager, ReplicationHandler replicationHandler); }
ReplicationChecker implements HeartbeatExecutor { @Override public void heartbeat() throws InterruptedException { if (mSafeModeManager.isInSafeMode()) { return; } TimeUnit.SECONDS.sleep(mQuietPeriodSeconds); Set<Long> inodes; inodes = mInodeTree.getPinIdSet(); check(inodes, mReplicationHandler, Mode.REPLICATE); inodes = mInodeTree.getReplicationLimitedFileIds(); check(inodes, mReplicationHandler, Mode.EVICT); inodes = mInodeTree.getPinIdSet(); checkMisreplicated(inodes, mReplicationHandler); } ReplicationChecker(InodeTree inodeTree, BlockMaster blockMaster,
      SafeModeManager safeModeManager, JobMasterClientPool jobMasterClientPool);  ReplicationChecker(InodeTree inodeTree, BlockMaster blockMaster,
      SafeModeManager safeModeManager, ReplicationHandler replicationHandler); @Override void heartbeat(); @Override void close(); }
ReplicationChecker implements HeartbeatExecutor { @Override public void heartbeat() throws InterruptedException { if (mSafeModeManager.isInSafeMode()) { return; } TimeUnit.SECONDS.sleep(mQuietPeriodSeconds); Set<Long> inodes; inodes = mInodeTree.getPinIdSet(); check(inodes, mReplicationHandler, Mode.REPLICATE); inodes = mInodeTree.getReplicationLimitedFileIds(); check(inodes, mReplicationHandler, Mode.EVICT); inodes = mInodeTree.getPinIdSet(); checkMisreplicated(inodes, mReplicationHandler); } ReplicationChecker(InodeTree inodeTree, BlockMaster blockMaster,
      SafeModeManager safeModeManager, JobMasterClientPool jobMasterClientPool);  ReplicationChecker(InodeTree inodeTree, BlockMaster blockMaster,
      SafeModeManager safeModeManager, ReplicationHandler replicationHandler); @Override void heartbeat(); @Override void close();  }