use of org.apache.tez.dag.api.client.VertexStatusBuilder in project tez by apache.
the class VertexImpl method getVertexStatus.
@Override
public VertexStatusBuilder getVertexStatus(Set<StatusGetOpts> statusOptions) {
this.readLock.lock();
try {
VertexStatusBuilder status = new VertexStatusBuilder();
status.setState(getInternalState());
status.setDiagnostics(diagnostics);
status.setProgress(getVertexProgress());
if (statusOptions.contains(StatusGetOpts.GET_COUNTERS)) {
status.setVertexCounters(getAllCounters());
}
return status;
} finally {
this.readLock.unlock();
}
}
use of org.apache.tez.dag.api.client.VertexStatusBuilder in project tez by apache.
the class DAGClientAMProtocolBlockingPBServerImpl method getVertexStatus.
@Override
public GetVertexStatusResponseProto getVertexStatus(RpcController controller, GetVertexStatusRequestProto request) throws ServiceException {
UserGroupInformation user = getRPCUser();
try {
String dagId = request.getDagId();
if (!real.getACLManager(dagId).checkDAGViewAccess(user)) {
throw new AccessControlException("User " + user + " cannot perform DAG view operation");
}
real.updateLastHeartbeatTime();
String vertexName = request.getVertexName();
VertexStatus status = real.getVertexStatus(dagId, vertexName, DagTypeConverters.convertStatusGetOptsFromProto(request.getStatusOptionsList()));
assert status instanceof VertexStatusBuilder;
VertexStatusBuilder builder = (VertexStatusBuilder) status;
return GetVertexStatusResponseProto.newBuilder().setVertexStatus(builder.getProto()).build();
} catch (TezException e) {
throw wrapException(e);
}
}
Aggregations