@Test public void generateReportMove() { Long block1 = 1L; Long block2 = 2L; Long block3 = 3L; moveBlock(block1, MEM_LOC); moveBlock(block2, SSD_LOC); moveBlock(block3, HDD_LOC); BlockHeartbeatReport report = mReporter.generateReport(); Map<BlockStoreLocation, List<Long>> addedBlocks = report.getAddedBlocks(); List<Long> addedBlocksMem = addedBlocks.get(MEM_LOC); assertEquals(1, addedBlocksMem.size()); assertEquals(block1, addedBlocksMem.get(0)); List<Long> addedBlocksSsd = addedBlocks.get(SSD_LOC); assertEquals(1, addedBlocksSsd.size()); assertEquals(block2, addedBlocksSsd.get(0)); List<Long> addedBlocksHdd = addedBlocks.get(HDD_LOC); assertEquals(1, addedBlocksHdd.size()); assertEquals(block3, addedBlocksHdd.get(0)); }
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);  }