This is an automated email from the ASF dual-hosted git repository.

git-site-role pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new e7b02bd8edb Publishing website 2022/09/30 04:17:21 at commit cc623db
e7b02bd8edb is described below

commit e7b02bd8edba3b882aa9d1e192e478ce8911db4e
Author: jenkins <bui...@apache.org>
AuthorDate: Fri Sep 30 04:17:21 2022 +0000

    Publishing website 2022/09/30 04:17:21 at commit cc623db
---
 website/generated-content/documentation/index.xml  | 35 ++++++++++++++++++----
 .../documentation/programming-guide/index.html     | 27 +++++++++++++++--
 2 files changed, 54 insertions(+), 8 deletions(-)

diff --git a/website/generated-content/documentation/index.xml 
b/website/generated-content/documentation/index.xml
index e2f61fc1bba..0b3ef341241 100644
--- a/website/generated-content/documentation/index.xml
+++ b/website/generated-content/documentation/index.xml
@@ -12880,11 +12880,17 @@ version = “v” 1*(DIGIT / “.”) ; For example, 
‘v1.2’&lt;/code>&lt;/pr
 &lt;p>Make sure you have any runtime environment dependencies (like the JRE) 
installed on your local machine. See the expansion service section for more 
details.&lt;/p>
 &lt;/li>
 &lt;li>
-&lt;p>Start up the expansion service for the SDK that is in the language of 
the transform you&amp;rsquo;re trying to consume, if not available.&lt;/p>
-&lt;p>Make sure the transform you&amp;rsquo;re trying to use is available and 
can be used by the expansion service. For Java, make sure the builder and 
registrar for the transform are available in the classpath of the expansion 
service.&lt;/p>
+&lt;p>Start up the expansion service for the SDK that is in the language of 
the transform you&amp;rsquo;re trying to consume, if not available.
+Python provides several classes for automatically starting expansion java 
services such as
+&lt;a 
href="https://beam.apache.org/releases/pydoc/current/apache_beam.transforms.external.html#apache_beam.transforms.external.JavaJarExpansionService";>JavaJarExpansionService&lt;/a>
+and &lt;a 
href="https://beam.apache.org/releases/pydoc/current/apache_beam.transforms.external.html#apache_beam.transforms.external.BeamJarExpansionService";>BeamJarExpansionService&lt;/a>
+which can be passed directly as an expansion service to 
&lt;code>beam.ExternalTransform&lt;/code>.
+Make sure the transform you&amp;rsquo;re trying to use is available and can be 
used by the expansion service.&lt;/p>
+&lt;p>For Java, make sure the builder and registrar for the transform are 
available in the classpath of the expansion service.&lt;/p>
 &lt;/li>
 &lt;li>
-&lt;p>Include &lt;code>ExternalTransform&lt;/code> when instantiating your 
pipeline. Reference the URN, payload, and expansion service. You can use one of 
the available &lt;a 
href="https://beam.apache.org/releases/pydoc/current/apache_beam.transforms.external.html#apache_beam.transforms.external.PayloadBuilder";>&lt;code>PayloadBuilder&lt;/code>&lt;/a>
 classes to build the payload for &lt;code>ExternalTransform&lt;/code>.&lt;/p>
+&lt;p>Include &lt;code>ExternalTransform&lt;/code> when instantiating your 
pipeline. Reference the URN, payload, and expansion service.
+You can use one of the available &lt;a 
href="https://beam.apache.org/releases/pydoc/current/apache_beam.transforms.external.html#apache_beam.transforms.external.PayloadBuilder";>&lt;code>PayloadBuilder&lt;/code>&lt;/a>
 classes to build the payload for &lt;code>ExternalTransform&lt;/code>.&lt;/p>
 &lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-py" 
data-lang="py">&lt;span class="k">with&lt;/span> &lt;span 
class="n">pipeline&lt;/span> &lt;span class="k">as&lt;/span> &lt;span 
class="n">p&lt;/span>&lt;span class="p">:&lt;/span>
 &lt;span class="n">res&lt;/span> &lt;span class="o">=&lt;/span> &lt;span 
