Java Code Examples for org.apache.hadoop.io.compress.DoNotPool

The following examples show how to use org.apache.hadoop.io.compress.DoNotPool. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: tajo   Source File: CodecPool.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Return the {@link Compressor} to the pool.
 *
 * @param compressor
 *          the <code>Compressor</code> to be returned to the pool
 */
public static void returnCompressor(Compressor compressor) {
  if (compressor == null) {
    return;
  }
  // if the compressor can't be reused, don't pool it.
  if (compressor.getClass().isAnnotationPresent(DoNotPool.class)) {
    return;
  }
  compressor.reset();
  payback(COMPRESSOR_POOL, compressor);
}
 
Example 2
Source Project: tajo   Source File: CodecPool.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Return the {@link Decompressor} to the pool.
 *
 * @param decompressor
 *          the <code>Decompressor</code> to be returned to the pool
 */
public static void returnDecompressor(Decompressor decompressor) {
  if (decompressor == null) {
    return;
  }
  // if the decompressor can't be reused, don't pool it.
  if (decompressor.getClass().isAnnotationPresent(DoNotPool.class)) {
    return;
  }
  decompressor.reset();
  payback(DECOMPRESSOR_POOL, decompressor);
}
 
Example 3
Source Project: hbase   Source File: Compression.java    License: Apache License 2.0 5 votes vote down vote up
public void returnDecompressor(Decompressor decompressor) {
  if (decompressor != null) {
    if (LOG.isTraceEnabled()) LOG.trace("Returning decompressor " + decompressor + " to pool.");
    CodecPool.returnDecompressor(decompressor);
    if (decompressor.getClass().isAnnotationPresent(DoNotPool.class)) {
      if (LOG.isTraceEnabled()) LOG.trace("Ending decompressor " + decompressor);
      decompressor.end();
    }
  }
}
 
Example 4
Source Project: incubator-tajo   Source File: CodecPool.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Return the {@link Compressor} to the pool.
 *
 * @param compressor
 *          the <code>Compressor</code> to be returned to the pool
 */
public static void returnCompressor(Compressor compressor) {
  if (compressor == null) {
    return;
  }
  // if the compressor can't be reused, don't pool it.
  if (compressor.getClass().isAnnotationPresent(DoNotPool.class)) {
    return;
  }
  compressor.reset();
  payback(COMPRESSOR_POOL, compressor);
}
 
Example 5
Source Project: incubator-tajo   Source File: CodecPool.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Return the {@link Decompressor} to the pool.
 *
 * @param decompressor
 *          the <code>Decompressor</code> to be returned to the pool
 */
public static void returnDecompressor(Decompressor decompressor) {
  if (decompressor == null) {
    return;
  }
  // if the decompressor can't be reused, don't pool it.
  if (decompressor.getClass().isAnnotationPresent(DoNotPool.class)) {
    return;
  }
  decompressor.reset();
  payback(DECOMPRESSOR_POOL, decompressor);
}