Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
Avro >> mail # user >> Upgrade usage of DecoderFactory with upgrade from Avro 1.3.3 --> 1.6.2


+
Lewis John Mcgibbney 2012-02-24, 23:38
+
Scott Carey 2012-02-25, 02:40
Copy link to this message
-
Re: Upgrade usage of DecoderFactory with upgrade from Avro 1.3.3 --> 1.6.2
Thanks Scott, I noticed that the Javadoc for Avro > 1.6.1 is excellent.
It's something which I will strive to achieve within other projects I'm
working on.

Thanks for the heads up.

Lewis

On Sat, Feb 25, 2012 at 2:40 AM, Scott Carey <[EMAIL PROTECTED]> wrote:

> In addition to what you have already noticed, the javadoc for these
> changes has a lot of other related information:
>
> http://avro.apache.org/docs/current/api/java/org/apache/avro/io/EncoderFact
> ory.html
> http://avro.apache.org/docs/current/api/java/org/apache/avro/io/DecoderFact
> ory.html#directBinaryDecoder%28java.io.InputStream,%20org.apache.avro.io.Bi
> naryDecoder%29<http://avro.apache.org/docs/current/api/java/org/apache/avro/io/DecoderFact%0Aory.html#directBinaryDecoder%28java.io.InputStream,%20org.apache.avro.io.Bi%0AnaryDecoder%29>
>
>
>
> On 2/24/12 3:38 PM, "Lewis John Mcgibbney" <[EMAIL PROTECTED]>
> wrote:
>
>
> >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.
> >
> >Lewis
> >
> >  @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);
> >  }
> >
> >[0]
> >
> http://avro.apache.org/docs/1.6.2/api/java/org/apache/avro/io/DecoderFacto
> >ry.html
> >--
> >
> >Lewis
>
>
>
--
*Lewis*
+
Lewis John Mcgibbney 2012-02-24, 23:42
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB