/** {@inheritDoc} */ @Override public RecordWriter<WritableComparable, BytesRefArrayWritable> getRecordWriter( FileSystem ignored, JobConf job, String name, Progressable progress) throws IOException { Path outputPath = getWorkOutputPath(job); FileSystem fs = outputPath.getFileSystem(job); Path file = new Path(outputPath, name); CompressionCodec codec = null; if (getCompressOutput(job)) { Class<?> codecClass = getOutputCompressorClass(job, DefaultCodec.class); codec = (CompressionCodec) ReflectionUtils.newInstance(codecClass, job); } final RCFile.Writer out = new RCFile.Writer(fs, job, file, progress, codec); return new RecordWriter<WritableComparable, BytesRefArrayWritable>() { @Override public void close(Reporter reporter) throws IOException { out.close(); } @Override public void write(WritableComparable key, BytesRefArrayWritable value) throws IOException { out.append(value); } }; }
/** {@inheritDoc} */ @Override public RecordWriter<WritableComparable, BytesRefArrayWritable> getRecordWriter( FileSystem ignored, JobConf job, String name, Progressable progress) throws IOException { Path outputPath = getWorkOutputPath(job); FileSystem fs = outputPath.getFileSystem(job); Path file = new Path(outputPath, name); CompressionCodec codec = null; if (getCompressOutput(job)) { Class<?> codecClass = getOutputCompressorClass(job, DefaultCodec.class); codec = (CompressionCodec) ReflectionUtils.newInstance(codecClass, job); } final RCFile.Writer out = new RCFile.Writer(fs, job, file, progress, codec); return new RecordWriter<WritableComparable, BytesRefArrayWritable>() { @Override public void close(Reporter reporter) throws IOException { out.close(); } @Override public void write(WritableComparable key, BytesRefArrayWritable value) throws IOException { out.append(value); } }; }
/** {@inheritDoc} */ @Override public RecordWriter<WritableComparable, BytesRefArrayWritable> getRecordWriter( FileSystem ignored, JobConf job, String name, Progressable progress) throws IOException { Path outputPath = getWorkOutputPath(job); FileSystem fs = outputPath.getFileSystem(job); if (!fs.exists(outputPath)) { fs.mkdirs(outputPath); } Path file = new Path(outputPath, name); CompressionCodec codec = null; if (getCompressOutput(job)) { Class<?> codecClass = getOutputCompressorClass(job, DefaultCodec.class); codec = (CompressionCodec) ReflectionUtils.newInstance(codecClass, job); } final RCFile.Writer out = new RCFile.Writer(fs, job, file, progress, codec); return new RecordWriter<WritableComparable, BytesRefArrayWritable>() { @Override public void close(Reporter reporter) throws IOException { out.close(); } @Override public void write(WritableComparable key, BytesRefArrayWritable value) throws IOException { out.append(value); } }; }
/** {@inheritDoc} */ @Override public RecordWriter<WritableComparable, BytesRefArrayWritable> getRecordWriter( FileSystem ignored, JobConf job, String name, Progressable progress) throws IOException { Path outputPath = getWorkOutputPath(job); FileSystem fs = outputPath.getFileSystem(job); Path file = new Path(outputPath, name); CompressionCodec codec = null; if (getCompressOutput(job)) { Class<?> codecClass = getOutputCompressorClass(job, DefaultCodec.class); codec = (CompressionCodec) ReflectionUtils.newInstance(codecClass, job); } final RCFile.Writer out = new RCFile.Writer(fs, job, file, progress, codec); return new RecordWriter<WritableComparable, BytesRefArrayWritable>() { @Override public void close(Reporter reporter) throws IOException { out.close(); } @Override public void write(WritableComparable key, BytesRefArrayWritable value) throws IOException { out.append(value); } }; }