Package org.apache.hadoop.io.compress

Examples of org.apache.hadoop.io.compress.CompressionCodec.createOutputStream()


                new CompressionCodecFactory(conf).getCodec(nextSegment);
            OutputStream output;
            Compressor compressor = null;
            if (codec != null) {
              compressor = CodecPool.getCompressor(codec);
              output = codec.createOutputStream(tempUncompOut, compressor);
            } else {
              output = tempUncompOut;
            }

            tempUncompOut = null;
View Full Code Here


    FileSystem fs = path.getFileSystem(conf);
    CompressionCodec codec = new CompressionCodecFactory(conf).getCodec(path);
    OutputStream output;
    if (codec != null) {
      compressor = CodecPool.getCompressor(codec);
      output = codec.createOutputStream(fs.create(path), compressor);
    } else {
      output = fs.create(path);
    }
    writer = new JsonObjectMapperWriter<T>(output,
        conf.getBoolean("rumen.output.pretty.print", true));
View Full Code Here

      FSDataOutputStream fileOut = fs.create(file, false);
      return new LineRecordWriter<K, V>(fileOut, keyValueSeparator);
    } else {
      FSDataOutputStream fileOut = fs.create(file, false);
      return new LineRecordWriter<K, V>(new DataOutputStream
                                        (codec.createOutputStream(fileOut)),
                                        keyValueSeparator);
    }
  }
}
View Full Code Here

        FileOutputFormat.getTaskOutputPath(job,
                                           name + codec.getDefaultExtension());
      FileSystem fs = file.getFileSystem(job);
      FSDataOutputStream fileOut = fs.create(file, progress);
      return new LineRecordWriter<K, V>(new DataOutputStream
                                        (codec.createOutputStream(fileOut)),
                                        keyValueSeparator);
    }
  }
}
View Full Code Here

    if (!isCompressed) {
      return new LineRecordWriter<Text, Text>(fileOut, separator);
    } else {
      DataOutputStream out =
        new DataOutputStream(codec.createOutputStream(fileOut));
      return new LineRecordWriter<Text, Text>(out, separator);
    }
  }

  /**
 
View Full Code Here

                  getFs().create(path);


              DataOutputStream stream = codec == null ? uncompressedStream :
                  new DataOutputStream(
                      codec.createOutputStream(uncompressedStream));

              Partition<I, V, E> partition =
                  getPartitionStore().getOrCreatePartition(partitionId);

              partition.write(stream);
View Full Code Here

    // open input stream
    InputStream in = srcFs.open(srcPath);

    // Create compression stream
    OutputStream out = dstFs.create(dstPath);
    out = codec.createOutputStream(out);

    IOUtils.copyBytes(in, out, conf, true);

    return 0;
  }
View Full Code Here

      return new CSVRecordWriter(fileOut,
          keyValueSeparator);
    } else {
      FSDataOutputStream fileOut = fs.create(file, false);
      return new CSVRecordWriter(
          new DataOutputStream(codec.createOutputStream(fileOut)),
          keyValueSeparator);
    }
  }

  protected static class CSVRecordWriter
View Full Code Here

    InputStream is = hdfs.open(new Path(args[0]));
    OutputStream os = hdfs.create(
        new Path(args[0] + codec.getDefaultExtension()));


    OutputStream cos = codec.createOutputStream(os);

    IOUtils.copyBytes(is, cos, config, true);

    IOUtils.closeStream(os);
    IOUtils.closeStream(is);
View Full Code Here

      FSDataOutputStream fileOut = fs.create(file, false);
      return new PasswdRecordWriter<K, V>(fileOut);
    } else {
      FSDataOutputStream fileOut = fs.create(file, false);
      return new PasswdRecordWriter<K, V>(new DataOutputStream
          (codec.createOutputStream(fileOut)));
    }
  }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.