blob: b3333ab236b27571c2cd31fdeb9fa85a7c7a030b [file] [log] [blame]
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="./">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>apache_beam.transforms.periodicsequence module &mdash; Apache Beam 2.68.0 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />
<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=2388e03a"></script>
<script src="_static/doctools.js?v=9a2dae69"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="apache_beam.transforms.ptransform module" href="apache_beam.transforms.ptransform.html" />
<link rel="prev" title="apache_beam.transforms.managed module" href="apache_beam.transforms.managed.html" />
</head>
<body class="wy-body-for-nav">
<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" aria-label="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="Navigation menu">
<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.dataframe.html">apache_beam.dataframe 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.ml.html">apache_beam.ml 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"><a class="reference internal" href="apache_beam.testing.html">apache_beam.testing package</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="apache_beam.transforms.html">apache_beam.transforms package</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="apache_beam.transforms.html#subpackages">Subpackages</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="apache_beam.transforms.html#submodules">Submodules</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.async_dofn.html">apache_beam.transforms.async_dofn module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.combinefn_lifecycle_pipeline.html">apache_beam.transforms.combinefn_lifecycle_pipeline module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.combiners.html">apache_beam.transforms.combiners module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.core.html">apache_beam.transforms.core module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.create_source.html">apache_beam.transforms.create_source module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.deduplicate.html">apache_beam.transforms.deduplicate module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.display.html">apache_beam.transforms.display module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.enrichment.html">apache_beam.transforms.enrichment module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.environments.html">apache_beam.transforms.environments module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.error_handling.html">apache_beam.transforms.error_handling module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.external.html">apache_beam.transforms.external module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.external_java.html">apache_beam.transforms.external_java module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.external_transform_provider.html">apache_beam.transforms.external_transform_provider module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.fully_qualified_named_transform.html">apache_beam.transforms.fully_qualified_named_transform module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.managed.html">apache_beam.transforms.managed module</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">apache_beam.transforms.periodicsequence module</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#apache_beam.transforms.periodicsequence.ImpulseSeqGenRestrictionProvider"><code class="docutils literal notranslate"><span class="pre">ImpulseSeqGenRestrictionProvider</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apache_beam.transforms.periodicsequence.ImpulseSeqGenDoFn"><code class="docutils literal notranslate"><span class="pre">ImpulseSeqGenDoFn</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apache_beam.transforms.periodicsequence.PeriodicSequence"><code class="docutils literal notranslate"><span class="pre">PeriodicSequence</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apache_beam.transforms.periodicsequence.RebaseMode"><code class="docutils literal notranslate"><span class="pre">RebaseMode</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#apache_beam.transforms.periodicsequence.PeriodicImpulse"><code class="docutils literal notranslate"><span class="pre">PeriodicImpulse</span></code></a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.ptransform.html">apache_beam.transforms.ptransform module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.resources.html">apache_beam.transforms.resources module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.sideinputs.html">apache_beam.transforms.sideinputs module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.sql.html">apache_beam.transforms.sql module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.stats.html">apache_beam.transforms.stats module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.timeutil.html">apache_beam.transforms.timeutil module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.trigger.html">apache_beam.transforms.trigger module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.userstate.html">apache_beam.transforms.userstate module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.util.html">apache_beam.transforms.util module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.window.html">apache_beam.transforms.window module</a></li>
</ul>
</li>
</ul>
</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>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.yaml.html">apache_beam.yaml 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>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<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="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item"><a href="apache_beam.transforms.html">apache_beam.transforms package</a></li>
<li class="breadcrumb-item active">apache_beam.transforms.periodicsequence module</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/apache_beam.transforms.periodicsequence.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">
<section id="module-apache_beam.transforms.periodicsequence">
<span id="apache-beam-transforms-periodicsequence-module"></span><h1>apache_beam.transforms.periodicsequence module<a class="headerlink" href="#module-apache_beam.transforms.periodicsequence" title="Link to this heading"></a></h1>
<dl class="py class">
<dt class="sig sig-object py" id="apache_beam.transforms.periodicsequence.ImpulseSeqGenRestrictionProvider">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">apache_beam.transforms.periodicsequence.</span></span><span class="sig-name descname"><span class="pre">ImpulseSeqGenRestrictionProvider</span></span><a class="reference internal" href="_modules/apache_beam/transforms/periodicsequence.html#ImpulseSeqGenRestrictionProvider"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.periodicsequence.ImpulseSeqGenRestrictionProvider" title="Link 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 notranslate"><span class="pre">RestrictionProvider</span></code></a></p>
<dl class="py method">
<dt class="sig sig-object py" id="apache_beam.transforms.periodicsequence.ImpulseSeqGenRestrictionProvider.initial_restriction">
<span class="sig-name descname"><span class="pre">initial_restriction</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">element</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/periodicsequence.html#ImpulseSeqGenRestrictionProvider.initial_restriction"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.periodicsequence.ImpulseSeqGenRestrictionProvider.initial_restriction" title="Link to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apache_beam.transforms.periodicsequence.ImpulseSeqGenRestrictionProvider.create_tracker">
<span class="sig-name descname"><span class="pre">create_tracker</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">restriction</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/periodicsequence.html#ImpulseSeqGenRestrictionProvider.create_tracker"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.periodicsequence.ImpulseSeqGenRestrictionProvider.create_tracker" title="Link to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apache_beam.transforms.periodicsequence.ImpulseSeqGenRestrictionProvider.restriction_size">
<span class="sig-name descname"><span class="pre">restriction_size</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">element</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">restriction</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/periodicsequence.html#ImpulseSeqGenRestrictionProvider.restriction_size"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.periodicsequence.ImpulseSeqGenRestrictionProvider.restriction_size" title="Link to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="apache_beam.transforms.periodicsequence.ImpulseSeqGenRestrictionProvider.truncate">
<span class="sig-name descname"><span class="pre">truncate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">unused_element</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">unused_restriction</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/periodicsequence.html#ImpulseSeqGenRestrictionProvider.truncate"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.periodicsequence.ImpulseSeqGenRestrictionProvider.truncate" title="Link to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
<dt class="sig sig-object py" id="apache_beam.transforms.periodicsequence.ImpulseSeqGenDoFn">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">apache_beam.transforms.periodicsequence.</span></span><span class="sig-name descname"><span class="pre">ImpulseSeqGenDoFn</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Sequence" title="(in Python v3.13)"><span class="pre">Sequence</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Any" title="(in Python v3.13)"><span class="pre">Any</span></a><span class="p"><span class="pre">]</span></span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.13)"><span class="pre">None</span></a></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/periodicsequence.html#ImpulseSeqGenDoFn"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.periodicsequence.ImpulseSeqGenDoFn" title="Link 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 notranslate"><span class="pre">DoFn</span></code></a></p>
<p>ImpulseSeqGenDoFn fn receives tuple elements with three parts:</p>
<ul class="simple">
<li><p>first_timestamp = The timestamp of the first element to be generated
(inclusive).</p></li>
<li><p>last_timestamp = The timestamp marking the end of the generation period
(exclusive). No elements will be generated at or after this time.</p></li>
<li><p>fire_interval = how often to fire an element.</p></li>
</ul>
<p>For each input element received, ImpulseSeqGenDoFn fn will start
generating output elements in following pattern:</p>
<ul class="simple">
<li><p>if element timestamp is less than current runtime then output element.</p></li>
<li><p>if element timestamp is greater than current runtime, wait until next
element timestamp.</p></li>
</ul>
<p>ImpulseSeqGenDoFn can’t guarantee that each element is output at exact time.
ImpulseSeqGenDoFn guarantees that elements would not be output prior to
given runtime timestamp.</p>
<p>The output mode of the DoFn is based on the input <cite>data</cite>:</p>
<blockquote>
<div><ul class="simple">
<li><p><strong>None</strong>: If <cite>data</cite> is None (by default), the output element will be the
timestamp.</p></li>
<li><p><strong>Non-Timestamped Data</strong>: If <cite>data</cite> is a sequence of arbitrary values
(e.g., <cite>[v1, v2, …]</cite>), the DoFn will assign a timestamp to each
emitted element.</p></li>
<li><p><strong>Pre-Timestamped Data</strong>: If <cite>data</cite> is a sequence of tuples, where each
tuple is <cite>(apache_beam.utils.timestamp.Timestamp, value)</cite>, the DoFn
will use the provided timestamp for the emitted element.</p></li>
</ul>
</div></blockquote>
<p>See the parameter description of <cite>PeriodicImpulse</cite> for more information.</p>
<dl class="py method">
<dt class="sig sig-object py" id="apache_beam.transforms.periodicsequence.ImpulseSeqGenDoFn.process">
<span class="sig-name descname"><span class="pre">process</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">element</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">restriction_tracker</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">RestrictionParam(ImpulseSeqGenRestrictionProvider)</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">watermark_estimator</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">WatermarkEstimatorProvider</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/periodicsequence.html#ImpulseSeqGenDoFn.process"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.periodicsequence.ImpulseSeqGenDoFn.process" title="Link to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>element</strong> – (start_timestamp, end_timestamp, interval)</p></li>
<li><p><strong>restriction_tracker</strong></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>yields elements at processing real-time intervals with value of
target output timestamp for the element.</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt class="sig sig-object py" id="apache_beam.transforms.periodicsequence.PeriodicSequence">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">apache_beam.transforms.periodicsequence.</span></span><span class="sig-name descname"><span class="pre">PeriodicSequence</span></span><a class="reference internal" href="_modules/apache_beam/transforms/periodicsequence.html#PeriodicSequence"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.periodicsequence.PeriodicSequence" title="Link 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 notranslate"><span class="pre">PTransform</span></code></a></p>
<p>PeriodicSequence transform receives tuple elements with three parts:</p>
<ul class="simple">
<li><p>first_timestamp = first timestamp to output element for.</p></li>
<li><p>last_timestamp = last timestamp/time to output element for.</p></li>
<li><p>fire_interval = how often to fire an element.</p></li>
</ul>
<p>For each input element received, PeriodicSequence transform will start
generating output elements in following pattern:</p>
<ul class="simple">
<li><p>if element timestamp is less than current runtime then output element.</p></li>
<li><p>if element timestamp is greater than current runtime, wait until next
element timestamp.</p></li>
</ul>
<p>PeriodicSequence can’t guarantee that each element is output at exact time.
PeriodicSequence guarantees that elements would not be output prior to given
runtime timestamp.
The PCollection generated by PeriodicSequence is unbounded.</p>
<dl class="py method">
<dt class="sig sig-object py" id="apache_beam.transforms.periodicsequence.PeriodicSequence.expand">
<span class="sig-name descname"><span class="pre">expand</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pcoll</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/periodicsequence.html#PeriodicSequence.expand"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.periodicsequence.PeriodicSequence.expand" title="Link to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
<dt class="sig sig-object py" id="apache_beam.transforms.periodicsequence.RebaseMode">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">apache_beam.transforms.periodicsequence.</span></span><span class="sig-name descname"><span class="pre">RebaseMode</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/periodicsequence.html#RebaseMode"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.periodicsequence.RebaseMode" title="Link to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/enum.html#enum.Enum" title="(in Python v3.13)"><code class="xref py py-class docutils literal notranslate"><span class="pre">Enum</span></code></a></p>
<p>Controls how the start and stop timestamps are rebased to execution time.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="apache_beam.transforms.periodicsequence.RebaseMode.REBASE_NONE">
<span class="sig-name descname"><span class="pre">REBASE_NONE</span></span><a class="headerlink" href="#apache_beam.transforms.periodicsequence.RebaseMode.REBASE_NONE" title="Link to this definition"></a></dt>
<dd><p>Timestamps are not changed.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="apache_beam.transforms.periodicsequence.RebaseMode.REBASE_ALL">
<span class="sig-name descname"><span class="pre">REBASE_ALL</span></span><a class="headerlink" href="#apache_beam.transforms.periodicsequence.RebaseMode.REBASE_ALL" title="Link to this definition"></a></dt>
<dd><p>Both start and stop timestamps are rebased, preserving the
original duration.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="apache_beam.transforms.periodicsequence.RebaseMode.REBASE_START">
<span class="sig-name descname"><span class="pre">REBASE_START</span></span><a class="headerlink" href="#apache_beam.transforms.periodicsequence.RebaseMode.REBASE_START" title="Link to this definition"></a></dt>
<dd><p>Only the start timestamp is rebased; the stop timestamp
is unchanged.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="id0">
<span class="sig-name descname"><span class="pre">REBASE_NONE</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">0</span></em><a class="headerlink" href="#id0" title="Link to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="id1">
<span class="sig-name descname"><span class="pre">REBASE_ALL</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">1</span></em><a class="headerlink" href="#id1" title="Link to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="id2">
<span class="sig-name descname"><span class="pre">REBASE_START</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">2</span></em><a class="headerlink" href="#id2" title="Link to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
<dt class="sig sig-object py" id="apache_beam.transforms.periodicsequence.PeriodicImpulse">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">apache_beam.transforms.periodicsequence.</span></span><span class="sig-name descname"><span class="pre">PeriodicImpulse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">start_timestamp</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.13)"><span class="pre">int</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.13)"><span class="pre">float</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference internal" href="apache_beam.utils.timestamp.html#apache_beam.utils.timestamp.Timestamp" title="apache_beam.utils.timestamp.Timestamp"><span class="pre">Timestamp</span></a></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">Timestamp(1757691148.562703)</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">stop_timestamp</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.13)"><span class="pre">int</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.13)"><span class="pre">float</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference internal" href="apache_beam.utils.timestamp.html#apache_beam.utils.timestamp.Timestamp" title="apache_beam.utils.timestamp.Timestamp"><span class="pre">Timestamp</span></a></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">Timestamp(9223372036854.775000)</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fire_interval</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.13)"><span class="pre">float</span></a></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">360.0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">apply_windowing</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.13)"><span class="pre">bool</span></a></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Sequence" title="(in Python v3.13)"><span class="pre">Sequence</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Any" title="(in Python v3.13)"><span class="pre">Any</span></a><span class="p"><span class="pre">]</span></span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.13)"><span class="pre">None</span></a></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rebase</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="#apache_beam.transforms.periodicsequence.RebaseMode" title="apache_beam.transforms.periodicsequence.RebaseMode"><span class="pre">RebaseMode</span></a></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">RebaseMode.REBASE_NONE</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/periodicsequence.html#PeriodicImpulse"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.periodicsequence.PeriodicImpulse" title="Link 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 notranslate"><span class="pre">PTransform</span></code></a></p>
<p>PeriodicImpulse transform generates an infinite sequence of elements with
given runtime interval.</p>
<p>PeriodicImpulse transform behaves same as <a class="reference external" href="mailto:{&#37;&#52;&#48;link">{<span>&#64;</span>link</a> PeriodicSequence} transform,
but can be used as first transform in pipeline.
The PCollection generated by PeriodicImpulse is unbounded.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>start_timestamp</strong> – Timestamp for first element.</p></li>
<li><p><strong>stop_timestamp</strong> – Timestamp at or after which no elements will be
output.</p></li>
<li><p><strong>fire_interval</strong> – Interval in seconds at which to output elements.</p></li>
<li><p><strong>apply_windowing</strong> – Whether each element should be assigned to
individual window. If false, all elements will reside in global window.</p></li>
<li><p><strong>data</strong><p>A sequence of elements to emit. The behavior depends on the
content:</p>
<ul>
<li><p><strong>None (default):</strong> The transform emits the event timestamps as
the element values, starting from start_timestamp and incrementing by
<cite>fire_interval</cite> up to the <cite>stop_timestamp</cite> (exclusive)</p></li>
<li><p><strong>Sequence of raw values (e.g., `[‘a’, ‘b’]`)</strong>: The transform emits
each value in the sequence, assigning it an event timestamp that is
calculated in the same manner as the default scenario. The sequence
is repeated if the impulse duration requires more elements than
are in the sequence (a warning will be given in this case).</p></li>
<li><p><strong>Sequence of pre-timestamped tuples (e.g.,
`[(t1, v1), (t2, v2)]`)</strong>: The transform emits each value with its
explicitly provided event time. The format must be
<cite>(apache_beam.utils.timestamp.Timestamp, value)</cite>. The provided
timestamps are used directly, overriding the calculated ones.
Note that the elements in the sequence is NOT required to be ordered
by event time; an element with a timestamp earlier than a preceding one
will be treated as a potential late event.
<strong>Important</strong>: In this mode, the number of elements in <cite>data</cite> must be
sufficient to cover the duration defined by <cite>start_timestamp</cite>,
<cite>stop_timestamp</cite>, and <cite>fire_interval</cite>; otherwise, a <cite>ValueError</cite> is
raised.</p></li>
</ul>
</p></li>
<li><p><strong>rebase</strong> – Controls how the start and stop timestamps are rebased to
execution time. See <cite>RebaseMode</cite> for more details. Defaults to
<cite>REBASE_NONE</cite>.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="apache_beam.transforms.periodicsequence.PeriodicImpulse.expand">
<span class="sig-name descname"><span class="pre">expand</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pbegin</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/periodicsequence.html#PeriodicImpulse.expand"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apache_beam.transforms.periodicsequence.PeriodicImpulse.expand" title="Link to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="apache_beam.transforms.managed.html" class="btn btn-neutral float-left" title="apache_beam.transforms.managed module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="apache_beam.transforms.ptransform.html" class="btn btn-neutral float-right" title="apache_beam.transforms.ptransform module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright %Y, Apache Beam.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>