Search in sources :

Example 1 with TerminateFragmentResponseProto

use of org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.TerminateFragmentResponseProto in project hive by apache.

the class LlapTaskCommunicator method sendTaskTerminated.

private void sendTaskTerminated(final TezTaskAttemptID taskAttemptId, boolean invokedByContainerEnd) {
    LOG.info("Attempting to send terminateRequest for fragment {} due to internal preemption invoked by {}", taskAttemptId.toString(), invokedByContainerEnd ? "containerEnd" : "taskEnd");
    LlapNodeId nodeId = entityTracker.getNodeIdForTaskAttempt(taskAttemptId);
    // NodeId can be null if the task gets unregistered due to failure / being killed by the daemon itself
    if (nodeId != null) {
        TerminateFragmentRequestProto request = TerminateFragmentRequestProto.newBuilder().setQueryIdentifier(constructQueryIdentifierProto(taskAttemptId.getTaskID().getVertexID().getDAGId().getId())).setFragmentIdentifierString(taskAttemptId.toString()).build();
        communicator.sendTerminateFragment(request, nodeId.getHostname(), nodeId.getPort(), new LlapProtocolClientProxy.ExecuteRequestCallback<TerminateFragmentResponseProto>() {

            @Override
            public void setResponse(TerminateFragmentResponseProto response) {
            }

            @Override
            public void indicateError(Throwable t) {
                LOG.warn("Failed to send terminate fragment request for {}", taskAttemptId.toString());
                processSendError(t);
            }
        });
    } else {
        LOG.info("Not sending terminate request for fragment {} since it's node is not known. Already unregistered", taskAttemptId.toString());
    }
}
Also used : LlapNodeId(org.apache.hadoop.hive.llap.LlapNodeId) TerminateFragmentResponseProto(org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.TerminateFragmentResponseProto) LlapProtocolClientProxy(org.apache.hadoop.hive.llap.tez.LlapProtocolClientProxy) TerminateFragmentRequestProto(org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.TerminateFragmentRequestProto)

Aggregations

LlapNodeId (org.apache.hadoop.hive.llap.LlapNodeId)1 TerminateFragmentRequestProto (org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.TerminateFragmentRequestProto)1 TerminateFragmentResponseProto (org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.TerminateFragmentResponseProto)1 LlapProtocolClientProxy (org.apache.hadoop.hive.llap.tez.LlapProtocolClientProxy)1