protocol-buffers - 将 Protobuf 定义转换为 Thrift

标签 protocol-buffers thrift

是否有任何工具可以从 Protobuf 定义生成 Thrift 接口(interface)定义?

最佳答案

wrote a translator将 Thrift 的一个子集转换为 Protobuf,反之亦然。

这是一些 Thrift 代码:

enum Operation{
    ADD=1,SUBTRACT=2,MULTIPLY=3,DIVIDE=4
}
struct Work{1:i32 num1,2:i32 num2,4:string comment
}

它会自动转换成这个 Protobuf 代码:
enum Operation{
    ADD=1,SUBTRACT=2,MULTIPLY=3,DIVIDE=4
}
message Work{int32 num1 = 1;int32 num2 = 2;string comment = 4;
}

关于protocol-buffers - 将 Protobuf 定义转换为 Thrift,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9624859/

相关文章:

java - java中的protobuf是线程安全的吗?

windows - 构建和使用 Google Protocol Buffers

scala - HBase - Scala - 无法初始化类 ProtobufUtil

scala - Apache thrift 是否与 Scala 一起工作

javascript - 写入/读取 Protocol Buffer

c++ - 是否可以在 google protobuf 中为类型(枚举或消息)定义别名?

java - Thrift:序列化+反序列化更改对象

c# - 在 Windows 中运行不同的 makefile

hadoop - Hive Server 2 节俭客户端错误 : Required field 'operationHandle' is unset

cassandra - Thrift API 和 CQL 之间的混淆