List of usage examples for org.apache.hadoop.io.compress CompressionCodec getDecompressorType
Class<? extends Decompressor> getDecompressorType();
From source file:com.facebook.presto.hadoop.HadoopNative.java
License:Apache License
private static void loadAllCodecs() { Configuration conf = new Configuration(); CompressionCodecFactory factory = new CompressionCodecFactory(conf); for (Class<? extends CompressionCodec> clazz : getCodecClasses(conf)) { CompressionCodec codec = factory.getCodecByClassName(clazz.getName()); if (codec == null) { throw new RuntimeException("failed to load codec: " + clazz.getName()); }// www . j a v a 2 s.co m codec.getDecompressorType(); } }
From source file:com.streamsets.pipeline.stage.destination.hdfs.BaseHdfsTargetIT.java
License:Apache License
@Test public void testSDCSnappyCompressionCodec() throws Exception { Assert.assertNotNull(CompressionMode.SNAPPY.getCodec().getField("SDC")); CompressionCodec codec = CompressionMode.SNAPPY.getCodec().newInstance(); Assert.assertNotNull(codec.getCompressorType().getField("SDC")); Assert.assertNotNull(codec.getDecompressorType().getField("SDC")); }
From source file:data.intelligence.platform.yarn.etl.io.CodecPool.java
License:Apache License
/** * Get a {@link Decompressor} for the given {@link CompressionCodec} from * the pool or a new one./*from w w w .j av a 2 s . com*/ * * @param codec * the <code>CompressionCodec</code> for which to get the * <code>Decompressor</code> * @return <code>Decompressor</code> for the given * <code>CompressionCodec</code> the pool or a new one */ public static Decompressor getDecompressor(CompressionCodec codec) { Decompressor decompressor = borrow(DECOMPRESSOR_POOL, codec.getDecompressorType()); if (decompressor == null) { decompressor = codec.createDecompressor(); LOG.info("Got brand-new decompressor"); } else { LOG.debug("Got recycled decompressor"); } return decompressor; }
From source file:org.apache.tajo.storage.compress.CodecPool.java
License:Apache License
/** * Get a {@link Decompressor} for the given {@link CompressionCodec} from the * pool or a new one.//from w ww . ja va2 s . com * * @param codec * the <code>CompressionCodec</code> for which to get the * <code>Decompressor</code> * @return <code>Decompressor</code> for the given * <code>CompressionCodec</code> the pool or a new one */ public static Decompressor getDecompressor(CompressionCodec codec) { Decompressor decompressor = borrow(DECOMPRESSOR_POOL, codec.getDecompressorType()); if (decompressor == null) { decompressor = codec.createDecompressor(); LOG.info("Got brand-new decompressor [" + codec.getDefaultExtension() + "]"); } else { if (LOG.isDebugEnabled()) { LOG.debug("Got recycled decompressor"); } } return decompressor; }