use of alluxio.stress.cli.RpcBenchPreparationUtils.CAPACITY in project alluxio by Alluxio.
the class RegisterWorkerBench method prepare.
@Override
public void prepare() throws Exception {
// The task ID is different for local and cluster executions
// So including that in the log can help associate the log to the run
LOG.info("Task ID is {}", mBaseParameters.mId);
mTierAliases = getTierAliases(mParameters.mTiers);
mCapacityMap = Maps.toMap(mTierAliases, (tier) -> CAPACITY);
mUsedMap = Maps.toMap(mTierAliases, (tier) -> 0L);
// Generate block IDs heuristically
Map<BlockStoreLocation, List<Long>> blockMap = RpcBenchPreparationUtils.generateBlockIdOnTiers(mParameters.mTiers);
BlockMasterClient client = new BlockMasterClient(MasterClientContext.newBuilder(ClientContext.create(mConf)).build());
mLocationBlockIdList = client.convertBlockListMapToProto(blockMap);
// done once, so skip preparation when running in job worker
if (!mBaseParameters.mDistributed) {
// Prepare these block IDs concurrently
LOG.info("Preparing blocks at the master");
RpcBenchPreparationUtils.prepareBlocksInMaster(blockMap);
LOG.info("Created all blocks at the master");
}
// Prepare worker IDs
int numWorkers = mParameters.mConcurrency;
mWorkerPool = RpcBenchPreparationUtils.prepareWorkerIds(client, numWorkers);
Preconditions.checkState(mWorkerPool.size() == numWorkers, "Expecting %s workers but registered %s", numWorkers, mWorkerPool.size());
LOG.info("Prepared worker IDs: {}", mWorkerPool);
}
use of alluxio.stress.cli.RpcBenchPreparationUtils.CAPACITY in project alluxio by Alluxio.
the class StreamRegisterWorkerBench method prepare.
@Override
public void prepare() throws Exception {
// The task ID is different for local and cluster executions
// So including that in the log can help associate the log to the run
LOG.info("Task ID is {}", mBaseParameters.mId);
mTierAliases = getTierAliases(mParameters.mTiers);
mCapacityMap = Maps.toMap(mTierAliases, (tier) -> CAPACITY);
mUsedMap = Maps.toMap(mTierAliases, (tier) -> 0L);
// Generate block IDs heuristically
Map<BlockStoreLocation, List<Long>> blockMap = RpcBenchPreparationUtils.generateBlockIdOnTiers(mParameters.mTiers);
BlockMasterClient client = new BlockMasterClient(MasterClientContext.newBuilder(ClientContext.create(mConf)).build());
mBlockMap = blockMap;
// done once, so skip preparation when running in job worker
if (!mBaseParameters.mDistributed) {
// Prepare these block IDs concurrently
LOG.info("Preparing blocks at the master");
RpcBenchPreparationUtils.prepareBlocksInMaster(blockMap);
LOG.info("Created all blocks at the master");
}
// Prepare worker IDs
int numWorkers = mParameters.mConcurrency;
mWorkerPool = RpcBenchPreparationUtils.prepareWorkerIds(client, numWorkers);
Preconditions.checkState(mWorkerPool.size() == numWorkers, "Expecting %s workers but registered %s", numWorkers, mWorkerPool.size());
LOG.info("Prepared worker IDs: {}", mWorkerPool);
}
Aggregations