public void send_handshake() throws TException { oprot_.writeMessageBegin(new TMessage("handshake", TMessageType.CALL, ++seqid_)); handshake_args args = new handshake_args(); args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); }
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("shutdown", org.apache.thrift.protocol.TMessageType.CALL, 0)); shutdown_args args = new shutdown_args(); args.write(prot); prot.writeMessageEnd(); }
public boolean process(TProtocol iprot, TProtocol oprot) throws TException { TMessage msg = iprot.readMessageBegin(); ProcessFunction fn = processMap_.get(msg.name); if (fn == null) { TProtocolUtil.skip(iprot, TType.STRUCT); iprot.readMessageEnd(); TApplicationException x = new TApplicationException(TApplicationException.UNKNOWN_METHOD, "Invalid method name: '"+msg.name+"'"); oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return true; } fn.process(msg.seqid, iprot, oprot); return true; }
applicationException = new TApplicationException(throwable.getMessage()); message = new TMessage(rd.methodName, TMessageType.EXCEPTION, rd.id); } else { message = new TMessage(rd.methodName, TMessageType.REPLY, rd.id); protocol.getTransport().flush(); headerLength = bos.size(); switch (message.type) { case TMessageType.EXCEPTION: applicationException.write(protocol); break; case TMessageType.REPLY: protocol.getTransport().flush(); int oldIndex = messageLength = bos.size();
protected void encodeRequest(Channel channel, ChannelBuffer buffer, Request request) throws IOException { Invocation invocation = (Invocation) request.getData(); TProtocol protocol = newProtocol(channel.getUrl(), buffer); try { protocol.writeMessageBegin(new TMessage( invocation.getMethodName(), TMessageType.CALL, thriftSeq.getAndIncrement())); protocol.writeStructBegin(new TStruct(invocation.getMethodName() + "_args")); for (int i = 0; i < invocation.getParameterTypes().length; i++) { Class<?> type = invocation.getParameterTypes()[i]; } } catch (TException e) { throw new IOException(e.getMessage(), e); } }
public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { write_args args = new write_args(); try { args.read(iprot); } catch (TProtocolException e) { iprot.readMessageEnd(); TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); oprot.writeMessageBegin(new TMessage("write", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } iprot.readMessageEnd(); write_result result = new write_result(); result.success = iface_.write(args.stream, args.data); oprot.writeMessageBegin(new TMessage("write", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } }
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("resourcePoolGetAll", org.apache.thrift.protocol.TMessageType.CALL, 0)); resourcePoolGetAll_args args = new resourcePoolGetAll_args(); args.write(prot); prot.writeMessageEnd(); }
public void send_handshakeWithClientInfo(ClientInfo clientInfo) throws TException { oprot_.writeMessageBegin(new TMessage("handshakeWithClientInfo", TMessageType.CALL, ++seqid_)); handshakeWithClientInfo_args args = new handshakeWithClientInfo_args(); args.setClientInfo(clientInfo); args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); }
applicationException = new TApplicationException(throwable.getMessage()); message = new TMessage(rd.methodName, TMessageType.EXCEPTION, rd.id); } else { message = new TMessage(rd.methodName, TMessageType.REPLY, rd.id); protocol.getTransport().flush(); headerLength = bos.size(); switch (message.type) { case TMessageType.EXCEPTION: applicationException.write(protocol); break; case TMessageType.REPLY: protocol.getTransport().flush(); int oldIndex = messageLength = bos.size();
protected void encodeRequest(Channel channel, ChannelBuffer buffer, Request request) throws IOException { Invocation invocation = (Invocation) request.getData(); TProtocol protocol = newProtocol(channel.getUrl(), buffer); try { protocol.writeMessageBegin(new TMessage( invocation.getMethodName(), TMessageType.CALL, thriftSeq.getAndIncrement())); protocol.writeStructBegin(new TStruct(invocation.getMethodName() + "_args")); for (int i = 0; i < invocation.getParameterTypes().length; i++) { Class<?> type = invocation.getParameterTypes()[i]; } } catch (TException e) { throw new IOException(e.getMessage(), e); } }
public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { truncate_args args = new truncate_args(); try { args.read(iprot); } catch (TProtocolException e) { iprot.readMessageEnd(); TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); oprot.writeMessageBegin(new TMessage("truncate", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } iprot.readMessageEnd(); truncate_result result = new truncate_result(); result.success = iface_.truncate(args.stream, args.dlsn, args.ctx); oprot.writeMessageBegin(new TMessage("truncate", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } }
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("stopSupervisors", org.apache.thrift.protocol.TMessageType.CALL, 0)); stopSupervisors_args args = new stopSupervisors_args(); args.write(prot); prot.writeMessageEnd(); }
public void send_setAcceptNewStream(boolean enabled) throws TException { oprot_.writeMessageBegin(new TMessage("setAcceptNewStream", TMessageType.CALL, ++seqid_)); setAcceptNewStream_args args = new setAcceptNewStream_args(); args.setEnabled(enabled); args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); }
public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { handshakeWithClientInfo_args args = new handshakeWithClientInfo_args(); try { args.read(iprot); } catch (TProtocolException e) { iprot.readMessageEnd(); TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); oprot.writeMessageBegin(new TMessage("handshakeWithClientInfo", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } iprot.readMessageEnd(); handshakeWithClientInfo_result result = new handshakeWithClientInfo_result(); result.success = iface_.handshakeWithClientInfo(args.clientInfo); oprot.writeMessageBegin(new TMessage("handshakeWithClientInfo", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } }
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("registerInterpreterProcess", org.apache.thrift.protocol.TMessageType.CALL, 0)); registerInterpreterProcess_args args = new registerInterpreterProcess_args(); args.setRegisterInfo(registerInfo); args.write(prot); prot.writeMessageEnd(); }
public void send_release(String stream, WriteContext ctx) throws TException { oprot_.writeMessageBegin(new TMessage("release", TMessageType.CALL, ++seqid_)); release_args args = new release_args(); args.setStream(stream); args.setCtx(ctx); args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); }
public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { heartbeat_args args = new heartbeat_args(); try { args.read(iprot); } catch (TProtocolException e) { iprot.readMessageEnd(); TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); oprot.writeMessageBegin(new TMessage("heartbeat", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } iprot.readMessageEnd(); heartbeat_result result = new heartbeat_result(); result.success = iface_.heartbeat(args.stream, args.ctx); oprot.writeMessageBegin(new TMessage("heartbeat", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } }
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("runParagraphs", org.apache.thrift.protocol.TMessageType.CALL, 0)); runParagraphs_args args = new runParagraphs_args(); args.setEvent(event); args.write(prot); prot.writeMessageEnd(); }