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; }
@Nullable private static TApplicationException readApplicationException(int seqId, ThriftFunction func, TProtocol inputProtocol, TMessage msg) throws TException { if (msg.seqid != seqId) { throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID); } if (!func.name().equals(msg.name)) { return new TApplicationException(TApplicationException.WRONG_METHOD_NAME, msg.name); } if (msg.type == TMessageType.EXCEPTION) { final TApplicationException appEx = TApplicationExceptions.read(inputProtocol); inputProtocol.readMessageEnd(); return appEx; } return null; }
public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { writeBulkWithContext_args args = new writeBulkWithContext_args(); try { args.read(iprot); } catch (TProtocolException e) { iprot.readMessageEnd(); TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); oprot.writeMessageBegin(new TMessage("writeBulkWithContext", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } iprot.readMessageEnd(); writeBulkWithContext_result result = new writeBulkWithContext_result(); result.success = iface_.writeBulkWithContext(args.stream, args.data, args.ctx); oprot.writeMessageBegin(new TMessage("writeBulkWithContext", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } }
public void recv_setAcceptNewStream() throws TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } if (msg.seqid != seqid_) { throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "setAcceptNewStream failed: out of sequence response"); } setAcceptNewStream_result result = new setAcceptNewStream_result(); result.read(iprot_); iprot_.readMessageEnd(); return; } }
public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { create_args args = new create_args(); try { args.read(iprot); } catch (TProtocolException e) { iprot.readMessageEnd(); TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); oprot.writeMessageBegin(new TMessage("create", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } iprot.readMessageEnd(); create_result result = new create_result(); result.success = iface_.create(args.stream, args.ctx); oprot.writeMessageBegin(new TMessage("create", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } }
public WriteResponse recv_heartbeat() throws TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } if (msg.seqid != seqid_) { throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "heartbeat failed: out of sequence response"); } heartbeat_result result = new heartbeat_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.isSetSuccess()) { return result.success; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "heartbeat failed: unknown result"); } public WriteResponse heartbeatWithOptions(String stream, WriteContext ctx, HeartbeatOptions options) throws TException
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 WriteResponse recv_truncate() throws TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } if (msg.seqid != seqid_) { throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "truncate failed: out of sequence response"); } truncate_result result = new truncate_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.isSetSuccess()) { return result.success; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "truncate failed: unknown result"); } public WriteResponse release(String stream, WriteContext ctx) throws TException
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 ServerInfo recv_handshake() throws TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } if (msg.seqid != seqid_) { throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "handshake failed: out of sequence response"); } handshake_result result = new handshake_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.isSetSuccess()) { return result.success; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "handshake failed: unknown result"); } public ServerInfo handshakeWithClientInfo(ClientInfo clientInfo) throws TException
public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { handshake_args args = new handshake_args(); try { args.read(iprot); } catch (TProtocolException e) { iprot.readMessageEnd(); TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); oprot.writeMessageBegin(new TMessage("handshake", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } iprot.readMessageEnd(); handshake_result result = new handshake_result(); result.success = iface_.handshake(); oprot.writeMessageBegin(new TMessage("handshake", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } }
public WriteResponse recv_writeWithContext() throws TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } if (msg.seqid != seqid_) { throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "writeWithContext failed: out of sequence response"); } writeWithContext_result result = new writeWithContext_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.isSetSuccess()) { return result.success; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "writeWithContext failed: unknown result"); } public BulkWriteResponse writeBulkWithContext(String stream, List<ByteBuffer> data, WriteContext ctx) throws TException
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 WriteResponse recv_write() throws TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } if (msg.seqid != seqid_) { throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "write failed: out of sequence response"); } write_result result = new write_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.isSetSuccess()) { return result.success; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "write failed: unknown result"); } public WriteResponse writeWithContext(String stream, ByteBuffer data, WriteContext ctx) throws TException
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 BulkWriteResponse recv_writeBulkWithContext() throws TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } if (msg.seqid != seqid_) { throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "writeBulkWithContext failed: out of sequence response"); } writeBulkWithContext_result result = new writeBulkWithContext_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.isSetSuccess()) { return result.success; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "writeBulkWithContext failed: unknown result"); } public WriteResponse truncate(String stream, String dlsn, WriteContext ctx) throws TException
public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { setAcceptNewStream_args args = new setAcceptNewStream_args(); try { args.read(iprot); } catch (TProtocolException e) { iprot.readMessageEnd(); TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); oprot.writeMessageBegin(new TMessage("setAcceptNewStream", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } iprot.readMessageEnd(); setAcceptNewStream_result result = new setAcceptNewStream_result(); iface_.setAcceptNewStream(args.enabled); oprot.writeMessageBegin(new TMessage("setAcceptNewStream", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } }
public WriteResponse recv_heartbeatWithOptions() throws TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } if (msg.seqid != seqid_) { throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "heartbeatWithOptions failed: out of sequence response"); } heartbeatWithOptions_result result = new heartbeatWithOptions_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.isSetSuccess()) { return result.success; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "heartbeatWithOptions failed: unknown result"); } public WriteResponse write(String stream, ByteBuffer data) throws TException
public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { heartbeatWithOptions_args args = new heartbeatWithOptions_args(); try { args.read(iprot); } catch (TProtocolException e) { iprot.readMessageEnd(); TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); oprot.writeMessageBegin(new TMessage("heartbeatWithOptions", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } iprot.readMessageEnd(); heartbeatWithOptions_result result = new heartbeatWithOptions_result(); result.success = iface_.heartbeatWithOptions(args.stream, args.ctx, args.options); oprot.writeMessageBegin(new TMessage("heartbeatWithOptions", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } }
public WriteResponse recv_release() throws TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } if (msg.seqid != seqid_) { throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "release failed: out of sequence response"); } release_result result = new release_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.isSetSuccess()) { return result.success; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "release failed: unknown result"); } public WriteResponse create(String stream, WriteContext ctx) throws TException