| <!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_151-google-v7) on Tue Oct 02 14:37:31 PDT 2018 --> |
| <title>Coder (Apache Beam 2.7.0-SNAPSHOT)</title> |
| <meta name="date" content="2018-10-02"> |
| <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="Coder (Apache Beam 2.7.0-SNAPSHOT)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var methods = {"i0":10,"i1":6,"i2":42,"i3":6,"i4":42,"i5":6,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":6,"i12":9,"i13":9}; |
| var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated 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/coders/CannotProvideCoderException.ReasonCode.html" title="enum in org.apache.beam.sdk.coders"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../../org/apache/beam/sdk/coders/Coder.Context.html" title="class in org.apache.beam.sdk.coders"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/apache/beam/sdk/coders/Coder.html" target="_top">Frames</a></li> |
| <li><a href="Coder.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../../allclasses-noframe.html">All 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: </li> |
| <li><a href="#nested.class.summary">Nested</a> | </li> |
| <li>Field | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </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.coders</div> |
| <h2 title="Class Coder" class="title">Class Coder<T></h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li>java.lang.Object</li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.apache.beam.sdk.coders.Coder<T></li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>T</code> - the type of values being encoded and decoded</dd> |
| </dl> |
| <dl> |
| <dt>All Implemented Interfaces:</dt> |
| <dd>java.io.Serializable</dd> |
| </dl> |
| <dl> |
| <dt>Direct Known Subclasses:</dt> |
| <dd><a href="../../../../../org/apache/beam/sdk/coders/CustomCoder.html" title="class in org.apache.beam.sdk.coders">CustomCoder</a>, <a href="../../../../../org/apache/beam/sdk/io/aws/sns/PublishResultCoder.html" title="class in org.apache.beam.sdk.io.aws.sns">PublishResultCoder</a>, <a href="../../../../../org/apache/beam/sdk/coders/StructuredCoder.html" title="class in org.apache.beam.sdk.coders">StructuredCoder</a></dd> |
| </dl> |
| <hr> |
| <br> |
| <pre>public abstract class <span class="typeNameLabel">Coder<T></span> |
| extends java.lang.Object |
| implements java.io.Serializable</pre> |
| <div class="block">A <a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders"><code>Coder<T></code></a> defines how to encode and decode values of type <code>T</code> into |
| byte streams. |
| |
| <p><a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders"><code>Coder</code></a> instances are serialized during job creation and deserialized before use. This |
| will generally be performed by serializing the object via Java Serialization. |
| |
| <p><a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders"><code>Coder</code></a> classes for compound types are often composed from coder classes for types |
| contains therein. The composition of <a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders"><code>Coder</code></a> instances into a coder for the compound class |
| is the subject of the <a href="../../../../../org/apache/beam/sdk/coders/CoderProvider.html" title="class in org.apache.beam.sdk.coders"><code>CoderProvider</code></a> type, which enables automatic generic composition of |
| <a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders"><code>Coder</code></a> classes within the <a href="../../../../../org/apache/beam/sdk/coders/CoderRegistry.html" title="class in org.apache.beam.sdk.coders"><code>CoderRegistry</code></a>. See <a href="../../../../../org/apache/beam/sdk/coders/CoderProvider.html" title="class in org.apache.beam.sdk.coders"><code>CoderProvider</code></a> and <a href="../../../../../org/apache/beam/sdk/coders/CoderRegistry.html" title="class in org.apache.beam.sdk.coders"><code>CoderRegistry</code></a> for more information about how coders are inferred. |
| |
| <p>All methods of a <a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders"><code>Coder</code></a> are required to be thread safe.</div> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../../serialized-form.html#org.apache.beam.sdk.coders.Coder">Serialized Form</a></dd> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ======== NESTED CLASS SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="nested.class.summary"> |
| <!-- --> |
| </a> |
| <h3>Nested Class Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation"> |
| <caption><span>Nested Classes</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Class and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static class </code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/coders/Coder.Context.html" title="class in org.apache.beam.sdk.coders">Coder.Context</a></span></code> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> |
| <div class="block"><span class="deprecationComment">To implement a coder, do not use any <a href="../../../../../org/apache/beam/sdk/coders/Coder.Context.html" title="class in org.apache.beam.sdk.coders"><code>Coder.Context</code></a>. Just implement only those |
| abstract methods which do not accept a <a href="../../../../../org/apache/beam/sdk/coders/Coder.Context.html" title="class in org.apache.beam.sdk.coders"><code>Coder.Context</code></a> and leave the default |
| implementations for methods accepting a <a href="../../../../../org/apache/beam/sdk/coders/Coder.Context.html" title="class in org.apache.beam.sdk.coders"><code>Coder.Context</code></a>.</span></div> |
| </div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static class </code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/coders/Coder.NonDeterministicException.html" title="class in org.apache.beam.sdk.coders">Coder.NonDeterministicException</a></span></code> |
| <div class="block">Exception thrown by <a href="../../../../../org/apache/beam/sdk/coders/Coder.html#verifyDeterministic--"><code>verifyDeterministic()</code></a> if the encoding is not deterministic, |
| including details of why the encoding is not deterministic.</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"> </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/coders/Coder.html#Coder--">Coder</a></span>()</code> </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"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd"> </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>boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/coders/Coder.html#consistentWithEquals--">consistentWithEquals</a></span>()</code> |
| <div class="block">Returns <code>true</code> if this <a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders"><code>Coder</code></a> is injective with respect to <code>Object.equals(java.lang.Object)</code>.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>abstract <a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="type parameter in Coder">T</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/coders/Coder.html#decode-java.io.InputStream-">decode</a></span>(java.io.InputStream inStream)</code> |
| <div class="block">Decodes a value of type <code>T</code> from the given input stream in the given context.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code><a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="type parameter in Coder">T</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/coders/Coder.html#decode-java.io.InputStream-org.apache.beam.sdk.coders.Coder.Context-">decode</a></span>(java.io.InputStream inStream, |
| <a href="../../../../../org/apache/beam/sdk/coders/Coder.Context.html" title="class in org.apache.beam.sdk.coders">Coder.Context</a> context)</code> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> |
| <div class="block"><span class="deprecationComment">only implement and call <a href="../../../../../org/apache/beam/sdk/coders/Coder.html#decode-java.io.InputStream-"><code>decode(InputStream)</code></a></span></div> |
| </div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>abstract void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/coders/Coder.html#encode-T-java.io.OutputStream-">encode</a></span>(<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="type parameter in Coder">T</a> value, |
| java.io.OutputStream outStream)</code> |
| <div class="block">Encodes the given value of type <code>T</code> onto the given output stream.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/coders/Coder.html#encode-T-java.io.OutputStream-org.apache.beam.sdk.coders.Coder.Context-">encode</a></span>(<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="type parameter in Coder">T</a> value, |
| java.io.OutputStream outStream, |
| <a href="../../../../../org/apache/beam/sdk/coders/Coder.Context.html" title="class in org.apache.beam.sdk.coders">Coder.Context</a> context)</code> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> |
| <div class="block"><span class="deprecationComment">only implement and call <a href="../../../../../org/apache/beam/sdk/coders/Coder.html#encode-T-java.io.OutputStream-"><code>encode(Object value, OutputStream)</code></a></span></div> |
| </div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>abstract java.util.List<? extends <a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders">Coder</a><?>></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/coders/Coder.html#getCoderArguments--">getCoderArguments</a></span>()</code> |
| <div class="block">If this is a <a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders"><code>Coder</code></a> for a parameterized type, returns the list of <a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders"><code>Coder</code></a>s being |
| used for each of the parameters in the same order they appear within the parameterized type's |
| type signature.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>protected long</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/coders/Coder.html#getEncodedElementByteSize-T-">getEncodedElementByteSize</a></span>(<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="type parameter in Coder">T</a> value)</code> |
| <div class="block">Returns the size in bytes of the encoded value using this coder.</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../../org/apache/beam/sdk/values/TypeDescriptor.html" title="class in org.apache.beam.sdk.values">TypeDescriptor</a><<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="type parameter in Coder">T</a>></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/coders/Coder.html#getEncodedTypeDescriptor--">getEncodedTypeDescriptor</a></span>()</code> |
| <div class="block">Returns the <a href="../../../../../org/apache/beam/sdk/values/TypeDescriptor.html" title="class in org.apache.beam.sdk.values"><code>TypeDescriptor</code></a> for the type encoded.</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/coders/Coder.html#isRegisterByteSizeObserverCheap-T-">isRegisterByteSizeObserverCheap</a></span>(<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="type parameter in Coder">T</a> value)</code> |
| <div class="block">Returns whether <a href="../../../../../org/apache/beam/sdk/coders/Coder.html#registerByteSizeObserver-T-org.apache.beam.sdk.util.common.ElementByteSizeObserver-"><code>registerByteSizeObserver(T, org.apache.beam.sdk.util.common.ElementByteSizeObserver)</code></a> cheap enough to call for every element, that |
| is, if this <code>Coder</code> can calculate the byte size of the element to be coded in roughly |
| constant time (or lazily).</div> |
| </td> |
| </tr> |
| <tr id="i9" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/coders/Coder.html#registerByteSizeObserver-T-org.apache.beam.sdk.util.common.ElementByteSizeObserver-">registerByteSizeObserver</a></span>(<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="type parameter in Coder">T</a> value, |
| org.apache.beam.sdk.util.common.ElementByteSizeObserver observer)</code> |
| <div class="block">Notifies the <code>ElementByteSizeObserver</code> about the byte size of the encoded value using |
| this <code>Coder</code>.</div> |
| </td> |
| </tr> |
| <tr id="i10" class="altColor"> |
| <td class="colFirst"><code>java.lang.Object</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/coders/Coder.html#structuralValue-T-">structuralValue</a></span>(<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="type parameter in Coder">T</a> value)</code> |
| <div class="block">Returns an object with an <code>Object.equals()</code> method that represents structural equality on |
| the argument.</div> |
| </td> |
| </tr> |
| <tr id="i11" class="rowColor"> |
| <td class="colFirst"><code>abstract void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/coders/Coder.html#verifyDeterministic--">verifyDeterministic</a></span>()</code> |
| <div class="block">Throw <a href="../../../../../org/apache/beam/sdk/coders/Coder.NonDeterministicException.html" title="class in org.apache.beam.sdk.coders"><code>Coder.NonDeterministicException</code></a> if the coding is not deterministic.</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/beam/sdk/coders/Coder.html#verifyDeterministic-org.apache.beam.sdk.coders.Coder-java.lang.String-org.apache.beam.sdk.coders.Coder...-">verifyDeterministic</a></span>(<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders">Coder</a><?> target, |
| java.lang.String message, |
| <a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders">Coder</a><?>... coders)</code> |
| <div class="block">Verifies all of the provided coders are deterministic.</div> |
| </td> |
| </tr> |
| <tr id="i13" class="rowColor"> |
| <td class="colFirst"><code>static void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/coders/Coder.html#verifyDeterministic-org.apache.beam.sdk.coders.Coder-java.lang.String-java.lang.Iterable-">verifyDeterministic</a></span>(<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders">Coder</a><?> target, |
| java.lang.String message, |
| java.lang.Iterable<<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders">Coder</a><?>> coders)</code> |
| <div class="block">Verifies all of the provided coders are deterministic.</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 java.lang.Object</h3> |
| <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a name="Coder--"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>Coder</h4> |
| <pre>public Coder()</pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="encode-java.lang.Object-java.io.OutputStream-"> |
| <!-- --> |
| </a><a name="encode-T-java.io.OutputStream-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>encode</h4> |
| <pre>public abstract void encode(<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="type parameter in Coder">T</a> value, |
| java.io.OutputStream outStream) |
| throws <a href="../../../../../org/apache/beam/sdk/coders/CoderException.html" title="class in org.apache.beam.sdk.coders">CoderException</a>, |
| java.io.IOException</pre> |
| <div class="block">Encodes the given value of type <code>T</code> onto the given output stream.</div> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.io.IOException</code> - if writing to the <code>OutputStream</code> fails for some reason</dd> |
| <dd><code><a href="../../../../../org/apache/beam/sdk/coders/CoderException.html" title="class in org.apache.beam.sdk.coders">CoderException</a></code> - if the value could not be encoded for some reason</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="encode-java.lang.Object-java.io.OutputStream-org.apache.beam.sdk.coders.Coder.Context-"> |
| <!-- --> |
| </a><a name="encode-T-java.io.OutputStream-org.apache.beam.sdk.coders.Coder.Context-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>encode</h4> |
| <pre>@Deprecated |
| <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#CODER_CONTEXT">CODER_CONTEXT</a>) |
| public void encode(<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="type parameter in Coder">T</a> value, |
| java.io.OutputStream outStream, |
| <a href="../../../../../org/apache/beam/sdk/coders/Coder.Context.html" title="class in org.apache.beam.sdk.coders">Coder.Context</a> context) |
| throws <a href="../../../../../org/apache/beam/sdk/coders/CoderException.html" title="class in org.apache.beam.sdk.coders">CoderException</a>, |
| java.io.IOException</pre> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> <span class="deprecationComment">only implement and call <a href="../../../../../org/apache/beam/sdk/coders/Coder.html#encode-T-java.io.OutputStream-"><code>encode(Object value, OutputStream)</code></a></span></div> |
| <div class="block">Encodes the given value of type <code>T</code> onto the given output stream in the given context.</div> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.io.IOException</code> - if writing to the <code>OutputStream</code> fails for some reason</dd> |
| <dd><code><a href="../../../../../org/apache/beam/sdk/coders/CoderException.html" title="class in org.apache.beam.sdk.coders">CoderException</a></code> - if the value could not be encoded for some reason</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="decode-java.io.InputStream-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>decode</h4> |
| <pre>public abstract <a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="type parameter in Coder">T</a> decode(java.io.InputStream inStream) |
| throws <a href="../../../../../org/apache/beam/sdk/coders/CoderException.html" title="class in org.apache.beam.sdk.coders">CoderException</a>, |
| java.io.IOException</pre> |
| <div class="block">Decodes a value of type <code>T</code> from the given input stream in the given context. Returns the |
| decoded value.</div> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.io.IOException</code> - if reading from the <code>InputStream</code> fails for some reason</dd> |
| <dd><code><a href="../../../../../org/apache/beam/sdk/coders/CoderException.html" title="class in org.apache.beam.sdk.coders">CoderException</a></code> - if the value could not be decoded for some reason</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="decode-java.io.InputStream-org.apache.beam.sdk.coders.Coder.Context-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>decode</h4> |
| <pre>@Deprecated |
| <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#CODER_CONTEXT">CODER_CONTEXT</a>) |
| public <a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="type parameter in Coder">T</a> decode(java.io.InputStream inStream, |
| <a href="../../../../../org/apache/beam/sdk/coders/Coder.Context.html" title="class in org.apache.beam.sdk.coders">Coder.Context</a> context) |
| throws <a href="../../../../../org/apache/beam/sdk/coders/CoderException.html" title="class in org.apache.beam.sdk.coders">CoderException</a>, |
| java.io.IOException</pre> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> <span class="deprecationComment">only implement and call <a href="../../../../../org/apache/beam/sdk/coders/Coder.html#decode-java.io.InputStream-"><code>decode(InputStream)</code></a></span></div> |
| <div class="block">Decodes a value of type <code>T</code> from the given input stream in the given context. Returns the |
| decoded value.</div> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.io.IOException</code> - if reading from the <code>InputStream</code> fails for some reason</dd> |
| <dd><code><a href="../../../../../org/apache/beam/sdk/coders/CoderException.html" title="class in org.apache.beam.sdk.coders">CoderException</a></code> - if the value could not be decoded for some reason</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getCoderArguments--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getCoderArguments</h4> |
| <pre>public abstract java.util.List<? extends <a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders">Coder</a><?>> getCoderArguments()</pre> |
| <div class="block">If this is a <a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders"><code>Coder</code></a> for a parameterized type, returns the list of <a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders"><code>Coder</code></a>s being |
| used for each of the parameters in the same order they appear within the parameterized type's |
| type signature. If this cannot be done, or this <a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders"><code>Coder</code></a> does not encode/decode a |
| parameterized type, returns the empty list.</div> |
| </li> |
| </ul> |
| <a name="verifyDeterministic--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>verifyDeterministic</h4> |
| <pre>public abstract void verifyDeterministic() |
| throws <a href="../../../../../org/apache/beam/sdk/coders/Coder.NonDeterministicException.html" title="class in org.apache.beam.sdk.coders">Coder.NonDeterministicException</a></pre> |
| <div class="block">Throw <a href="../../../../../org/apache/beam/sdk/coders/Coder.NonDeterministicException.html" title="class in org.apache.beam.sdk.coders"><code>Coder.NonDeterministicException</code></a> if the coding is not deterministic. |
| |
| <p>In order for a <code>Coder</code> to be considered deterministic, the following must be true: |
| |
| <ul> |
| <li>two values that compare as equal (via <code>Object.equals()</code> or <code>Comparable.compareTo()</code>, if supported) have the same encoding. |
| <li>the <code>Coder</code> always produces a canonical encoding, which is the same for an instance |
| of an object even if produced on different computers at different times. |
| </ul></div> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="../../../../../org/apache/beam/sdk/coders/Coder.NonDeterministicException.html" title="class in org.apache.beam.sdk.coders">Coder.NonDeterministicException</a></code> - if this coder is not deterministic.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="verifyDeterministic-org.apache.beam.sdk.coders.Coder-java.lang.String-java.lang.Iterable-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>verifyDeterministic</h4> |
| <pre>public static void verifyDeterministic(<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders">Coder</a><?> target, |
| java.lang.String message, |
| java.lang.Iterable<<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders">Coder</a><?>> coders) |
| throws <a href="../../../../../org/apache/beam/sdk/coders/Coder.NonDeterministicException.html" title="class in org.apache.beam.sdk.coders">Coder.NonDeterministicException</a></pre> |
| <div class="block">Verifies all of the provided coders are deterministic. If any are not, throws a <a href="../../../../../org/apache/beam/sdk/coders/Coder.NonDeterministicException.html" title="class in org.apache.beam.sdk.coders"><code>Coder.NonDeterministicException</code></a> for the <code>target</code> <a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders"><code>Coder</code></a>.</div> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="../../../../../org/apache/beam/sdk/coders/Coder.NonDeterministicException.html" title="class in org.apache.beam.sdk.coders">Coder.NonDeterministicException</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="verifyDeterministic-org.apache.beam.sdk.coders.Coder-java.lang.String-org.apache.beam.sdk.coders.Coder...-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>verifyDeterministic</h4> |
| <pre>public static void verifyDeterministic(<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders">Coder</a><?> target, |
| java.lang.String message, |
| <a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders">Coder</a><?>... coders) |
| throws <a href="../../../../../org/apache/beam/sdk/coders/Coder.NonDeterministicException.html" title="class in org.apache.beam.sdk.coders">Coder.NonDeterministicException</a></pre> |
| <div class="block">Verifies all of the provided coders are deterministic. If any are not, throws a <a href="../../../../../org/apache/beam/sdk/coders/Coder.NonDeterministicException.html" title="class in org.apache.beam.sdk.coders"><code>Coder.NonDeterministicException</code></a> for the <code>target</code> <a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders"><code>Coder</code></a>.</div> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="../../../../../org/apache/beam/sdk/coders/Coder.NonDeterministicException.html" title="class in org.apache.beam.sdk.coders">Coder.NonDeterministicException</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="consistentWithEquals--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>consistentWithEquals</h4> |
| <pre>public boolean consistentWithEquals()</pre> |
| <div class="block">Returns <code>true</code> if this <a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders"><code>Coder</code></a> is injective with respect to <code>Object.equals(java.lang.Object)</code>. |
| |
| <p>Whenever the encoded bytes of two values are equal, then the original values are equal |
| according to <code>Objects.equals()</code>. Note that this is well-defined for <code>null</code>. |
| |
| <p>This condition is most notably false for arrays. More generally, this condition is false |
| whenever <code>equals()</code> compares object identity, rather than performing a |
| semantic/structural comparison. |
| |
| <p>By default, returns false.</div> |
| </li> |
| </ul> |
| <a name="structuralValue-java.lang.Object-"> |
| <!-- --> |
| </a><a name="structuralValue-T-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>structuralValue</h4> |
| <pre>public java.lang.Object structuralValue(<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="type parameter in Coder">T</a> value)</pre> |
| <div class="block">Returns an object with an <code>Object.equals()</code> method that represents structural equality on |
| the argument. |
| |
| <p>For any two values <code>x</code> and <code>y</code> of type <code>T</code>, if their encoded bytes are the |
| same, then it must be the case that <code>structuralValue(x).equals(structuralValue(y))</code>. |
| |
| <p>Most notably: |
| |
| <ul> |
| <li>The structural value for an array coder should perform a structural comparison of the |
| contents of the arrays, rather than the default behavior of comparing according to object |
| identity. |
| <li>The structural value for a coder accepting <code>null</code> should be a proper object with an |
| <code>equals()</code> method, even if the input value is <code>null</code>. |
| </ul> |
| |
| <p>See also <a href="../../../../../org/apache/beam/sdk/coders/Coder.html#consistentWithEquals--"><code>consistentWithEquals()</code></a>. |
| |
| <p>By default, if this coder is <a href="../../../../../org/apache/beam/sdk/coders/Coder.html#consistentWithEquals--"><code>consistentWithEquals()</code></a>, and the value is not null, |
| returns the provided object. Otherwise, encodes the value into a <code>byte[]</code>, and returns an |
| object that performs array equality on the encoded bytes.</div> |
| </li> |
| </ul> |
| <a name="isRegisterByteSizeObserverCheap-java.lang.Object-"> |
| <!-- --> |
| </a><a name="isRegisterByteSizeObserverCheap-T-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isRegisterByteSizeObserverCheap</h4> |
| <pre>public boolean isRegisterByteSizeObserverCheap(<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="type parameter in Coder">T</a> value)</pre> |
| <div class="block">Returns whether <a href="../../../../../org/apache/beam/sdk/coders/Coder.html#registerByteSizeObserver-T-org.apache.beam.sdk.util.common.ElementByteSizeObserver-"><code>registerByteSizeObserver(T, org.apache.beam.sdk.util.common.ElementByteSizeObserver)</code></a> cheap enough to call for every element, that |
| is, if this <code>Coder</code> can calculate the byte size of the element to be coded in roughly |
| constant time (or lazily). |
| |
| <p>Not intended to be called by user code, but instead by <a href="../../../../../org/apache/beam/sdk/PipelineRunner.html" title="class in org.apache.beam.sdk"><code>PipelineRunner</code></a> |
| implementations. |
| |
| <p>By default, returns false. The default <a href="../../../../../org/apache/beam/sdk/coders/Coder.html#registerByteSizeObserver-T-org.apache.beam.sdk.util.common.ElementByteSizeObserver-"><code>registerByteSizeObserver(T, org.apache.beam.sdk.util.common.ElementByteSizeObserver)</code></a> implementation |
| invokes <a href="../../../../../org/apache/beam/sdk/coders/Coder.html#getEncodedElementByteSize-T-"><code>getEncodedElementByteSize(T)</code></a> which requires re-encoding an element unless it is |
| overridden. This is considered expensive.</div> |
| </li> |
| </ul> |
| <a name="registerByteSizeObserver-java.lang.Object-org.apache.beam.sdk.util.common.ElementByteSizeObserver-"> |
| <!-- --> |
| </a><a name="registerByteSizeObserver-T-org.apache.beam.sdk.util.common.ElementByteSizeObserver-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>registerByteSizeObserver</h4> |
| <pre>public void registerByteSizeObserver(<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="type parameter in Coder">T</a> value, |
| org.apache.beam.sdk.util.common.ElementByteSizeObserver observer) |
| throws java.lang.Exception</pre> |
| <div class="block">Notifies the <code>ElementByteSizeObserver</code> about the byte size of the encoded value using |
| this <code>Coder</code>. |
| |
| <p>Not intended to be called by user code, but instead by <a href="../../../../../org/apache/beam/sdk/PipelineRunner.html" title="class in org.apache.beam.sdk"><code>PipelineRunner</code></a> |
| implementations. |
| |
| <p>By default, this notifies <code>observer</code> about the byte size of the encoded value using |
| this coder as returned by <a href="../../../../../org/apache/beam/sdk/coders/Coder.html#getEncodedElementByteSize-T-"><code>getEncodedElementByteSize(T)</code></a>.</div> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.lang.Exception</code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getEncodedElementByteSize-java.lang.Object-"> |
| <!-- --> |
| </a><a name="getEncodedElementByteSize-T-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getEncodedElementByteSize</h4> |
| <pre>protected long getEncodedElementByteSize(<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="type parameter in Coder">T</a> value) |
| throws java.lang.Exception</pre> |
| <div class="block">Returns the size in bytes of the encoded value using this coder.</div> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.lang.Exception</code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getEncodedTypeDescriptor--"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>getEncodedTypeDescriptor</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#CODER_TYPE_ENCODING">CODER_TYPE_ENCODING</a>) |
| public <a href="../../../../../org/apache/beam/sdk/values/TypeDescriptor.html" title="class in org.apache.beam.sdk.values">TypeDescriptor</a><<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="type parameter in Coder">T</a>> getEncodedTypeDescriptor()</pre> |
| <div class="block">Returns the <a href="../../../../../org/apache/beam/sdk/values/TypeDescriptor.html" title="class in org.apache.beam.sdk.values"><code>TypeDescriptor</code></a> for the type encoded.</div> |
| </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/coders/CannotProvideCoderException.ReasonCode.html" title="enum in org.apache.beam.sdk.coders"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../../org/apache/beam/sdk/coders/Coder.Context.html" title="class in org.apache.beam.sdk.coders"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/apache/beam/sdk/coders/Coder.html" target="_top">Frames</a></li> |
| <li><a href="Coder.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../../allclasses-noframe.html">All 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: </li> |
| <li><a href="#nested.class.summary">Nested</a> | </li> |
| <li>Field | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </body> |
| </html> |