From 1711d81d9a4242a0020fdf0cb85b1700727beda7 Mon Sep 17 00:00:00 2001 From: Matt Massie Date: Fri, 5 Dec 2014 13:36:11 -0800 Subject: [PATCH] Move models and RPC methods out of root package This updates the namespace to place the models into the org.ga4gh.models package and RPC methods into the org.ga4gh.rpc package. Previously, all objects were on the root package org.ga4gh. --- .gitignore | 3 +++ GeneratingDocumentation.md | 6 +++--- src/main/resources/avro/beacon.avdl | 4 ++-- src/main/resources/avro/common.avdl | 13 +------------ src/main/resources/avro/methods.avdl | 18 ++++++++++++++++++ src/main/resources/avro/readmethods.avdl | 15 ++++++++------- src/main/resources/avro/reads.avdl | 2 +- src/main/resources/avro/referencemethods.avdl | 11 ++++++----- src/main/resources/avro/references.avdl | 2 +- src/main/resources/avro/variantmethods.avdl | 13 +++++++------ src/main/resources/avro/variants.avdl | 2 +- src/main/resources/avro/wip/metadata.avdl | 2 +- .../resources/avro/wip/metadatamethods.avdl | 13 +++++++------ 13 files changed, 59 insertions(+), 45 deletions(-) create mode 100644 src/main/resources/avro/methods.avdl diff --git a/.gitignore b/.gitignore index 48fc6ace..ac70ab6a 100644 --- a/.gitignore +++ b/.gitignore @@ -66,3 +66,6 @@ target/ #********** Travis CI ********** !.travis.yml + +#********** IntelliJ files ****** +*.iml diff --git a/GeneratingDocumentation.md b/GeneratingDocumentation.md index 807094b2..0e6b8bdb 100644 --- a/GeneratingDocumentation.md +++ b/GeneratingDocumentation.md @@ -10,12 +10,12 @@ Assuming that you have [Node.js](http://nodejs.org/) and [NPM](https://www.npmjs npm install avrodoc --global ``` -The `avrodoc` tool expects Avro schemas in JSON format. The Maven plugin we use for generation of artifacts and tests does not produce the JSON formatted Avro schema. You will need to download the [Avro tools JAR file](http://www.us.apache.org/dist/avro/avro-1.7.6/java/avro-tools-1.7.6.jar) +The `avrodoc` tool expects Avro schemas in JSON format. The Maven plugin we use for generation of artifacts and tests does not produce the JSON formatted Avro schema. You will need to download the [Avro tools JAR file](http://www.us.apache.org/dist/avro/avro-1.7.7/java/avro-tools-1.7.7.jar) ```shell # For a full list of mirrors, see http://www.apache.org/dyn/closer.cgi/avro/ -curl -o /opt/avro-tools.jar http://www.us.apache.org/dist/avro/avro-1.7.6/java/avro-tools-1.7.6.jar +curl -o /opt/avro-tools.jar http://www.us.apache.org/dist/avro/avro-1.7.7/java/avro-tools-1.7.7.jar ``` @@ -39,7 +39,7 @@ avrodoc input.avpr > output.html npm install avrodoc --global # download the Avro tools -curl -o /opt/avro-tools.jar http://www.us.apache.org/dist/avro/avro-1.7.6/java/avro-tools-1.7.6.jar +curl -o /opt/avro-tools.jar http://www.us.apache.org/dist/avro/avro-1.7.7/java/avro-tools-1.7.7.jar # assumes that $CWD is the ga4gh/schemas project dir diff --git a/src/main/resources/avro/beacon.avdl b/src/main/resources/avro/beacon.avdl index 6e573f9f..c61e1bc9 100644 --- a/src/main/resources/avro/beacon.avdl +++ b/src/main/resources/avro/beacon.avdl @@ -1,4 +1,4 @@ -@namespace("org.ga4gh") +@namespace("org.ga4gh.beacon") protocol BEACON { @@ -27,4 +27,4 @@ record BEACONResponse { union{ null, long } frequency = null; } -} \ No newline at end of file +} diff --git a/src/main/resources/avro/common.avdl b/src/main/resources/avro/common.avdl index b4f4cdb6..bc5e1a19 100644 --- a/src/main/resources/avro/common.avdl +++ b/src/main/resources/avro/common.avdl @@ -1,21 +1,10 @@ -@namespace("org.ga4gh") +@namespace("org.ga4gh.models") /** This protocol defines common types used in the other GA4GH protocols. It does not have any methods; it is merely a library of types. */ protocol Common { -/** -A general exception type. -*/ -error GAException { - /** The error message */ - string message; - - /** The numerical error code */ - int errorCode = -1; -} - /** An abstraction for referring to a genomic position, in relation to some already known reference. For now, represents a genomic position as a reference diff --git a/src/main/resources/avro/methods.avdl b/src/main/resources/avro/methods.avdl new file mode 100644 index 00000000..e4cecdf0 --- /dev/null +++ b/src/main/resources/avro/methods.avdl @@ -0,0 +1,18 @@ +@namespace("org.ga4gh.methods") + +protocol RPC { + +/** +A general exception type. +*/ +error GAException { + /** The error message */ + string message; + + /** The numerical error code */ + int errorCode = -1; +} + + + +} diff --git a/src/main/resources/avro/readmethods.avdl b/src/main/resources/avro/readmethods.avdl index 44549791..ab69c207 100644 --- a/src/main/resources/avro/readmethods.avdl +++ b/src/main/resources/avro/readmethods.avdl @@ -1,7 +1,8 @@ -@namespace("org.ga4gh") +@namespace("org.ga4gh.methods") protocol ReadMethods { import idl "common.avdl"; +import idl "methods.avdl"; import idl "reads.avdl"; /****************** /reads/search *********************/ @@ -66,7 +67,7 @@ record SearchReadsResponse { The list of matching alignment records, sorted by position. Unmapped reads, which have no position, are returned last. */ - array alignments = []; + array alignments = []; /** The continuation token, which is used to page through large result sets. @@ -115,7 +116,7 @@ record SearchReadGroupSetsRequest { /** This is the response from `POST /readgroupsets/search` expressed as JSON. */ record SearchReadGroupSetsResponse { /** The list of matching read group sets. */ - array readGroupSets = []; + array readGroupSets = []; /** The continuation token, which is used to page through large result sets. @@ -140,10 +141,10 @@ SearchReadGroupSetsResponse searchReadGroupSets( /**************** /readgroupsets/{id} *******************/ /** -Gets a `ReadGroupSet` by ID. +Gets a `org.ga4gh.models.ReadGroupSet` by ID. `GET /readgroupsets/{id}` will return a JSON version of `ReadGroupSet`. */ -ReadGroupSet getReadGroupSet( +org.ga4gh.models.ReadGroupSet getReadGroupSet( /** The ID of the `ReadGroupSet`. */ @@ -154,10 +155,10 @@ ReadGroupSet getReadGroupSet( Gets a `Dataset` by ID. `GET /datasets/{id}` will return a JSON version of `Dataset`. */ -Dataset getDataset( +org.ga4gh.models.Dataset getDataset( /** The ID of the `Dataset`. */ string id) throws GAException; -} \ No newline at end of file +} diff --git a/src/main/resources/avro/reads.avdl b/src/main/resources/avro/reads.avdl index 35fe098c..a2c85fe3 100644 --- a/src/main/resources/avro/reads.avdl +++ b/src/main/resources/avro/reads.avdl @@ -1,4 +1,4 @@ -@namespace("org.ga4gh") +@namespace("org.ga4gh.models") /** This file defines the objects used to represent a hierarchy of reads and alignments: diff --git a/src/main/resources/avro/referencemethods.avdl b/src/main/resources/avro/referencemethods.avdl index 766ae195..6e9d7b64 100644 --- a/src/main/resources/avro/referencemethods.avdl +++ b/src/main/resources/avro/referencemethods.avdl @@ -1,7 +1,8 @@ -@namespace("org.ga4gh") +@namespace("org.ga4gh.methods") protocol ReferenceMethods { import idl "common.avdl"; +import idl "methods.avdl"; import idl "references.avdl"; /**************** /referencesets/search *******************/ @@ -51,7 +52,7 @@ expressed as JSON. */ record SearchReferenceSetsResponse { /** The list of matching reference sets. */ - array referenceSets = []; + array referenceSets = []; /** The continuation token, which is used to page through large result sets. @@ -80,7 +81,7 @@ SearchReferenceSetsResponse searchReferenceSets( Gets a `ReferenceSet` by ID. `GET /referencesets/{id}` will return a JSON version of `ReferenceSet`. */ -ReferenceSet getReferenceSet( +org.ga4gh.models.ReferenceSet getReferenceSet( /** The ID of the `ReferenceSet`. */ @@ -131,7 +132,7 @@ This is the response from `POST /references/search` expressed as JSON. */ record SearchReferencesResponse { /** The list of matching references. */ - array references = []; + array references = []; /** The continuation token, which is used to page through large result sets. @@ -160,7 +161,7 @@ SearchReferencesResponse searchReferences( Gets a `Reference` by ID. `GET /references/{id}` will return a JSON version of `Reference`. */ -Reference getReference( +org.ga4gh.models.Reference getReference( /** The ID of the `Reference`. */ diff --git a/src/main/resources/avro/references.avdl b/src/main/resources/avro/references.avdl index d45e68e0..c8535def 100644 --- a/src/main/resources/avro/references.avdl +++ b/src/main/resources/avro/references.avdl @@ -1,4 +1,4 @@ -@namespace("org.ga4gh") +@namespace("org.ga4gh.models") protocol References { diff --git a/src/main/resources/avro/variantmethods.avdl b/src/main/resources/avro/variantmethods.avdl index 7d84185b..cdc77993 100644 --- a/src/main/resources/avro/variantmethods.avdl +++ b/src/main/resources/avro/variantmethods.avdl @@ -1,6 +1,7 @@ -@namespace("org.ga4gh") +@namespace("org.ga4gh.methods") protocol VariantMethods { +import idl "methods.avdl"; import idl "variants.avdl"; /****************** /variantsets/search *********************/ @@ -29,7 +30,7 @@ record SearchVariantSetsRequest { /** This is the response from `POST /variantsets/search` expressed as JSON. */ record SearchVariantSetsResponse { /** The list of matching variant sets. */ - array variantSets = []; + array variantSets = []; /** The continuation token, which is used to page through large result sets. @@ -108,7 +109,7 @@ record SearchVariantsResponse { of the calls on each `Variant`. The number of results will also be the same. */ - array variants = []; + array variants = []; /** The continuation token, which is used to page through large result sets. @@ -160,7 +161,7 @@ record SearchCallSetsRequest { /** This is the response from `POST /callsets/search` expressed as JSON. */ record SearchCallSetsResponse { /** The list of matching call sets. */ - array callSets = []; + array callSets = []; /** The continuation token, which is used to page through large result sets. @@ -185,10 +186,10 @@ SearchCallSetsResponse searchCallSets( Gets a `CallSet` by ID. `GET /callsets/{id}` will return a JSON version of `CallSet`. */ -CallSet getCallSet( +org.ga4gh.models.CallSet getCallSet( /** The ID of the `CallSet`. */ string id) throws GAException; -} \ No newline at end of file +} diff --git a/src/main/resources/avro/variants.avdl b/src/main/resources/avro/variants.avdl index aad3dba5..f6452f45 100644 --- a/src/main/resources/avro/variants.avdl +++ b/src/main/resources/avro/variants.avdl @@ -1,4 +1,4 @@ -@namespace("org.ga4gh") +@namespace("org.ga4gh.models") protocol Variants { import idl "common.avdl"; diff --git a/src/main/resources/avro/wip/metadata.avdl b/src/main/resources/avro/wip/metadata.avdl index 68fbd385..af4c45bd 100644 --- a/src/main/resources/avro/wip/metadata.avdl +++ b/src/main/resources/avro/wip/metadata.avdl @@ -1,4 +1,4 @@ -@namespace("org.ga4gh") +@namespace("org.ga4gh.models") /** This protocol defines metadata used in the other GA4GH protocols. diff --git a/src/main/resources/avro/wip/metadatamethods.avdl b/src/main/resources/avro/wip/metadatamethods.avdl index ac5b52dd..72408569 100644 --- a/src/main/resources/avro/wip/metadatamethods.avdl +++ b/src/main/resources/avro/wip/metadatamethods.avdl @@ -1,6 +1,7 @@ -@namespace("org.ga4gh") +@namespace("org.ga4gh.methods") protocol MetadataMethods { +import idl "methods.avdl"; import idl "metadata.avdl"; /****************** /individuals/search *********************/ @@ -39,7 +40,7 @@ record SearchIndividualsResponse { /** The list of matching individuals. */ - array individuals = []; + array individuals = []; /** The continuation token, which is used to page through large result sets. @@ -94,7 +95,7 @@ record SearchSamplesResponse { /** The list of matching samples. */ - array samples = []; + array samples = []; /** The continuation token, which is used to page through large result sets. @@ -146,7 +147,7 @@ record SearchExperimentsResponse { /** The list of matching experiments. */ - array experiments = []; + array experiments = []; /** The continuation token, which is used to page through large result sets. @@ -200,7 +201,7 @@ record SearchIndividualGroupsResponse { /** The list of matching individual groups. */ - array individualGroups = []; + array individualGroups = []; /** The continuation token, which is used to page through large result sets. @@ -254,7 +255,7 @@ record SearchAnalysesResponse { /** The list of matching analyses. */ - array analyses = []; + array analyses = []; /** The continuation token, which is used to page through large result sets.