Search in sources :

Example 1 with CachingBlockMasterClient

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;
}
Also used : Instant(java.time.Instant) CachingBlockMasterClient(alluxio.stress.CachingBlockMasterClient) RpcTaskResult(alluxio.stress.rpc.RpcTaskResult)

Example 2 with CachingBlockMasterClient

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;
}
Also used : CachingBlockMasterClient(alluxio.stress.CachingBlockMasterClient) RpcTaskResult(alluxio.stress.rpc.RpcTaskResult)

Example 3 with CachingBlockMasterClient

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;
}
Also used : CachingBlockMasterClient(alluxio.stress.CachingBlockMasterClient) RpcTaskResult(alluxio.stress.rpc.RpcTaskResult)

Aggregations

CachingBlockMasterClient (alluxio.stress.CachingBlockMasterClient)3 RpcTaskResult (alluxio.stress.rpc.RpcTaskResult)3 Instant (java.time.Instant)1