gpt4 book ai didi

org.apache.hadoop.io.compress.zlib.ZlibFactory.getCompressionLevel()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 20:12:40 32 4
gpt4 key购买 nike

本文整理了Java中org.apache.hadoop.io.compress.zlib.ZlibFactory.getCompressionLevel()方法的一些代码示例,展示了ZlibFactory.getCompressionLevel()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZlibFactory.getCompressionLevel()方法的具体详情如下:
包路径:org.apache.hadoop.io.compress.zlib.ZlibFactory
类名称:ZlibFactory
方法名:getCompressionLevel

ZlibFactory.getCompressionLevel介绍

暂无

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-common

/**
 * Creates a new compressor, taking settings from the configuration.
 */
public ZlibCompressor(Configuration conf) {
 this(ZlibFactory.getCompressionLevel(conf),
    ZlibFactory.getCompressionStrategy(conf),
    CompressionHeader.DEFAULT_HEADER,
    DEFAULT_DIRECT_BUFFER_SIZE);
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

public GzipZlibCompressor(Configuration conf) {
  super(ZlibFactory.getCompressionLevel(conf),
     ZlibFactory.getCompressionStrategy(conf),
     ZlibCompressor.CompressionHeader.GZIP_FORMAT,
     64 * 1024);
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

/**
 * Return the appropriate implementation of the zlib compressor. 
 * 
 * @param conf configuration
 * @return the appropriate implementation of the zlib compressor.
 */
public static Compressor getZlibCompressor(Configuration conf) {
 return (isNativeZlibLoaded(conf)) ? 
  new ZlibCompressor(conf) :
  new BuiltInZlibDeflater(ZlibFactory.getCompressionLevel(conf).compressionLevel());
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

/**
  * reinit the compressor with the given configuration. It will reset the
  * compressor's compression level and compression strategy. Different from
  * <tt>ZlibCompressor</tt>, <tt>BuiltInZlibDeflater</tt> only support three
  * kind of compression strategy: FILTERED, HUFFMAN_ONLY and DEFAULT_STRATEGY.
  * It will use DEFAULT_STRATEGY as default if the configured compression
  * strategy is not supported.
  */
 @Override
 public void reinit(Configuration conf) {
  reset();
  if (conf == null) {
   return;
  }
  setLevel(ZlibFactory.getCompressionLevel(conf).compressionLevel());
  final ZlibCompressor.CompressionStrategy strategy =
   ZlibFactory.getCompressionStrategy(conf);
  try {
   setStrategy(strategy.compressionStrategy());
  } catch (IllegalArgumentException ill) {
   LOG.warn(strategy + " not supported by BuiltInZlibDeflater.");
   setStrategy(DEFAULT_STRATEGY);
  }
  if(LOG.isDebugEnabled()) {
   LOG.debug("Reinit compressor with new compression configuration");
  }
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

/**
 * Prepare the compressor to be used in a new stream with settings defined in
 * the given Configuration. It will reset the compressor's compression level
 * and compression strategy.
 * 
 * @param conf Configuration storing new settings
 */
@Override
public void reinit(Configuration conf) {
 reset();
 if (conf == null) {
  return;
 }
 end(stream);
 level = ZlibFactory.getCompressionLevel(conf);
 strategy = ZlibFactory.getCompressionStrategy(conf);
 stream = init(level.compressionLevel(), 
        strategy.compressionStrategy(), 
        windowBits.windowBits());
 if(LOG.isDebugEnabled()) {
  LOG.debug("Reinit compressor with new compression configuration");
 }
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

/**
 * Creates a new compressor, taking settings from the configuration.
 */
public ZlibCompressor(Configuration conf) {
 this(ZlibFactory.getCompressionLevel(conf),
    ZlibFactory.getCompressionStrategy(conf),
    CompressionHeader.DEFAULT_HEADER,
    DEFAULT_DIRECT_BUFFER_SIZE);
}

代码示例来源:origin: io.hops/hadoop-common

public GzipZlibCompressor(Configuration conf) {
  super(ZlibFactory.getCompressionLevel(conf),
     ZlibFactory.getCompressionStrategy(conf),
     ZlibCompressor.CompressionHeader.GZIP_FORMAT,
     64 * 1024);
 }
}

代码示例来源:origin: io.hops/hadoop-common

/**
 * Creates a new compressor, taking settings from the configuration.
 */
public ZlibCompressor(Configuration conf) {
 this(ZlibFactory.getCompressionLevel(conf),
    ZlibFactory.getCompressionStrategy(conf),
    CompressionHeader.DEFAULT_HEADER,
    DEFAULT_DIRECT_BUFFER_SIZE);
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

public GzipZlibCompressor(Configuration conf) {
  super(ZlibFactory.getCompressionLevel(conf),
     ZlibFactory.getCompressionStrategy(conf),
     ZlibCompressor.CompressionHeader.GZIP_FORMAT,
     64 * 1024);
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

public GzipZlibCompressor(Configuration conf) {
  super(ZlibFactory.getCompressionLevel(conf),
     ZlibFactory.getCompressionStrategy(conf),
     ZlibCompressor.CompressionHeader.GZIP_FORMAT,
     64 * 1024);
 }
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

public GzipZlibCompressor(Configuration conf) {
  super(ZlibFactory.getCompressionLevel(conf),
     ZlibFactory.getCompressionStrategy(conf),
     ZlibCompressor.CompressionHeader.GZIP_FORMAT,
     64 * 1024);
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

/**
 * Creates a new compressor, taking settings from the configuration.
 */
public ZlibCompressor(Configuration conf) {
 this(ZlibFactory.getCompressionLevel(conf),
    ZlibFactory.getCompressionStrategy(conf),
    CompressionHeader.DEFAULT_HEADER,
    DEFAULT_DIRECT_BUFFER_SIZE);
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

/**
 * Creates a new compressor, taking settings from the configuration.
 */
public ZlibCompressor(Configuration conf) {
 this(ZlibFactory.getCompressionLevel(conf),
    ZlibFactory.getCompressionStrategy(conf),
    CompressionHeader.DEFAULT_HEADER,
    DEFAULT_DIRECT_BUFFER_SIZE);
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

/**
 * Return the appropriate implementation of the zlib compressor. 
 * 
 * @param conf configuration
 * @return the appropriate implementation of the zlib compressor.
 */
public static Compressor getZlibCompressor(Configuration conf) {
 return (isNativeZlibLoaded(conf)) ? 
  new ZlibCompressor(conf) :
  new BuiltInZlibDeflater(ZlibFactory.getCompressionLevel(conf).compressionLevel());
}

代码示例来源:origin: io.hops/hadoop-common

/**
 * Return the appropriate implementation of the zlib compressor. 
 * 
 * @param conf configuration
 * @return the appropriate implementation of the zlib compressor.
 */
public static Compressor getZlibCompressor(Configuration conf) {
 return (isNativeZlibLoaded(conf)) ? 
  new ZlibCompressor(conf) :
  new BuiltInZlibDeflater(ZlibFactory.getCompressionLevel(conf).compressionLevel());
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

/**
 * Return the appropriate implementation of the zlib compressor. 
 * 
 * @param conf configuration
 * @return the appropriate implementation of the zlib compressor.
 */
public static Compressor getZlibCompressor(Configuration conf) {
 return (isNativeZlibLoaded(conf)) ? 
  new ZlibCompressor(conf) :
  new BuiltInZlibDeflater(ZlibFactory.getCompressionLevel(conf).compressionLevel());
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

/**
 * Return the appropriate implementation of the zlib compressor. 
 * 
 * @param conf configuration
 * @return the appropriate implementation of the zlib compressor.
 */
public static Compressor getZlibCompressor(Configuration conf) {
 return (isNativeZlibLoaded(conf)) ? 
  new ZlibCompressor(conf) :
  new BuiltInZlibDeflater(ZlibFactory.getCompressionLevel(conf).compressionLevel());
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

/**
 * Prepare the compressor to be used in a new stream with settings defined in
 * the given Configuration. It will reset the compressor's compression level
 * and compression strategy.
 * 
 * @param conf Configuration storing new settings
 */
@Override
public void reinit(Configuration conf) {
 reset();
 if (conf == null) {
  return;
 }
 end(stream);
 level = ZlibFactory.getCompressionLevel(conf);
 strategy = ZlibFactory.getCompressionStrategy(conf);
 stream = init(level.compressionLevel(), 
        strategy.compressionStrategy(), 
        windowBits.windowBits());
 if(LOG.isDebugEnabled()) {
  LOG.debug("Reinit compressor with new compression configuration");
 }
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

@Test
public void testZlibFactory() {
 Configuration cfg = new Configuration();
 assertTrue("testZlibFactory compression level error !!!",
   CompressionLevel.DEFAULT_COMPRESSION == ZlibFactory
     .getCompressionLevel(cfg));
 assertTrue("testZlibFactory compression strategy error !!!",
   CompressionStrategy.DEFAULT_STRATEGY == ZlibFactory
     .getCompressionStrategy(cfg));
 ZlibFactory.setCompressionLevel(cfg, CompressionLevel.BEST_COMPRESSION);
 assertTrue("testZlibFactory compression strategy error !!!",
   CompressionLevel.BEST_COMPRESSION == ZlibFactory
     .getCompressionLevel(cfg));
 ZlibFactory.setCompressionStrategy(cfg, CompressionStrategy.FILTERED);
 assertTrue("testZlibFactory compression strategy error !!!",
   CompressionStrategy.FILTERED == ZlibFactory.getCompressionStrategy(cfg));
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

@Test
public void testZlibFactory() {
 Configuration cfg = new Configuration();
 assertTrue("testZlibFactory compression level error !!!",
   CompressionLevel.DEFAULT_COMPRESSION == ZlibFactory
     .getCompressionLevel(cfg));
 assertTrue("testZlibFactory compression strategy error !!!",
   CompressionStrategy.DEFAULT_STRATEGY == ZlibFactory
     .getCompressionStrategy(cfg));
 ZlibFactory.setCompressionLevel(cfg, CompressionLevel.BEST_COMPRESSION);
 assertTrue("testZlibFactory compression strategy error !!!",
   CompressionLevel.BEST_COMPRESSION == ZlibFactory
     .getCompressionLevel(cfg));
 ZlibFactory.setCompressionStrategy(cfg, CompressionStrategy.FILTERED);
 assertTrue("testZlibFactory compression strategy error !!!",
   CompressionStrategy.FILTERED == ZlibFactory.getCompressionStrategy(cfg));
}

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com