Examples of readMessageEnd()


Examples of org.apache.thrift.protocol.TBinaryProtocol.readMessageEnd()

        Assert.assertEquals( "echoString", message.name );
        Assert.assertEquals( TMessageType.REPLY, message.type );
        Assert.assertEquals( ThriftCodec.getSeqId(), message.seqid );
        Demo.echoString_result result = new Demo.echoString_result();
        result.read( protocol );
        protocol.readMessageEnd();

        Assert.assertEquals( rpcResult.getValue(), result.getSuccess() );
    }

    @Test
View Full Code Here

Examples of org.apache.thrift.protocol.TBinaryProtocol.readMessageEnd()

        TMessage message = protocol.readMessageBegin();
        Assert.assertEquals( "echoString", message.name );
        Assert.assertEquals( TMessageType.EXCEPTION, message.type );
        Assert.assertEquals( ThriftCodec.getSeqId(), message.seqid );
        TApplicationException exception = TApplicationException.read( protocol );
        protocol.readMessageEnd();

        Assert.assertEquals( exceptionMessage, exception.getMessage() );

    }
View Full Code Here

Examples of org.apache.thrift.protocol.TBinaryProtocol.readMessageEnd()

        Demo.echoString_args args = new Demo.echoString_args();

        args.read( protocol );

        protocol.readMessageEnd();

        Assert.assertEquals( "echoString", message.name );

        Assert.assertEquals( TMessageType.CALL, message.type );
View Full Code Here

Examples of org.apache.thrift.protocol.TBinaryProtocol.readMessageEnd()

            TTransport transport = new TChannelBufferInputTransport(buffer);
            TBinaryProtocol protocol = new TBinaryProtocol(transport);

            protocol.readMessageBegin();
            TProtocolUtil.skip(protocol, TType.STRUCT);
            protocol.readMessageEnd();

            messageBuffer = buffer.slice(messageBeginIndex, buffer.readerIndex());
        }
        catch (IndexOutOfBoundsException e)
        {
View Full Code Here

Examples of org.apache.thrift.protocol.TBinaryProtocol.readMessageEnd()

                                                            ThriftTransportType.UNFRAMED);
            TBinaryProtocol protocol = new TBinaryProtocol(transport);

            protocol.readMessageBegin();
            TProtocolUtil.skip(protocol, TType.STRUCT);
            protocol.readMessageEnd();

            messageBuffer = buffer.slice(messageBeginIndex, buffer.readerIndex());
        }
        catch (IndexOutOfBoundsException e)
        {
View Full Code Here

Examples of org.apache.thrift.protocol.TProtocol.readMessageEnd()

                    this.inputProtocolFactory.getProtocol(decodeAttemptTransport);

            // Skip through the message
            inputProtocol.readMessageBegin();
            TProtocolUtil.skip(inputProtocol, TType.STRUCT);
            inputProtocol.readMessageEnd();

            messageLength = buffer.readerIndex() - messageStartReaderIndex;
        } catch (IndexOutOfBoundsException e) {
            // No complete message was decoded: ran out of bytes
            return null;
View Full Code Here

Examples of org.apache.thrift.protocol.TProtocol.readMessageEnd()

                throw new RuntimeException("Unable to find a matching ProcessFunction for invoked method : " + message.name);
            }
            TBase args = invokedProcessFunction.getEmptyArgsInstance(); // get the empty args. The values will then be read from the client's TProtocol
            //Read the argument values from the client's TProtocol
            args.read(clientProtocol);
            clientProtocol.readMessageEnd();

            // Instantiate the call result object using the Thrift naming convention used for classes
            TBase result = (TBase) Class.forName( this.getThriftServiceClass() + "$" + message.name + DEFAULT_RESULT_CLASS_NAME).newInstance();

            serviceSocket = new TSocket(this.getThriftServer(), this.getThriftPort(), this.getThriftTimeoutMillis());
View Full Code Here

Examples of org.apache.thrift.protocol.TProtocol.readMessageEnd()

                    inputProtocolFactory.getProtocol(decodeAttemptTransport);

            // Skip through the message
            inputProtocol.readMessageBegin();
            TProtocolUtil.skip(inputProtocol, TType.STRUCT);
            inputProtocol.readMessageEnd();

            messageLength = decodeAttemptTransport.getReadByteCount() - initialReadBytes;
        } catch (TTransportException | IndexOutOfBoundsException e) {
            // No complete message was decoded: ran out of bytes
            return null;
View Full Code Here

Examples of org.apache.thrift.protocol.TProtocol.readMessageEnd()

                    inputProtocolFactory.getProtocol(decodeAttemptTransport);

            // Skip through the message
            inputProtocol.readMessageBegin();
            TProtocolUtil.skip(inputProtocol, TType.STRUCT);
            inputProtocol.readMessageEnd();

            messageLength = buffer.readerIndex() - messageStartReaderIndex;
        } catch (IndexOutOfBoundsException e) {
            // No complete message was decoded: ran out of bytes
            return null;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.