[
https://issues.apache.org/jira/browse/AVRO-659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12907310#action_12907310
]
Doug Cutting commented on AVRO-659:
-----------------------------------
Jeff, that sounds like a language-specific issue. In Java, one generally uses,
as Philip indicated, the CLASSPATH via ClassLoader#getResource(). If folks
find that idiom too complex, then we could add it as a method in Schema.java,
e.g.:
public static Schema getResource(String resource) throws IOException;
Applications simply bundle their .avsc files into their jars with their .class
files, then use the above method to load them.
Should we add this method and similar methods to each language? That seems a
fine goal. Probably we should have a separate Jira issue for each language
though.
> Portable specification of the location of schema and protocol files
> -------------------------------------------------------------------
>
> Key: AVRO-659
> URL: https://issues.apache.org/jira/browse/AVRO-659
> Project: Avro
> Issue Type: New Feature
> Reporter: Jeff Hammerbacher
>
> Avro doesn't require code generation, which is great. However, if you want to
> use a protocol or a schema, your code needs to know where to find it. When
> your code is ported to new systems, the protocol or schema file must be
> placed in the same place as on the previous system for things to work
> correctly.
> For importing modules in a portable fashion, Python provides a default set of
> places it will look for modules and an environment variable called PYTHONPATH
> that programs can use to override these defaults. It may be useful to explore
> similar constructs for Avro implementations that don't do code generation.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.