gpt4 book ai didi

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

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

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

ZlibFactory.isNativeZlibLoaded介绍

[英]Check if native-zlib code is loaded & initialized correctly and can be loaded for this job.
[中]检查本机zlib代码是否已正确加载和初始化,并且可以为此作业加载。

代码示例

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

@Override
public Class<? extends Decompressor> getDecompressorType() {
 return ZlibFactory.isNativeZlibLoaded(conf)
  ? GzipZlibDecompressor.class
  : BuiltInGzipDecompressor.class;
}

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

/**
 * Return the appropriate type of the zlib decompressor. 
 * 
 * @param conf configuration
 * @return the appropriate type of the zlib decompressor.
 */
public static Class<? extends Decompressor> 
getZlibDecompressorType(Configuration conf) {
 return (isNativeZlibLoaded(conf)) ? 
     ZlibDecompressor.class : BuiltInZlibInflater.class;
}

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

/**
 * Return the appropriate type of the zlib compressor. 
 * 
 * @param conf configuration
 * @return the appropriate type of the zlib compressor.
 */
public static Class<? extends Compressor> 
getZlibCompressorType(Configuration conf) {
 return (isNativeZlibLoaded(conf)) ? 
     ZlibCompressor.class : BuiltInZlibDeflater.class;
}

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

@Override
public Class<? extends Compressor> getCompressorType() {
 return ZlibFactory.isNativeZlibLoaded(conf)
  ? GzipZlibCompressor.class
  : null;
}

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

@Override
public DirectDecompressor createDirectDecompressor() {
 return ZlibFactory.isNativeZlibLoaded(conf) 
   ? new ZlibDecompressor.ZlibDirectDecompressor(
    ZlibDecompressor.CompressionHeader.AUTODETECT_GZIP_ZLIB, 0) : null;
}

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

@Override
public Compressor createCompressor() {
 return (ZlibFactory.isNativeZlibLoaded(conf))
  ? new GzipZlibCompressor(conf)
  : null;
}

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

/**
 * Return the appropriate implementation of the zlib direct decompressor. 
 * 
 * @param conf configuration
 * @return the appropriate implementation of the zlib decompressor.
 */
public static DirectDecompressor getZlibDirectDecompressor(Configuration conf) {
 return (isNativeZlibLoaded(conf)) ? 
  new ZlibDecompressor.ZlibDirectDecompressor() : null; 
}

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

@Override
public Decompressor createDecompressor() {
 return (ZlibFactory.isNativeZlibLoaded(conf))
  ? new GzipZlibDecompressor()
  : new BuiltInGzipDecompressor();
}

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

/**
 * Return the appropriate implementation of the zlib decompressor. 
 * 
 * @param conf configuration
 * @return the appropriate implementation of the zlib decompressor.
 */
public static Decompressor getZlibDecompressor(Configuration conf) {
 return (isNativeZlibLoaded(conf)) ? 
  new ZlibDecompressor() : new BuiltInZlibInflater(); 
}

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

@Override
public CompressionOutputStream createOutputStream(OutputStream out) 
 throws IOException {
 if (!ZlibFactory.isNativeZlibLoaded(conf)) {
  return new GzipOutputStream(out);
 }
 return CompressionCodec.Util.
   createOutputStreamWithCodecPool(this, conf, out);
}

代码示例来源:origin: apache/hbase

@Override
public CompressionOutputStream createOutputStream(OutputStream out)
  throws IOException {
 if (ZlibFactory.isNativeZlibLoaded(getConf())) {
  return super.createOutputStream(out);
 }
 return new ReusableGzipOutputStream(out);
}

代码示例来源: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

zlibLoaded = ZlibFactory.isNativeZlibLoaded(conf);
if (zlibLoaded) {
 zlibLibraryName = ZlibFactory.getLibraryName();

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

(codec instanceof GzipCodec) &&
 !NativeCodeLoader.isNativeCodeLoaded() &&
 !ZlibFactory.isNativeZlibLoaded(conf)) {
throw new IllegalArgumentException("SequenceFile doesn't work with " +
                  "GzipCodec without native-hadoop " +

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

@Override
public Class<? extends Decompressor> getDecompressorType() {
 return ZlibFactory.isNativeZlibLoaded(conf)
  ? GzipZlibDecompressor.class
  : BuiltInGzipDecompressor.class;
}

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

/**
 * Return the appropriate implementation of the zlib direct decompressor. 
 * 
 * @param conf configuration
 * @return the appropriate implementation of the zlib decompressor.
 */
public static DirectDecompressor getZlibDirectDecompressor(Configuration conf) {
 return (isNativeZlibLoaded(conf)) ? 
  new ZlibDecompressor.ZlibDirectDecompressor() : null; 
}

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

@Override
public DirectDecompressor createDirectDecompressor() {
 return ZlibFactory.isNativeZlibLoaded(conf) 
   ? new ZlibDecompressor.ZlibDirectDecompressor(
    ZlibDecompressor.CompressionHeader.AUTODETECT_GZIP_ZLIB, 0) : null;
}

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

@Override
public CompressionOutputStream createOutputStream(OutputStream out) 
 throws IOException {
 if (!ZlibFactory.isNativeZlibLoaded(conf)) {
  return new GzipOutputStream(out);
 }
 return CompressionCodec.Util.
   createOutputStreamWithCodecPool(this, conf, out);
}

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

/**
 * Return the appropriate implementation of the zlib decompressor. 
 * 
 * @param conf configuration
 * @return the appropriate implementation of the zlib decompressor.
 */
public static Decompressor getZlibDecompressor(Configuration conf) {
 return (isNativeZlibLoaded(conf)) ? 
  new ZlibDecompressor() : new BuiltInZlibInflater(); 
}

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

@Override
public CompressionOutputStream createOutputStream(OutputStream out)
  throws IOException {
 if (ZlibFactory.isNativeZlibLoaded(getConf())) {
  return super.createOutputStream(out);
 }
 return new ReusableGzipOutputStream(out);
}

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