Return-Path: Delivered-To: apmail-avro-commits-archive@www.apache.org Received: (qmail 70637 invoked from network); 18 Jun 2010 19:19:33 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 18 Jun 2010 19:19:33 -0000 Received: (qmail 72864 invoked by uid 500); 18 Jun 2010 19:19:33 -0000 Delivered-To: apmail-avro-commits-archive@avro.apache.org Received: (qmail 72848 invoked by uid 500); 18 Jun 2010 19:19:32 -0000 Mailing-List: contact commits-help@avro.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@avro.apache.org Delivered-To: mailing list commits@avro.apache.org Received: (qmail 72840 invoked by uid 99); 18 Jun 2010 19:19:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Jun 2010 19:19:32 +0000 X-ASF-Spam-Status: No, hits=-1148.5 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Jun 2010 19:19:31 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 61C7523889DD; Fri, 18 Jun 2010 19:18:45 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r956103 - in /avro/trunk: ./ doc/src/content/xdocs/ lang/java/ lang/java/src/java/org/apache/avro/genavro/ lang/java/src/java/org/apache/avro/idl/ lang/java/src/java/org/apache/avro/tool/ lang/java/src/test/genavro/ lang/java/src/test/idl/ ... Date: Fri, 18 Jun 2010 19:18:45 -0000 To: commits@avro.apache.org From: cutting@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100618191845.61C7523889DD@eris.apache.org> Author: cutting Date: Fri Jun 18 19:18:44 2010 New Revision: 956103 URL: http://svn.apache.org/viewvc?rev=956103&view=rev Log: AVRO-372. Rename GenAvro to be Avro IDL. Added: avro/trunk/doc/src/content/xdocs/idl.xml - copied, changed from r955435, avro/trunk/doc/src/content/xdocs/genavro.xml avro/trunk/lang/java/src/java/org/apache/avro/idl/ - copied from r955435, avro/trunk/lang/java/src/java/org/apache/avro/genavro/ avro/trunk/lang/java/src/java/org/apache/avro/idl/idl.jj - copied, changed from r955435, avro/trunk/lang/java/src/java/org/apache/avro/genavro/genavro.jj avro/trunk/lang/java/src/java/org/apache/avro/tool/IdlTool.java - copied, changed from r955435, avro/trunk/lang/java/src/java/org/apache/avro/tool/GenAvroTool.java avro/trunk/lang/java/src/test/idl/ - copied from r955435, avro/trunk/lang/java/src/test/genavro/ avro/trunk/lang/java/src/test/idl/input/interop.avdl - copied unchanged from r955435, avro/trunk/lang/java/src/test/genavro/input/interop.genavro avro/trunk/lang/java/src/test/idl/input/mr_events.avdl - copied unchanged from r955435, avro/trunk/lang/java/src/test/genavro/input/mr_events.genavro avro/trunk/lang/java/src/test/idl/input/namespaces.avdl - copied unchanged from r955435, avro/trunk/lang/java/src/test/genavro/input/namespaces.genavro avro/trunk/lang/java/src/test/idl/input/reservedwords.avdl - copied unchanged from r955435, avro/trunk/lang/java/src/test/genavro/input/reservedwords.genavro avro/trunk/lang/java/src/test/idl/input/simple.avdl - copied unchanged from r955435, avro/trunk/lang/java/src/test/genavro/input/simple.genavro avro/trunk/lang/java/src/test/idl/input/unicode.avdl - copied unchanged from r955435, avro/trunk/lang/java/src/test/genavro/input/unicode.genavro avro/trunk/lang/java/src/test/java/org/apache/avro/idl/ - copied from r955435, avro/trunk/lang/java/src/test/java/org/apache/avro/genavro/ avro/trunk/lang/java/src/test/java/org/apache/avro/idl/TestIdl.java - copied, changed from r955435, avro/trunk/lang/java/src/test/java/org/apache/avro/genavro/TestGenAvro.java Removed: avro/trunk/doc/src/content/xdocs/genavro.xml avro/trunk/lang/java/src/java/org/apache/avro/genavro/ avro/trunk/lang/java/src/java/org/apache/avro/idl/genavro.jj avro/trunk/lang/java/src/java/org/apache/avro/tool/GenAvroTool.java avro/trunk/lang/java/src/test/genavro/ avro/trunk/lang/java/src/test/idl/input/interop.genavro avro/trunk/lang/java/src/test/idl/input/mr_events.genavro avro/trunk/lang/java/src/test/idl/input/namespaces.genavro avro/trunk/lang/java/src/test/idl/input/reservedwords.genavro avro/trunk/lang/java/src/test/idl/input/simple.genavro avro/trunk/lang/java/src/test/idl/input/unicode.genavro avro/trunk/lang/java/src/test/java/org/apache/avro/genavro/ avro/trunk/lang/java/src/test/java/org/apache/avro/idl/TestGenAvro.java Modified: avro/trunk/CHANGES.txt avro/trunk/doc/src/content/xdocs/site.xml avro/trunk/lang/java/build.xml avro/trunk/lang/java/src/java/org/apache/avro/tool/Main.java Modified: avro/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/avro/trunk/CHANGES.txt?rev=956103&r1=956102&r2=956103&view=diff ============================================================================== --- avro/trunk/CHANGES.txt (original) +++ avro/trunk/CHANGES.txt Fri Jun 18 19:18:44 2010 @@ -4,6 +4,9 @@ Avro 1.4.0 (unreleased) INCOMPATIBLE CHANGES + AVRO-372. Rename GenAvro to be Avro IDL. The tool name is now + 'idl'. The file suffix is now '.avdl'. (cutting) + NEW FEATURES AVRO-493. Add support for Hadoop Mapreduce with Avro data files. (cutting) Copied: avro/trunk/doc/src/content/xdocs/idl.xml (from r955435, avro/trunk/doc/src/content/xdocs/genavro.xml) URL: http://svn.apache.org/viewvc/avro/trunk/doc/src/content/xdocs/idl.xml?p2=avro/trunk/doc/src/content/xdocs/idl.xml&p1=avro/trunk/doc/src/content/xdocs/genavro.xml&r1=955435&r2=956103&rev=956103&view=diff ============================================================================== --- avro/trunk/doc/src/content/xdocs/genavro.xml (original) +++ avro/trunk/doc/src/content/xdocs/idl.xml Fri Jun 18 19:18:44 2010 @@ -22,14 +22,14 @@ ]>
- Avro &AvroVersion; GenAvro Language Docs + Avro IDL &AvroVersion;
Introduction -

