Package com.hadoop.compression.lzo

Examples of com.hadoop.compression.lzo.LzopCodec.createOutputStream()


    FileSystem hdfs = FileSystem.get(config);
    InputStream is = null;
    OutputStream os = null;
    try {
      is = hdfs.open(src);
      os = codec.createOutputStream(hdfs.create(destFile));

      IOUtils.copyBytes(is, os, config);
    } finally {
      IOUtils.closeStream(os);
      IOUtils.closeStream(is);
View Full Code Here


      FileSystem hdfs = FileSystem.get(config);
      OutputStream os = hdfs.create(input);

      LzopCodec codec = new LzopCodec();
      codec.setConf(config);
      OutputStream lzopOutputStream = codec.createOutputStream(os);

      ThriftBlockWriter<Stock> writer =
          new ThriftBlockWriter<Stock>(
              lzopOutputStream, Stock.class);
View Full Code Here

    FileSystem hdfs = FileSystem.get(config);
    OutputStream os = hdfs.create(input);

    LzopCodec codec = new LzopCodec();
    codec.setConf(config);
    OutputStream lzopOutputStream = codec.createOutputStream(os);

    ProtobufBlockWriter<Stock> writer =
        new ProtobufBlockWriter<Stock>(
            lzopOutputStream, Stock.class);
View Full Code Here

            bufferSize);
      } else if (fileType.equalsIgnoreCase("lzo")) {
        LzopCodec lzopCodec = new LzopCodec();
        lzopCodec.setConf(SFTPUtils.getConf());

        cout = lzopCodec.createOutputStream(out);
        bw = new BufferedWriter(new OutputStreamWriter(cout, encoding),
            bufferSize);
      } else {
        throw new IllegalArgumentException("illegal argument fileType="
            + fileType);
View Full Code Here

    codec.setConf(conf);

    if (file.exists()) {
      file.delete();
    }
    return new DataOutputStream(codec.createOutputStream(new FileOutputStream(file)));
  }

  // thrift class related :
  private ThriftToPig<TestPerson> thriftToPig = ThriftToPig.newInstance(TestPerson.class);
  private ThriftConverter<TestPerson> tConverter = ThriftConverter.newInstance(TestPerson.class);
View Full Code Here

    codec.setConf(conf);

    if (file.exists()) {
      file.delete();
    }
    return new DataOutputStream(codec.createOutputStream(new FileOutputStream(file)));
  }

  // return a Person object
  private static Person makePerson(int index) {
    return Person.newBuilder()
View Full Code Here

    codec.setConf(conf);

    if (file.exists()) {
      file.delete();
    }
    return new DataOutputStream(codec.createOutputStream(new FileOutputStream(file)));
  }

  // thrift class related :
  private ThriftToPig<TestPerson> thriftToPig = ThriftToPig.newInstance(TestPerson.class);
  private ThriftWritable<TestPerson> thriftWritable = ThriftWritable.newInstance(TestPerson.class);
View Full Code Here

    final boolean isIndexed = indexOut != null;

    OutputStream out = ( isIndexed ?
        codec.createIndexedOutputStream(fileOut, indexOut) :
        codec.createOutputStream(fileOut) );

    return new DataOutputStream(out) {
      // override close() to handle renaming index file.

      public void close() throws IOException {
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.