blob: 31a1a082de348cc4efc99d17c772e5957b32060e [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_292) on Tue Jun 15 06:00:54 GMT 2021 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>FileOutputFormat (Apache Hadoop Main 3.3.1 API)</title>
<meta name="date" content="2021-06-15">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="FileOutputFormat (Apache Hadoop Main 3.3.1 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":9,"i2":10,"i3":10,"i4":9,"i5":9,"i6":9,"i7":9,"i8":6,"i9":9,"i10":9,"i11":9,"i12":9,"i13":9,"i14":9};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/FileOutputFormat.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputCommitter.html" title="class in org.apache.hadoop.mapreduce.lib.output"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormatCounter.html" title="enum in org.apache.hadoop.mapreduce.lib.output"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html" target="_top">Frames</a></li>
<li><a href="FileOutputFormat.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.hadoop.mapreduce.lib.output</div>
<h2 title="Class FileOutputFormat" class="title">Class FileOutputFormat&lt;K,V&gt;</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../../../../org/apache/hadoop/mapreduce/OutputFormat.html" title="class in org.apache.hadoop.mapreduce">org.apache.hadoop.mapreduce.OutputFormat</a>&lt;K,V&gt;</li>
<li>
<ul class="inheritance">
<li>org.apache.hadoop.mapreduce.lib.output.FileOutputFormat&lt;K,V&gt;</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/MapFileOutputFormat.html" title="class in org.apache.hadoop.mapreduce.lib.output">MapFileOutputFormat</a>, <a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/SequenceFileOutputFormat.html" title="class in org.apache.hadoop.mapreduce.lib.output">SequenceFileOutputFormat</a>, <a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/TextOutputFormat.html" title="class in org.apache.hadoop.mapreduce.lib.output">TextOutputFormat</a></dd>
</dl>
<hr>
<br>
<pre>@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract class <span class="typeNameLabel">FileOutputFormat&lt;K,V&gt;</span>
extends <a href="../../../../../../org/apache/hadoop/mapreduce/OutputFormat.html" title="class in org.apache.hadoop.mapreduce">OutputFormat</a>&lt;K,V&gt;</pre>
<div class="block">A base class for <a href="../../../../../../org/apache/hadoop/mapreduce/OutputFormat.html" title="class in org.apache.hadoop.mapreduce"><code>OutputFormat</code></a>s that read from <a href="../../../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs"><code>FileSystem</code></a>s.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html#BASE_OUTPUT_NAME">BASE_OUTPUT_NAME</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html#COMPRESS">COMPRESS</a></span></code>
<div class="block">Configuration option: should output be compressed? "mapreduce.output.fileoutputformat.compress".</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html#COMPRESS_CODEC">COMPRESS_CODEC</a></span></code>
<div class="block">If compression is enabled, name of codec: "mapreduce.output.fileoutputformat.compress.codec".</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html#COMPRESS_TYPE">COMPRESS_TYPE</a></span></code>
<div class="block">Type of compression "mapreduce.output.fileoutputformat.compress.type": NONE, RECORD, BLOCK.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html#OUTDIR">OUTDIR</a></span></code>
<div class="block">Destination directory of work: "mapreduce.output.fileoutputformat.outputdir".</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html#PART">PART</a></span></code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html#FileOutputFormat--">FileOutputFormat</a></span>()</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html#checkOutputSpecs-org.apache.hadoop.mapreduce.JobContext-">checkOutputSpecs</a></span>(<a href="../../../../../../org/apache/hadoop/mapreduce/JobContext.html" title="interface in org.apache.hadoop.mapreduce">JobContext</a>&nbsp;job)</code>
<div class="block">Check for validity of the output-specification for the job.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html#getCompressOutput-org.apache.hadoop.mapreduce.JobContext-">getCompressOutput</a></span>(<a href="../../../../../../org/apache/hadoop/mapreduce/JobContext.html" title="interface in org.apache.hadoop.mapreduce">JobContext</a>&nbsp;job)</code>
<div class="block">Is the job output compressed?</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html#getDefaultWorkFile-org.apache.hadoop.mapreduce.TaskAttemptContext-java.lang.String-">getDefaultWorkFile</a></span>(<a href="../../../../../../org/apache/hadoop/mapreduce/TaskAttemptContext.html" title="interface in org.apache.hadoop.mapreduce">TaskAttemptContext</a>&nbsp;context,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;extension)</code>
<div class="block">Get the default path and filename for the output format.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/hadoop/mapreduce/OutputCommitter.html" title="class in org.apache.hadoop.mapreduce">OutputCommitter</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html#getOutputCommitter-org.apache.hadoop.mapreduce.TaskAttemptContext-">getOutputCommitter</a></span>(<a href="../../../../../../org/apache/hadoop/mapreduce/TaskAttemptContext.html" title="interface in org.apache.hadoop.mapreduce">TaskAttemptContext</a>&nbsp;context)</code>
<div class="block">Get the output committer for this output format.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;? extends <a href="../../../../../../org/apache/hadoop/io/compress/CompressionCodec.html" title="interface in org.apache.hadoop.io.compress">CompressionCodec</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html#getOutputCompressorClass-org.apache.hadoop.mapreduce.JobContext-java.lang.Class-">getOutputCompressorClass</a></span>(<a href="../../../../../../org/apache/hadoop/mapreduce/JobContext.html" title="interface in org.apache.hadoop.mapreduce">JobContext</a>&nbsp;job,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;? extends <a href="../../../../../../org/apache/hadoop/io/compress/CompressionCodec.html" title="interface in org.apache.hadoop.io.compress">CompressionCodec</a>&gt;&nbsp;defaultValue)</code>
<div class="block">Get the <a href="../../../../../../org/apache/hadoop/io/compress/CompressionCodec.html" title="interface in org.apache.hadoop.io.compress"><code>CompressionCodec</code></a> for compressing the job outputs.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>protected static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html#getOutputName-org.apache.hadoop.mapreduce.JobContext-">getOutputName</a></span>(<a href="../../../../../../org/apache/hadoop/mapreduce/JobContext.html" title="interface in org.apache.hadoop.mapreduce">JobContext</a>&nbsp;job)</code>
<div class="block">Get the base output name for the output file.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>static <a href="../../../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html#getOutputPath-org.apache.hadoop.mapreduce.JobContext-">getOutputPath</a></span>(<a href="../../../../../../org/apache/hadoop/mapreduce/JobContext.html" title="interface in org.apache.hadoop.mapreduce">JobContext</a>&nbsp;job)</code>
<div class="block">Get the <a href="../../../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs"><code>Path</code></a> to the output directory for the map-reduce job.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html#getPathForWorkFile-org.apache.hadoop.mapreduce.TaskInputOutputContext-java.lang.String-java.lang.String-">getPathForWorkFile</a></span>(<a href="../../../../../../org/apache/hadoop/mapreduce/TaskInputOutputContext.html" title="interface in org.apache.hadoop.mapreduce">TaskInputOutputContext</a>&lt;?,?,?,?&gt;&nbsp;context,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;extension)</code>
<div class="block">Helper function to generate a <a href="../../../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs"><code>Path</code></a> for a file that is unique for
the task within the job output directory.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>abstract <a href="../../../../../../org/apache/hadoop/mapreduce/RecordWriter.html" title="class in org.apache.hadoop.mapreduce">RecordWriter</a>&lt;<a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html" title="type parameter in FileOutputFormat">K</a>,<a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html" title="type parameter in FileOutputFormat">V</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html#getRecordWriter-org.apache.hadoop.mapreduce.TaskAttemptContext-">getRecordWriter</a></span>(<a href="../../../../../../org/apache/hadoop/mapreduce/TaskAttemptContext.html" title="interface in org.apache.hadoop.mapreduce">TaskAttemptContext</a>&nbsp;job)</code>
<div class="block">Get the <a href="../../../../../../org/apache/hadoop/mapreduce/RecordWriter.html" title="class in org.apache.hadoop.mapreduce"><code>RecordWriter</code></a> for the given task.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html#getUniqueFile-org.apache.hadoop.mapreduce.TaskAttemptContext-java.lang.String-java.lang.String-">getUniqueFile</a></span>(<a href="../../../../../../org/apache/hadoop/mapreduce/TaskAttemptContext.html" title="interface in org.apache.hadoop.mapreduce">TaskAttemptContext</a>&nbsp;context,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;extension)</code>
<div class="block">Generate a unique filename, based on the task id, name, and extension</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>static <a href="../../../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html#getWorkOutputPath-org.apache.hadoop.mapreduce.TaskInputOutputContext-">getWorkOutputPath</a></span>(<a href="../../../../../../org/apache/hadoop/mapreduce/TaskInputOutputContext.html" title="interface in org.apache.hadoop.mapreduce">TaskInputOutputContext</a>&lt;?,?,?,?&gt;&nbsp;context)</code>
<div class="block">Get the <a href="../../../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs"><code>Path</code></a> to the task's temporary output directory
for the map-reduce job
<b id="SideEffectFiles">Tasks' Side-Effect Files</b></div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html#setCompressOutput-org.apache.hadoop.mapreduce.Job-boolean-">setCompressOutput</a></span>(<a href="../../../../../../org/apache/hadoop/mapreduce/Job.html" title="class in org.apache.hadoop.mapreduce">Job</a>&nbsp;job,
boolean&nbsp;compress)</code>
<div class="block">Set whether the output of the job is compressed.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html#setOutputCompressorClass-org.apache.hadoop.mapreduce.Job-java.lang.Class-">setOutputCompressorClass</a></span>(<a href="../../../../../../org/apache/hadoop/mapreduce/Job.html" title="class in org.apache.hadoop.mapreduce">Job</a>&nbsp;job,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;? extends <a href="../../../../../../org/apache/hadoop/io/compress/CompressionCodec.html" title="interface in org.apache.hadoop.io.compress">CompressionCodec</a>&gt;&nbsp;codecClass)</code>
<div class="block">Set the <a href="../../../../../../org/apache/hadoop/io/compress/CompressionCodec.html" title="interface in org.apache.hadoop.io.compress"><code>CompressionCodec</code></a> to be used to compress job outputs.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>protected static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html#setOutputName-org.apache.hadoop.mapreduce.JobContext-java.lang.String-">setOutputName</a></span>(<a href="../../../../../../org/apache/hadoop/mapreduce/JobContext.html" title="interface in org.apache.hadoop.mapreduce">JobContext</a>&nbsp;job,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</code>
<div class="block">Set the base output name for output file to be created.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html#setOutputPath-org.apache.hadoop.mapreduce.Job-org.apache.hadoop.fs.Path-">setOutputPath</a></span>(<a href="../../../../../../org/apache/hadoop/mapreduce/Job.html" title="class in org.apache.hadoop.mapreduce">Job</a>&nbsp;job,
<a href="../../../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;outputDir)</code>
<div class="block">Set the <a href="../../../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs"><code>Path</code></a> of the output directory for the map-reduce job.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="BASE_OUTPUT_NAME">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>BASE_OUTPUT_NAME</h4>
<pre>protected static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> BASE_OUTPUT_NAME</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../constant-values.html#org.apache.hadoop.mapreduce.lib.output.FileOutputFormat.BASE_OUTPUT_NAME">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="PART">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>PART</h4>
<pre>protected static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> PART</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../constant-values.html#org.apache.hadoop.mapreduce.lib.output.FileOutputFormat.PART">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="COMPRESS">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>COMPRESS</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> COMPRESS</pre>
<div class="block">Configuration option: should output be compressed? "mapreduce.output.fileoutputformat.compress".</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../constant-values.html#org.apache.hadoop.mapreduce.lib.output.FileOutputFormat.COMPRESS">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="COMPRESS_CODEC">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>COMPRESS_CODEC</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> COMPRESS_CODEC</pre>
<div class="block">If compression is enabled, name of codec: "mapreduce.output.fileoutputformat.compress.codec".</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../constant-values.html#org.apache.hadoop.mapreduce.lib.output.FileOutputFormat.COMPRESS_CODEC">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="COMPRESS_TYPE">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>COMPRESS_TYPE</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> COMPRESS_TYPE</pre>
<div class="block">Type of compression "mapreduce.output.fileoutputformat.compress.type": NONE, RECORD, BLOCK.
Generally only used in <code>SequenceFileOutputFormat</code>.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../constant-values.html#org.apache.hadoop.mapreduce.lib.output.FileOutputFormat.COMPRESS_TYPE">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="OUTDIR">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>OUTDIR</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> OUTDIR</pre>
<div class="block">Destination directory of work: "mapreduce.output.fileoutputformat.outputdir".</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../constant-values.html#org.apache.hadoop.mapreduce.lib.output.FileOutputFormat.OUTDIR">Constant Field Values</a></dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="FileOutputFormat--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>FileOutputFormat</h4>
<pre>public&nbsp;FileOutputFormat()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="setCompressOutput-org.apache.hadoop.mapreduce.Job-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setCompressOutput</h4>
<pre>public static&nbsp;void&nbsp;setCompressOutput(<a href="../../../../../../org/apache/hadoop/mapreduce/Job.html" title="class in org.apache.hadoop.mapreduce">Job</a>&nbsp;job,
boolean&nbsp;compress)</pre>
<div class="block">Set whether the output of the job is compressed.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>job</code> - the job to modify</dd>
<dd><code>compress</code> - should the output of the job be compressed?</dd>
</dl>
</li>
</ul>
<a name="getCompressOutput-org.apache.hadoop.mapreduce.JobContext-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCompressOutput</h4>
<pre>public static&nbsp;boolean&nbsp;getCompressOutput(<a href="../../../../../../org/apache/hadoop/mapreduce/JobContext.html" title="interface in org.apache.hadoop.mapreduce">JobContext</a>&nbsp;job)</pre>
<div class="block">Is the job output compressed?</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>job</code> - the Job to look in</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>true</code> if the job output should be compressed,
<code>false</code> otherwise</dd>
</dl>
</li>
</ul>
<a name="setOutputCompressorClass-org.apache.hadoop.mapreduce.Job-java.lang.Class-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setOutputCompressorClass</h4>
<pre>public static&nbsp;void&nbsp;setOutputCompressorClass(<a href="../../../../../../org/apache/hadoop/mapreduce/Job.html" title="class in org.apache.hadoop.mapreduce">Job</a>&nbsp;job,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;? extends <a href="../../../../../../org/apache/hadoop/io/compress/CompressionCodec.html" title="interface in org.apache.hadoop.io.compress">CompressionCodec</a>&gt;&nbsp;codecClass)</pre>
<div class="block">Set the <a href="../../../../../../org/apache/hadoop/io/compress/CompressionCodec.html" title="interface in org.apache.hadoop.io.compress"><code>CompressionCodec</code></a> to be used to compress job outputs.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>job</code> - the job to modify</dd>
<dd><code>codecClass</code> - the <a href="../../../../../../org/apache/hadoop/io/compress/CompressionCodec.html" title="interface in org.apache.hadoop.io.compress"><code>CompressionCodec</code></a> to be used to
compress the job outputs</dd>
</dl>
</li>
</ul>
<a name="getOutputCompressorClass-org.apache.hadoop.mapreduce.JobContext-java.lang.Class-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getOutputCompressorClass</h4>
<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;? extends <a href="../../../../../../org/apache/hadoop/io/compress/CompressionCodec.html" title="interface in org.apache.hadoop.io.compress">CompressionCodec</a>&gt;&nbsp;getOutputCompressorClass(<a href="../../../../../../org/apache/hadoop/mapreduce/JobContext.html" title="interface in org.apache.hadoop.mapreduce">JobContext</a>&nbsp;job,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;? extends <a href="../../../../../../org/apache/hadoop/io/compress/CompressionCodec.html" title="interface in org.apache.hadoop.io.compress">CompressionCodec</a>&gt;&nbsp;defaultValue)</pre>
<div class="block">Get the <a href="../../../../../../org/apache/hadoop/io/compress/CompressionCodec.html" title="interface in org.apache.hadoop.io.compress"><code>CompressionCodec</code></a> for compressing the job outputs.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>job</code> - the <a href="../../../../../../org/apache/hadoop/mapreduce/Job.html" title="class in org.apache.hadoop.mapreduce"><code>Job</code></a> to look in</dd>
<dd><code>defaultValue</code> - the <a href="../../../../../../org/apache/hadoop/io/compress/CompressionCodec.html" title="interface in org.apache.hadoop.io.compress"><code>CompressionCodec</code></a> to return if not set</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <a href="../../../../../../org/apache/hadoop/io/compress/CompressionCodec.html" title="interface in org.apache.hadoop.io.compress"><code>CompressionCodec</code></a> to be used to compress the
job outputs</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if the class was specified, but not found</dd>
</dl>
</li>
</ul>
<a name="getRecordWriter-org.apache.hadoop.mapreduce.TaskAttemptContext-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRecordWriter</h4>
<pre>public abstract&nbsp;<a href="../../../../../../org/apache/hadoop/mapreduce/RecordWriter.html" title="class in org.apache.hadoop.mapreduce">RecordWriter</a>&lt;<a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html" title="type parameter in FileOutputFormat">K</a>,<a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html" title="type parameter in FileOutputFormat">V</a>&gt;&nbsp;getRecordWriter(<a href="../../../../../../org/apache/hadoop/mapreduce/TaskAttemptContext.html" title="interface in org.apache.hadoop.mapreduce">TaskAttemptContext</a>&nbsp;job)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../../../org/apache/hadoop/mapreduce/OutputFormat.html#getRecordWriter-org.apache.hadoop.mapreduce.TaskAttemptContext-">OutputFormat</a></code></span></div>
<div class="block">Get the <a href="../../../../../../org/apache/hadoop/mapreduce/RecordWriter.html" title="class in org.apache.hadoop.mapreduce"><code>RecordWriter</code></a> for the given task.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../org/apache/hadoop/mapreduce/OutputFormat.html#getRecordWriter-org.apache.hadoop.mapreduce.TaskAttemptContext-">getRecordWriter</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../org/apache/hadoop/mapreduce/OutputFormat.html" title="class in org.apache.hadoop.mapreduce">OutputFormat</a>&lt;<a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html" title="type parameter in FileOutputFormat">K</a>,<a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html" title="type parameter in FileOutputFormat">V</a>&gt;</code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>job</code> - the information about the current task.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a <a href="../../../../../../org/apache/hadoop/mapreduce/RecordWriter.html" title="class in org.apache.hadoop.mapreduce"><code>RecordWriter</code></a> to write the output for the job.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></code></dd>
</dl>
</li>
</ul>
<a name="checkOutputSpecs-org.apache.hadoop.mapreduce.JobContext-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>checkOutputSpecs</h4>
<pre>public&nbsp;void&nbsp;checkOutputSpecs(<a href="../../../../../../org/apache/hadoop/mapreduce/JobContext.html" title="interface in org.apache.hadoop.mapreduce">JobContext</a>&nbsp;job)
throws <a href="../../../../../../org/apache/hadoop/mapred/FileAlreadyExistsException.html" title="class in org.apache.hadoop.mapred">FileAlreadyExistsException</a>,
<a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../../../org/apache/hadoop/mapreduce/OutputFormat.html#checkOutputSpecs-org.apache.hadoop.mapreduce.JobContext-">OutputFormat</a></code></span></div>
<div class="block">Check for validity of the output-specification for the job.
<p>This is to validate the output specification for the job when it is
a job is submitted. Typically checks that it does not already exist,
throwing an exception when it already exists, so that output is not
overwritten.</p>
Implementations which write to filesystems which support delegation
tokens usually collect the tokens for the destination path(s)
and attach them to the job context's JobConf.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../org/apache/hadoop/mapreduce/OutputFormat.html#checkOutputSpecs-org.apache.hadoop.mapreduce.JobContext-">checkOutputSpecs</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../org/apache/hadoop/mapreduce/OutputFormat.html" title="class in org.apache.hadoop.mapreduce">OutputFormat</a>&lt;<a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html" title="type parameter in FileOutputFormat">K</a>,<a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html" title="type parameter in FileOutputFormat">V</a>&gt;</code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>job</code> - information about the job</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - when output should not be attempted</dd>
<dd><code><a href="../../../../../../org/apache/hadoop/mapred/FileAlreadyExistsException.html" title="class in org.apache.hadoop.mapred">FileAlreadyExistsException</a></code></dd>
</dl>
</li>
</ul>
<a name="setOutputPath-org.apache.hadoop.mapreduce.Job-org.apache.hadoop.fs.Path-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setOutputPath</h4>
<pre>public static&nbsp;void&nbsp;setOutputPath(<a href="../../../../../../org/apache/hadoop/mapreduce/Job.html" title="class in org.apache.hadoop.mapreduce">Job</a>&nbsp;job,
<a href="../../../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;outputDir)</pre>
<div class="block">Set the <a href="../../../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs"><code>Path</code></a> of the output directory for the map-reduce job.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>job</code> - The job to modify</dd>
<dd><code>outputDir</code> - the <a href="../../../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs"><code>Path</code></a> of the output directory for
the map-reduce job.</dd>
</dl>
</li>
</ul>
<a name="getOutputPath-org.apache.hadoop.mapreduce.JobContext-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getOutputPath</h4>
<pre>public static&nbsp;<a href="../../../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;getOutputPath(<a href="../../../../../../org/apache/hadoop/mapreduce/JobContext.html" title="interface in org.apache.hadoop.mapreduce">JobContext</a>&nbsp;job)</pre>
<div class="block">Get the <a href="../../../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs"><code>Path</code></a> to the output directory for the map-reduce job.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <a href="../../../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs"><code>Path</code></a> to the output directory for the map-reduce job.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html#getWorkOutputPath-org.apache.hadoop.mapreduce.TaskInputOutputContext-"><code>getWorkOutputPath(TaskInputOutputContext)</code></a></dd>
</dl>
</li>
</ul>
<a name="getWorkOutputPath-org.apache.hadoop.mapreduce.TaskInputOutputContext-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getWorkOutputPath</h4>
<pre>public static&nbsp;<a href="../../../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;getWorkOutputPath(<a href="../../../../../../org/apache/hadoop/mapreduce/TaskInputOutputContext.html" title="interface in org.apache.hadoop.mapreduce">TaskInputOutputContext</a>&lt;?,?,?,?&gt;&nbsp;context)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></pre>
<div class="block">Get the <a href="../../../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs"><code>Path</code></a> to the task's temporary output directory
for the map-reduce job
<b id="SideEffectFiles">Tasks' Side-Effect Files</b>
<p>Some applications need to create/write-to side-files, which differ from
the actual job-outputs.
<p>In such cases there could be issues with 2 instances of the same TIP
(running simultaneously e.g. speculative tasks) trying to open/write-to the
same file (path) on HDFS. Hence the application-writer will have to pick
unique names per task-attempt (e.g. using the attemptid, say
<tt>attempt_200709221812_0001_m_000000_0</tt>), not just per TIP.</p>
<p>To get around this the Map-Reduce framework helps the application-writer
out by maintaining a special
<tt>${mapreduce.output.fileoutputformat.outputdir}/_temporary/_${taskid}</tt>
sub-directory for each task-attempt on HDFS where the output of the
task-attempt goes. On successful completion of the task-attempt the files
in the <tt>${mapreduce.output.fileoutputformat.outputdir}/_temporary/_${taskid}</tt> (only)
are <i>promoted</i> to <tt>${mapreduce.output.fileoutputformat.outputdir}</tt>. Of course, the
framework discards the sub-directory of unsuccessful task-attempts. This
is completely transparent to the application.</p>
<p>The application-writer can take advantage of this by creating any
side-files required in a work directory during execution
of his task i.e. via
<a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html#getWorkOutputPath-org.apache.hadoop.mapreduce.TaskInputOutputContext-"><code>getWorkOutputPath(TaskInputOutputContext)</code></a>, and
the framework will move them out similarly - thus she doesn't have to pick
unique paths per task-attempt.</p>
<p>The entire discussion holds true for maps of jobs with
reducer=NONE (i.e. 0 reduces) since output of the map, in that case,
goes directly to HDFS.</p></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <a href="../../../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs"><code>Path</code></a> to the task's temporary output directory
for the map-reduce job.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></code></dd>
</dl>
</li>
</ul>
<a name="getPathForWorkFile-org.apache.hadoop.mapreduce.TaskInputOutputContext-java.lang.String-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPathForWorkFile</h4>
<pre>public static&nbsp;<a href="../../../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;getPathForWorkFile(<a href="../../../../../../org/apache/hadoop/mapreduce/TaskInputOutputContext.html" title="interface in org.apache.hadoop.mapreduce">TaskInputOutputContext</a>&lt;?,?,?,?&gt;&nbsp;context,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;extension)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></pre>
<div class="block">Helper function to generate a <a href="../../../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs"><code>Path</code></a> for a file that is unique for
the task within the job output directory.
<p>The path can be used to create custom files from within the map and
reduce tasks. The path name will be unique for each task. The path parent
will be the job output directory.</p>ls
<p>This method uses the <a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html#getUniqueFile-org.apache.hadoop.mapreduce.TaskAttemptContext-java.lang.String-java.lang.String-"><code>getUniqueFile(org.apache.hadoop.mapreduce.TaskAttemptContext, java.lang.String, java.lang.String)</code></a> method to make the file name
unique for the task.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>context</code> - the context for the task.</dd>
<dd><code>name</code> - the name for the file.</dd>
<dd><code>extension</code> - the extension for the file</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a unique path accross all tasks of the job.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></code></dd>
</dl>
</li>
</ul>
<a name="getUniqueFile-org.apache.hadoop.mapreduce.TaskAttemptContext-java.lang.String-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getUniqueFile</h4>
<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getUniqueFile(<a href="../../../../../../org/apache/hadoop/mapreduce/TaskAttemptContext.html" title="interface in org.apache.hadoop.mapreduce">TaskAttemptContext</a>&nbsp;context,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;extension)</pre>
<div class="block">Generate a unique filename, based on the task id, name, and extension</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>context</code> - the task that is calling this</dd>
<dd><code>name</code> - the base filename</dd>
<dd><code>extension</code> - the filename extension</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a string like $name-[mrsct]-$id$extension</dd>
</dl>
</li>
</ul>
<a name="getDefaultWorkFile-org.apache.hadoop.mapreduce.TaskAttemptContext-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDefaultWorkFile</h4>
<pre>public&nbsp;<a href="../../../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;getDefaultWorkFile(<a href="../../../../../../org/apache/hadoop/mapreduce/TaskAttemptContext.html" title="interface in org.apache.hadoop.mapreduce">TaskAttemptContext</a>&nbsp;context,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;extension)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Get the default path and filename for the output format.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>context</code> - the task context</dd>
<dd><code>extension</code> - an extension to add to the filename</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a full path $output/_temporary/$taskid/part-[mr]-$id</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="getOutputName-org.apache.hadoop.mapreduce.JobContext-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getOutputName</h4>
<pre>protected static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getOutputName(<a href="../../../../../../org/apache/hadoop/mapreduce/JobContext.html" title="interface in org.apache.hadoop.mapreduce">JobContext</a>&nbsp;job)</pre>
<div class="block">Get the base output name for the output file.</div>
</li>
</ul>
<a name="setOutputName-org.apache.hadoop.mapreduce.JobContext-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setOutputName</h4>
<pre>protected static&nbsp;void&nbsp;setOutputName(<a href="../../../../../../org/apache/hadoop/mapreduce/JobContext.html" title="interface in org.apache.hadoop.mapreduce">JobContext</a>&nbsp;job,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</pre>
<div class="block">Set the base output name for output file to be created.</div>
</li>
</ul>
<a name="getOutputCommitter-org.apache.hadoop.mapreduce.TaskAttemptContext-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getOutputCommitter</h4>
<pre>public&nbsp;<a href="../../../../../../org/apache/hadoop/mapreduce/OutputCommitter.html" title="class in org.apache.hadoop.mapreduce">OutputCommitter</a>&nbsp;getOutputCommitter(<a href="../../../../../../org/apache/hadoop/mapreduce/TaskAttemptContext.html" title="interface in org.apache.hadoop.mapreduce">TaskAttemptContext</a>&nbsp;context)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../../../org/apache/hadoop/mapreduce/OutputFormat.html#getOutputCommitter-org.apache.hadoop.mapreduce.TaskAttemptContext-">OutputFormat</a></code></span></div>
<div class="block">Get the output committer for this output format. This is responsible
for ensuring the output is committed correctly.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../org/apache/hadoop/mapreduce/OutputFormat.html#getOutputCommitter-org.apache.hadoop.mapreduce.TaskAttemptContext-">getOutputCommitter</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../org/apache/hadoop/mapreduce/OutputFormat.html" title="class in org.apache.hadoop.mapreduce">OutputFormat</a>&lt;<a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html" title="type parameter in FileOutputFormat">K</a>,<a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html" title="type parameter in FileOutputFormat">V</a>&gt;</code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>context</code> - the task context</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an output committer</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/FileOutputFormat.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputCommitter.html" title="class in org.apache.hadoop.mapreduce.lib.output"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../../org/apache/hadoop/mapreduce/lib/output/FileOutputFormatCounter.html" title="enum in org.apache.hadoop.mapreduce.lib.output"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.html" target="_top">Frames</a></li>
<li><a href="FileOutputFormat.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2021 <a href="https://www.apache.org">Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>