當前位置: 首頁>>代碼示例>>Java>>正文


Java FileOutputFormat.getCompressOutput方法代碼示例

本文整理匯總了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);
}
 
開發者ID:mini666,項目名稱:hive-phoenix-handler,代碼行數:16,代碼來源:Utilities.java

示例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);
}
 
開發者ID:mini666,項目名稱:hive-phoenix-handler,代碼行數:21,代碼來源:Utilities.java


注:本文中的org.apache.hadoop.mapred.FileOutputFormat.getCompressOutput方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。