public class CachingBlockMasterClient extends BlockMasterClient
Modifier and Type | Class and Description |
---|---|
static class |
CachingBlockMasterClient.CachingBlockMapIterator
Pre-generate the list so the RPC execution time does not include the conversion time.
|
AbstractClient.RpcCallable<V>
Modifier and Type | Field and Description |
---|---|
CachingBlockMasterClient.CachingBlockMapIterator |
mBlockBatchIterator |
mAsyncClient, mClient
mChannel, mClosed, mConnected, mContext, mServerAddress, mServiceVersion, mVersionService
Constructor and Description |
---|
CachingBlockMasterClient(MasterClientContext conf,
List<LocationBlockIdListEntry> locationBlockIdList)
Creates a new instance and caches the converted proto.
|
CachingBlockMasterClient(MasterClientContext conf,
Map<BlockStoreLocation,List<Long>> blockMap)
Creates a new instance and caches the converted proto.
|
Modifier and Type | Method and Description |
---|---|
List<LocationBlockIdListEntry> |
convertBlockListMapToProto(Map<BlockStoreLocation,List<Long>> blockListOnLocation)
Converts the block list map to a proto list.
|
void |
registerWithStream(long workerId,
List<String> storageTierAliases,
Map<String,Long> totalBytesOnTiers,
Map<String,Long> usedBytesOnTiers,
Map<BlockStoreLocation,List<Long>> currentBlocksOnLocation,
Map<String,List<String>> lostStorage,
List<ConfigProperty> configList)
Registers with the master in a stream.
|
acquireRegisterLeaseWithBackoff, afterConnect, commitBlock, commitBlockInUfs, getId, getRemoteServiceType, getServiceName, getServiceVersion, heartbeat, notifyWorkerId, register
afterDisconnect, beforeConnect, getConfAddress, queryGrpcServerAddress
beforeDisconnect, checkVersion, close, connect, connectWithRuntimeException, disconnect, getRemoteHostName, getRemoteServiceVersion, getRemoteSockAddress, isClosed, isConnected, retryRPC, retryRPC
public CachingBlockMasterClient.CachingBlockMapIterator mBlockBatchIterator
public CachingBlockMasterClient(MasterClientContext conf, List<LocationBlockIdListEntry> locationBlockIdList)
conf
- master client configurationlocationBlockIdList
- location block id listpublic CachingBlockMasterClient(MasterClientContext conf, Map<BlockStoreLocation,List<Long>> blockMap)
conf
- master client configurationblockMap
- block lists of each locationpublic List<LocationBlockIdListEntry> convertBlockListMapToProto(Map<BlockStoreLocation,List<Long>> blockListOnLocation)
BlockMasterClient
LocationBlockIdListEntry
instances shall have the same BlockStoreLocationProto
.
The uniqueness of BlockStoreLocationProto
is determined by tier alias and medium type.
That means directories with the same tier alias and medium type will be merged into the same
LocationBlockIdListEntry
.convertBlockListMapToProto
in class BlockMasterClient
blockListOnLocation
- a map from block location to the block listpublic void registerWithStream(long workerId, List<String> storageTierAliases, Map<String,Long> totalBytesOnTiers, Map<String,Long> usedBytesOnTiers, Map<BlockStoreLocation,List<Long>> currentBlocksOnLocation, Map<String,List<String>> lostStorage, List<ConfigProperty> configList) throws IOException
BlockMasterClient
registerWithStream
in class BlockMasterClient
workerId
- the worker IDstorageTierAliases
- storage/tier setup from the configurationtotalBytesOnTiers
- the capacity of each tierusedBytesOnTiers
- the current usage of each tiercurrentBlocksOnLocation
- the blocks in each tier/dirlostStorage
- the lost storage pathsconfigList
- the configuration propertiesIOException
Copyright © 2023. All Rights Reserved.