regarding thrift function return list

廉价感情. 提交于 2019-12-13 00:16:53

问题


i have thrift service with a function returning list of Object ABC:

struct ABC
{

     1: string user_id;

     2: string foo;

     3: optional list<string> data;
}


list<ABC> getABCByUser(1:required string user_id, 2:i32 limit,3:i32 pageId, 4:string lastDocID)
throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException    te)

server side written by c++ I print out result returned by server side, data in ABC instance is NOT null in the response of getABCByUser.

How ever on client side which is written by java: I set break point in the code generated by thrift on java side, data in ABC instance is null, other fields are not null. it looks like a issue on the client side. Any idea how to fix this issue?

thanks in advance!


回答1:


I encounter the same problem with you. I found that if delete the "optional" modifier before list, the return value will be right. But I don't know why we can't use "optional" before list.




回答2:


If you think you may have found a bug, please open a JIRA ticket and add your reproducible test case. This makes it easier for others to have a look at it. Thank you!



来源:https://stackoverflow.com/questions/18052957/regarding-thrift-function-return-list

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!