blob: 0d6410011ad9494ea161357841a54288768cd10a [file] [log] [blame]
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>apache_beam.testing.synthetic_pipeline module &mdash; Apache Beam documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="index" title="Index"
href="genindex.html"/>
<link rel="search" title="Search" href="search.html"/>
<link rel="top" title="Apache Beam documentation" href="index.html"/>
<link rel="up" title="apache_beam.testing package" href="apache_beam.testing.html"/>
<link rel="next" title="apache_beam.testing.test_pipeline module" href="apache_beam.testing.test_pipeline.html"/>
<link rel="prev" title="apache_beam.testing.pipeline_verifiers module" href="apache_beam.testing.pipeline_verifiers.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> Apache Beam
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="apache_beam.coders.html">apache_beam.coders package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.internal.html">apache_beam.internal package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.io.html">apache_beam.io package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.metrics.html">apache_beam.metrics package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.options.html">apache_beam.options package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.portability.html">apache_beam.portability package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.runners.html">apache_beam.runners package</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="apache_beam.testing.html">apache_beam.testing package</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="apache_beam.testing.html#subpackages">Subpackages</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="apache_beam.testing.html#submodules">Submodules</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="apache_beam.testing.metric_result_matchers.html">apache_beam.testing.metric_result_matchers module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.testing.pipeline_verifiers.html">apache_beam.testing.pipeline_verifiers module</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">apache_beam.testing.synthetic_pipeline module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.testing.test_pipeline.html">apache_beam.testing.test_pipeline module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.testing.test_stream.html">apache_beam.testing.test_stream module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.testing.test_utils.html">apache_beam.testing.test_utils module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.testing.util.html">apache_beam.testing.util module</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.tools.html">apache_beam.tools package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.transforms.html">apache_beam.transforms package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.typehints.html">apache_beam.typehints package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.utils.html">apache_beam.utils package</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.error.html">apache_beam.error module</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.pipeline.html">apache_beam.pipeline module</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.pvalue.html">apache_beam.pvalue module</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.version.html">apache_beam.version module</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Apache Beam</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
<li><a href="apache_beam.testing.html">apache_beam.testing package</a> &raquo;</li>
<li>apache_beam.testing.synthetic_pipeline module</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/apache_beam.testing.synthetic_pipeline.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="module-apache_beam.testing.synthetic_pipeline">
<span id="apache-beam-testing-synthetic-pipeline-module"></span><h1>apache_beam.testing.synthetic_pipeline module<a class="headerlink" href="#module-apache_beam.testing.synthetic_pipeline" title="Permalink to this headline"></a></h1>
<p>A set of utilities to write pipelines for performance tests.</p>
<p>This module offers a way to create pipelines using synthetic sources and steps.
Exact shape of the pipeline and the behaviour of sources and steps can be
controlled through arguments. Please see function ‘parse_args()’ for more
details about the arguments.</p>
<p>Shape of the pipeline is primariy controlled through two arguments. Argument
‘steps’ can be used to define a list of steps as a JSON string. Argument
‘barrier’ describes how these steps are separated from each other. Argument
‘barrier’ can be use to build a pipeline as a a series of steps or a tree of
steps with a fanin or a fanout of size 2.</p>
<p>Other arguments describe what gets generated by synthetic sources that produce
data for the pipeline.</p>
<dl class="function">
<dt id="apache_beam.testing.synthetic_pipeline.parse_byte_size">
<code class="descclassname">apache_beam.testing.synthetic_pipeline.</code><code class="descname">parse_byte_size</code><span class="sig-paren">(</span><em>s</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#parse_byte_size"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.parse_byte_size" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="apache_beam.testing.synthetic_pipeline.div_round_up">
<code class="descclassname">apache_beam.testing.synthetic_pipeline.</code><code class="descname">div_round_up</code><span class="sig-paren">(</span><em>a</em>, <em>b</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#div_round_up"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.div_round_up" title="Permalink to this definition"></a></dt>
<dd><p>Return ceil(a/b).</p>
</dd></dl>
<dl class="function">
<dt id="apache_beam.testing.synthetic_pipeline.rotate_key">
<code class="descclassname">apache_beam.testing.synthetic_pipeline.</code><code class="descname">rotate_key</code><span class="sig-paren">(</span><em>element</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#rotate_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.rotate_key" title="Permalink to this definition"></a></dt>
<dd><p>Returns a new key-value pair of the same size but with a different key.</p>
</dd></dl>
<dl class="function">
<dt id="apache_beam.testing.synthetic_pipeline.initial_splitting_zipf">
<code class="descclassname">apache_beam.testing.synthetic_pipeline.</code><code class="descname">initial_splitting_zipf</code><span class="sig-paren">(</span><em>start_position</em>, <em>stop_position</em>, <em>desired_num_bundles</em>, <em>distribution_parameter</em>, <em>num_total_records=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#initial_splitting_zipf"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.initial_splitting_zipf" title="Permalink to this definition"></a></dt>
<dd><p>Split the given range (defined by start_position, stop_position) into
desired_num_bundles using zipf with the given distribution_parameter.</p>
</dd></dl>
<dl class="class">
<dt id="apache_beam.testing.synthetic_pipeline.SyntheticStep">
<em class="property">class </em><code class="descclassname">apache_beam.testing.synthetic_pipeline.</code><code class="descname">SyntheticStep</code><span class="sig-paren">(</span><em>per_element_delay_sec=0</em>, <em>per_bundle_delay_sec=0</em>, <em>output_records_per_input_record=1</em>, <em>output_filter_ratio=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#SyntheticStep"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.SyntheticStep" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="apache_beam.transforms.core.html#apache_beam.transforms.core.DoFn" title="apache_beam.transforms.core.DoFn"><code class="xref py py-class docutils literal"><span class="pre">apache_beam.transforms.core.DoFn</span></code></a></p>
<p>A DoFn of which behavior can be controlled through prespecified parameters.</p>
<dl class="method">
<dt id="apache_beam.testing.synthetic_pipeline.SyntheticStep.start_bundle">
<code class="descname">start_bundle</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#SyntheticStep.start_bundle"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.SyntheticStep.start_bundle" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="apache_beam.testing.synthetic_pipeline.SyntheticStep.finish_bundle">
<code class="descname">finish_bundle</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#SyntheticStep.finish_bundle"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.SyntheticStep.finish_bundle" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="apache_beam.testing.synthetic_pipeline.SyntheticStep.process">
<code class="descname">process</code><span class="sig-paren">(</span><em>element</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#SyntheticStep.process"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.SyntheticStep.process" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="apache_beam.testing.synthetic_pipeline.NonLiquidShardingOffsetRangeTracker">
<em class="property">class </em><code class="descclassname">apache_beam.testing.synthetic_pipeline.</code><code class="descname">NonLiquidShardingOffsetRangeTracker</code><span class="sig-paren">(</span><em>start_position</em>, <em>stop_position</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#NonLiquidShardingOffsetRangeTracker"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.NonLiquidShardingOffsetRangeTracker" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="apache_beam.io.restriction_trackers.html#apache_beam.io.restriction_trackers.OffsetRestrictionTracker" title="apache_beam.io.restriction_trackers.OffsetRestrictionTracker"><code class="xref py py-class docutils literal"><span class="pre">apache_beam.io.restriction_trackers.OffsetRestrictionTracker</span></code></a></p>
<p>An OffsetRangeTracker that doesn’t allow splitting.</p>
<dl class="method">
<dt id="apache_beam.testing.synthetic_pipeline.NonLiquidShardingOffsetRangeTracker.try_split">
<code class="descname">try_split</code><span class="sig-paren">(</span><em>split_offset</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#NonLiquidShardingOffsetRangeTracker.try_split"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.NonLiquidShardingOffsetRangeTracker.try_split" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="apache_beam.testing.synthetic_pipeline.NonLiquidShardingOffsetRangeTracker.checkpoint">
<code class="descname">checkpoint</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#NonLiquidShardingOffsetRangeTracker.checkpoint"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.NonLiquidShardingOffsetRangeTracker.checkpoint" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="apache_beam.testing.synthetic_pipeline.SyntheticSDFStepRestrictionProvider">
<em class="property">class </em><code class="descclassname">apache_beam.testing.synthetic_pipeline.</code><code class="descname">SyntheticSDFStepRestrictionProvider</code><span class="sig-paren">(</span><em>num_records</em>, <em>initial_splitting_num_bundles</em>, <em>initial_splitting_uneven_chunks</em>, <em>disable_liquid_sharding</em>, <em>size_estimate_override</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#SyntheticSDFStepRestrictionProvider"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.SyntheticSDFStepRestrictionProvider" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="apache_beam.transforms.core.html#apache_beam.transforms.core.RestrictionProvider" title="apache_beam.transforms.core.RestrictionProvider"><code class="xref py py-class docutils literal"><span class="pre">apache_beam.transforms.core.RestrictionProvider</span></code></a></p>
<p>A <cite>RestrictionProvider</cite> for SyntheticSDFStep.</p>
<p>An initial_restriction and split that operate on num_records and ignores
source description (element). Splits into initial_splitting_num_bundles.
Returns size_estimate_override as restriction size, if set. Otherwise uses
element size.</p>
<p>If initial_splitting_uneven_chunks, produces uneven chunks.</p>
<dl class="method">
<dt id="apache_beam.testing.synthetic_pipeline.SyntheticSDFStepRestrictionProvider.initial_restriction">
<code class="descname">initial_restriction</code><span class="sig-paren">(</span><em>element</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#SyntheticSDFStepRestrictionProvider.initial_restriction"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.SyntheticSDFStepRestrictionProvider.initial_restriction" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="apache_beam.testing.synthetic_pipeline.SyntheticSDFStepRestrictionProvider.create_tracker">
<code class="descname">create_tracker</code><span class="sig-paren">(</span><em>restriction</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#SyntheticSDFStepRestrictionProvider.create_tracker"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.SyntheticSDFStepRestrictionProvider.create_tracker" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="apache_beam.testing.synthetic_pipeline.SyntheticSDFStepRestrictionProvider.split">
<code class="descname">split</code><span class="sig-paren">(</span><em>element</em>, <em>restriction</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#SyntheticSDFStepRestrictionProvider.split"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.SyntheticSDFStepRestrictionProvider.split" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="apache_beam.testing.synthetic_pipeline.SyntheticSDFStepRestrictionProvider.restriction_size">
<code class="descname">restriction_size</code><span class="sig-paren">(</span><em>element</em>, <em>restriction</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#SyntheticSDFStepRestrictionProvider.restriction_size"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.SyntheticSDFStepRestrictionProvider.restriction_size" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="function">
<dt id="apache_beam.testing.synthetic_pipeline.getSyntheticSDFStep">
<code class="descclassname">apache_beam.testing.synthetic_pipeline.</code><code class="descname">getSyntheticSDFStep</code><span class="sig-paren">(</span><em>per_element_delay_sec=0</em>, <em>per_bundle_delay_sec=0</em>, <em>output_records_per_input_record=1</em>, <em>output_filter_ratio=0</em>, <em>initial_splitting_num_bundles=8</em>, <em>initial_splitting_uneven_chunks=False</em>, <em>disable_liquid_sharding=False</em>, <em>size_estimate_override=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#getSyntheticSDFStep"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.getSyntheticSDFStep" title="Permalink to this definition"></a></dt>
<dd><p>A function which returns a SyntheticSDFStep with given parameters.</p>
</dd></dl>
<dl class="class">
<dt id="apache_beam.testing.synthetic_pipeline.SyntheticSource">
<em class="property">class </em><code class="descclassname">apache_beam.testing.synthetic_pipeline.</code><code class="descname">SyntheticSource</code><span class="sig-paren">(</span><em>input_spec</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#SyntheticSource"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.SyntheticSource" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="apache_beam.io.iobase.html#apache_beam.io.iobase.BoundedSource" title="apache_beam.io.iobase.BoundedSource"><code class="xref py py-class docutils literal"><span class="pre">apache_beam.io.iobase.BoundedSource</span></code></a></p>
<p>A custom source of a specified size.</p>
<p>Initiates a synthetic source.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>input_spec</strong> – Input specification of the source. See corresponding option in
function ‘parse_args()’ below for more details.</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><code class="xref py py-exc docutils literal"><span class="pre">ValueError</span></code> – if input parameters are invalid.</td>
</tr>
</tbody>
</table>
<dl class="attribute">
<dt id="apache_beam.testing.synthetic_pipeline.SyntheticSource.element_size">
<code class="descname">element_size</code><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.SyntheticSource.element_size" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="apache_beam.testing.synthetic_pipeline.SyntheticSource.estimate_size">
<code class="descname">estimate_size</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#SyntheticSource.estimate_size"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.SyntheticSource.estimate_size" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="apache_beam.testing.synthetic_pipeline.SyntheticSource.split">
<code class="descname">split</code><span class="sig-paren">(</span><em>desired_bundle_size</em>, <em>start_position=0</em>, <em>stop_position=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#SyntheticSource.split"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.SyntheticSource.split" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="apache_beam.testing.synthetic_pipeline.SyntheticSource.get_range_tracker">
<code class="descname">get_range_tracker</code><span class="sig-paren">(</span><em>start_position</em>, <em>stop_position</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#SyntheticSource.get_range_tracker"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.SyntheticSource.get_range_tracker" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="apache_beam.testing.synthetic_pipeline.SyntheticSource.read">
<code class="descname">read</code><span class="sig-paren">(</span><em>range_tracker</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#SyntheticSource.read"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.SyntheticSource.read" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="apache_beam.testing.synthetic_pipeline.SyntheticSource.default_output_coder">
<code class="descname">default_output_coder</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#SyntheticSource.default_output_coder"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.SyntheticSource.default_output_coder" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="apache_beam.testing.synthetic_pipeline.SyntheticSDFSourceRestrictionProvider">
<em class="property">class </em><code class="descclassname">apache_beam.testing.synthetic_pipeline.</code><code class="descname">SyntheticSDFSourceRestrictionProvider</code><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#SyntheticSDFSourceRestrictionProvider"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.SyntheticSDFSourceRestrictionProvider" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="apache_beam.transforms.core.html#apache_beam.transforms.core.RestrictionProvider" title="apache_beam.transforms.core.RestrictionProvider"><code class="xref py py-class docutils literal"><span class="pre">apache_beam.transforms.core.RestrictionProvider</span></code></a></p>
<p>A <cite>RestrictionProvider</cite> for SyntheticSDFAsSource.</p>
<p>In initial_restriction(element) and split(element), element means source
description.
A typical element is like:</p>
<blockquote>
<div><dl class="docutils">
<dt>{</dt>
<dd>‘key_size’: 1,
‘value_size’: 1,
‘initial_splitting_num_bundles’: 8,
‘initial_splitting_desired_bundle_size’: 2,
‘sleep_per_input_record_sec’: 0,
‘initial_splitting’ : ‘const’</dd>
</dl>
<p>}</p>
</div></blockquote>
<dl class="method">
<dt id="apache_beam.testing.synthetic_pipeline.SyntheticSDFSourceRestrictionProvider.initial_restriction">
<code class="descname">initial_restriction</code><span class="sig-paren">(</span><em>element</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#SyntheticSDFSourceRestrictionProvider.initial_restriction"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.SyntheticSDFSourceRestrictionProvider.initial_restriction" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="apache_beam.testing.synthetic_pipeline.SyntheticSDFSourceRestrictionProvider.create_tracker">
<code class="descname">create_tracker</code><span class="sig-paren">(</span><em>restriction</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#SyntheticSDFSourceRestrictionProvider.create_tracker"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.SyntheticSDFSourceRestrictionProvider.create_tracker" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="apache_beam.testing.synthetic_pipeline.SyntheticSDFSourceRestrictionProvider.split">
<code class="descname">split</code><span class="sig-paren">(</span><em>element</em>, <em>restriction</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#SyntheticSDFSourceRestrictionProvider.split"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.SyntheticSDFSourceRestrictionProvider.split" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="apache_beam.testing.synthetic_pipeline.SyntheticSDFSourceRestrictionProvider.restriction_size">
<code class="descname">restriction_size</code><span class="sig-paren">(</span><em>element</em>, <em>restriction</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#SyntheticSDFSourceRestrictionProvider.restriction_size"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.SyntheticSDFSourceRestrictionProvider.restriction_size" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="apache_beam.testing.synthetic_pipeline.SyntheticSDFAsSource">
<em class="property">class </em><code class="descclassname">apache_beam.testing.synthetic_pipeline.</code><code class="descname">SyntheticSDFAsSource</code><span class="sig-paren">(</span><em>*unused_args</em>, <em>**unused_kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#SyntheticSDFAsSource"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.SyntheticSDFAsSource" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="apache_beam.transforms.core.html#apache_beam.transforms.core.DoFn" title="apache_beam.transforms.core.DoFn"><code class="xref py py-class docutils literal"><span class="pre">apache_beam.transforms.core.DoFn</span></code></a></p>
<p>A SDF that generates records like a source.</p>
<p>This SDF accepts a PCollection of record-based source description.
A typical description is like:</p>
<blockquote>
<div><dl class="docutils">
<dt>{</dt>
<dd>‘key_size’: 1,
‘value_size’: 1,
‘initial_splitting_num_bundles’: 8,
‘initial_splitting_desired_bundle_size’: 2,
‘sleep_per_input_record_sec’: 0,
‘initial_splitting’ : ‘const’</dd>
</dl>
<p>}</p>
</div></blockquote>
<dl class="docutils">
<dt>A simple pipeline taking this SDF as a source is like:</dt>
<dd>p
| beam.Create([description1, description2,…])
| beam.ParDo(SyntheticSDFAsSource())</dd>
</dl>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The SDF.process() will have different param content between defining a DoFn
and runtime.
When defining an SDF.process, the restriction_tracker should be a
<cite>RestrictionProvider</cite>.
During runtime, the DoFnRunner.process_with_sized_restriction() will feed
a ‘RestrictionTracker’ based on a restriction to SDF.process().</p>
</div>
<dl class="method">
<dt id="apache_beam.testing.synthetic_pipeline.SyntheticSDFAsSource.process">
<code class="descname">process</code><span class="sig-paren">(</span><em>element</em>, <em>restriction_tracker=RestrictionParam(SyntheticSDFSourceRestrictionProvider)</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#SyntheticSDFAsSource.process"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.SyntheticSDFAsSource.process" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="apache_beam.testing.synthetic_pipeline.ShuffleBarrier">
<em class="property">class </em><code class="descclassname">apache_beam.testing.synthetic_pipeline.</code><code class="descname">ShuffleBarrier</code><span class="sig-paren">(</span><em>label=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#ShuffleBarrier"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.ShuffleBarrier" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="apache_beam.transforms.ptransform.html#apache_beam.transforms.ptransform.PTransform" title="apache_beam.transforms.ptransform.PTransform"><code class="xref py py-class docutils literal"><span class="pre">apache_beam.transforms.ptransform.PTransform</span></code></a></p>
<dl class="method">
<dt id="apache_beam.testing.synthetic_pipeline.ShuffleBarrier.expand">
<code class="descname">expand</code><span class="sig-paren">(</span><em>pc</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#ShuffleBarrier.expand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.ShuffleBarrier.expand" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="apache_beam.testing.synthetic_pipeline.SideInputBarrier">
<em class="property">class </em><code class="descclassname">apache_beam.testing.synthetic_pipeline.</code><code class="descname">SideInputBarrier</code><span class="sig-paren">(</span><em>label=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#SideInputBarrier"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.SideInputBarrier" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="apache_beam.transforms.ptransform.html#apache_beam.transforms.ptransform.PTransform" title="apache_beam.transforms.ptransform.PTransform"><code class="xref py py-class docutils literal"><span class="pre">apache_beam.transforms.ptransform.PTransform</span></code></a></p>
<dl class="method">
<dt id="apache_beam.testing.synthetic_pipeline.SideInputBarrier.expand">
<code class="descname">expand</code><span class="sig-paren">(</span><em>pc</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#SideInputBarrier.expand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.SideInputBarrier.expand" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="function">
<dt id="apache_beam.testing.synthetic_pipeline.merge_using_gbk">
<code class="descclassname">apache_beam.testing.synthetic_pipeline.</code><code class="descname">merge_using_gbk</code><span class="sig-paren">(</span><em>name</em>, <em>pc1</em>, <em>pc2</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#merge_using_gbk"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.merge_using_gbk" title="Permalink to this definition"></a></dt>
<dd><p>Merges two given PCollections using a CoGroupByKey.</p>
</dd></dl>
<dl class="function">
<dt id="apache_beam.testing.synthetic_pipeline.merge_using_side_input">
<code class="descclassname">apache_beam.testing.synthetic_pipeline.</code><code class="descname">merge_using_side_input</code><span class="sig-paren">(</span><em>name</em>, <em>pc1</em>, <em>pc2</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#merge_using_side_input"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.merge_using_side_input" title="Permalink to this definition"></a></dt>
<dd><p>Merges two given PCollections using side inputs.</p>
</dd></dl>
<dl class="function">
<dt id="apache_beam.testing.synthetic_pipeline.expand_using_gbk">
<code class="descclassname">apache_beam.testing.synthetic_pipeline.</code><code class="descname">expand_using_gbk</code><span class="sig-paren">(</span><em>name</em>, <em>pc</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#expand_using_gbk"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.expand_using_gbk" title="Permalink to this definition"></a></dt>
<dd><p>Expands a given PCollection into two copies using GroupByKey.</p>
</dd></dl>
<dl class="function">
<dt id="apache_beam.testing.synthetic_pipeline.expand_using_second_output">
<code class="descclassname">apache_beam.testing.synthetic_pipeline.</code><code class="descname">expand_using_second_output</code><span class="sig-paren">(</span><em>name</em>, <em>pc</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#expand_using_second_output"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.expand_using_second_output" title="Permalink to this definition"></a></dt>
<dd><p>Expands a given PCollection into two copies using side outputs.</p>
</dd></dl>
<dl class="function">
<dt id="apache_beam.testing.synthetic_pipeline.parse_args">
<code class="descclassname">apache_beam.testing.synthetic_pipeline.</code><code class="descname">parse_args</code><span class="sig-paren">(</span><em>args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#parse_args"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.parse_args" title="Permalink to this definition"></a></dt>
<dd><p>Parses a given set of arguments.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>args</strong> – set of arguments to be passed.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">a tuple where first item gives the set of arguments defined and parsed
within this method and second item gives the set of unknown arguments.</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="apache_beam.testing.synthetic_pipeline.run">
<code class="descclassname">apache_beam.testing.synthetic_pipeline.</code><code class="descname">run</code><span class="sig-paren">(</span><em>argv=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/testing/synthetic_pipeline.html#run"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.testing.synthetic_pipeline.run" title="Permalink to this definition"></a></dt>
<dd><p>Runs the workflow.</p>
</dd></dl>
</div>
</div>
<div class="articleComments">
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="apache_beam.testing.test_pipeline.html" class="btn btn-neutral float-right" title="apache_beam.testing.test_pipeline module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="apache_beam.testing.pipeline_verifiers.html" class="btn btn-neutral" title="apache_beam.testing.pipeline_verifiers module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright .
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>