*/
public void map(Text key, Writable value,
OutputCollector<Text, ObjectWritable> output, Reporter reporter)
throws IOException {
ObjectWritable objUrl = new ObjectWritable();
objUrl.set(key);
if (value instanceof FieldsWritable) {
// collect the fields for the url
FieldsWritable fields = (FieldsWritable)value;
FieldWritable url = fields.getField(Fields.URL);
FieldWritable orig = fields.getField(Fields.ORIG_URL);
output.collect(new Text(url.getValue()), objUrl);
// collect for the orig / redirect url if one exists
if (orig != null) {
output.collect(new Text(orig.getValue()), objUrl);
}
}
else {
// anything else passes through
ObjectWritable objWrite = new ObjectWritable();
objWrite.set(value);
output.collect(key, objWrite);
}
}