public MockRequest(SubmitWorkRequestProto requestProto, QueryFragmentInfo fragmentInfo, boolean canFinish, boolean canFinishQueue, long workTime, TezEvent initialEvent, boolean isGuaranteed) { super(requestProto, fragmentInfo, new Configuration(), new ExecutionContextImpl("localhost"), null, new Credentials(), 0, mock(AMReporter.class), null, mock( LlapDaemonExecutorMetrics.class), mock(KilledTaskHandler.class), mock( FragmentCompletionHandler.class), new DefaultHadoopShim(), null, requestProto.getWorkSpec().getVertex(), initialEvent, null, mock( SchedulerFragmentCompletingListener.class), mock(SocketFactory.class), isGuaranteed, null); this.workTime = workTime; this.canFinish = canFinish; this.canFinishQueue = canFinishQueue; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasVertex()) { hash = (37 * hash) + VERTEX_FIELD_NUMBER; hash = (53 * hash) + getVertex().hashCode(); } if (hasVertexBinary()) { hash = (37 * hash) + VERTEXBINARY_FIELD_NUMBER; hash = (53 * hash) + getVertexBinary().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; }
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; }
/** * 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(); }
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; }
/** * 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(); }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.VertexOrBinary)) { return super.equals(obj); } org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.VertexOrBinary other = (org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.VertexOrBinary) obj; boolean result = true; result = result && (hasVertex() == other.hasVertex()); if (hasVertex()) { result = result && getVertex() .equals(other.getVertex()); } result = result && (hasVertexBinary() == other.hasVertexBinary()); if (hasVertexBinary()) { result = result && getVertexBinary() .equals(other.getVertexBinary()); } result = result && getUnknownFields().equals(other.getUnknownFields()); return result; }
public Builder mergeFrom(org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.VertexOrBinary other) { if (other == org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.VertexOrBinary.getDefaultInstance()) return this; if (other.hasVertex()) { mergeVertex(other.getVertex()); } if (other.hasVertexBinary()) { setVertexBinary(other.getVertexBinary()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
private static MockRequest createMockRequest(boolean canFinish, boolean canFinishQueue, long workTime, SubmitWorkRequestProto request, boolean isGuaranteed) { QueryFragmentInfo queryFragmentInfo = createQueryFragmentInfo( request.getWorkSpec().getVertex(), request.getFragmentNumber()); return new MockRequest(request, queryFragmentInfo, canFinish, canFinishQueue, workTime, null, isGuaranteed); }