FSDataOutputStream fileOut = fs.create(new Path(dir, name), progress);
return new LineRecordWriter<K, V>(fileOut);
} else {
Class codecClass = getOutputCompressorClass(job, GzipCodec.class);
// create the named codec
CompressionCodec codec = (CompressionCodec)
ReflectionUtils.newInstance(codecClass, job);
// build the filename including the extension
Path filename = new Path(dir, name + codec.getDefaultExtension());
FSDataOutputStream fileOut = fs.create(filename, progress);
return new LineRecordWriter<K, V>(new DataOutputStream
(codec.createOutputStream(fileOut)));
}
}