2013-08-30 30 views
0

我有我试图编译以下.avdl文件:如何包含已经在另一个.avdl文件中定义的记录?

@namespace("com.test.foo.bar") 
protocol PairStore { 

    /* This is already defined in another namespace - "com.test.foo.nan" */ 
    record Pair { 
     string item1; 
     string item2; 
    } 

    record Registration { 
     Pair inputPair; 
     Pair outputPair; 
     string indexURI; 
    } 
} 

所以,问题是我怎么引用在com.test.foo.nan当我创造com.test.foo.barPairStoreRegistration被定义Pair

回答

0

在挖掘Avro文档后,我终于找到了一个包含解决方案的示例。具体而言,this example

@namespace("com.test.foo") 
protocol PairStore { 

    /** Still need to define this record, but define it in the existing namespace. */ 
    @namespace("com.test.bar") 
    record Pair { 
     string item1; 
     string item2; 
    } 

    record Registration { 
     /** And this is how you refer to that record. */ 
     com.test.bar.Pair inputPair; 
     com.test.bar.Pair outputPair; 
     string indexURI; 
    } 
} 
相关问题