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; }
setIpAddress(in); final TMessage msg = in.readMessageBegin(); final ProcessFunction<Iface, ? extends TBase> fn = functions.get(msg.name); if (fn == null) {
path = protocol.readString(); id = protocol.readI64(); message = protocol.readMessageBegin(); } catch (TException e) { throw new IOException(e.getMessage(), e);
path = protocol.readString(); id = protocol.readI64(); message = protocol.readMessageBegin(); } catch (TException e) { throw new IOException(e.getMessage(), e);
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 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 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 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 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 ServerInfo recv_handshakeWithClientInfo() 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, "handshakeWithClientInfo failed: out of sequence response"); } handshakeWithClientInfo_result result = new handshakeWithClientInfo_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.isSetSuccess()) { return result.success; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "handshakeWithClientInfo failed: unknown result"); } public WriteResponse heartbeat(String stream, WriteContext ctx) throws TException
public WriteResponse recv_create() 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, "create failed: out of sequence response"); } create_result result = new create_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.isSetSuccess()) { return result.success; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "create failed: unknown result"); } public WriteResponse delete(String stream, WriteContext ctx) throws TException
public WriteResponse recv_delete() 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, "delete failed: out of sequence response"); } delete_result result = new delete_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.isSetSuccess()) { return result.success; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "delete failed: unknown result"); } public void setAcceptNewStream(boolean enabled) throws TException
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 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 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 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
public TMessage readMessageBegin() throws TException { return concreteProtocol.readMessageBegin(); }
public Future<byte[]> apply(byte[] request) { TTransport inputTransport = new TMemoryInputTransport(request); TProtocol iprot = protocolFactory.getProtocol(inputTransport); TMessage msg; try { msg = iprot.readMessageBegin(); } catch (Exception e) { return Future.exception(e); } Function2<TProtocol, Integer, Future<byte[]>> fn = functionMap.get(msg.name); if (fn == null) { try { TProtocolUtil.skip(iprot, TType.STRUCT); iprot.readMessageEnd(); TApplicationException x = new TApplicationException(TApplicationException.UNKNOWN_METHOD, "Invalid method name: '"+msg.name+"'"); TMemoryBuffer memoryBuffer = new TMemoryBuffer(512); TProtocol oprot = protocolFactory.getProtocol(memoryBuffer); oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return Future.value(Arrays.copyOfRange(memoryBuffer.getArray(), 0, memoryBuffer.length())); } catch (Exception e) { return Future.exception(e); } } return fn.apply(iprot, msg.seqid); } }
header = inProto.readMessageBegin(); } catch (Exception e) { logger.debug("{} Failed to decode a {} header:", ctx, serializationFormat, e);
final TProtocol inputProtocol = protocolFactory.getProtocol(inputTransport); final TMessage header = inputProtocol.readMessageBegin(); final TApplicationException appEx = readApplicationException(seqId, func, inputProtocol, header); if (appEx != null) {