Package alluxio.stress
Class CachingBlockMasterClient
- java.lang.Object
-
- alluxio.AbstractClient
-
- alluxio.AbstractMasterClient
-
- alluxio.worker.block.BlockMasterClient
-
- alluxio.stress.CachingBlockMasterClient
-
- All Implemented Interfaces:
alluxio.Client,java.io.Closeable,java.lang.AutoCloseable
public class CachingBlockMasterClient extends alluxio.worker.block.BlockMasterClientUse this class to avoid the map-list conversion at the client side. This reduces the client side work so the time measurement for the whole RPC better reflects the time taken at the master side. Also reducing the workload on the client side will avoid the test becoming CPU-bound on the client side, when the concurrency is high.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCachingBlockMasterClient.CachingBlockMapIteratorPre-generate the list so the RPC execution time does not include the conversion time.
-
Field Summary
Fields Modifier and Type Field Description CachingBlockMasterClient.CachingBlockMapIteratormBlockBatchIterator
-
Constructor Summary
Constructors Constructor Description CachingBlockMasterClient(alluxio.master.MasterClientContext conf, java.util.List<alluxio.grpc.LocationBlockIdListEntry> locationBlockIdList)Creates a new instance and caches the converted proto.CachingBlockMasterClient(alluxio.master.MasterClientContext conf, java.util.Map<alluxio.worker.block.BlockStoreLocation,java.util.List<java.lang.Long>> blockMap)Creates a new instance and caches the converted proto.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<alluxio.grpc.LocationBlockIdListEntry>convertBlockListMapToProto(java.util.Map<alluxio.worker.block.BlockStoreLocation,java.util.List<java.lang.Long>> blockListOnLocation)voidregisterWithStream(long workerId, java.util.List<java.lang.String> storageTierAliases, java.util.Map<java.lang.String,java.lang.Long> totalBytesOnTiers, java.util.Map<java.lang.String,java.lang.Long> usedBytesOnTiers, java.util.Map<alluxio.worker.block.BlockStoreLocation,java.util.List<java.lang.Long>> currentBlocksOnLocation, java.util.Map<java.lang.String,java.util.List<java.lang.String>> lostStorage, java.util.List<alluxio.grpc.ConfigProperty> configList)-
Methods inherited from class alluxio.worker.block.BlockMasterClient
acquireRegisterLeaseWithBackoff, afterConnect, commitBlock, commitBlockInUfs, getId, getRemoteServiceType, getServiceName, getServiceVersion, heartbeat, notifyWorkerId, register
-
Methods inherited from class alluxio.AbstractMasterClient
afterDisconnect, beforeConnect, getConfAddress, queryGrpcServerAddress
-
-
-
-
Field Detail
-
mBlockBatchIterator
public CachingBlockMasterClient.CachingBlockMapIterator mBlockBatchIterator
-
-
Constructor Detail
-
CachingBlockMasterClient
public CachingBlockMasterClient(alluxio.master.MasterClientContext conf, java.util.List<alluxio.grpc.LocationBlockIdListEntry> locationBlockIdList)Creates a new instance and caches the converted proto.- Parameters:
conf- master client configurationlocationBlockIdList- location block id list
-
CachingBlockMasterClient
public CachingBlockMasterClient(alluxio.master.MasterClientContext conf, java.util.Map<alluxio.worker.block.BlockStoreLocation,java.util.List<java.lang.Long>> blockMap)Creates a new instance and caches the converted proto.- Parameters:
conf- master client configurationblockMap- block lists of each location
-
-
Method Detail
-
convertBlockListMapToProto
public java.util.List<alluxio.grpc.LocationBlockIdListEntry> convertBlockListMapToProto(java.util.Map<alluxio.worker.block.BlockStoreLocation,java.util.List<java.lang.Long>> blockListOnLocation)
- Overrides:
convertBlockListMapToProtoin classalluxio.worker.block.BlockMasterClient
-
registerWithStream
public void registerWithStream(long workerId, java.util.List<java.lang.String> storageTierAliases, java.util.Map<java.lang.String,java.lang.Long> totalBytesOnTiers, java.util.Map<java.lang.String,java.lang.Long> usedBytesOnTiers, java.util.Map<alluxio.worker.block.BlockStoreLocation,java.util.List<java.lang.Long>> currentBlocksOnLocation, java.util.Map<java.lang.String,java.util.List<java.lang.String>> lostStorage, java.util.List<alluxio.grpc.ConfigProperty> configList) throws java.io.IOException- Overrides:
registerWithStreamin classalluxio.worker.block.BlockMasterClient- Throws:
java.io.IOException
-
-