FAQ
Hello all,

I have my own VersionedWritable class like so:


public class MyWritable extends VersionedWritable {

public OtherWritable anotherWritable; // instance var, implements Writable
...

public MyWritable() {
anotherWritable = null;
}

@Override
public void readFields(DataInput in) {
if (condition) {
anotherWritable = new OtherWritable();
// ...
}
}
}


I can verify that the no-arg constructor of MyWritable is being called,
but it appears as if the no-arg constructor for OtherWritable is being
called some time between the construction of MyWritable and the call to
MyWritable's readFields(). Is this expected behavior, because the
OtherWritable is a public instance variable that implements Writable?

This is happening when a SequenceFile containing a bunch of these is
read into a Reducer.

Ted

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommon-user @
categorieshadoop
postedJun 17, '08 at 11:23p
activeJun 17, '08 at 11:23p
posts1
users1
websitehadoop.apache.org...
irc#hadoop

1 user in discussion

Ted Dziuba: 1 post

People

Translate

site design / logo © 2022 Grokbase