Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Avro, mail # user - How should I migrate 1.4 code to avro 1.5?


Copy link to this message
-
Re: How should I migrate 1.4 code to avro 1.5?
Scott Carey 2011-09-03, 00:00
The javadoc for the deprecated method directs users to the replacement.

BinaryEncoder and BinaryDecoder are well documented, with docs available via
maven for IDE's to consume easily, or via the Apache Avro website:
http://avro.apache.org/docs/1.5.3/api/java/org/apache/avro/io/BinaryEncoder.
html
http://avro.apache.org/docs/1.5.3/api/java/org/apache/avro/io/DecoderFactory
.html

defaultFactory
<http://avro.apache.org/docs/1.5.3/api/java/org/apache/avro/io/DecoderFactor
y.html#defaultFactory%28%29> ()
" Deprecated. use the equivalent get()
<http://avro.apache.org/docs/1.5.3/api/java/org/apache/avro/io/DecoderFactor
y.html#get%28%29>  instead"

Generally, when using Avro you will have an easier time if you have the docs
available in your IDE or at least available for reference in a browser.
There are not a lot of blog posts and examples out there, but the javadoc is
mostly decent and we try hard to make sure all public and protected methods
and constructors have documentation.  Many classes and packages have solid
documentation as well.  Please report any documentation bugs or suggestions
for improvement.

Thanks!

-Scott

On 9/2/11 2:41 PM, "W.P. McNeill" <[EMAIL PROTECTED]> wrote:

> I'm new to Avro. Since I'm having trouble finding simple examples online I'm
> writing one of my own that I'm putting on github.
>
> https://github.com/wpm/AvroExample
>
> Hopefully, this will be of help to people like me who are also having trouble
> finding simple code examples.
>
> I want to get this compiling without of hitch in Maven. I had it running with
> a 1.4 version of Avro, but when I changed that to 1.5, some of the code no
> longer works. Specifically, BinaryEncoder can no longer be instantiated
> directly because it is now an abstract class (AvroExample.java: line 33) and
> DecoderFactory.defaultFactory is deprecated (AvroExample.java: line 41).
>
> How should I modify this code so that it works with the latest and greatest
> version of Avro?  I looked through the Release Notes, but the answers weren't
> obvious.
>
> Thanks.
>