use of alluxio.stress.CachingBlockMasterClient in project alluxio by Alluxio.
the class WorkerHeartbeatBench method runRPC.
@Override
public RpcTaskResult runRPC() throws Exception {
RpcTaskResult result = new RpcTaskResult();
if (mWorkerPool == null) {
result.addError("Worker ID pool is null");
return result;
}
// Get the worker to use
if (mWorkerPool.isEmpty()) {
result.addError("No more worker IDs for use");
return result;
}
long workerId = mWorkerPool.poll();
LOG.info("Acquired worker ID {}", workerId);
// Use a mocked client to save conversion
CachingBlockMasterClient client = new CachingBlockMasterClient(MasterClientContext.newBuilder(ClientContext.create(mConf)).build(), mLocationBlockIdList);
long durationMs = FormatUtils.parseTimeSize(mParameters.mDuration);
Instant startTime = Instant.now();
Instant endTime = startTime.plus(durationMs, ChronoUnit.MILLIS);
LOG.info("Test start time {}, end time {}", startTime, endTime);
// Stop after certain time has elapsed
RpcTaskResult taskResult = simulateBlockHeartbeat(client, workerId, endTime);
LOG.info("Test finished with results: {}", taskResult);
return taskResult;
}
use of alluxio.stress.CachingBlockMasterClient in project alluxio by Alluxio.
the class StreamRegisterWorkerBench method runRPC.
@Override
public RpcTaskResult runRPC() throws Exception {
// Use a mocked client to save conversion
CachingBlockMasterClient client = new CachingBlockMasterClient(MasterClientContext.newBuilder(ClientContext.create(mConf)).build(), mBlockMap);
RpcTaskResult taskResult = simulateRegisterWorkerStream(client);
LOG.info("Received task result {}", taskResult);
LOG.info("Run finished");
return taskResult;
}
use of alluxio.stress.CachingBlockMasterClient in project alluxio by Alluxio.
the class RegisterWorkerBench method runRPC.
@Override
public RpcTaskResult runRPC() throws Exception {
// Use a mocked client to save conversion
CachingBlockMasterClient client = new CachingBlockMasterClient(MasterClientContext.newBuilder(ClientContext.create(mConf)).build(), mLocationBlockIdList);
RpcTaskResult taskResult = simulateRegisterWorker(client);
LOG.info("Received task result {}", taskResult);
LOG.info("Run finished");
return taskResult;
}
Aggregations