public static SequenceFile.Writer createSequenceWriter(JobConf jc, FileSystem fs,
Path file, Class<?> keyClass,
Class<?> valClass) throws IOException {
CompressionCodec codec = null;
CompressionType compressionType = CompressionType.NONE;
if (SequenceFileOutputFormat.getCompressOutput(jc)) {
compressionType = SequenceFileOutputFormat.getOutputCompressionType(jc);
Class codecClass = SequenceFileOutputFormat.getOutputCompressorClass(jc, DefaultCodec.class);
codec = (CompressionCodec)
ReflectionUtils.newInstance(codecClass, jc);