2013-08-30 56 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; 
    } 
} 
相關問題