/** * Create a compression instance based on the user's configuration in the given * Configuration object. * @throws IOException if the specified codec is not available. */ static FSImageCompression createCompression(Configuration conf) throws IOException { boolean compressImage = conf.getBoolean( DFSConfigKeys.DFS_IMAGE_COMPRESS_KEY, DFSConfigKeys.DFS_IMAGE_COMPRESS_DEFAULT); if (!compressImage) { return createNoopCompression(); } String codecClassName = conf.get( DFSConfigKeys.DFS_IMAGE_COMPRESSION_CODEC_KEY, DFSConfigKeys.DFS_IMAGE_COMPRESSION_CODEC_DEFAULT); return createCompression(conf, codecClassName); }
/** * Create a compression instance based on a header read from an input stream. * @throws IOException if the specified codec is not available or the * underlying IO fails. */ static FSImageCompression readCompressionHeader( Configuration conf, DataInput in) throws IOException { boolean isCompressed = in.readBoolean(); if (!isCompressed) { return createNoopCompression(); } else { String codecClassName = Text.readString(in); return createCompression(conf, codecClassName); } }
compression = FSImageCompression.readCompressionHeader(conf, in); } else { compression = FSImageCompression.createNoopCompression();
/** * Create a compression instance based on the user's configuration in the given * Configuration object. * @throws IOException if the specified codec is not available. */ static FSImageCompression createCompression(Configuration conf) throws IOException { boolean compressImage = conf.getBoolean( DFSConfigKeys.DFS_IMAGE_COMPRESS_KEY, DFSConfigKeys.DFS_IMAGE_COMPRESS_DEFAULT); if (!compressImage) { return createNoopCompression(); } String codecClassName = conf.get( DFSConfigKeys.DFS_IMAGE_COMPRESSION_CODEC_KEY, DFSConfigKeys.DFS_IMAGE_COMPRESSION_CODEC_DEFAULT); return createCompression(conf, codecClassName); }
/** * Create a compression instance based on the user's configuration in the given * Configuration object. * @throws IOException if the specified codec is not available. */ static FSImageCompression createCompression(Configuration conf, boolean forceUncompressed) throws IOException { boolean compressImage = (!forceUncompressed) && conf.getBoolean( HdfsConstants.DFS_IMAGE_COMPRESS_KEY, HdfsConstants.DFS_IMAGE_COMPRESS_DEFAULT); if (!compressImage) { return createNoopCompression(); } String codecClassName = conf.get( HdfsConstants.DFS_IMAGE_COMPRESSION_CODEC_KEY, HdfsConstants.DFS_IMAGE_COMPRESSION_CODEC_DEFAULT); return createCompression(conf, codecClassName); }
/** * Create a compression instance based on the user's configuration in the given * Configuration object. * @throws IOException if the specified codec is not available. */ static FSImageCompression createCompression(Configuration conf) throws IOException { boolean compressImage = conf.getBoolean( DFSConfigKeys.DFS_IMAGE_COMPRESS_KEY, DFSConfigKeys.DFS_IMAGE_COMPRESS_DEFAULT); if (!compressImage) { return createNoopCompression(); } String codecClassName = conf.get( DFSConfigKeys.DFS_IMAGE_COMPRESSION_CODEC_KEY, DFSConfigKeys.DFS_IMAGE_COMPRESSION_CODEC_DEFAULT); return createCompression(conf, codecClassName); }
/** * Create a compression instance based on a header read from an input stream. * @throws IOException if the specified codec is not available or the * underlying IO fails. */ static FSImageCompression readCompressionHeader( Configuration conf, DataInputStream dis) throws IOException { boolean isCompressed = dis.readBoolean(); if (!isCompressed) { return createNoopCompression(); } else { String codecClassName = Text.readString(dis); return createCompression(conf, codecClassName); } }
/** * Create a compression instance based on a header read from an input stream. * @throws IOException if the specified codec is not available or the * underlying IO fails. */ static FSImageCompression readCompressionHeader( Configuration conf, DataInput in) throws IOException { boolean isCompressed = in.readBoolean(); if (!isCompressed) { return createNoopCompression(); } else { String codecClassName = Text.readString(in); return createCompression(conf, codecClassName); } }
/** * Create a compression instance based on a header read from an input stream. * @throws IOException if the specified codec is not available or the * underlying IO fails. */ static FSImageCompression readCompressionHeader( Configuration conf, DataInput in) throws IOException { boolean isCompressed = in.readBoolean(); if (!isCompressed) { return createNoopCompression(); } else { String codecClassName = Text.readString(in); return createCompression(conf, codecClassName); } }
compression = FSImageCompression.readCompressionHeader(conf, in); } else { compression = FSImageCompression.createNoopCompression();
compression = FSImageCompression.readCompressionHeader(conf, in); } else { compression = FSImageCompression.createNoopCompression();
compression = FSImageCompression.readCompressionHeader(conf, in); } else { compression = FSImageCompression.createNoopCompression();