List of usage examples for org.apache.hadoop.io.compress Compressor reinit
public void reinit(Configuration conf);
From source file:org.apache.tajo.storage.compress.CodecPool.java
License:Apache License
/** * Get a {@link Compressor} for the given {@link CompressionCodec} from the * pool or a new one./* w w w . j av a2s . co m*/ * * @param codec * the <code>CompressionCodec</code> for which to get the * <code>Compressor</code> * @param conf the <code>Configuration</code> object which contains confs for creating or reinit the compressor * @return <code>Compressor</code> for the given <code>CompressionCodec</code> * from the pool or a new one */ public static Compressor getCompressor(CompressionCodec codec, Configuration conf) { Compressor compressor = borrow(COMPRESSOR_POOL, codec.getCompressorType()); if (compressor == null) { compressor = codec.createCompressor(); LOG.info("Got brand-new compressor [" + codec.getDefaultExtension() + "]"); } else { compressor.reinit(conf); if (LOG.isDebugEnabled()) { LOG.debug("Got recycled compressor"); } } return compressor; }