public interface BlockMaster extends Master, ContainerIdGenerable
| Modifier and Type | Method and Description |
|---|---|
void |
commitBlock(long workerId,
long usedBytesOnTier,
java.lang.String tierAlias,
java.lang.String mediumType,
long blockId,
long length)
Marks a block as committed on a specific worker.
|
void |
commitBlockInUFS(long blockId,
long length)
Marks a block as committed, but without a worker location.
|
BlockInfo |
getBlockInfo(long blockId) |
java.util.List<BlockInfo> |
getBlockInfoList(java.util.List<java.lang.Long> blockIds)
Retrieves information for the given list of block ids.
|
long |
getCapacityBytes() |
StorageTierAssoc |
getGlobalStorageTierAssoc() |
java.util.Set<java.lang.Long> |
getLostBlocks() |
int |
getLostWorkerCount() |
java.util.List<WorkerInfo> |
getLostWorkersInfoList() |
java.util.Map<java.lang.String,java.lang.Long> |
getTotalBytesOnTiers() |
long |
getUsedBytes() |
java.util.Map<java.lang.String,java.lang.Long> |
getUsedBytesOnTiers() |
int |
getWorkerCount() |
long |
getWorkerId(WorkerNetAddress workerNetAddress)
Returns a worker id for the given worker, creating one if the worker is new.
|
java.util.List<WorkerInfo> |
getWorkerInfoList() |
java.util.List<WorkerLostStorageInfo> |
getWorkerLostStorage() |
java.util.List<WorkerInfo> |
getWorkerReport(GetWorkerReportOptions options)
Gets the worker information list for report CLI.
|
void |
registerLostWorkerFoundListener(java.util.function.Consumer<Address> function)
Registers callback functions to use when lost workers become alive.
|
void |
registerNewWorkerConfListener(java.util.function.BiConsumer<Address,java.util.List<ConfigProperty>> function)
Registers callback functions to use when workers register with configuration.
|
void |
registerWorkerLostListener(java.util.function.Consumer<Address> function)
Registers callback functions to use when detecting lost workers.
|
void |
removeBlocks(java.util.List<java.lang.Long> blockIds,
boolean delete)
Removes blocks from workers.
|
void |
reportLostBlocks(java.util.List<java.lang.Long> blockIds)
Reports the ids of the blocks lost on workers.
|
void |
validateBlocks(java.util.function.Function<java.lang.Long,java.lang.Boolean> validator,
boolean repair)
Validates the integrity of blocks with respect to the validator.
|
Command |
workerHeartbeat(long workerId,
java.util.Map<java.lang.String,java.lang.Long> capacityBytesOnTiers,
java.util.Map<java.lang.String,java.lang.Long> usedBytesOnTiers,
java.util.List<java.lang.Long> removedBlockIds,
java.util.Map<Block.BlockLocation,java.util.List<java.lang.Long>> addedBlocks,
java.util.Map<java.lang.String,StorageList> lostStorage,
java.util.List<Metric> metrics)
Updates metadata when a worker periodically heartbeats with the master.
|
void |
workerRegister(long workerId,
java.util.List<java.lang.String> storageTiers,
java.util.Map<java.lang.String,java.lang.Long> totalBytesOnTiers,
java.util.Map<java.lang.String,java.lang.Long> usedBytesOnTiers,
java.util.Map<Block.BlockLocation,java.util.List<java.lang.Long>> currentBlocksOnLocation,
java.util.Map<java.lang.String,StorageList> lostStorage,
RegisterWorkerPOptions options)
Updates metadata when a worker registers with the master.
|
createJournalContextapplyAndJournal, processJournalEntry, resetState, restoreFromCheckpoint, writeToCheckpointgetCheckpointNamegetJournalEntryIteratorclose, getDependencies, getName, getServices, start, stopgetNewContainerIdint getWorkerCount()
int getLostWorkerCount()
long getCapacityBytes()
StorageTierAssoc getGlobalStorageTierAssoc()
long getUsedBytes()
java.util.List<WorkerInfo> getWorkerInfoList() throws UnavailableException
WorkerInfo objects representing the live workers in AlluxioUnavailableExceptionjava.util.List<WorkerInfo> getLostWorkersInfoList() throws UnavailableException
WorkerInfos of lost workersUnavailableExceptionjava.util.List<WorkerInfo> getWorkerReport(GetWorkerReportOptions options) throws UnavailableException, InvalidArgumentException
options - the GetWorkerReportOptions defines the info rangeWorkerInfo objects representing the workers in AlluxioUnavailableExceptionInvalidArgumentExceptionjava.util.List<WorkerLostStorageInfo> getWorkerLostStorage()
void removeBlocks(java.util.List<java.lang.Long> blockIds,
boolean delete)
throws UnavailableException
blockIds - a list of block ids to remove from Alluxio spacedelete - whether to delete blocks' metadata in MasterUnavailableExceptionvoid validateBlocks(java.util.function.Function<java.lang.Long,java.lang.Boolean> validator,
boolean repair)
throws UnavailableException
validator - a function returns true if the given block id is validrepair - if true, deletes the invalid blocksUnavailableException - if the invalid blocks cannot be deletedvoid commitBlock(long workerId,
long usedBytesOnTier,
java.lang.String tierAlias,
java.lang.String mediumType,
long blockId,
long length)
throws NotFoundException,
UnavailableException
workerId - the worker id committing the blockusedBytesOnTier - the updated used bytes on the tier of the workertierAlias - the alias of the storage tier where the worker is committing the block tomediumType - the medium type where the worker is committing the block toblockId - the committing block idlength - the length of the blockNotFoundException - if the workerId is not activeUnavailableExceptionvoid commitBlockInUFS(long blockId,
long length)
throws UnavailableException
blockId - the id of the block to commitlength - the length of the blockUnavailableExceptionBlockInfo getBlockInfo(long blockId) throws BlockInfoException, UnavailableException
blockId - the block id to get information forBlockInfo for the given block idBlockInfoException - if the block info is not foundUnavailableExceptionjava.util.List<BlockInfo> getBlockInfoList(java.util.List<java.lang.Long> blockIds) throws UnavailableException
blockIds - A list of block ids to retrieve the information forBlockInfo objects corresponding to the input list of block ids. The
list is in the same order as the input listUnavailableExceptionjava.util.Map<java.lang.String,java.lang.Long> getTotalBytesOnTiers()
java.util.Map<java.lang.String,java.lang.Long> getUsedBytesOnTiers()
long getWorkerId(WorkerNetAddress workerNetAddress)
workerNetAddress - the worker WorkerNetAddressvoid workerRegister(long workerId,
java.util.List<java.lang.String> storageTiers,
java.util.Map<java.lang.String,java.lang.Long> totalBytesOnTiers,
java.util.Map<java.lang.String,java.lang.Long> usedBytesOnTiers,
java.util.Map<Block.BlockLocation,java.util.List<java.lang.Long>> currentBlocksOnLocation,
java.util.Map<java.lang.String,StorageList> lostStorage,
RegisterWorkerPOptions options)
throws NotFoundException
workerId - the worker id of the worker registeringstorageTiers - a list of storage tier aliases in order of their position in the worker's
hierarchytotalBytesOnTiers - a mapping from storage tier alias to total bytesusedBytesOnTiers - a mapping from storage tier alias to the used byescurrentBlocksOnLocation - a mapping from storage tier alias to a list of blockslostStorage - a mapping from storage tier alias to a list of lost storage pathsoptions - the options that may contain worker configurationNotFoundException - if workerId cannot be foundCommand workerHeartbeat(long workerId, java.util.Map<java.lang.String,java.lang.Long> capacityBytesOnTiers, java.util.Map<java.lang.String,java.lang.Long> usedBytesOnTiers, java.util.List<java.lang.Long> removedBlockIds, java.util.Map<Block.BlockLocation,java.util.List<java.lang.Long>> addedBlocks, java.util.Map<java.lang.String,StorageList> lostStorage, java.util.List<Metric> metrics)
workerId - the worker idcapacityBytesOnTiers - a mapping from tier alias to the capacity bytesusedBytesOnTiers - a mapping from tier alias to the used bytesremovedBlockIds - a list of block ids removed from this workeraddedBlocks - a mapping from tier alias to the added blockslostStorage - a mapping from tier alias to lost storage pathsmetrics - worker metricsjava.util.Set<java.lang.Long> getLostBlocks()
void reportLostBlocks(java.util.List<java.lang.Long> blockIds)
blockIds - the ids of the lost blocksvoid registerLostWorkerFoundListener(java.util.function.Consumer<Address> function)
function - the function to registervoid registerWorkerLostListener(java.util.function.Consumer<Address> function)
function - the function to registervoid registerNewWorkerConfListener(java.util.function.BiConsumer<Address,java.util.List<ConfigProperty>> function)
function - the function to registerCopyright © 2019. All Rights Reserved.