This document defines GenAvro, an experimental higher-level language for authoring Avro schemata. +

This document defines Avro IDL, an experimental higher-level language for authoring Avro schemata. Before reading this document, you should have familiarity with the concepts of schemata and protocols, as well as the various primitive and complex types available in Avro.

@@ -44,40 +44,40 @@ Overview
Purpose -

The aim of the GenAvro language is to enable developers to author schemata in a way that +

The aim of the Avro IDL language is to enable developers to author schemata in a way that feels more similar to common programming languages like Java, C++, or Python. Additionally, - the GenAvro language may feel more familiar for those users who have previously used the + the Avro IDL language may feel more familiar for those users who have previously used the interface description languages (IDLs) in other frameworks like Thrift, Protocol Buffers, or CORBA.

Usage

- Each GenAvro file defines a single Avro Protocol, and thus generates as its output a JSON-format + Each Avro IDL file defines a single Avro Protocol, and thus generates as its output a JSON-format Avro Protocol file with extension .avpr.

- To convert a .genavro file into a .avpr file, it must be processed by the - avroj genavro tool. For example: + To convert a .avdl file into a .avpr file, it must be processed by the + idl tool. For example:

-$ java -jar avroj-1.3.0.jar genavro src/test/genavro/input/namespaces.genavro /tmp/namespaces.avpr +$ java -jar avroj-tools-1.4.0.jar idl src/test/idl/input/namespaces.avdl /tmp/namespaces.avpr $ head /tmp/namespaces.avpr { "protocol" : "TestNamespace", "namespace" : "avro.test.protocol",

- The avroj genavro tool can also process input to and from stdin and stdout. - See avroj genavro --help for full usage information. + The idl tool can also process input to and from stdin and stdout. + See idl --help for full usage information.

- Defining a Protocol in GenAvro + Defining a Protocol in Avro IDL -

A GenAvro file consists of exactly one protocol definition. The minimal protocol is defined +

An Avro IDL file consists of exactly one protocol definition. The minimal protocol is defined by the following code:

@@ -105,11 +105,11 @@ protocol MyProtocol { }

-3 This notation is used throughout GenAvro as a way of specifying properties for the annotated element, +3 This notation is used throughout Avro IDL as a way of specifying properties for the annotated element, as will be described later in this document.

- Protocols in GenAvro can contain the following items: + Protocols in Avro IDL can contain the following items:

  • Definitions of named schemata, including records, errors, enums, and fixeds.
  • @@ -119,7 +119,7 @@ protocol MyProtocol {
    Defining an Enumeration

    - Enums are defined in GenAvro using a syntax similar to C or Java: + Enums are defined in Avro IDL using a syntax similar to C or Java:

    enum Suit { @@ -144,7 +144,7 @@ fixed MD5(16);
    Defining Records and Errors

    - Records are defined in GenAvro using a syntax similar to a struct definition in C: + Records are defined in Avro IDL using a syntax similar to a struct definition in C:

    record Employee { @@ -169,7 +169,7 @@ error Kaboom {

    Each field in a record or error consists of a type and a name, along with optional property annotations.

    -

    A type reference in GenAvro must be one of:

    +

    A type reference in Avro IDL must be one of:

    • A primitive type
    • A named schema defined prior to this usage in the same Protocol
    • @@ -178,7 +178,7 @@ error Kaboom {
      Primitive Types -

      The primitive types supported by GenAvro are the same as those supported by Avro's JSON format. +

      The primitive types supported by Avro IDL are the same as those supported by Avro's JSON format. This list includes int, long, string, boolean, float, double, null, and bytes.

      @@ -186,7 +186,7 @@ error Kaboom {
      References to Named Schemata -

      If a named schema has already been defined in the same GenAvro file, it may be referenced by name +

      If a named schema has already been defined in the same Avro IDL file, it may be referenced by name as if it were a primitive type:

      @@ -227,7 +227,7 @@ record RecordWithUnion { }

      - Note that the same restrictions apply to GenAvro unions as apply to unions defined in the + Note that the same restrictions apply to Avro IDL unions as apply to unions defined in the JSON format; namely, a record may not contain multiple elements of the same type.

      @@ -235,7 +235,7 @@ record RecordWithUnion {
      Defining RPC Messages -

      The syntax to define an RPC message within a GenAvro protocol is similar to the syntax for +

      The syntax to define an RPC message within a Avro IDL protocol is similar to the syntax for a method declaration within a C header file or a Java interface. To define an RPC message add which takes two arguments named foo and bar, returning an int, simply include the following definition within the protocol: @@ -261,7 +261,7 @@ void goKaboom() throws Kaboom; Other Language Features

      Comments -

      All Java-style comments are supported within a GenAvro file. Any text following +

      All Java-style comments are supported within a Avro IDL file. Any text following // on a line is ignored, as is any text between /* and */, possibly spanning multiple lines.

      @@ -280,7 +280,7 @@ void `error`(); Annotations for Ordering and Namespaces

      Java-style annotations may be used to add additional properties to types throughout - GenAvro. For example, to specify the sort order of a field within a record, one may use + Avro IDL. For example, to specify the sort order of a field within a record, one may use the @order annotation as follows:

      @@ -316,10 +316,10 @@ protocol MyProto {
      Complete Example -

      The following is a complete example of a GenAvro file that shows most of the above features:

      +

      The following is a complete example of a Avro IDL file that shows most of the above features:

      /** - * An example protocol in GenAvro + * An example protocol in Avro IDL */ @namespace("org.apache.avro.test") protocol Simple { @@ -356,7 +356,7 @@ protocol Simple { void `error`() throws TestError; } -

      Additional examples may be found in the Avro source tree under the src/test/genavro/input directory.

      +

      Additional examples may be found in the Avro source tree under the src/test/idl/input directory.

      Modified: avro/trunk/doc/src/content/xdocs/site.xml URL: http://svn.apache.org/viewvc/avro/trunk/doc/src/content/xdocs/site.xml?rev=956103&r1=956102&r2=956103&view=diff ============================================================================== --- avro/trunk/doc/src/content/xdocs/site.xml (original) +++ avro/trunk/doc/src/content/xdocs/site.xml Fri Jun 18 19:18:44 2010 @@ -45,7 +45,7 @@ See http://forrest.apache.org/docs/linki - + Modified: avro/trunk/lang/java/build.xml URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/build.xml?rev=956103&r1=956102&r2=956103&view=diff ============================================================================== --- avro/trunk/lang/java/build.xml (original) +++ avro/trunk/lang/java/build.xml Fri Jun 18 19:18:44 2010 @@ -51,8 +51,8 @@ - - + + @@ -142,15 +142,15 @@ + srcfile="${java.src.dir}/org/apache/avro/idl/idl.jj" + targetfile="${build.dir}/src/org/apache/avro/idl"/> - + - @@ -350,8 +350,8 @@ - - + + Copied: avro/trunk/lang/java/src/java/org/apache/avro/idl/idl.jj (from r955435, avro/trunk/lang/java/src/java/org/apache/avro/genavro/genavro.jj) URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/java/org/apache/avro/idl/idl.jj?p2=avro/trunk/lang/java/src/java/org/apache/avro/idl/idl.jj&p1=avro/trunk/lang/java/src/java/org/apache/avro/genavro/genavro.jj&r1=955435&r2=956103&rev=956103&view=diff ============================================================================== --- avro/trunk/lang/java/src/java/org/apache/avro/genavro/genavro.jj (original) +++ avro/trunk/lang/java/src/java/org/apache/avro/idl/idl.jj Fri Jun 18 19:18:44 2010 @@ -56,9 +56,9 @@ options { JDK_VERSION = "1.6"; } -PARSER_BEGIN(GenAvro) +PARSER_BEGIN(Idl) -package org.apache.avro.genavro; +package org.apache.avro.idl; import java.io.*; import java.util.ArrayList; @@ -80,13 +80,13 @@ import org.apache.commons.lang.StringEsc * Note: each instance is not thread-safe, but multiple separate * instances are safely independent. */ -public class GenAvro +public class Idl { String namespace; Map names = new LinkedHashMap(); } -PARSER_END(GenAvro) +PARSER_END(Idl) /* WHITE SPACE */ @@ -894,11 +894,11 @@ TOKEN : /******************************************** - * THE GENAVRO LANGUAGE GRAMMAR STARTS HERE * + * THE AVRO IDL LANGUAGE GRAMMAR STARTS HERE * ********************************************/ /** - * The input to genavro is a CompilationUnit, which is currently + * The input to Idl is a CompilationUnit, which is currently * just a single Protocol. */ Protocol CompilationUnit(): Copied: avro/trunk/lang/java/src/java/org/apache/avro/tool/IdlTool.java (from r955435, avro/trunk/lang/java/src/java/org/apache/avro/tool/GenAvroTool.java) URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/java/org/apache/avro/tool/IdlTool.java?p2=avro/trunk/lang/java/src/java/org/apache/avro/tool/IdlTool.java&p1=avro/trunk/lang/java/src/java/org/apache/avro/tool/GenAvroTool.java&r1=955435&r2=956103&rev=956103&view=diff ============================================================================== --- avro/trunk/lang/java/src/java/org/apache/avro/tool/GenAvroTool.java (original) +++ avro/trunk/lang/java/src/java/org/apache/avro/tool/IdlTool.java Fri Jun 18 19:18:44 2010 @@ -19,7 +19,7 @@ package org.apache.avro.tool; import org.apache.avro.Protocol; -import org.apache.avro.genavro.GenAvro; +import org.apache.avro.idl.Idl; import java.io.FileInputStream; import java.io.FileOutputStream; @@ -29,9 +29,9 @@ import java.util.List; /** * Tool implementation for generating Avro JSON schemata from - * genavro format files. + * idl format files. */ -public class GenAvroTool implements Tool { +public class IdlTool implements Tool { @Override public int run(InputStream in, PrintStream out, PrintStream err, List args) throws Exception { @@ -42,7 +42,7 @@ public class GenAvroTool implements Tool if (args.size() > 2 || (args.size() == 1 && (args.get(0).equals("--help") || args.get(0).equals("-help")))) { - err.println("Usage: GenAvroTool [in] [out]"); + err.println("Usage: idl [in] [out]"); err.println(""); err.println("If an output path is not specified, outputs to stdout."); err.println("If no input or output is specified, takes input from"); @@ -60,7 +60,7 @@ public class GenAvroTool implements Tool } - GenAvro parser = new GenAvro(parseIn); + Idl parser = new Idl(parseIn); Protocol p = parser.CompilationUnit(); parseOut.print(p.toString(true)); return 0; @@ -68,11 +68,11 @@ public class GenAvroTool implements Tool @Override public String getName() { - return "genavro"; + return "idl"; } @Override public String getShortDescription() { - return "Generates a JSON schema from a GenAvro file"; + return "Generates a JSON schema from an Avro IDL file"; } } Modified: avro/trunk/lang/java/src/java/org/apache/avro/tool/Main.java URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/java/org/apache/avro/tool/Main.java?rev=956103&r1=956102&r2=956103&view=diff ============================================================================== --- avro/trunk/lang/java/src/java/org/apache/avro/tool/Main.java (original) +++ avro/trunk/lang/java/src/java/org/apache/avro/tool/Main.java Fri Jun 18 19:18:44 2010 @@ -46,7 +46,7 @@ public class Main { new DataFileReadTool(), new DataFileWriteTool(), new DataFileGetSchemaTool(), - new GenAvroTool(), + new IdlTool(), new RpcReceiveTool(), new RpcSendTool(), new FromTextTool(), Copied: avro/trunk/lang/java/src/test/java/org/apache/avro/idl/TestIdl.java (from r955435, avro/trunk/lang/java/src/test/java/org/apache/avro/genavro/TestGenAvro.java) URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/test/java/org/apache/avro/idl/TestIdl.java?p2=avro/trunk/lang/java/src/test/java/org/apache/avro/idl/TestIdl.java&p1=avro/trunk/lang/java/src/test/java/org/apache/avro/genavro/TestGenAvro.java&r1=955435&r2=956103&rev=956103&view=diff ============================================================================== --- avro/trunk/lang/java/src/test/java/org/apache/avro/genavro/TestGenAvro.java (original) +++ avro/trunk/lang/java/src/test/java/org/apache/avro/idl/TestIdl.java Fri Jun 18 19:18:44 2010 @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.avro.genavro; +package org.apache.avro.idl; import org.junit.Before; import org.junit.Test; @@ -34,20 +34,20 @@ import java.io.InputStreamReader; import org.apache.avro.Protocol; /** - * Simple test harness for GenAvro. + * Simple test harness for Idl. * This relies on an input/ and output/ directory. Inside - * the input/ directory are .genavro files. Each file should have + * the input/ directory are .avdl files. Each file should have * a corresponding .avpr file in output/. When the test is run, - * it generates and stringifies each .genavro file and compares + * it generates and stringifies each .avdl file and compares * it to the expected output, failing if the two differ. * * To make it simpler to write these tests, you can run - * ant -Dtestcase=TestGenAvro -Dtest.genavro.mode=write + * ant -Dtestcase=TestIdl -Dtest.idl.mode=write * which will *replace* all expected output. */ -public class TestGenAvro { +public class TestIdl { private static final File TEST_DIR = - new File(System.getProperty("test.genavro.dir")); + new File(System.getProperty("test.idl.dir")); private static final File TEST_INPUT_DIR = new File(TEST_DIR, "input"); @@ -56,7 +56,7 @@ public class TestGenAvro { new File(TEST_DIR, "output"); private static final String TEST_MODE = - System.getProperty("test.genavro.mode", "run"); + System.getProperty("test.idl.mode", "run"); private List tests; @@ -68,12 +68,12 @@ public class TestGenAvro { tests = new ArrayList(); for (File inF : TEST_INPUT_DIR.listFiles()) { - if (!inF.getName().endsWith(".genavro")) continue; + if (!inF.getName().endsWith(".avdl")) continue; if (inF.getName().startsWith(".")) continue; File outF = new File( TEST_OUTPUT_DIR, - inF.getName().replaceFirst("\\.genavro$", ".avpr")); + inF.getName().replaceFirst("\\.avdl$", ".avpr")); tests.add(new GenTest(inF, outF)); } } @@ -121,7 +121,7 @@ public class TestGenAvro { } private String generate() throws Exception { - GenAvro parser = new GenAvro(new FileInputStream(in), "UTF-8"); + Idl parser = new Idl(new FileInputStream(in), "UTF-8"); Protocol p = parser.CompilationUnit(); return p.toString(true); }