avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Carey <scottca...@apache.org>
Subject Re: Upgrade usage of DecoderFactory with upgrade from Avro 1.3.3 --> 1.6.2
Date Sat, 25 Feb 2012 02:40:02 GMT
In addition to what you have already noticed, the javadoc for these
changes has a lot of other related information:


On 2/24/12 3:38 PM, "Lewis John Mcgibbney" <lewis.mcgibbney@gmail.com>

>Hi List,
>I've embarked upon upgrading the Avro (and subsequently Hadoop) libraries
>in Apache Gora to 1.6.2 and 1.0.0 respectively and have run into a small
>(one of many) question.
>Use of DecoderFactory().configureDirectDecoder(boolean) is now deprecated
>[0], so I am looking for advice on how to configure the direct decoder
>accordingly, to achieve the same results as explained below.
>I was thinking of implementing
>decoder = new DecoderFactory().binaryDecoder(in, decoder), however is
>this suitable/satisfactory?
>If so can someone please explain why this is the case and how
>functionality has been retained even after removing the configuration for
>the DirectDecoder?
>Thank you in advance for any suggestions.
>  @Override
>  public void open(InputStream in) throws IOException {
>    /* It is very important to use a direct buffer, since Hadoop
>     * supplies an input stream that is only valid until the end of one
>     * record serialization. Each time deserialize() is called, the IS
>     * is advanced to point to the right location, so we should not
>     * buffer the whole input stream at once.
>     */
>    decoder = new DecoderFactory().configureDirectDecoder(true)
>      .createBinaryDecoder(in, decoder);
>  }

View raw message