hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Dunning <tdunn...@veoh.com>
Subject Re: Using my own classes as keys and values
Date Wed, 10 Oct 2007 22:30:04 GMT


You don't need to implement the comparator.  I do think that you need a
no-argument constructor.  In general, when Hadoop is creating one of your
objects, it will call the no-argument constructor and then call readFields.

As a point of style, I would consider it very bad form to not mark fields as
private without a very good reason.

On 10/10/07 3:18 PM, "Steve Schlosser" <swschlosser@gmail.com> wrote:

> For the time being, I've given up on using object serialization to do
> what I want.  Instead, I'm going to just marshal and unmarshal the
> values of my class myself.  I've implemented write() and readField()
> methods in the classes that I want to read and write.  (See my
> definition of Sample below.)
> Unfortunately, Hadoop throws the following exception when my program starts:
> Job started: Wed Oct 10 18:04:06 EDT 2007
> 07/10/10 18:04:06 INFO mapred.InputFormatBase: Total input paths to process :
> 1
> 07/10/10 18:04:06 INFO mapred.JobClient: Running job: job_nlx1k6
> 07/10/10 18:04:06 WARN mapred.LocalJobRunner: job_nlx1k6
> java.lang.ExceptionInInitializerError
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Class.java:247)
>         at 
> org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:315)
>         at 

View raw message