class="p">(&lt;/span>
 &lt;span class="n">p&lt;/span>
@@ -12892,14 +12898,33 @@ version = “v” 1*(DIGIT / “.”) ; For example, 
‘v1.2’&lt;/code>&lt;/pr
 &lt;span class="o">|&lt;/span> &lt;span class="n">beam&lt;/span>&lt;span 
class="o">.&lt;/span>&lt;span class="n">ExternalTransform&lt;/span>&lt;span 
class="p">(&lt;/span>
 &lt;span class="n">TEST_PREFIX_URN&lt;/span>&lt;span class="p">,&lt;/span>
 &lt;span class="n">ImplicitSchemaPayloadBuilder&lt;/span>&lt;span 
class="p">({&lt;/span>&lt;span 
class="s1">&amp;#39;data&amp;#39;&lt;/span>&lt;span class="p">:&lt;/span> 
&lt;span class="sa">u&lt;/span>&lt;span 
class="s1">&amp;#39;0&amp;#39;&lt;/span>&lt;span class="p">}),&lt;/span>
-&lt;span class="o">&amp;lt;&lt;/span>&lt;span class="n">Address&lt;/span> 
&lt;span class="n">of&lt;/span> &lt;span class="n">expansion&lt;/span> &lt;span 
class="n">service&lt;/span>&lt;span class="o">&amp;gt;&lt;/span>&lt;span 
class="p">))&lt;/span>
+&lt;span class="o">&amp;lt;&lt;/span>&lt;span class="n">expansion&lt;/span> 
&lt;span class="n">service&lt;/span>&lt;span 
class="o">&amp;gt;&lt;/span>&lt;span class="p">))&lt;/span>
 &lt;span class="n">assert_that&lt;/span>&lt;span class="p">(&lt;/span>&lt;span 
class="n">res&lt;/span>&lt;span class="p">,&lt;/span> &lt;span 
class="n">equal_to&lt;/span>&lt;span class="p">([&lt;/span>&lt;span 
class="s1">&amp;#39;0a&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span> 
&lt;span class="s1">&amp;#39;0b&amp;#39;&lt;/span>&lt;span 
class="p">]))&lt;/span>
 &lt;/code>&lt;/pre>&lt;/div>&lt;p>For additional examples, see &lt;a 
href="https://github.com/apache/beam/blob/master/examples/multi-language/python/addprefix.py";>addprefix.py&lt;/a>
 and &lt;a 
href="https://github.com/apache/beam/blob/master/examples/multi-language/python/javacount.py";>javacount.py&lt;/a>.&lt;/p>
 &lt;/li>
 &lt;li>
-&lt;p>After the job has been submitted to the Beam runner, shut down the 
expansion service by terminating the expansion service process.&lt;/p>
+&lt;p>After the job has been submitted to the Beam runner, shut down any 
manually started expansion services by terminating the expansion service 
process.&lt;/p>
 &lt;/li>
 &lt;/ol>
+&lt;p>&lt;strong>Using the JavaExternalTransform class&lt;/strong>&lt;/p>
+&lt;p>Python has the ability to invoke Java-defined transforms via &lt;a 
href="https://beam.apache.org/releases/pydoc/current/apache_beam.transforms.external.html#apache_beam.transforms.external.JavaExternalTransform";>proxy
 objects&lt;/a>
+as if they were Python transforms.
+These are invoked as follows&lt;/p>
+&lt;pre>&lt;code>```py
+MyJavaTransform = beam.JavaExternalTransform('fully.qualified.ClassName', 
classpath=[jars])
+with pipeline as p:
+res = (
+p
+| beam.Create(['a', 'b']).with_output_types(unicode)
+| MyJavaTransform(javaConstructorArg, ...).builderMethod(...)
+assert_that(res, equal_to(['0a', '0b']))
+```
+&lt;/code>&lt;/pre>
+&lt;p>Python&amp;rsquo;s &lt;code>getattr&lt;/code> method can be used if the 
method names in java are reserved
+Python keywords such as &lt;code>from&lt;/code>.&lt;/p>
+&lt;p>As with other external transforms, either a pre-started expansion 
service can
+be provided, or jar files that include the transform, its dependencies, and
+Beam&amp;rsquo;s expansion service in which case an expansion service will be 
auto-started.&lt;/p>
 &lt;h4 id="1323-using-cross-language-transforms-in-a-go-pipeline">13.2.3. 
