@Test public void generateReportRemove() { Long block1 = 1L; Long block2 = 2L; Long block3 = 3L; removeBlock(block1); removeBlock(block2); removeBlock(block3); BlockHeartbeatReport report = mReporter.generateReport(); List<Long> removedBlocks = report.getRemovedBlocks(); assertEquals(3, removedBlocks.size()); assertTrue(removedBlocks.contains(block1)); assertTrue(removedBlocks.contains(block2)); assertTrue(removedBlocks.contains(block3)); Map<BlockStoreLocation, List<Long>> addedBlocks = report.getAddedBlocks(); assertTrue(addedBlocks.isEmpty()); }
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);  }