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 9FB0317F9D for ; Sun, 31 Jan 2016 00:13:57 +0000 (UTC) Received: (qmail 98672 invoked by uid 500); 31 Jan 2016 00:13:57 -0000 Delivered-To: apmail-avro-user-archive@avro.apache.org Received: (qmail 98596 invoked by uid 500); 31 Jan 2016 00:13:57 -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 98586 invoked by uid 99); 31 Jan 2016 00:13:57 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 31 Jan 2016 00:13:57 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id D6086C0D8C for ; Sun, 31 Jan 2016 00:13:56 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.88 X-Spam-Level: ** X-Spam-Status: No, score=2.88 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id wxIwb_3XRYmo for ; Sun, 31 Jan 2016 00:13:50 +0000 (UTC) Received: from mail-lf0-f42.google.com (mail-lf0-f42.google.com [209.85.215.42]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id EBAD242A26 for ; Sun, 31 Jan 2016 00:13:49 +0000 (UTC) Received: by mail-lf0-f42.google.com with SMTP id j78so7217783lfb.1 for ; Sat, 30 Jan 2016 16:13:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-type; bh=6jrj3xLIboVHraat2guYtoefwWaH8rtg9BtiZRy/7jk=; b=Jlh557Mk12tNeF1Sc+fAzbSpjwv9FVhAZOPPD8/ZazRyUVX8mmmbuvUcHNXnmNUdF2 fjwnE+P0k6ZTSTUREQZ1asbSatIgcdsDr20OQp/P4eTM0N3kGOs7Dlyncu8rMEfE1RXq 9Ye2NWnCtC5oCjEGLcj4k51L0t1U4w1pJ0pdDucRTRXL6wn6ddNl24uWkxd4VFZhejs7 l1BcWgbpnSuU+XpJLuVsGQar0WEkVyx70f9GHzAdf51eoIklOFAUpBmBE/jxMlopvnOy WjJBPQLsoepx+KpRATdzy2K4uvfK8Ks7gKINAUkD3ElhyYOxOH+xE5MJx9ZXcSIwRU5+ W/4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-type; bh=6jrj3xLIboVHraat2guYtoefwWaH8rtg9BtiZRy/7jk=; b=RkS7NFeWWPSl/M4y7+L6qHvkPq8VpiCjbNgNW+w3IkKO51UZbJdApJ0dfsdSDYvuh6 ttSEA8X0NwydLgSDPXXQ4YnHDi7Smd5EcceWtEskJ8xoO0NOOXo+PCfEHybSl79ACFqf AcgEUduMnA+qORYthT3s+1fCHnnlmQTTaTqfPY6oaFd1fM1Zq4nVjH/7cEs3POql4ZOS /tdQiaDXwEmsx9ryx/DgAUHWnAB2rn/+jrlrSJRdLx/Pc327UNRQ4T2yqPj7zxTwT/ba QI69nEfE3Z8cPCOh4ph4tGE8sfkyXqH5oO7UW3Sk6k91s/KbFsDgajpEd0Dq8n+HT7sF XFKA== X-Gm-Message-State: AG10YOTREShfbSkZj2ILdIU3TbALXbDl3+a6eRC7E4dvf33WN6UUNHZDjwhiHVUKjSZcqzIFyPPde19gg8M7tA== X-Received: by 10.25.5.6 with SMTP id 6mr3914608lff.3.1454199228622; Sat, 30 Jan 2016 16:13:48 -0800 (PST) MIME-Version: 1.0 References: <9D090DE1-137E-43C6-81E3-D733C5D1FD46@rat.io> In-Reply-To: <9D090DE1-137E-43C6-81E3-D733C5D1FD46@rat.io> From: Evan McClain Date: Sun, 31 Jan 2016 00:13:37 +0000 Message-ID: Subject: Re: Autogenerating Java classes from IDL To: user@avro.apache.org Content-Type: multipart/alternative; boundary=001a113eb888746e8b052a96241a --001a113eb888746e8b052a96241a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I have used IDLs with the avro-maven-plugin and that worked for me. Evan On Sat, Jan 30, 2016, 8:52 AM tl wrote: > Hi, > > I started working with Avro only recently so maybe I missed something but > it seems to me that schemas can be defined in JSON as well as in IDL but > only from JSON schemas can builder classes be autogenerated. This is a pi= ty > since IDLs are much easier to write and read than the JSON representation= . > I wrote a few IDL schemas, converted them to avpr and tweaked those avpr > files to become valid avsc schema files from which I autogenerated the > classes. This is a rather convoluted process. I wouldn=E2=80=99t mind so = much if I > wouldn=E2=80=99t know that I or somebody else will have to update the sch= emas and > classes from time to time. This doesn=E2=80=99t look like a robust workfl= ow. > > Deleting the IDLs and avpr files and doing updates only in the avsc > schemas reduces the workflow to 2 steps but I loose the nice properties o= f > IDLs [0]. > Using only generic mapping would reduce the workflow by one step too but > I=E2=80=99d loose static type checking. > > I=E2=80=99d love to be able to autogenerate the Java classes from the IDL= s > directly. Is there a way? > > Regards, > Thomas > > > [0] Regarding IDLs it would be cool if I could forward reference objects > in the schema or even write nested schemas but that=E2=80=99s a relativel= y minor > gripe. > > > --001a113eb888746e8b052a96241a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I have used IDLs with the avro-maven-plugin and that worke= d for me.

Evan


On Sat, Jan 30, 2016= , 8:52 AM=C2=A0tl <tl@rat.io> wrote:=
Hi,

I started working with Avro only recently so maybe I missed something but i= t seems to me that schemas can be defined in JSON as well as in IDL but onl= y from JSON schemas can builder classes be autogenerated. This is a pity si= nce IDLs are much easier to write and read than the JSON representation. I wrote a few IDL schemas, converted them to avpr and tweaked those avpr fi= les to become valid avsc schema files from which I autogenerated the classe= s. This is a rather convoluted process. I wouldn=E2=80=99t mind so much if = I wouldn=E2=80=99t know that I or somebody else will have to update the sch= emas and classes from time to time. This doesn=E2=80=99t look like a robust= workflow.

Deleting the IDLs and avpr files and doing updates only in the avsc schemas= reduces the workflow to 2 steps but I loose the nice properties of IDLs [0= ].
Using only generic mapping would reduce the workflow by one step too but I= =E2=80=99d loose static type checking.

I=E2=80=99d love to be able to autogenerate the Java classes from the IDLs = directly. Is there a way?

Regards,
Thomas


[0] Regarding IDLs it would be cool if I could forward reference objects in= the schema or even write nested schemas but that=E2=80=99s a relatively mi= nor gripe.


--001a113eb888746e8b052a96241a--