Just an update... my problem seems to be beyond defining generic types.

Ted, I dont know if you have the answer for this question, which is
regarding SequenceFile.

If I am to create a SequenceFile by hand, I can do the following:

<code>
JobConf jobConf = new JobConf(MyClass.class);
JobClient jobClient = new JobClient(jobConf);

FileSystem fileSystem = jobClient.getFs();
SequenceFile.Writer writer = SequenceFile.createWriter(fileSystem,
jobConf, path, Text.class, Text.class);

</code>

After that, I can write all Text-based keys and values by doing this:

<code>
Text keyText = new Text();
keyText.set("mykey");

Text valText = new Text();
valText.set("myval");

writer.append(keyText, valText);
</code>

As you can see, there is no LongWriteable what-so-ever.

However, in a map/reduce job, if I am to specify
<code>
jobConf.setOutputFormat(SequenceFileOutputFormat.class);
</code>

And later in the mapper, if I am to say
<code>
Text newkey = new Text();
newkey.set("AAA");

Text newval = new Text();
newval.set("bbb");

output.collect(newkey, newval);
</code>

It would throw an exception, complaining that the key is not LongWriteable.

So that's a part of the reason that I am having trouble connecting the
pipes - it seems to me that SequenceFile and SequenceFileOutputFormat
are talking about two different kinds of "sequence files"...

Reply via email to