- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.hadoop.io.compress.zlib.ZlibFactory
类的一些代码示例,展示了ZlibFactory
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZlibFactory
类的具体详情如下:
包路径:org.apache.hadoop.io.compress.zlib.ZlibFactory
类名称:ZlibFactory
[英]A collection of factories to create the right zlib/gzip compressor/decompressor instances.
[中]创建正确的zlib/gzip压缩程序/解压缩程序实例的工厂集合。
代码示例来源: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
@Override
public Compressor createCompressor() {
return ZlibFactory.getZlibCompressor(conf);
}
代码示例来源:origin: org.apache.hadoop/hadoop-common
@Override
public Decompressor createDecompressor() {
return ZlibFactory.getZlibDecompressor(conf);
}
代码示例来源: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
/**
* 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: com.github.jiayuhan-it/hadoop-common
@Test
public void testZlibCompressorDecompressorSetDictionary() {
Configuration conf = new Configuration();
conf.setBoolean(CommonConfigurationKeys.IO_NATIVE_LIB_AVAILABLE_KEY, true);
if (ZlibFactory.isNativeZlibLoaded(conf)) {
Compressor zlibCompressor = ZlibFactory.getZlibCompressor(conf);
Decompressor zlibDecompressor = ZlibFactory.getZlibDecompressor(conf);
checkSetDictionaryNullPointerException(zlibCompressor);
checkSetDictionaryNullPointerException(zlibDecompressor);
checkSetDictionaryArrayIndexOutOfBoundsException(zlibDecompressor);
checkSetDictionaryArrayIndexOutOfBoundsException(zlibCompressor);
} else {
assertTrue("ZlibFactory is using native libs against request",
ZlibFactory.isNativeZlibLoaded(conf));
}
}
代码示例来源:origin: org.apache.hadoop/hadoop-common-test
conf.setBoolean(CommonConfigurationKeys.IO_NATIVE_LIB_AVAILABLE_KEY, false);
assertFalse("ZlibFactory is using native libs against request",
ZlibFactory.isNativeZlibLoaded(conf));
Decompressor zlibDecompressor = ZlibFactory.getZlibDecompressor(conf);
assertNotNull("zlibDecompressor is null!", zlibDecompressor);
assertTrue("ZlibFactory returned unexpected inflator",
代码示例来源:origin: org.apache.hadoop/hadoop-common-test
conf.setBoolean(CommonConfigurationKeys.IO_NATIVE_LIB_AVAILABLE_KEY, useNative);
if (useNative) {
if (!ZlibFactory.isNativeZlibLoaded(conf)) {
LOG.warn("testGzipCodecWrite skipped: native libs not loaded");
return;
ZlibFactory.isNativeZlibLoaded(conf));
Compressor zlibCompressor = ZlibFactory.getZlibCompressor(conf);
assertNotNull("zlibCompressor is null!", zlibCompressor);
assertTrue("ZlibFactory returned unexpected deflator",
代码示例来源: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));
}
代码示例来源:origin: org.apache.hadoop/hadoop-common
@Override
public Class<? extends Decompressor> getDecompressorType() {
return ZlibFactory.getZlibDecompressorType(conf);
}
代码示例来源:origin: org.apache.hadoop/hadoop-common
@Override
public Class<? extends Compressor> getCompressorType() {
return ZlibFactory.getZlibCompressorType(conf);
}
代码示例来源:origin: ch.cern.hadoop/hadoop-common
@Test
public void testNativeCodeLoaded() {
if (requireTestJni() == false) {
LOG.info("TestNativeCodeLoader: libhadoop.so testing is not required.");
return;
}
if (!NativeCodeLoader.isNativeCodeLoaded()) {
fail("TestNativeCodeLoader: libhadoop.so testing was required, but " +
"libhadoop.so was not loaded.");
}
assertFalse(NativeCodeLoader.getLibraryName().isEmpty());
// library names are depended on platform and build envs
// so just check names are available
assertFalse(ZlibFactory.getLibraryName().isEmpty());
if (NativeCodeLoader.buildSupportsSnappy()) {
assertFalse(SnappyCodec.getLibraryName().isEmpty());
}
if (NativeCodeLoader.buildSupportsOpenssl()) {
assertFalse(OpensslCipher.getLibraryName().isEmpty());
}
assertFalse(Lz4Codec.getLibraryName().isEmpty());
LOG.info("TestNativeCodeLoader: libhadoop.so is loaded.");
}
}
代码示例来源:origin: ch.cern.hadoop/hadoop-common
@Test
public void testZlibCompressorDecompressorSetDictionary() {
Configuration conf = new Configuration();
conf.setBoolean(CommonConfigurationKeys.IO_NATIVE_LIB_AVAILABLE_KEY, true);
if (ZlibFactory.isNativeZlibLoaded(conf)) {
Compressor zlibCompressor = ZlibFactory.getZlibCompressor(conf);
Decompressor zlibDecompressor = ZlibFactory.getZlibDecompressor(conf);
checkSetDictionaryNullPointerException(zlibCompressor);
checkSetDictionaryNullPointerException(zlibDecompressor);
checkSetDictionaryArrayIndexOutOfBoundsException(zlibDecompressor);
checkSetDictionaryArrayIndexOutOfBoundsException(zlibCompressor);
} else {
assertTrue("ZlibFactory is using native libs against request",
ZlibFactory.isNativeZlibLoaded(conf));
}
}
代码示例来源:origin: com.github.jiayuhan-it/hadoop-common
conf.setBoolean(CommonConfigurationKeys.IO_NATIVE_LIB_AVAILABLE_KEY, false);
assertFalse("ZlibFactory is using native libs against request",
ZlibFactory.isNativeZlibLoaded(conf));
Decompressor zlibDecompressor = ZlibFactory.getZlibDecompressor(conf);
assertNotNull("zlibDecompressor is null!", zlibDecompressor);
assertTrue("ZlibFactory returned unexpected inflator",
代码示例来源:origin: org.apache.hadoop/hadoop-common
public GzipZlibCompressor(Configuration conf) {
super(ZlibFactory.getCompressionLevel(conf),
ZlibFactory.getCompressionStrategy(conf),
ZlibCompressor.CompressionHeader.GZIP_FORMAT,
64 * 1024);
}
}
代码示例来源: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: io.prestosql.hadoop/hadoop-apache
zlibLoaded = ZlibFactory.isNativeZlibLoaded(conf);
if (zlibLoaded) {
zlibLibraryName = ZlibFactory.getLibraryName();
代码示例来源:origin: ch.cern.hadoop/hadoop-common
conf.setBoolean(CommonConfigurationKeys.IO_NATIVE_LIB_AVAILABLE_KEY, useNative);
if (useNative) {
if (!ZlibFactory.isNativeZlibLoaded(conf)) {
LOG.warn("testGzipCodecWrite skipped: native libs not loaded");
return;
ZlibFactory.isNativeZlibLoaded(conf));
Compressor zlibCompressor = ZlibFactory.getZlibCompressor(conf);
assertNotNull("zlibCompressor is null!", zlibCompressor);
assertTrue("ZlibFactory returned unexpected deflator",
代码示例来源: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));
}
本文整理了Java中org.apache.hadoop.io.compress.zlib.ZlibFactory.setCompressionLevel()方法的一些代码示例,展示了ZlibFacto
本文整理了Java中org.apache.hadoop.io.compress.zlib.ZlibFactory.getZlibDecompressorType()方法的一些代码示例,展示了ZlibF
本文整理了Java中org.apache.hadoop.io.compress.zlib.ZlibFactory.getZlibDirectDecompressor()方法的一些代码示例,展示了Zli
本文整理了Java中org.apache.hadoop.io.compress.zlib.ZlibFactory.getZlibCompressorType()方法的一些代码示例,展示了ZlibFac
本文整理了Java中org.apache.hadoop.io.compress.zlib.ZlibFactory.setCompressionStrategy()方法的一些代码示例,展示了ZlibFa
本文整理了Java中org.apache.hadoop.io.compress.zlib.ZlibFactory.getCompressionStrategy()方法的一些代码示例,展示了ZlibFa
本文整理了Java中org.apache.hadoop.io.compress.zlib.ZlibFactory.getZlibDecompressor()方法的一些代码示例,展示了ZlibFacto
本文整理了Java中org.apache.hadoop.io.compress.zlib.ZlibFactory.getLibraryName()方法的一些代码示例,展示了ZlibFactory.ge
本文整理了Java中org.apache.hadoop.io.compress.zlib.ZlibFactory.getZlibCompressor()方法的一些代码示例,展示了ZlibFactory
本文整理了Java中org.apache.hadoop.io.compress.zlib.ZlibFactory.getCompressionLevel()方法的一些代码示例,展示了ZlibFacto
本文整理了Java中org.apache.hadoop.io.compress.zlib.ZlibFactory.isNativeZlibLoaded()方法的一些代码示例,展示了ZlibFactor
我是一名优秀的程序员,十分优秀!