protected SequenceFileWriterHolder<Writer> getOutput() throws IOException {
FileSystem fs = FileSystem.get(getConfiguration());
SequenceFileWriterHolder<Writer> holder;
Writer writer;
CodecInfo codecInfo = getCodec();
Path p = getResolvedPath();
if (codecInfo == null) {
writer = SequenceFile.createWriter(
fs, getConfiguration(), getResolvedPath(),
Text.class, Text.class, CompressionType.NONE, (CompressionCodec) null);
holder = new SequenceFileWriterHolder<SequenceFile.Writer>(writer, p);
}
else {
Class<?> clazz = ClassUtils.resolveClassName(codecInfo.getCodecClass(), getClass().getClassLoader());
CompressionCodec compressionCodec = (CompressionCodec) ReflectionUtils.newInstance(clazz,
getConfiguration());
writer = SequenceFile.createWriter(fs,
getConfiguration(), getResolvedPath(),
Text.class, Text.class, CompressionType.RECORD, compressionCodec);