1

コンパイルしようとしている次の .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;
    }
}

だから問題は、私が作成しているときとでPair定義されている をどのように参照するのですか?com.test.foo.nanPairStoreRegistrationcom.test.foo.bar

4

2 に答える 2

0

Avro docs を掘り下げた後、最終的に解決策を含む例を見つけました。具体的には、この例です。

@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;
    }
}
于 2013-09-03T15:03:55.567 に答える