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");
      }
    }
    if (compressor != null && !compressor.getClass().isAnnotationPresent(DoNotPool.class)) {
      updateLeaseCount(compressorCounts, compressor, 1);
    }
    return compressor;
  }
Get a {@link Compressor} for the given {@link CompressionCodec} from the pool, or get a new one
if the pool is empty. Copied from hadoop-common without significant modification.
hbase-common/src/main/java/org/apache/hadoop/hbase/io/compress/CodecPool.java