Using cross-language transforms in a Go pipeline&lt;/h4>
 &lt;p>If a Go-specific wrapper for a cross-language is available, use that. 
Otherwise, you have to use the
 lower-level &lt;a 
href="https://pkg.go.dev/github.com/apache/beam/sdks/v2/go/pkg/beam#CrossLanguage";>CrossLanguage&lt;/a>
diff --git 
a/website/generated-content/documentation/programming-guide/index.html 
b/website/generated-content/documentation/programming-guide/index.html
index 4623d962365..186fd89d1de 100644
--- a/website/generated-content/documentation/programming-guide/index.html
+++ b/website/generated-content/documentation/programming-guide/index.html
@@ -4791,16 +4791,37 @@ version = “v” 1*(DIGIT / “.”)  ; For example, 
‘v1.2’</code></pre></d
             <span class=n>topics</span><span class=o>=</span><span 
class=p>[</span><span class=bp>self</span><span class=o>.</span><span 
class=n>topic</span><span class=p>],</span>
             <span class=n>max_num_records</span><span class=o>=</span><span 
class=n>max_num_records</span><span class=p>,</span>
             <span class=n>expansion_service</span><span 
class=o>=&lt;</span><span class=n>Address</span> <span class=n>of</span> <span 
class=n>expansion</span> <span class=n>service</span><span 
class=o>&gt;</span><span class=p>))</span>
-</code></pre></div><p><strong>Using the ExternalTransform 
class</strong></p><p>When an SDK-specific wrapper isn&rsquo;t available, you 
will have to access the cross-language transform through the 
<code>ExternalTransform</code> class.</p><ol><li><p>Make sure you have any 
runtime environment dependencies (like the JRE) installed on your local 
machine. See the expansion service section for more 
details.</p></li><li><p>Start up the expansion service for the SDK that is in 
the language of the [...]
+</code></pre></div><p><strong>Using the ExternalTransform 
class</strong></p><p>When an SDK-specific wrapper isn&rsquo;t available, you 
will have to access the cross-language transform through the 
<code>ExternalTransform</code> class.</p><ol><li><p>Make sure you have any 
runtime environment dependencies (like the JRE) installed on your local 
machine. See the expansion service section for more 
details.</p></li><li><p>Start up the expansion service for the SDK that is in 
the language of the [...]
+Python provides several classes for automatically starting expansion java 
services such as
+<a 
href=https://beam.apache.org/releases/pydoc/current/apache_beam.transforms.external.html#apache_beam.transforms.external.JavaJarExpansionService>JavaJarExpansionService</a>
+and <a 
href=https://beam.apache.org/releases/pydoc/current/apache_beam.transforms.external.html#apache_beam.transforms.external.BeamJarExpansionService>BeamJarExpansionService</a>
+which can be passed directly as an expansion service to 
<code>beam.ExternalTransform</code>.
+Make sure the transform you&rsquo;re trying to use is available and can be 
used by the expansion service.</p><p>For Java, make sure the builder and 
registrar for the transform are available in the classpath of the expansion 
service.</p></li><li><p>Include <code>ExternalTransform</code> when 
instantiating your pipeline. Reference the URN, payload, and expansion service.
+You can use one of the available <a 
href=https://beam.apache.org/releases/pydoc/current/apache_beam.transforms.external.html#apache_beam.transforms.external.PayloadBuilder><code>PayloadBuilder</code></a>
 classes to build the payload for <code>ExternalTransform</code>.</p><div 
