Return-Path: X-Original-To: apmail-avro-user-archive@www.apache.org Delivered-To: apmail-avro-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5E02B7BF8 for ; Wed, 12 Oct 2011 22:15:28 +0000 (UTC) Received: (qmail 94922 invoked by uid 500); 12 Oct 2011 22:15:28 -0000 Delivered-To: apmail-avro-user-archive@avro.apache.org Received: (qmail 94885 invoked by uid 500); 12 Oct 2011 22:15:27 -0000 Mailing-List: contact user-help@avro.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@avro.apache.org Delivered-To: mailing list user@avro.apache.org Received: (qmail 94877 invoked by uid 99); 12 Oct 2011 22:15:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Oct 2011 22:15:27 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of matt.r.stevenson@gmail.com designates 209.85.214.43 as permitted sender) Received: from [209.85.214.43] (HELO mail-bw0-f43.google.com) (209.85.214.43) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Oct 2011 22:15:21 +0000 Received: by bkas6 with SMTP id s6so719882bka.30 for ; Wed, 12 Oct 2011 15:15:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=l7DvE/Cq4GvWkO86eKza/Ku3SD+MxgBiRcQfWAiqr10=; b=rxPvMEj9Nkd0izFUWEfD1tiXP0XmPxut4G0uk6afH+7+RvBP3Qdw7r4voB0N8uOrl2 CXmr/X21Qy6ZF+UhI4fglBD/a9LBtQOTo3XiWFkHpjpKTFzYh7l4bvtJT5Q8iz+q7anY MLaN0bEU7at64xXUQrbVvXEi6jveQHkUaNwF0= Received: by 10.204.135.197 with SMTP id o5mr602862bkt.37.1318457700141; Wed, 12 Oct 2011 15:15:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.63.140 with HTTP; Wed, 12 Oct 2011 15:14:20 -0700 (PDT) In-Reply-To: References: From: Matt Stevenson Date: Wed, 12 Oct 2011 17:14:20 -0500 Message-ID: Subject: Re: C++/Java schema compatibility To: user@avro.apache.org Content-Type: multipart/alternative; boundary=000e0cd1b38cde4c2b04af215a1d --000e0cd1b38cde4c2b04af215a1d Content-Type: text/plain; charset=ISO-8859-1 Yes, Java has full support and C++ does not. I do not know of a way to use an .avpr in C++.If it doesn't already exist, you could make a script to pull out records and namespaces from an .avpr and then generate. imho, adding full protocol/RPC support from a schema is a bigger priority than code gen. On Wed, Oct 12, 2011 at 4:48 PM, Shaun Williams wrote: > So is there richer schema support for java than c++? I am trying to use > avro RPC as the protocol between a java client and a c++ server. I was > hoping that I could define the schemas once and generate code for both > platforms. Is that not possible at the moment? > > Thanks! > > Shaun > > > On Wed, Oct 12, 2011 at 2:30 PM, Matt Stevenson < > matt.r.stevenson@gmail.com> wrote: > >> Sorry, I wasn't paying attention and thought the Java class was json. >> >> Save this as a .json: >> >>> { >>> "name": "Message", "type": "record", >>> "fields": [ >>> {"name": "to", "type": "string"}, >>> {"name": "from", "type": "string"}, >>> {"name": "body", "type": "string"} >>> ] >>> } >>> >> >> >> On Wed, Oct 12, 2011 at 4:27 PM, Matt Stevenson < >> matt.r.stevenson@gmail.com> wrote: >> >>> The avrogencpp tool will only parse individual records. >>> If you save >>> >>> record Message { >>> string to; >>> string from; >>> string body; >>> } >>> >>> as a .json file, it will generate the class. >>> I think only records are supported in C++ and not full protocols. >>> >>> >>> On Wed, Oct 12, 2011 at 1:37 PM, Shaun Williams wrote: >>> >>>> I'm trying to compile the Mail.avpr schema from the avro-rpc-quickstart >>>> example using the c++ tools, and precompile fails with the following error: >>>> "Failed to parse or compile schema: Schema is invalid, due to bad node >>>> of type symbolic." >>>> >>>> I even tried generating the avpr from an avdl, but precompile still >>>> fails with the same error. Any idea what the problem might be? >>>> >>>> Here's my avdl FYI: >>>> >>>> @namespace("example.proto") >>>> protocol Mail{ >>>> record Message { >>>> string to; >>>> string from; >>>> string body; >>>> } >>>> >>>> string send(Message message); >>>> } >>>> >>>> Thanks! >>>> >>> >>> >>> >>> -- >>> Matt Stevenson. >>> >> >> >> >> -- >> Matt Stevenson. >> > > -- Matt Stevenson. --000e0cd1b38cde4c2b04af215a1d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Yes, Java has full support and C++ does not.

I do not know of a way = to use an .avpr in C++.If it doesn't already exist, you could make a sc= ript to pull out records and namespaces from an .avpr and then generate.
imho, adding full protocol/RPC support from a schema is a bigger priori= ty than code gen.

On Wed, Oct 12, 2011 at= 4:48 PM, Shaun Williams <shaunwilli42@gmail.com> wrote:
So is there richer schema support for java = than c++? =A0I am trying to use avro RPC as the protocol between a java cli= ent and a c++ server. =A0I was hoping that I could define the schemas once = and generate code for both platforms. =A0Is that not possible at the moment= ?

Thanks!

Sha= un=A0


On Wed, Oct 12, 2011 at 2:30 PM, Matt Stevenson <= ;matt.r.ste= venson@gmail.com> wrote:
Sorry, I wasn't paying attention and tho= ught the Java class was json.

Save this as a .json:
{
=A0=A0=A0 "name": "Message", "type": &qu= ot;record",
=A0=A0=A0 "fields": [
=A0=A0=A0=A0=A0=A0= =A0 {"name": "to", "type": "string"= },
=A0=A0=A0=A0=A0=A0=A0 {"name": "from", "type= ": "string"},
=A0=A0=A0=A0=A0=A0=A0 {"name": "body", "type"= : "string"}
=A0=A0=A0 ]
}


On Wed, Oct 12, 2011 at 4:27 PM, Matt Stevenson <matt.r.stevenson@gmail.com> wrote:
The avrogencpp tool will only parse individu= al records.
If you save

record Message {
string to;
string from;
<= span style=3D"white-space:pre-wrap"> string body;
<= span style=3D"white-space:pre-wrap"> }

as a .json file, it wi= ll generate the class.
I think only records are supported in C++ and not full protocols.
=


On Wed, Oct 12, 201= 1 at 1:37 PM, Shaun Williams <shaunwilli42@gmail.com> w= rote:
I'm trying to compile the Mail.avpr sche= ma from the avro-rpc-quickstart example using the c++ tools, and precompile= fails with the following error:
"Failed to parse or compile schema: Schema is invalid, due to bad node= of type symbolic."

I even tried generating the avpr from an avdl, but prec= ompile still fails with the same error. =A0Any idea what the problem might = be?

Here's my avdl FYI:

@namespace("example.proto")
protocol Mail{
record Message {
=
string to;
string from;
<= span style=3D"white-space:pre-wrap"> string body;
}

string sen= d(Message message);
}

Thanks!



--
Matt Stevenson.


--
Matt Stevenson.




--
Matt Stevenson.
--000e0cd1b38cde4c2b04af215a1d--