Examples of CompressionType


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

    * @throws Exception
    */
    @Test
    public void getCompType02() throws Exception {
        DfsFileImport fileImport = new DfsFileImport();
        CompressionType compType = fileImport.getCompType("BLOCK");
        assertEquals(CompressionType.BLOCK, compType);
    }
View Full Code Here

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

    * @throws Exception
    */
    @Test
    public void getCompType03() throws Exception {
        DfsFileImport fileImport = new DfsFileImport();
        CompressionType compType = fileImport.getCompType("RECORD");
        assertEquals(CompressionType.RECORD, compType);
    }
View Full Code Here

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

    * @throws Exception
    */
    @Test
    public void getCompType04() throws Exception {
        DfsFileImport fileImport = new DfsFileImport();
        CompressionType compType = fileImport.getCompType("DUMMY");
        assertEquals(CompressionType.NONE, compType);
    }
View Full Code Here

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

    throws IOException {

    Path file = new Path(job.getOutputPath(), name);
    FileSystem fs = file.getFileSystem(job);
    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

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

      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

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

              .forName(codecStr);
          FileOutputFormat.setOutputCompressorClass(jc_output, codec);
        }
        String type = conf.getCompressType();
        if (type != null && !type.trim().equals("")) {
          CompressionType style = CompressionType.valueOf(type);
          SequenceFileOutputFormat.setOutputCompressionType(jc, style);
        }
      }
      return getRecordWriter(jc_output, hiveOutputFormat, outputClass,
          isCompressed, tableInfo.getProperties(), outPath);
View Full Code Here

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

   * @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

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

                                                         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 = SequenceFileOutputFormat.getOutputCompressorClass(jc, DefaultCodec.class);
      codec = (CompressionCodec)
View Full Code Here

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

   * @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

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

    throws IOException {

    Path file = new Path(job.getOutputPath(), 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
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.