class=highlight><pre class=chroma><code class=language-py data-lang=py><span 
class=k>with</span> <span class=n>pipeline</span> <span class=k>as</span> <span 
class=n>p</span><span class=p>:</span>
     <span class=n>res</span> <span class=o>=</span> <span class=p>(</span>
         <span class=n>p</span>
         <span class=o>|</span> <span class=n>beam</span><span 
class=o>.</span><span class=n>Create</span><span class=p>([</span><span 
class=s1>&#39;a&#39;</span><span class=p>,</span> <span 
class=s1>&#39;b&#39;</span><span class=p>])</span><span class=o>.</span><span 
class=n>with_output_types</span><span class=p>(</span><span 
class=nb>unicode</span><span class=p>)</span>
         <span class=o>|</span> <span class=n>beam</span><span 
class=o>.</span><span class=n>ExternalTransform</span><span class=p>(</span>
             <span class=n>TEST_PREFIX_URN</span><span class=p>,</span>
             <span class=n>ImplicitSchemaPayloadBuilder</span><span 
class=p>({</span><span class=s1>&#39;data&#39;</span><span class=p>:</span> 
<span class=sa>u</span><span class=s1>&#39;0&#39;</span><span class=p>}),</span>
-            <span class=o>&lt;</span><span class=n>Address</span> <span 
class=n>of</span> <span class=n>expansion</span> <span 
class=n>service</span><span class=o>&gt;</span><span class=p>))</span>
+            <span class=o>&lt;</span><span class=n>expansion</span> <span 
class=n>service</span><span class=o>&gt;</span><span class=p>))</span>
     <span class=n>assert_that</span><span class=p>(</span><span 
class=n>res</span><span class=p>,</span> <span class=n>equal_to</span><span 
class=p>([</span><span class=s1>&#39;0a&#39;</span><span class=p>,</span> <span 
class=s1>&#39;0b&#39;</span><span class=p>]))</span>
-</code></pre></div><p>For additional examples, see <a 
href=https://github.com/apache/beam/blob/master/examples/multi-language/python/addprefix.py>addprefix.py</a>
 and <a 
href=https://github.com/apache/beam/blob/master/examples/multi-language/python/javacount.py>javacount.py</a>.</p></li><li><p>After
 the job has been submitted to the Beam runner, shut down the expansion service 
by terminating the expansion service process.</p></li></ol><h4 
id=1323-using-cross-language-transforms-in-a-go-p [...]
+</code></pre></div><p>For additional examples, see <a 
href=https://github.com/apache/beam/blob/master/examples/multi-language/python/addprefix.py>addprefix.py</a>
 and <a 
href=https://github.com/apache/beam/blob/master/examples/multi-language/python/javacount.py>javacount.py</a>.</p></li><li><p>After
 the job has been submitted to the Beam runner, shut down any manually started 
expansion services by terminating the expansion service 
process.</p></li></ol><p><strong>Using the JavaExternalTr [...]
+as if they were Python transforms.
+These are invoked as follows</p><pre><code>```py
+MyJavaTransform = beam.JavaExternalTransform('fully.qualified.ClassName', 
classpath=[jars])
+
+with pipeline as p:
+    res = (
+        p
+        | beam.Create(['a', 'b']).with_output_types(unicode)
+        | MyJavaTransform(javaConstructorArg, ...).builderMethod(...)
+    assert_that(res, equal_to(['0a', '0b']))
+```
+</code></pre><p>Python&rsquo;s <code>getattr</code> method can be used if the 
method names in java are reserved
+Python keywords such as <code>from</code>.</p><p>As with other external 
transforms, either a pre-started expansion service can
+be provided, or jar files that include the transform, its dependencies, and
+Beam&rsquo;s expansion service in which case an expansion service will be 
auto-started.</p><h4 
id=1323-using-cross-language-transforms-in-a-go-pipeline>13.2.3. Using 
cross-language transforms in a Go pipeline</h4><p>If a Go-specific wrapper for 
a cross-language is available, use that. Otherwise, you have to use the
 lower-level <a 
href=https://pkg.go.dev/github.com/apache/beam/sdks/v2/go/pkg/beam#CrossLanguage>CrossLanguage</a>
 function to access the transform.</p><p><strong>Expansion 
Services</strong></p><p>The Go SDK supports automatically starting Java 
expansion services if an expansion address is not provided, although this is 
slower than
 providing a persistent expansion service. Many wrapped Java transforms manage 
perform this automatically; if you wish to do this manually, use the 
<code>xlangx</code> package&rsquo;s

Reply via email to