@ThreadSafe public class BlockHeartbeatReporter extends AbstractBlockStoreEventListener
BlockWorker.commitBlock(long, long, boolean)
.Constructor and Description |
---|
BlockHeartbeatReporter()
Creates a new instance of
BlockHeartbeatReporter . |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the internal states of the reporter.
|
BlockHeartbeatReport |
generateReportAndClear()
Generates the report of the report and clear the states.
|
void |
mergeBack(BlockHeartbeatReport previousReport)
Merges back the cleared block lists/maps given a generated report.
|
void |
onBlockLost(long blockId)
Actions when a block is lost.
|
void |
onMoveBlockByClient(long blockId,
BlockStoreLocation oldLocation,
BlockStoreLocation newLocation)
Actions when moving a block by a client from a
BlockStoreLocation to another. |
void |
onMoveBlockByWorker(long blockId,
BlockStoreLocation oldLocation,
BlockStoreLocation newLocation)
Actions when moving a block by a worker from a
BlockStoreLocation to another. |
void |
onRemoveBlockByClient(long blockId)
Actions when removing an existing block.
|
void |
onRemoveBlockByWorker(long blockId)
Actions when removing an existing block by worker.
|
void |
onStorageLost(String tierAlias,
String dirPath)
Actions when a storage dir is lost.
|
onAbortBlock, onAccessBlock, onAccessBlock, onCommitBlockToLocal, onCommitBlockToMaster, onRemoveBlock, onStorageLost
public BlockHeartbeatReporter()
BlockHeartbeatReporter
.public BlockHeartbeatReport generateReportAndClear()
public void clear()
public void mergeBack(BlockHeartbeatReport previousReport)
previousReport
- the previous generated reportpublic void onMoveBlockByClient(long blockId, BlockStoreLocation oldLocation, BlockStoreLocation newLocation)
BlockStoreEventListener
BlockStoreLocation
to another.onMoveBlockByClient
in interface BlockStoreEventListener
onMoveBlockByClient
in class AbstractBlockStoreEventListener
blockId
- the id of the block to be movedoldLocation
- the source location of the block to be movednewLocation
- the destination location where the block is to be moved topublic void onRemoveBlockByClient(long blockId)
BlockStoreEventListener
onRemoveBlockByClient
in interface BlockStoreEventListener
onRemoveBlockByClient
in class AbstractBlockStoreEventListener
blockId
- the id of the block to be removedpublic void onRemoveBlockByWorker(long blockId)
BlockStoreEventListener
onRemoveBlockByWorker
in interface BlockStoreEventListener
onRemoveBlockByWorker
in class AbstractBlockStoreEventListener
blockId
- the id of the block to be removedpublic void onMoveBlockByWorker(long blockId, BlockStoreLocation oldLocation, BlockStoreLocation newLocation)
BlockStoreEventListener
BlockStoreLocation
to another.onMoveBlockByWorker
in interface BlockStoreEventListener
onMoveBlockByWorker
in class AbstractBlockStoreEventListener
blockId
- the id of the block to be movedoldLocation
- the source location of the block to be movednewLocation
- the destination location where the block is to be moved topublic void onBlockLost(long blockId)
BlockStoreEventListener
onBlockLost
in interface BlockStoreEventListener
onBlockLost
in class AbstractBlockStoreEventListener
blockId
- the id of the lost blockpublic void onStorageLost(String tierAlias, String dirPath)
BlockStoreEventListener
onStorageLost
in interface BlockStoreEventListener
onStorageLost
in class AbstractBlockStoreEventListener
tierAlias
- the tier alias of this storagedirPath
- the directory path of this storageCopyright © 2023. All Rights Reserved.