[
https://issues.apache.org/jira/browse/FLUME-1896?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13574916#comment-13574916
]
Hari Shreedharan commented on FLUME-1896:
-----------------------------------------
The sendBase and receiveBase methods as of Thrift 0.9.0:
{code}
protected void sendBase(String methodName, TBase args) throws TException {
oprot_.writeMessageBegin(new TMessage(methodName, TMessageType.CALL,
++seqid_));
args.write(oprot_);
oprot_.writeMessageEnd();
oprot_.getTransport().flush();
}
protected void receiveBase(TBase result, String methodName) 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,
methodName + " failed: out of sequence response");
}
result.read(iprot_);
iprot_.readMessageEnd();
}
{code}
Notice how the sequence ids are handled.
The readMessageBegin causes the thread to block until a message actually is
received - which causes the client.appendBatch etc to be blocking (they call
receiveBase after sending).
> Implement Thrift RpcClient
> --------------------------
>
> Key: FLUME-1896
> URL: https://issues.apache.org/jira/browse/FLUME-1896
> Project: Flume
> Issue Type: Sub-task
> Reporter: Hari Shreedharan
> Assignee: Hari Shreedharan
> Attachments: FLUME-1896-1.patch, FLUME-1896-2.patch,
> FLUME-1896-3.patch, FLUME-1896-4.patch, FLUME-1896-5.patch, FLUME-1896.patch
>
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira