@Override public GetWorkerIdTResponse getWorkerId(final WorkerNetAddress workerNetAddress, GetWorkerIdTOptions options) throws AlluxioTException { return RpcUtils.call(LOG, (RpcCallable<GetWorkerIdTResponse>) () -> new GetWorkerIdTResponse( mBlockMaster.getWorkerId(fromThrift(workerNetAddress))), "GetWorkerId", "workerNetAddress=%s, options=%s", workerNetAddress, options); }
/** * Creates a new instance of {@link BlockLocation} from a thrift representation. * * @param blockLocation the thrift representation of a block location * @return the instance */ public static BlockLocation fromThrift(alluxio.thrift.BlockLocation blockLocation) { return new BlockLocation() .setWorkerId(blockLocation.getWorkerId()) .setWorkerAddress(WorkerNetAddress.fromThrift(blockLocation.getWorkerAddress())) .setTierAlias(blockLocation.getTierAlias()); }
/** * Creates a new instance of {@link WorkerInfo} from a thrift representation. * * @param workerInfo the thrift representation of a worker information * @return the instance */ public static WorkerInfo fromThrift(alluxio.thrift.WorkerInfo workerInfo) { return new WorkerInfo() .setAddress(WorkerNetAddress.fromThrift(workerInfo.getAddress())) .setCapacityBytes(workerInfo.getCapacityBytes()) .setCapacityBytesOnTiers(workerInfo.getCapacityBytesOnTiers()) .setId(workerInfo.getId()) .setLastContactSec(workerInfo.getLastContactSec()) .setStartTimeMs(workerInfo.getStartTimeMs()) .setState(workerInfo.getState()) .setUsedBytes(workerInfo.getUsedBytes()) .setUsedBytesOnTiers(workerInfo.getUsedBytesOnTiers()); }