@Test public void generateReportMoveThenRemove() { Long block1 = 1L; moveBlock(block1, MEM_LOC); removeBlock(block1); BlockHeartbeatReport report = mReporter.generateReport(); assertEquals(null, report.getAddedBlocks().get(MEM_LOC)); List<Long> removedBlocks = report.getRemovedBlocks(); assertEquals(1, removedBlocks.size()); assertTrue(removedBlocks.contains(block1)); }
public BlockHeartbeatReport generateReport() { synchronized (mLock) { BlockHeartbeatReport report = new BlockHeartbeatReport(mAddedBlocks, mRemovedBlocks, mLostStorage); mAddedBlocks.clear(); mRemovedBlocks.clear(); mLostStorage.clear(); return report; } }
BlockHeartbeatReporter extends AbstractBlockStoreEventListener { public BlockHeartbeatReport generateReport() { synchronized (mLock) { BlockHeartbeatReport report = new BlockHeartbeatReport(mAddedBlocks, mRemovedBlocks, mLostStorage); mAddedBlocks.clear(); mRemovedBlocks.clear(); mLostStorage.clear(); return report; } } }
BlockHeartbeatReporter extends AbstractBlockStoreEventListener { public BlockHeartbeatReport generateReport() { synchronized (mLock) { BlockHeartbeatReport report = new BlockHeartbeatReport(mAddedBlocks, mRemovedBlocks, mLostStorage); mAddedBlocks.clear(); mRemovedBlocks.clear(); mLostStorage.clear(); return report; } } BlockHeartbeatReporter(); }
BlockHeartbeatReporter extends AbstractBlockStoreEventListener { public BlockHeartbeatReport generateReport() { synchronized (mLock) { BlockHeartbeatReport report = new BlockHeartbeatReport(mAddedBlocks, mRemovedBlocks, mLostStorage); mAddedBlocks.clear(); mRemovedBlocks.clear(); mLostStorage.clear(); return report; } } BlockHeartbeatReporter(); BlockHeartbeatReport generateReport(); @Override void onMoveBlockByClient(long sessionId, long blockId, BlockStoreLocation oldLocation,
      BlockStoreLocation newLocation); @Override void onRemoveBlockByClient(long sessionId, long blockId); @Override void onRemoveBlockByWorker(long sessionId, long blockId); @Override void onMoveBlockByWorker(long sessionId, long blockId, BlockStoreLocation oldLocation,
      BlockStoreLocation newLocation); @Override void onBlockLost(long blockId); @Override void onStorageLost(String tierAlias, String dirPath); }
BlockHeartbeatReporter extends AbstractBlockStoreEventListener { public BlockHeartbeatReport generateReport() { synchronized (mLock) { BlockHeartbeatReport report = new BlockHeartbeatReport(mAddedBlocks, mRemovedBlocks, mLostStorage); mAddedBlocks.clear(); mRemovedBlocks.clear(); mLostStorage.clear(); return report; } } BlockHeartbeatReporter(); BlockHeartbeatReport generateReport(); @Override void onMoveBlockByClient(long sessionId, long blockId, BlockStoreLocation oldLocation,
      BlockStoreLocation newLocation); @Override void onRemoveBlockByClient(long sessionId, long blockId); @Override void onRemoveBlockByWorker(long sessionId, long blockId); @Override void onMoveBlockByWorker(long sessionId, long blockId, BlockStoreLocation oldLocation,
      BlockStoreLocation newLocation); @Override void onBlockLost(long blockId); @Override void onStorageLost(String tierAlias, String dirPath);  }