Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Avro >> mail # user >> Avro IDL: Sharing complex types in multiple protocols

Copy link to this message
Re: Avro IDL: Sharing complex types in multiple protocols
Hey Sharad,

I brought up adding protocol inheritance (what we do to solve this problem
in Thrift) to Avro IDL, but Philip felt it was not a good idea:

A workaround would be to write protocol definition fragments and use a
script of some sort to construct the final protocol file (e.g. manage the
inheritance hierarchy manually). I've seen people do this with Pig scripts
for similar reasons. It's ugly but it works.


On Thu, Jul 22, 2010 at 11:40 AM, Sharad Agarwal <[EMAIL PROTECTED]>wrote:

> I don't find a way to to share complex type in more than one protocol. I
> want to do something like:
> @namespace ("x.y")
> protocol Protocol1 {
>  record MyRecord {
>   string name;
>  }
>  void message1(MyRecord r);
> }
> @namespace ("x.y.z")
> protocol Protocol2 {
>  void message2(x.y.MyRecord r);
> }
> Is there a workaround for this ?
> Sharad