Thrift 包含两个同名文件?

Thrift include two files with same name?

我有这个结构:(命名空间是java)

package/common.thrift
common.thrift
fileA.thrift

我希望 fileA.thrift 包括两者 common.thrift

include ".../package/common.thrift"
include "common.thrift"

struct A {
   1: common.Something something #From first file (no error)
   2: common.SomethingElse else  #This throws error.
}

Thrift 只从第一个指定的文件中读取内容 为了。有没有办法:common.thrift as common 这样我就可以区分它们。或者唯一的解决办法是 不同的文件名

Thrift only reads content from the file specified first in order

不完全是。但是 Thrift 需要一个前缀来访问包含的东西。因为前缀是文件名,所以不能包含两个 "common" 文件而不产生歧义。

因此,问题的答案是不,你不能