/** * Delegates to {@link RpcBus#send} for this client. */ public <SEND extends MessageLite, RECEIVE extends MessageLite> RpcFuture<RECEIVE> send(T rpcType, SEND protobufBody, Class<RECEIVE> clazz, ByteBuf... dataBodies) { return super.send(connection, rpcType, protobufBody, clazz, dataBodies); }
public void handle(PhysicalConnection connection, int rpcType, ByteString pBody, ByteBuf body, ResponseSender sender) throws RpcException { switch(rpcType){ case RpcType.REQ_RECORD_BATCH_VALUE: { final FragmentRecordBatch fragmentBatch = RpcBus.get(pBody, FragmentRecordBatch.PARSER); handleFragmentRecordBatch(fragmentBatch, body, sender); return; } case RpcType.REQ_STREAM_COMPLETE_VALUE: { final FragmentStreamComplete completion = RpcBus.get(pBody, FragmentStreamComplete.PARSER); handleFragmentStreamCompletion(completion); sender.send(OK); return; } case RpcType.REQ_RECEIVER_FINISHED_VALUE: { final FinishedReceiver completion = RpcBus.get(pBody, FinishedReceiver.PARSER); handleReceiverFinished(completion); sender.send(OK); return; } case RpcType.REQ_OOB_MESSAGE_VALUE: { final OOBMessage oobMessage = RpcBus.get(pBody, OOBMessage.PARSER); handleOobMessage(oobMessage); sender.send(OK); return; } default: throw new UnsupportedOperationException(); } }
protected void handle(C connection, int rpcType, byte[] pBody, ByteBuf dBody, ResponseSender sender) throws RpcException { sender.send(handle(connection, rpcType, pBody, dBody)); }
final FragmentHandle handle = get(pBody, FragmentHandle.PARSER); coordToExec.get().cancelFragment(handle); sender.send(OK); final InitializeFragments fragments = get(pBody, InitializeFragments.PARSER); coordToExec.get().startFragments(fragments, sender); break; FragmentStatus status = get(pBody, FragmentStatus.PARSER); execToCoord.get().fragmentStatusUpdate(status); sender.send(OK); QueryData header = get(pBody, QueryData.PARSER); execToCoord.get().dataArrived(header, dBody, sender); break; NodeQueryStatus nodeQueryStatus = get(pBody, NodeQueryStatus.PARSER); execToCoord.get().nodeQueryStatusUpdate(nodeQueryStatus); sender.send(OK);
public <SEND extends MessageLite, RECEIVE extends MessageLite> void send(RpcOutcomeListener<RECEIVE> listener, C connection, T rpcType, SEND protobufBody, Class<RECEIVE> clazz, ByteBuf... dataBodies) { send(listener, connection, rpcType, protobufBody, clazz, false, dataBodies); }
@Override public void handle( PhysicalConnection connection, int rpcType, ByteString pBody, ByteBuf dBody, ResponseSender sender) throws RpcException { switch (rpcType) { case RpcType.REQ_SOURCE_CONFIG_VALUE: { final SourceWrapper wrapper = get(pBody, SourceWrapper.PARSER); serializedExecutor.execute(Runnables.combo(new MessageHandler(wrapper, sender, true))); break; } case RpcType.REQ_DEL_SOURCE_VALUE: { final SourceWrapper wrapper = get(pBody, SourceWrapper.PARSER); serializedExecutor.execute(Runnables.combo(new MessageHandler(wrapper, sender, false))); break; } default: throw new RpcException("Message received that is not yet supported. Message type: " + rpcType); } }
/** * Delegates to {@link RpcBus#send} for this client. */ public <SEND extends MessageLite, RECEIVE extends MessageLite> void send(RpcOutcomeListener<RECEIVE> listener, T rpcType, SEND protobufBody, Class<RECEIVE> clazz, ByteBuf... dataBodies) { super.send(listener, connection, rpcType, protobufBody, clazz, dataBodies); }
final CoordRPC.JobCancelRequest jobCancelRequest = get(pBody, CoordRPC.JobCancelRequest.PARSER); final ExternalId id = jobCancelRequest.getExternalId(); final String cancelreason = jobCancelRequest.getCancelReason(); ExternalId id = get(pBody, ExternalId.PARSER); Optional<QueryProfile> profile = tool.getProfile(id); if(!profile.isPresent()){
@Override public <SEND extends MessageLite, RECEIVE extends MessageLite> void send( RpcOutcomeListener<RECEIVE> outcomeListener, RpcType rpcType, SEND protobufBody, Class<RECEIVE> clazz, ByteBuf... dataBodies) { bus.send(outcomeListener, this, rpcType, protobufBody, clazz, dataBodies); }
/** * Maps internal low-level API protocol to {@link UserResultsListener}-level API protocol. * handles query data messages */ public void batchArrived( ConnectionThrottle throttle, byte[] pBody, ByteBuf dBody ) throws RpcException { final QueryData queryData = RpcBus.get( pBody, QueryData.PARSER ); // Current batch coming in. final ArrowBuf ArrowBuf = (ArrowBuf) dBody; final QueryDataBatch batch = new QueryDataBatch( queryData, ArrowBuf ); final QueryId queryId = queryData.getQueryId(); if (logger.isDebugEnabled()) { logger.debug("batchArrived: queryId = {}", QueryIdHelper.getQueryId(queryId)); } logger.trace( "batchArrived: batch = {}", batch ); final UserResultsListener resultsListener = newUserResultsListener(queryId); // A data case--pass on via dataArrived try { resultsListener.dataArrived(batch, throttle); // That releases batch if successful. } catch ( Exception e ) { batch.release(); resultsListener.submissionFailed(UserException.systemError(e).build(logger)); } }
/** * See {@link RpcBus#send}. */ @Override // overridden to expand visibility public <SEND extends MessageLite, RECEIVE extends MessageLite> RpcFuture<RECEIVE> send(C connection, T rpcType, SEND protobufBody, Class<RECEIVE> clazz, ByteBuf... dataBodies) { return super.send(connection, rpcType, protobufBody, clazz, dataBodies); }
final QueryResult queryResult = RpcBus.get( pBody, QueryResult.PARSER );
public <SEND extends MessageLite, RECEIVE extends MessageLite> void sendUnsafe(RpcOutcomeListener<RECEIVE> outcomeListener, RpcType rpcType, SEND protobufBody, Class<RECEIVE> clazz, ByteBuf... dataBodies) { bus.send(outcomeListener, this, rpcType, protobufBody, clazz, true, dataBodies); }
protected void handle(FabricIdentity remoteIdentity, FabricIdentity localIdentity, FabricConnection connection, int rpcType, byte[] pBody, ByteBuf dBody, ResponseSender responseSender) throws RpcException{ final FabricMessage message = RpcBus.get(pBody, FabricMessage.PARSER); final int protocolId = message.getProtocolId(); FabricProtocol protocol = getProtocol(protocolId);
<SEND extends MessageLite, RECEIVE extends MessageLite> RpcFuture<RECEIVE> send(C connection, T rpcType, SEND protobufBody, Class<RECEIVE> clazz, ByteBuf... dataBodies) { RpcFutureImpl<RECEIVE> rpcFuture = new RpcFutureImpl<>(); this.send(rpcFuture, connection, rpcType, protobufBody, clazz, dataBodies); return rpcFuture; }