Examples of CompressionCodec


Examples of com.facebook.hive.orc.compression.CompressionCodec

  public void testNoOverflow() throws Exception {
    ByteBuffer in = ByteBuffer.allocate(10);
    ByteBuffer out = ByteBuffer.allocate(10);
    in.put(new byte[]{1,2,3,4,5,6,7,10});
    in.flip();
    CompressionCodec codec = new ZlibCodec();
    assertEquals(false, codec.compress(in, out, null));
  }
View Full Code Here

Examples of com.facebook.hive.orc.compression.CompressionCodec

  @Test
  public void testCorrupt() throws Exception {
    ByteBuffer buf = ByteBuffer.allocate(1000);
    buf.put(new byte[]{127,-128,0,99,98,-1});
    buf.flip();
    CompressionCodec codec = new ZlibCodec();
    ByteBuffer out = ByteBuffer.allocate(1000);
    try {
      codec.decompress(buf, out);
      fail();
    } catch (IOException ioe) {
      // EXPECTED
    }
  }
View Full Code Here

Examples of com.facebook.hive.orc.compression.CompressionCodec

    }
  }

  @Test
  public void testCompressedSeek() throws Exception {
    CompressionCodec codec = new SnappyCodec();
    TestInStream.OutputCollector collect = new TestInStream.OutputCollector();

    ReaderWriterProfiler.setProfilerOptions(null);
    RunLengthByteWriter out = new RunLengthByteWriter(new OutStream("test", 500,
        codec, collect, new MemoryEstimate()));
View Full Code Here

Examples of com.facebook.hive.orc.compression.CompressionCodec

  @Test
  public void testCompressedSeekReadAllAvailable() throws Exception {
    // Prepare an output stream
    ReaderWriterProfiler.setProfilerOptions(null);
    OutputCollector collect = new OutputCollector();
    CompressionCodec codec = new ZlibCodec();
    OutStream out = new OutStream("test", 300, codec, collect, new MemoryEstimate());
    RowIndex.Builder rowIndex = OrcProto.RowIndex.newBuilder();
    RowIndexEntry.Builder rowIndexEntry = OrcProto.RowIndexEntry.newBuilder();
    WriterImpl.RowIndexPositionRecorder rowIndexPosition =
        new RowIndexPositionRecorder(rowIndexEntry);
View Full Code Here

Examples of com.facebook.hive.orc.compression.CompressionCodec

  @Test
  public void testCompressed() throws Exception {
    ReaderWriterProfiler.setProfilerOptions(null);
    OutputCollector collect = new OutputCollector();
    CompressionCodec codec = new ZlibCodec();
    OutStream out = new OutStream("test", 300, codec, collect, new MemoryEstimate());
    RowIndex.Builder rowIndex = OrcProto.RowIndex.newBuilder();
    RowIndexEntry.Builder rowIndexEntry = OrcProto.RowIndexEntry.newBuilder();
    WriterImpl.RowIndexPositionRecorder rowIndexPosition = new RowIndexPositionRecorder(rowIndexEntry);
    for(int i=0; i < 1024; ++i) {
View Full Code Here

Examples of com.facebook.hive.orc.compression.CompressionCodec

  @Test
  public void testCorruptStream() throws Exception {
    ReaderWriterProfiler.setProfilerOptions(null);
    OutputCollector collect = new OutputCollector();
    CompressionCodec codec = new ZlibCodec();
    OutStream out = new OutStream("test", 500, codec, collect, new MemoryEstimate());
    for(int i=0; i < 1024; ++i) {
      out.write(i);
    }
    out.flush();
View Full Code Here

Examples of org.apache.abdera.i18n.text.io.CompressionUtil.CompressionCodec

        encoding != null ?
          ProviderHelper.orderByQ(encoding) :
          new String[0];
      for (String enc : encodings) {
        try {
          CompressionCodec codec = CompressionCodec.valueOf(enc.toUpperCase());
          return new CompressingResponseContextWrapper(chain.next(request), codec);
        } catch (Exception e) {}
      }
      return chain.next(request);
  }
View Full Code Here

Examples of org.apache.abdera.util.CompressionUtil.CompressionCodec

        encoding != null ?
          ProviderHelper.orderByQ(encoding) :
          new String[0];
      for (String enc : encodings) {
        try {
          CompressionCodec codec = CompressionCodec.valueOf(enc.toUpperCase());
          return new CompressingResponseContextWrapper(chain.next(request), codec);
        } catch (Exception e) {}
      }
      return chain.next(request);
  }
View Full Code Here

Examples of org.apache.hadoop.io.compress.CompressionCodec

    Configuration conf = new Configuration();
    List<Class<? extends CompressionCodec>> codecs = CompressionCodecFactory
        .getCodecClasses(conf);
    // Wish we could base this on DefaultCodec but appears not all codec's
    // extend DefaultCodec(Lzo)
    CompressionCodec codec = null;
    ArrayList<String> codecStrs = new ArrayList<String>();
    codecStrs.add("None");
    for (Class<? extends CompressionCodec> cls : codecs) {
      codecStrs.add(cls.getSimpleName());
      if (codecMatches(cls, codecName)) {
View Full Code Here

Examples of org.apache.hadoop.io.compress.CompressionCodec

          Text.class, Text.class, CompressionType.NONE, (CompressionCodec) null);
      holder = new SequenceFileWriterHolder<SequenceFile.Writer>(writer, p);
    }
    else {
      Class<?> clazz = ClassUtils.resolveClassName(codecInfo.getCodecClass(), getClass().getClassLoader());
      CompressionCodec compressionCodec = (CompressionCodec) ReflectionUtils.newInstance(clazz,
          getConfiguration());
      writer = SequenceFile.createWriter(fs,
          getConfiguration(), getResolvedPath(),
          Text.class, Text.class, CompressionType.RECORD, compressionCodec);
      holder = new SequenceFileWriterHolder<SequenceFile.Writer>(writer, p);
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.