###可能问题**compiler/cpp/thriftl.cc:2190: undefined reference to yywrap'”**需要安装 Flex library **mv: cannot stat “'.deps/TBinaryProtocol.Tpo': No such file or directory”**
重新配置
##教程###The Missing Guide####语法类型#####Type包含基本类型,用户定义结构,容器类型,异常以及服务定义
**基本类型**
没有无符号类型,因为很多生成语言不支持该类型,比如java
- bool: A boolean value (true or false), one byte
- byte: A signed byte
- i16: A 16-bit signed integer
- i32: A 32-bit signed integer
- i64: A 64-bit signed integer
- double: A 64-bit floating point number
- string: Encoding agnostic text or binary string
**容器**
因为容器的复杂性,thrift没有消息长度,但是过于复杂的容器会阻碍消息的编解码
- list<t1>: An ordered list of elements of type t1. May contain duplicates.
- set<t1>: An unordered set of unique elements of type t1.
- map<t1,t2>: A map of strictly unique keys of type t1 to values of type t2.
**自定义结构和异常**
自定义结构类似于c的语法,而异常类似于把结构定义中的struct变为exception
**服务**
和定义接口或者纯虚类一样
#####Typedef类似c/c++
// A method definition looks like C code. It has a return type, arguments,
// and optionally a list of exceptions that it may throw. Note that argument
// lists and exception list are specified using the exact same syntax as
// field lists in structs.
void ping(), // 1
bool postTweet(1:Tweet tweet); // 2
TweetSearchResult searchTweets(1:string query); // 3
// The 'oneway' modifier indicates that the client only makes a request and
// does not wait for any response at all. Oneway methods MUST be void.
oneway void zip() // 4
1. 逗号和分号都可以作为结束
2. 参数必须带类型和id
3. 返回值必须带类型
4. oneway返回值必须为void
####代码生成下面图标识的thrift的网络模型
{% img data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeoAAAEmCAIAAAAiJUSiAAAqT0lEQVR42u2dC1hVVcK/A8EQEy8hKmlYXtJKSpOyTMdLhikZ6ieiGaiDiqFmXjPvOhoKIV5QzG4zX9lM9U0+TuNYWWNFVpZFUXntQjHRTDfMpCj7/v/fafntjueyzwGMDvL+nvfhOXvt29r7nPPuddbZZ3HW/yOEEFILcxangBBC0DchhJAa1/f/EkIICfigb0IIQd+EEELQNyGEEPRNCCHomxBCCPomhBCCvgkhB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QQ9M1JIYQQ9E0IIQR9E0IIQd+EEIK+CSGEoG9CCCHomxBC0DchhJDA1jchhJBaFPRNCCHomxBCSE3l/wOElkIjUdGBzgAAAABJRU5ErkJggg==%}#####TransportTransport层提供了一个抽象的网络读写接口,解耦网络层和其他层之间的关系(比如序列化/反序列化)
Transport层接口如下
- open
- close
- read- write
- flush
在Transport层上thrift还定义了ServerTransport层来提供接受或者创建transport对象的功能。顾名思义,该层用于为进入的链接创建新的
transport对象,其包含接口如下
- open
- listen
- accept
- close
对于thrift支持的语言来说,下面的接口都是可用的
- file: read/write to/from a file on disk
- http: as the name suggests
#####Protocol负责内存中的数据结构和网络协议的转化