Search in sources :

Example 1 with VertexStatusBuilder

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();
    }
}
Also used : VertexStatusBuilder(org.apache.tez.dag.api.client.VertexStatusBuilder)

Example 2 with VertexStatusBuilder

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);
    }
}
Also used : TezException(org.apache.tez.dag.api.TezException) VertexStatus(org.apache.tez.dag.api.client.VertexStatus) VertexStatusBuilder(org.apache.tez.dag.api.client.VertexStatusBuilder) AccessControlException(java.security.AccessControlException) UserGroupInformation(org.apache.hadoop.security.UserGroupInformation)

Aggregations

VertexStatusBuilder (org.apache.tez.dag.api.client.VertexStatusBuilder)2 AccessControlException (java.security.AccessControlException)1 UserGroupInformation (org.apache.hadoop.security.UserGroupInformation)1 TezException (org.apache.tez.dag.api.TezException)1 VertexStatus (org.apache.tez.dag.api.client.VertexStatus)1