Package org.apache.hadoop.io.SequenceFile

Examples of org.apache.hadoop.io.SequenceFile.CompressionType


                                      String name, Progressable progress)
                                      throws IOException {

    Path file = new Path(job.getOutputPath(), name);
    CompressionCodec codec = null;
    CompressionType compressionType = CompressionType.NONE;
    if (getCompressOutput(job)) {
      // find the kind of compression to do
      compressionType = SequenceFile.getCompressionType(job);

      // find the right codec
View Full Code Here


        if (rwonly && (!create || merge || fast)) {
          System.err.println(usage);
          System.exit(-1);
        }

        CompressionType compressionType =
          CompressionType.valueOf(compressType);

        if (rwonly || (create && !merge)) {
            writeTest(fs, count, seed, file, compressionType);
            readTest(fs, count, seed, file);
View Full Code Here

      throws IOException, InterruptedException {
    Configuration conf = context.getConfiguration();

    // Configure compression if requested.
    CompressionCodec codec = null;
    CompressionType compressionType = CompressionType.NONE;
    if (getCompressOutput(context)) {
      // Find the kind of compression to do.
      compressionType = getOutputCompressionType(conf);

      // Find the right codec.
View Full Code Here

      RecordReader sampleReader = inputFormat.getRecordReader(splits[0], job);

      List<SequenceFile.Writer> writers = new ArrayList<SequenceFile.Writer>(
          splits.length);

      CompressionType compressionType = getOutputCompressionType(job);
      Class<? extends CompressionCodec> outputCompressorClass = getOutputCompressorClass(
          job, null);
      CompressionCodec codec = null;
      if (outputCompressorClass != null) {
        codec = ReflectionUtils.newInstance(outputCompressorClass,
View Full Code Here

  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);
View Full Code Here

    // get the path of the temporary output file
    Path file = FileOutputFormat.getTaskOutputPath(job, name);
   
    FileSystem fs = file.getFileSystem(job);
    CompressionCodec codec = null;
    CompressionType compressionType = CompressionType.NONE;
    if (getCompressOutput(job)) {
      // find the kind of compression to do
      compressionType = getOutputCompressionType(job);

      // find the right codec
View Full Code Here

   * @return output stream over the created sequencefile
   */
  public static SequenceFile.Writer createSequenceWriter(JobConf jc, FileSystem fs, Path file,
      Class<?> keyClass, Class<?> valClass, boolean isCompressed) throws IOException {
    CompressionCodec codec = null;
    CompressionType compressionType = CompressionType.NONE;
    Class codecClass = null;
    if (isCompressed) {
      compressionType = SequenceFileOutputFormat.getOutputCompressionType(jc);
      codecClass = FileOutputFormat.getOutputCompressorClass(jc, DefaultCodec.class);
      codec = (CompressionCodec) ReflectionUtils.newInstance(codecClass, jc);
View Full Code Here

        if (rwonly && (!create || merge || fast)) {
          System.err.println(usage);
          System.exit(-1);
        }

        CompressionType compressionType =
          CompressionType.valueOf(compressType);
        CompressionCodec codec = (CompressionCodec)ReflectionUtils.newInstance(
                                    conf.getClassByName(compressionCodec),
                                    conf);
View Full Code Here

      throws IOException, InterruptedException {
    Configuration conf = context.getConfiguration();

    // Configure compression if requested.
    CompressionCodec codec = null;
    CompressionType compressionType = CompressionType.NONE;
    if (getCompressOutput(context)) {
      // Find the kind of compression to do.
      compressionType = getOutputCompressionType(conf);

      // Find the right codec.
View Full Code Here

      if (rwonly && (!create || merge || fast)) {
        System.err.println(usage);
        System.exit(-1);
      }

      CompressionType compressionType =
        CompressionType.valueOf(compressType);
      CompressionCodec codec = (CompressionCodec)ReflectionUtils.newInstance(
                                                                             conf.getClassByName(compressionCodec),
                                                                             conf);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.io.SequenceFile.CompressionType

Copyright © 2018 www.massapicom. 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.