thrift 学习笔记

规则篇

namespace

The namespace scope indicates which language the namespace applies to;

a scope of '*' indicates that the namespace applies to all target languages

field

structunionexception 和函数形参列表中的变量声明规则如下:

Field        ::=  FieldID? FieldReq? FieldType Identifier ('=' ConstValue)? XsdFieldOptions ListSeparator?
FieldID      ::=  IntConstant ':'
FieldReq     ::=  'required' | 'optional'
FieldType    ::=  Identifier | BaseType | ContainerType

optional, required and default

default optional required
是否生成 isset 函数
TProtocol 读取该字段时发现为空(read 失败) 无事 无事 error
将该字段写入 TProtocol 时发现为空(write 失败) error 无事 error

查询篇

语法:Interface Description Language (IDL)

概念:Concepts

你可能感兴趣的:(thrift)