本文整理匯總了Java中org.apache.hadoop.mapred.FileOutputFormat.getCompressOutput方法的典型用法代碼示例。如果您正苦於以下問題:Java FileOutputFormat.getCompressOutput方法的具體用法?Java FileOutputFormat.getCompressOutput怎麽用?Java FileOutputFormat.getCompressOutput使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.hadoop.mapred.FileOutputFormat
的用法示例。
在下文中一共展示了FileOutputFormat.getCompressOutput方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createCompressedStream
import org.apache.hadoop.mapred.FileOutputFormat; //導入方法依賴的package包/類
/**
* Convert an output stream to a compressed output stream based on codecs and compression options
* specified in the Job Configuration.
*
* @param jc
* Job Configuration
* @param out
* Output Stream to be converted into compressed output stream
* @return compressed output stream
*/
public static OutputStream createCompressedStream(JobConf jc, OutputStream out)
throws IOException {
boolean isCompressed = FileOutputFormat.getCompressOutput(jc);
return createCompressedStream(jc, out, isCompressed);
}
示例2: createSequenceWriter
import org.apache.hadoop.mapred.FileOutputFormat; //導入方法依賴的package包/類
/**
* Create a sequencefile output stream based on job configuration.
*
* @param jc
* Job configuration
* @param fs
* File System to create file in
* @param file
* Path to be created
* @param keyClass
* Java Class for key
* @param valClass
* Java Class for value
* @return output stream over the created sequencefile
*/
public static SequenceFile.Writer createSequenceWriter(JobConf jc, FileSystem fs, Path file,
Class<?> keyClass, Class<?> valClass, Progressable progressable) throws IOException {
boolean isCompressed = FileOutputFormat.getCompressOutput(jc);
return createSequenceWriter(jc, fs, file, keyClass, valClass, isCompressed, progressable);
}