Ah - this was the problem! Now that I have the constructor, I am able
to serialize either way - using Java's serialization or my own. For
this app, I'm happy either way, but I'll think about sticking with my
own serialization in the future.
Thanks for the help!
-steve
On 10/10/07, Christopher
Steve,
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
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.)
You're right, Serializable should be sufficient. I was thinking of a
case where you'd sometimes want to write them out as values, but other
times combine them inside Sample.
On 10/10/07, Steve Schlosser <[EMAIL PROTECTED]> wrote:
> Is this true? The fact that SampleValue and Address implement
> S
Is this true? The fact that SampleValue and Address implement
Serializable should be sufficient to write them out to the stream.
They are not ever written out as keys or values themselves.
-steve
On 10/10/07, Matt Kent <[EMAIL PROTECTED]> wrote:
> I believe in this case you'll want to make Sampl
Hey Steve,
WritableComparable should be implemented by classes meant as Keys
Writable should be implemented by classes meant as Values
The class as Keys need comparing ability because they undergo sorting
The keys undergo sorting , hence they need a comparison
Steve Schlosser wrote:
Hello all
I believe in this case you'll want to make Sample and Address writable as well.
On 10/10/07, Steve Schlosser <[EMAIL PROTECTED]> wrote:
> Hello all
>
> Is there a best practice for using my own classes as keys and values?
>
> My first attempt at doing this was successful - I built a
> BigIntegerWr