Search in sources :

Example 1 with VertexOrBinary

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

the class ContainerRunnerImpl method extractVertexSpec.

private SignableVertexSpec extractVertexSpec(SubmitWorkRequestProto request, LlapTokenInfo tokenInfo) throws InvalidProtocolBufferException, IOException {
    VertexOrBinary vob = request.getWorkSpec();
    SignableVertexSpec vertex = vob.hasVertex() ? vob.getVertex() : null;
    ByteString vertexBinary = vob.hasVertexBinary() ? vob.getVertexBinary() : null;
    if (vertexBinary != null) {
        if (vertex != null) {
            throw new IOException("Vertex and vertexBinary in VertexOrBinary cannot be set at the same time");
        }
        vertex = SignableVertexSpec.parseFrom(vob.getVertexBinary());
    }
    if (tokenInfo.isSigningRequired) {
        checkSignature(vertex, vertexBinary, request, tokenInfo.userName);
    }
    return vertex;
}
Also used : VertexOrBinary(org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.VertexOrBinary) ByteString(com.google.protobuf.ByteString) SignableVertexSpec(org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.SignableVertexSpec) IOException(java.io.IOException)

Example 2 with VertexOrBinary

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

the class LlapTaskUmbilicalExternalClient method submitWork.

/**
 * Submit the work for actual execution.
 */
public void submitWork(SubmitWorkRequestProto request, String llapHost, int llapPort) {
    // Register the pending events to be sent for this spec.
    VertexOrBinary vob = request.getWorkSpec();
    assert vob.hasVertexBinary() != vob.hasVertex();
    SignableVertexSpec vertex = null;
    try {
        vertex = vob.hasVertex() ? vob.getVertex() : SignableVertexSpec.parseFrom(vob.getVertexBinary());
    } catch (InvalidProtocolBufferException e) {
        throw new RuntimeException(e);
    }
    QueryIdentifierProto queryIdentifierProto = vertex.getQueryIdentifier();
    TezTaskAttemptID attemptId = Converters.createTaskAttemptId(queryIdentifierProto, vertex.getVertexIndex(), request.getFragmentNumber(), request.getAttemptNumber());
    final String fragmentId = attemptId.toString();
    this.requestInfo = new RequestInfo(request, queryIdentifierProto, fragmentId, llapHost, llapPort);
    this.tezEvents = Lists.<TezEvent>newArrayList();
    registerClient();
    // Send out the actual SubmitWorkRequest
    final LlapTaskUmbilicalExternalClient client = this;
    communicator.start();
    submitWork();
}
Also used : VertexOrBinary(org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.VertexOrBinary) SignableVertexSpec(org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.SignableVertexSpec) InvalidProtocolBufferException(com.google.protobuf.InvalidProtocolBufferException) QueryIdentifierProto(org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.QueryIdentifierProto) TezTaskAttemptID(org.apache.tez.dag.records.TezTaskAttemptID)

Aggregations

SignableVertexSpec (org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.SignableVertexSpec)2 VertexOrBinary (org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.VertexOrBinary)2 ByteString (com.google.protobuf.ByteString)1 InvalidProtocolBufferException (com.google.protobuf.InvalidProtocolBufferException)1 IOException (java.io.IOException)1 QueryIdentifierProto (org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.QueryIdentifierProto)1 TezTaskAttemptID (org.apache.tez.dag.records.TezTaskAttemptID)1