
thrift
岚天逸剑
这个作者很懒,什么都没留下…
展开
-
使用gcc-13.1.0编译安装thrift-0.18.1
注意如果不指定 --with-libevent,则不会构建 TNonblockingServer,–with-boost 也需要指定。接下来执行 make 编译 和 make install 安装即可。原创 2023-07-25 17:06:58 · 510 阅读 · 0 评论 -
编译 thrift-0.14.2 的 C++ 版本
编译命令:./configure --prefix=/usr/local/thrift-0.14.2 --with-cpp=yes --with-php=no --with-python=no --with-qt5=no --with-c_glib=no --with-java=no --with-erlang=no --with-nodejs=no --with-nodets=no --with-lua=no --with-py3=no --with-perl=no --with-php_extensi原创 2021-09-05 09:53:01 · 589 阅读 · 0 评论 -
Thrift辅助类,用于简化Thrift编程
CThriftServerHelper用于服务端,CThriftClientHelper用于客户端。IDL定义:service PackageManagerService{}服务端使用示例:CThriftServerHelper _thrift_server_helper;return _thrift_server_helper.serve(FLAGS_原创 2014-05-02 17:01:15 · 15954 阅读 · 2 评论 -
Thrift线程和状态机分析
目录目录 11. 工作线程和IO线程 12. TNonblockingServer::TConnection::transition() 23. RPC函数被调用过程 34. 管道和任务队列 45. 对象间关系 56. 相关代码摘要 6 1. 工作线程和IO线程启动Thrift时,可启动两类线程,一是TNonblockingIOThread,另一是Worke原创 2015-09-08 21:59:00 · 21590 阅读 · 3 评论 -
Thrift编译错误('::malloc' has not been declared)
问题版本:0.9.0make[4]: Entering directory `/tmp/X/thrift-0.9.0/lib/cpp'/bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../.. -I/usr/local/thirdparty/boost/include -I./src原创 2015-08-21 18:59:58 · 3923 阅读 · 4 评论 -
java thrift返回List<String>异常
对于下段代码:public List hmget(String key, List fields) throws org.apache.thrift.TException{ JedisCluster jedis_cluster = RedisClusterProxy.get_jedis_cluster(); String[] field_array = new String原创 2016-04-15 15:27:43 · 10626 阅读 · 1 评论 -
Apache Thrift的C++多线程编程定式
Facebook贡献给Apache的开源RPC组件Thrift有着广泛的应用,C++中使用Thrift也十分普遍,但由于Thrift的Handler会被多个线程调用,因而多线程中应用并不直接的友好,利用C++的“thread_local”特性或GCC的“__thread”特性可化简这一问题。看具体实例,有一Thriftservice:XService,编译后生成接口文件XService...原创 2019-03-18 19:22:11 · 919 阅读 · 0 评论 -
Thrift结构分析及增加取客户端IP功能实现
目录目录 11.前言 12.示例Service 13.网络部分类图 24.线程模式 34.1.IO线程 34.2.工作线程 44.2.1.工作线程类图 44.2.2.工作线程启动过程 55.一个RPC函数被调用时序图 55.1.启动准备 55.2.接受连接 65.3.收发数据:执行调用 75.4.服务端回...原创 2015-09-07 09:54:37 · 16297 阅读 · 2 评论 -
C++ Thrift服务端记录调用者IP和被调接口方法
Apache开源的Thrift(http://thrift.apache.org)有着广泛的使用,有时候需要知道谁调用了指定的函数,比如在下线一起老的接口之前,需要确保对这些老接口的访问已全部迁移到新口。Thrift提供了支持,在《Thrift结构分析及增加取客户端IP功能实现》一文中已做过介绍,但不够具体。本文对这个做一个详细的介绍,过程中使用到了开源的C++Thrift服务端的辅助...原创 2019-04-17 17:16:04 · 1609 阅读 · 0 评论