blob: 13f26080078a51a2e81048704d40ec8fd74615d0 [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 -->
<title>FileBasedSink.WriteOperation (Apache Beam 2.38.0-SNAPSHOT)</title>
<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="FileBasedSink.WriteOperation (Apache Beam 2.38.0-SNAPSHOT)";
}
}
catch(err) {
}
//-->
var methods = {"i0":9,"i1":6,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10};
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="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/beam/sdk/io/FileBasedSink.WritableByteChannelFactory.html" title="interface in org.apache.beam.sdk.io"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.Writer.html" title="class in org.apache.beam.sdk.io"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html" target="_top">Frames</a></li>
<li><a href="FileBasedSink.WriteOperation.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.beam.sdk.io</div>
<h2 title="Class FileBasedSink.WriteOperation" class="title">Class FileBasedSink.WriteOperation&lt;DestinationT,OutputT&gt;</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.beam.sdk.io.FileBasedSink.WriteOperation&lt;DestinationT,OutputT&gt;</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>OutputT</code> - the type of values written to the sink.</dd>
</dl>
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>java.io.Serializable</dd>
</dl>
<dl>
<dt>Enclosing class:</dt>
<dd><a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.html" title="class in org.apache.beam.sdk.io">FileBasedSink</a>&lt;<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.html" title="type parameter in FileBasedSink">UserT</a>,<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.html" title="type parameter in FileBasedSink">DestinationT</a>,<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.html" title="type parameter in FileBasedSink">OutputT</a>&gt;</dd>
</dl>
<hr>
<br>
<pre>public abstract static class <span class="typeNameLabel">FileBasedSink.WriteOperation&lt;DestinationT,OutputT&gt;</span>
extends java.lang.Object
implements java.io.Serializable</pre>
<div class="block">Abstract operation that manages the process of writing to <a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.html" title="class in org.apache.beam.sdk.io"><code>FileBasedSink</code></a>.
<p>The primary responsibilities of the WriteOperation is the management of output files. During
a write, <a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.Writer.html" title="class in org.apache.beam.sdk.io"><code>FileBasedSink.Writer</code></a>s write bundles to temporary file locations. After the bundles have been
written,
<ol>
<li><a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html#finalizeDestination-DestinationT-org.apache.beam.sdk.transforms.windowing.BoundedWindow-java.lang.Integer-java.util.Collection-"><code>finalizeDestination(DestinationT, org.apache.beam.sdk.transforms.windowing.BoundedWindow, java.lang.Integer, java.util.Collection&lt;org.apache.beam.sdk.io.FileBasedSink.FileResult&lt;DestinationT&gt;&gt;)</code></a> is given a list of the temporary files
containing the output bundles.
<li>During finalize, these temporary files are copied to final output locations and named
according to a file naming template.
<li>Finally, any temporary files that were created during the write are removed.
</ol>
<p>Subclass implementations of WriteOperation must implement <a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html#createWriter--"><code>createWriter()</code></a> to return a concrete FileBasedSinkWriter.
<h2>Temporary and Output File Naming:</h2>
<p>During the write, bundles are written to temporary files using the tempDirectory that can be
provided via the constructor of WriteOperation. These temporary files will be named <code>{tempDirectory}/{bundleId}</code>, where bundleId is the unique id of the bundle. For example, if
tempDirectory is "gs://my-bucket/my_temp_output", the output for a bundle with bundle id 15723
will be "gs://my-bucket/my_temp_output/15723".
<p>Final output files are written to the location specified by the <a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.FilenamePolicy.html" title="class in org.apache.beam.sdk.io"><code>FileBasedSink.FilenamePolicy</code></a>. If
no filename policy is specified, then the <a href="../../../../../org/apache/beam/sdk/io/DefaultFilenamePolicy.html" title="class in org.apache.beam.sdk.io"><code>DefaultFilenamePolicy</code></a> will be used. The
directory that the files are written to is determined by the <a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.FilenamePolicy.html" title="class in org.apache.beam.sdk.io"><code>FileBasedSink.FilenamePolicy</code></a> instance.
<p>Note that in the case of permanent failure of a bundle's write, no clean up of temporary
files will occur.
<p>If there are no elements in the PCollection being written, no output will be generated.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../serialized-form.html#org.apache.beam.sdk.io.FileBasedSink.WriteOperation">Serialized Form</a></dd>
</dl>
</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 <a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.html" title="class in org.apache.beam.sdk.io">FileBasedSink</a>&lt;?,<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html" title="type parameter in FileBasedSink.WriteOperation">DestinationT</a>,<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html" title="type parameter in FileBasedSink.WriteOperation">OutputT</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html#sink">sink</a></span></code>
<div class="block">The Sink that this WriteOperation will write to.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html#windowedWrites">windowedWrites</a></span></code>
<div class="block">Whether windowed writes are being used.</div>
</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/beam/sdk/io/FileBasedSink.WriteOperation.html#WriteOperation-org.apache.beam.sdk.io.FileBasedSink-">WriteOperation</a></span>(<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.html" title="class in org.apache.beam.sdk.io">FileBasedSink</a>&lt;?,<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html" title="type parameter in FileBasedSink.WriteOperation">DestinationT</a>,<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html" title="type parameter in FileBasedSink.WriteOperation">OutputT</a>&gt;&nbsp;sink)</code>
<div class="block">Constructs a WriteOperation using the default strategy for generating a temporary directory
from the base output filename.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html#WriteOperation-org.apache.beam.sdk.io.FileBasedSink-org.apache.beam.sdk.io.fs.ResourceId-">WriteOperation</a></span>(<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.html" title="class in org.apache.beam.sdk.io">FileBasedSink</a>&lt;?,<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html" title="type parameter in FileBasedSink.WriteOperation">DestinationT</a>,<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html" title="type parameter in FileBasedSink.WriteOperation">OutputT</a>&gt;&nbsp;sink,
<a href="../../../../../org/apache/beam/sdk/io/fs/ResourceId.html" title="interface in org.apache.beam.sdk.io.fs">ResourceId</a>&nbsp;tempDirectory)</code>
<div class="block">Create a new WriteOperation.</div>
</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>protected static <a href="../../../../../org/apache/beam/sdk/io/fs/ResourceId.html" title="interface in org.apache.beam.sdk.io.fs">ResourceId</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html#buildTemporaryFilename-org.apache.beam.sdk.io.fs.ResourceId-java.lang.String-">buildTemporaryFilename</a></span>(<a href="../../../../../org/apache/beam/sdk/io/fs/ResourceId.html" title="interface in org.apache.beam.sdk.io.fs">ResourceId</a>&nbsp;tempDirectory,
java.lang.String&nbsp;filename)</code>
<div class="block">Constructs a temporary file resource given the temporary directory and a filename.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>abstract <a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.Writer.html" title="class in org.apache.beam.sdk.io">FileBasedSink.Writer</a>&lt;<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html" title="type parameter in FileBasedSink.WriteOperation">DestinationT</a>,<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html" title="type parameter in FileBasedSink.WriteOperation">OutputT</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html#createWriter--">createWriter</a></span>()</code>
<div class="block">Clients must implement to return a subclass of <a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.Writer.html" title="class in org.apache.beam.sdk.io"><code>FileBasedSink.Writer</code></a>.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>protected java.util.List&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.FileResult.html" title="class in org.apache.beam.sdk.io">FileBasedSink.FileResult</a>&lt;<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html" title="type parameter in FileBasedSink.WriteOperation">DestinationT</a>&gt;,<a href="../../../../../org/apache/beam/sdk/io/fs/ResourceId.html" title="interface in org.apache.beam.sdk.io.fs">ResourceId</a>&gt;&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html#finalizeDestination-DestinationT-org.apache.beam.sdk.transforms.windowing.BoundedWindow-java.lang.Integer-java.util.Collection-">finalizeDestination</a></span>(<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html" title="type parameter in FileBasedSink.WriteOperation">DestinationT</a>&nbsp;dest,
<a href="https://static.javadoc.io/org.checkerframework/checker-qual/3.10.0/org/checkerframework/checker/nullness/qual/Nullable.html?is-external=true" title="class or interface in org.checkerframework.checker.nullness.qual">@Nullable</a> <a href="../../../../../org/apache/beam/sdk/transforms/windowing/BoundedWindow.html" title="class in org.apache.beam.sdk.transforms.windowing">BoundedWindow</a>&nbsp;window,
<a href="https://static.javadoc.io/org.checkerframework/checker-qual/3.10.0/org/checkerframework/checker/nullness/qual/Nullable.html?is-external=true" title="class or interface in org.checkerframework.checker.nullness.qual">@Nullable</a> java.lang.Integer&nbsp;numShards,
java.util.Collection&lt;<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.FileResult.html" title="class in org.apache.beam.sdk.io">FileBasedSink.FileResult</a>&lt;<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html" title="type parameter in FileBasedSink.WriteOperation">DestinationT</a>&gt;&gt;&nbsp;existingResults)</code>&nbsp;</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.html" title="class in org.apache.beam.sdk.io">FileBasedSink</a>&lt;?,<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html" title="type parameter in FileBasedSink.WriteOperation">DestinationT</a>,<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html" title="type parameter in FileBasedSink.WriteOperation">OutputT</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html#getSink--">getSink</a></span>()</code>
<div class="block">Returns the FileBasedSink for this write operation.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/beam/sdk/io/fs/ResourceId.html" title="interface in org.apache.beam.sdk.io.fs">ResourceId</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html#getTempDirectory--">getTempDirectory</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html#removeTemporaryFiles-java.util.Collection-">removeTemporaryFiles</a></span>(java.util.Collection&lt;<a href="../../../../../org/apache/beam/sdk/io/fs/ResourceId.html" title="interface in org.apache.beam.sdk.io.fs">ResourceId</a>&gt;&nbsp;filenames)</code>&nbsp;</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html#setWindowedWrites--">setWindowedWrites</a></span>()</code>
<div class="block">Indicates that the operation will be performing windowed writes.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html#toString--">toString</a></span>()</code>&nbsp;</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.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</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="sink">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sink</h4>
<pre>protected final&nbsp;<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.html" title="class in org.apache.beam.sdk.io">FileBasedSink</a>&lt;?,<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html" title="type parameter in FileBasedSink.WriteOperation">DestinationT</a>,<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html" title="type parameter in FileBasedSink.WriteOperation">OutputT</a>&gt; sink</pre>
<div class="block">The Sink that this WriteOperation will write to.</div>
</li>
</ul>
<a name="windowedWrites">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>windowedWrites</h4>
<pre><a href="../../../../../org/apache/beam/sdk/annotations/Experimental.html" title="annotation in org.apache.beam.sdk.annotations">@Experimental</a>(<a href="../../../../../org/apache/beam/sdk/annotations/Experimental.html#value--">value</a>=<a href="../../../../../org/apache/beam/sdk/annotations/Experimental.Kind.html#FILESYSTEM">FILESYSTEM</a>)
protected&nbsp;boolean windowedWrites</pre>
<div class="block">Whether windowed writes are being used.</div>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="WriteOperation-org.apache.beam.sdk.io.FileBasedSink-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>WriteOperation</h4>
<pre>public&nbsp;WriteOperation(<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.html" title="class in org.apache.beam.sdk.io">FileBasedSink</a>&lt;?,<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html" title="type parameter in FileBasedSink.WriteOperation">DestinationT</a>,<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html" title="type parameter in FileBasedSink.WriteOperation">OutputT</a>&gt;&nbsp;sink)</pre>
<div class="block">Constructs a WriteOperation using the default strategy for generating a temporary directory
from the base output filename.
<p>Without windowing, the default is a uniquely named subdirectory of the provided
tempDirectory, e.g. if tempDirectory is /path/to/foo/, the temporary directory will be
/path/to/foo/.temp-beam-$uuid.
<p>With windowing, the default is a consistent named subdirectory of the provided
tempDirectory, e.g. if tempDirectory is /path/to/foo/, the temporary directory will be
/path/to/foo/.temp-beam. With windowing, unique subdirectories of the tempDirectory are not
beneficial as they cannot be used for cleanup. By using a consistent directory, the created
temp files are well-distributed beneath a common directory prefix, across both worker and
pipeline executions. This is beneficial for filesystems such as GCS which can reuse
autoscaling of the file metadata.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>sink</code> - the FileBasedSink that will be used to configure this write operation.</dd>
</dl>
</li>
</ul>
<a name="WriteOperation-org.apache.beam.sdk.io.FileBasedSink-org.apache.beam.sdk.io.fs.ResourceId-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>WriteOperation</h4>
<pre><a href="../../../../../org/apache/beam/sdk/annotations/Experimental.html" title="annotation in org.apache.beam.sdk.annotations">@Experimental</a>(<a href="../../../../../org/apache/beam/sdk/annotations/Experimental.html#value--">value</a>=<a href="../../../../../org/apache/beam/sdk/annotations/Experimental.Kind.html#FILESYSTEM">FILESYSTEM</a>)
public&nbsp;WriteOperation(<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.html" title="class in org.apache.beam.sdk.io">FileBasedSink</a>&lt;?,<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html" title="type parameter in FileBasedSink.WriteOperation">DestinationT</a>,<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html" title="type parameter in FileBasedSink.WriteOperation">OutputT</a>&gt;&nbsp;sink,
<a href="../../../../../org/apache/beam/sdk/io/fs/ResourceId.html" title="interface in org.apache.beam.sdk.io.fs">ResourceId</a>&nbsp;tempDirectory)</pre>
<div class="block">Create a new WriteOperation.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>sink</code> - the FileBasedSink that will be used to configure this write operation.</dd>
<dd><code>tempDirectory</code> - the base directory to be used for temporary output files.</dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="buildTemporaryFilename-org.apache.beam.sdk.io.fs.ResourceId-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>buildTemporaryFilename</h4>
<pre><a href="../../../../../org/apache/beam/sdk/annotations/Experimental.html" title="annotation in org.apache.beam.sdk.annotations">@Experimental</a>(<a href="../../../../../org/apache/beam/sdk/annotations/Experimental.html#value--">value</a>=<a href="../../../../../org/apache/beam/sdk/annotations/Experimental.Kind.html#FILESYSTEM">FILESYSTEM</a>)
protected static&nbsp;<a href="../../../../../org/apache/beam/sdk/io/fs/ResourceId.html" title="interface in org.apache.beam.sdk.io.fs">ResourceId</a>&nbsp;buildTemporaryFilename(<a href="../../../../../org/apache/beam/sdk/io/fs/ResourceId.html" title="interface in org.apache.beam.sdk.io.fs">ResourceId</a>&nbsp;tempDirectory,
java.lang.String&nbsp;filename)
throws java.io.IOException</pre>
<div class="block">Constructs a temporary file resource given the temporary directory and a filename.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.io.IOException</code></dd>
</dl>
</li>
</ul>
<a name="getTempDirectory--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTempDirectory</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/beam/sdk/io/fs/ResourceId.html" title="interface in org.apache.beam.sdk.io.fs">ResourceId</a>&nbsp;getTempDirectory()</pre>
</li>
</ul>
<a name="createWriter--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createWriter</h4>
<pre>public abstract&nbsp;<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.Writer.html" title="class in org.apache.beam.sdk.io">FileBasedSink.Writer</a>&lt;<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html" title="type parameter in FileBasedSink.WriteOperation">DestinationT</a>,<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html" title="type parameter in FileBasedSink.WriteOperation">OutputT</a>&gt;&nbsp;createWriter()
throws java.lang.Exception</pre>
<div class="block">Clients must implement to return a subclass of <a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.Writer.html" title="class in org.apache.beam.sdk.io"><code>FileBasedSink.Writer</code></a>. This method must not mutate
the state of the object.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.Exception</code></dd>
</dl>
</li>
</ul>
<a name="setWindowedWrites--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setWindowedWrites</h4>
<pre>public&nbsp;void&nbsp;setWindowedWrites()</pre>
<div class="block">Indicates that the operation will be performing windowed writes.</div>
</li>
</ul>
<a name="removeTemporaryFiles-java.util.Collection-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeTemporaryFiles</h4>
<pre>public&nbsp;void&nbsp;removeTemporaryFiles(java.util.Collection&lt;<a href="../../../../../org/apache/beam/sdk/io/fs/ResourceId.html" title="interface in org.apache.beam.sdk.io.fs">ResourceId</a>&gt;&nbsp;filenames)
throws java.io.IOException</pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.io.IOException</code></dd>
</dl>
</li>
</ul>
<a name="finalizeDestination-java.lang.Object-org.apache.beam.sdk.transforms.windowing.BoundedWindow-java.lang.Integer-java.util.Collection-">
<!-- -->
</a><a name="finalizeDestination-DestinationT-org.apache.beam.sdk.transforms.windowing.BoundedWindow-java.lang.Integer-java.util.Collection-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>finalizeDestination</h4>
<pre><a href="../../../../../org/apache/beam/sdk/annotations/Experimental.html" title="annotation in org.apache.beam.sdk.annotations">@Experimental</a>(<a href="../../../../../org/apache/beam/sdk/annotations/Experimental.html#value--">value</a>=<a href="../../../../../org/apache/beam/sdk/annotations/Experimental.Kind.html#FILESYSTEM">FILESYSTEM</a>)
protected final&nbsp;java.util.List&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.FileResult.html" title="class in org.apache.beam.sdk.io">FileBasedSink.FileResult</a>&lt;<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html" title="type parameter in FileBasedSink.WriteOperation">DestinationT</a>&gt;,<a href="../../../../../org/apache/beam/sdk/io/fs/ResourceId.html" title="interface in org.apache.beam.sdk.io.fs">ResourceId</a>&gt;&gt;&nbsp;finalizeDestination(<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html" title="type parameter in FileBasedSink.WriteOperation">DestinationT</a>&nbsp;dest,
<a href="https://static.javadoc.io/org.checkerframework/checker-qual/3.10.0/org/checkerframework/checker/nullness/qual/Nullable.html?is-external=true" title="class or interface in org.checkerframework.checker.nullness.qual">@Nullable</a> <a href="../../../../../org/apache/beam/sdk/transforms/windowing/BoundedWindow.html" title="class in org.apache.beam.sdk.transforms.windowing">BoundedWindow</a>&nbsp;window,
<a href="https://static.javadoc.io/org.checkerframework/checker-qual/3.10.0/org/checkerframework/checker/nullness/qual/Nullable.html?is-external=true" title="class or interface in org.checkerframework.checker.nullness.qual">@Nullable</a> java.lang.Integer&nbsp;numShards,
java.util.Collection&lt;<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.FileResult.html" title="class in org.apache.beam.sdk.io">FileBasedSink.FileResult</a>&lt;<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html" title="type parameter in FileBasedSink.WriteOperation">DestinationT</a>&gt;&gt;&nbsp;existingResults)
throws java.lang.Exception</pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.Exception</code></dd>
</dl>
</li>
</ul>
<a name="getSink--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSink</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.html" title="class in org.apache.beam.sdk.io">FileBasedSink</a>&lt;?,<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html" title="type parameter in FileBasedSink.WriteOperation">DestinationT</a>,<a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html" title="type parameter in FileBasedSink.WriteOperation">OutputT</a>&gt;&nbsp;getSink()</pre>
<div class="block">Returns the FileBasedSink for this write operation.</div>
</li>
</ul>
<a name="toString--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>toString</h4>
<pre>public&nbsp;java.lang.String&nbsp;toString()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>toString</code>&nbsp;in class&nbsp;<code>java.lang.Object</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="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/beam/sdk/io/FileBasedSink.WritableByteChannelFactory.html" title="interface in org.apache.beam.sdk.io"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/beam/sdk/io/FileBasedSink.Writer.html" title="class in org.apache.beam.sdk.io"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/beam/sdk/io/FileBasedSink.WriteOperation.html" target="_top">Frames</a></li>
<li><a href="FileBasedSink.WriteOperation.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 ======= -->
</body>
</html>