blob: 93727cacbacebf22d6e7a34943131c39566de2fc [file]
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
<html>
<head>
<title>pulsar.functions.context.Context</title>
<meta name="generator" content="pydoctor 23.4.1">
</meta>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1" />
<link rel="stylesheet" type="text/css" href="apidocs.css" />
<link rel="stylesheet" type="text/css" href="readthedocstheme.css" />
<link rel="stylesheet" type="text/css" href="extra.css" />
</head>
<body>
<nav class="navbar navbar-default mainnavbar">
<div class="container-fluid">
<div class="navbar-header">
<div class="navlinks">
<span class="navbar-brand">
_pulsar/pulsar <a href="index.html">API Documentation</a>
</span>
<a href="moduleIndex.html">
Modules
</a>
<a href="classIndex.html">
Classes
</a>
<a href="nameIndex.html">
Names
</a>
<div id="search-box-container">
<div class="input-group">
<input id="search-box" type="search" name="search-query" placeholder="Search..." aria-label="Search" minlength="2" class="form-control" autocomplete="off" />
<span class="input-group-btn">
<a style="display: none;" class="btn btn-default" id="search-clear-button" title="Clear" onclick="clearSearch()"><img src="fonts/x-circle.svg" alt="Clear" /></a>
<a class="btn btn-default" id="search-help-button" title="Help" onclick="toggleSearchHelpText()"><img src="fonts/info.svg" alt="Help" /></a>
</span>
</div>
</div>
</div>
</div>
</div>
<!-- Side navigation -->
<div class="sidebarcontainer">
<nav class="sidebar">
<div>
<div class="thingTitle">
<span>Class</span>
<code class="thisobject"><a href="pulsar.functions.context.Context.html" class="internal-link" title="This class"><wbr></wbr>Context</a></code>
</div>
<div>
<div class="childrenKindTitle">Methods</div>
<ul>
<li class="">
<div class="itemName"><code><a href="#ack" class="internal-link" title="pulsar.functions.context.Context.ack">ack</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#del_counter" class="internal-link" title="pulsar.functions.context.Context.del_counter">del<wbr></wbr>_counter</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#get_counter" class="internal-link" title="pulsar.functions.context.Context.get_counter">get<wbr></wbr>_counter</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#get_current_message_topic_name" class="internal-link" title="pulsar.functions.context.Context.get_current_message_topic_name">get<wbr></wbr>_current<wbr></wbr>_message<wbr></wbr>_topic<wbr></wbr>_name</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#get_function_id" class="internal-link" title="pulsar.functions.context.Context.get_function_id">get<wbr></wbr>_function<wbr></wbr>_id</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#get_function_name" class="internal-link" title="pulsar.functions.context.Context.get_function_name">get<wbr></wbr>_function<wbr></wbr>_name</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#get_function_namespace" class="internal-link" title="pulsar.functions.context.Context.get_function_namespace">get<wbr></wbr>_function<wbr></wbr>_namespace</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#get_function_tenant" class="internal-link" title="pulsar.functions.context.Context.get_function_tenant">get<wbr></wbr>_function<wbr></wbr>_tenant</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#get_function_version" class="internal-link" title="pulsar.functions.context.Context.get_function_version">get<wbr></wbr>_function<wbr></wbr>_version</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#get_input_topics" class="internal-link" title="pulsar.functions.context.Context.get_input_topics">get<wbr></wbr>_input<wbr></wbr>_topics</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#get_instance_id" class="internal-link" title="pulsar.functions.context.Context.get_instance_id">get<wbr></wbr>_instance<wbr></wbr>_id</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#get_logger" class="internal-link" title="pulsar.functions.context.Context.get_logger">get<wbr></wbr>_logger</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#get_message_eventtime" class="internal-link" title="pulsar.functions.context.Context.get_message_eventtime">get<wbr></wbr>_message<wbr></wbr>_eventtime</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#get_message_id" class="internal-link" title="pulsar.functions.context.Context.get_message_id">get<wbr></wbr>_message<wbr></wbr>_id</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#get_message_key" class="internal-link" title="pulsar.functions.context.Context.get_message_key">get<wbr></wbr>_message<wbr></wbr>_key</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#get_message_properties" class="internal-link" title="pulsar.functions.context.Context.get_message_properties">get<wbr></wbr>_message<wbr></wbr>_properties</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#get_output_serde_class_name" class="internal-link" title="pulsar.functions.context.Context.get_output_serde_class_name">get<wbr></wbr>_output<wbr></wbr>_serde<wbr></wbr>_class<wbr></wbr>_name</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#get_output_topic" class="internal-link" title="pulsar.functions.context.Context.get_output_topic">get<wbr></wbr>_output<wbr></wbr>_topic</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#get_partition_key" class="internal-link" title="pulsar.functions.context.Context.get_partition_key">get<wbr></wbr>_partition<wbr></wbr>_key</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#get_secret" class="internal-link" title="pulsar.functions.context.Context.get_secret">get<wbr></wbr>_secret</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#get_state" class="internal-link" title="pulsar.functions.context.Context.get_state">get<wbr></wbr>_state</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#get_user_config_map" class="internal-link" title="pulsar.functions.context.Context.get_user_config_map">get<wbr></wbr>_user<wbr></wbr>_config<wbr></wbr>_map</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#get_user_config_value" class="internal-link" title="pulsar.functions.context.Context.get_user_config_value">get<wbr></wbr>_user<wbr></wbr>_config<wbr></wbr>_value</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#incr_counter" class="internal-link" title="pulsar.functions.context.Context.incr_counter">incr<wbr></wbr>_counter</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#publish" class="internal-link" title="pulsar.functions.context.Context.publish">publish</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#put_state" class="internal-link" title="pulsar.functions.context.Context.put_state">put<wbr></wbr>_state</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#record_metric" class="internal-link" title="pulsar.functions.context.Context.record_metric">record<wbr></wbr>_metric</a></code>
</div>
</li>
</ul>
</div>
</div><div>
<div class="thingTitle">
<span>Module</span>
<code><a href="pulsar.functions.context.html" class="internal-link" title="The parent of this class">context</a></code>
</div>
<div>
<div class="childrenKindTitle">Classes</div>
<ul>
<li class=" thisobject">
<div class="itemName"><code><a href="pulsar.functions.context.Context.html" class="internal-link" title="pulsar.functions.context.Context"><wbr></wbr>Context</a></code>
</div>
</li>
</ul>
</div>
</div>
</nav>
<!-- No sidebar toggle for read the docs theme, the sidebar is always
visible when the screen is width enough.
-->
</div>
</nav>
<div class="container-fluid">
<div id="main" class="">
<div id="search-results-container" style="display: none;">
<div id="search-buttons">
<span class="label label-default" id="search-docstrings-button">
<label class="checkbox-inline">
<input type="checkbox" id="toggle-search-in-docstrings-checkbox" value="false" onclick="toggleSearchInDocstrings()">
search in docstrings
</input>
</label>
</span>
</div>
<noscript>
<h1>Cannot search: JavaScript is not supported/enabled in your browser.</h1>
</noscript>
<div class="hint" id="search-help-box">
<p class="rst-last">
Search bar offers the following options:
<ul>
<li>
<strong>Term presence.</strong> The below example searches for documents that
must contain “foo”, might contain “bar” and must not contain “baz”: <code>+foo bar -baz</code>
</li>
<li>
<strong>Wildcards.</strong> The below example searches for documents with words beginning with “foo”: <code>foo*</code>
</li>
<li>
<strong>Search in specific fields.</strong> The following search matches all objects
in "twisted.mail" that matches “search”: <code>+qname:twisted.mail.* +search</code>
<p>
Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'.
Last two fields are only applicable if "search in docstrings" is enabled.
</p>
</li>
<li>
<strong>Fuzzy matches.</strong> The following search matches all documents
that have a word within 1 edit distance of “foo”: <code>foo~1</code>
</li>
</ul>
</p>
</div>
<div id="search-status"> </div>
<div class="warning" id="search-warn-box" style="display: none;">
<p class="rst-last"><span id="search-warn"></span></p>
</div>
<table id="search-results">
<!-- Filled dynamically by JS -->
</table>
<div style="margin-top: 8px;">
<p>Results provided by <a href="https://lunrjs.com">Lunr.js</a></p>
</div>
</div>
<div class="page-header">
<h1 class="class"><code><code><a href="pulsar.html" class="internal-link">pulsar</a></code><wbr></wbr>.<code><a href="pulsar.functions.html" class="internal-link" title="pulsar.functions">functions</a></code><wbr></wbr>.<code><a href="pulsar.functions.context.html" class="internal-link" title="pulsar.functions.context">context</a></code><wbr></wbr>.<code><a href="pulsar.functions.context.Context.html" class="internal-link" title="pulsar.functions.context.Context">Context</a></code></code></h1>
<div id="showPrivate">
<button class="btn btn-link" onclick="togglePrivate()">Toggle Private API</button>
</div>
</div>
<div class="categoryHeader">
class documentation
</div>
<div class="extrasDocstring">
<p class="class-signature"><code><span class="py-keyword">class</span> <span class="py-defname">Context</span>(<a href="https://docs.python.org/3/library/functions.html#object" class="intersphinx-link">object</a>): <a href="https://github.com/apache/pulsar-client-python/tree/v3.3.0/pulsar/functions/context.py#L45" class="sourceLink">(source)</a></code></p>
<p><a href="classIndex.html#pulsar.functions.context.Context">View In Hierarchy</a></p>
</div>
<div class="moduleDocstring">
<div><p>Interface defining information available at process time</p></div>
</div>
<div id="splitTables">
<table class="children sortable" id="id7">
<tr class="method">
<td>Method</td>
<td><code><a href="#ack" class="internal-link" title="pulsar.functions.context.Context.ack">ack</a></code></td>
<td>ack this message id</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#del_counter" class="internal-link" title="pulsar.functions.context.Context.del_counter">del<wbr></wbr>_counter</a></code></td>
<td>delete the counter of a given key in the managed state</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#get_counter" class="internal-link" title="pulsar.functions.context.Context.get_counter">get<wbr></wbr>_counter</a></code></td>
<td>get the counter of a given key in the managed state</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#get_current_message_topic_name" class="internal-link" title="pulsar.functions.context.Context.get_current_message_topic_name">get<wbr></wbr>_current<wbr></wbr>_message<wbr></wbr>_topic<wbr></wbr>_name</a></code></td>
<td>Returns the topic name of the message that we are processing</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#get_function_id" class="internal-link" title="pulsar.functions.context.Context.get_function_id">get<wbr></wbr>_function<wbr></wbr>_id</a></code></td>
<td>Returns the function id that we are a part of</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#get_function_name" class="internal-link" title="pulsar.functions.context.Context.get_function_name">get<wbr></wbr>_function<wbr></wbr>_name</a></code></td>
<td>Returns the function name that we are a part of</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#get_function_namespace" class="internal-link" title="pulsar.functions.context.Context.get_function_namespace">get<wbr></wbr>_function<wbr></wbr>_namespace</a></code></td>
<td>Returns the namespace of the message that's being processed</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#get_function_tenant" class="internal-link" title="pulsar.functions.context.Context.get_function_tenant">get<wbr></wbr>_function<wbr></wbr>_tenant</a></code></td>
<td>Returns the tenant of the message that's being processed</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#get_function_version" class="internal-link" title="pulsar.functions.context.Context.get_function_version">get<wbr></wbr>_function<wbr></wbr>_version</a></code></td>
<td>Returns the version of function that we are executing</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#get_input_topics" class="internal-link" title="pulsar.functions.context.Context.get_input_topics">get<wbr></wbr>_input<wbr></wbr>_topics</a></code></td>
<td>Returns the input topics of function</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#get_instance_id" class="internal-link" title="pulsar.functions.context.Context.get_instance_id">get<wbr></wbr>_instance<wbr></wbr>_id</a></code></td>
<td>Returns the instance id that is executing the function</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#get_logger" class="internal-link" title="pulsar.functions.context.Context.get_logger">get<wbr></wbr>_logger</a></code></td>
<td>Returns the logger object that can be used to do logging</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#get_message_eventtime" class="internal-link" title="pulsar.functions.context.Context.get_message_eventtime">get<wbr></wbr>_message<wbr></wbr>_eventtime</a></code></td>
<td>Return the event time of the current message that we are processing</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#get_message_id" class="internal-link" title="pulsar.functions.context.Context.get_message_id">get<wbr></wbr>_message<wbr></wbr>_id</a></code></td>
<td>Return the messageid of the current message that we are processing</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#get_message_key" class="internal-link" title="pulsar.functions.context.Context.get_message_key">get<wbr></wbr>_message<wbr></wbr>_key</a></code></td>
<td>Return the key of the current message that we are processing</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#get_message_properties" class="internal-link" title="pulsar.functions.context.Context.get_message_properties">get<wbr></wbr>_message<wbr></wbr>_properties</a></code></td>
<td>Return the message properties kv map of the current message that we are processing</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#get_output_serde_class_name" class="internal-link" title="pulsar.functions.context.Context.get_output_serde_class_name">get<wbr></wbr>_output<wbr></wbr>_serde<wbr></wbr>_class<wbr></wbr>_name</a></code></td>
<td>return output Serde class</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#get_output_topic" class="internal-link" title="pulsar.functions.context.Context.get_output_topic">get<wbr></wbr>_output<wbr></wbr>_topic</a></code></td>
<td>Returns the output topic of function</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#get_partition_key" class="internal-link" title="pulsar.functions.context.Context.get_partition_key">get<wbr></wbr>_partition<wbr></wbr>_key</a></code></td>
<td>Returns partition key of the input message is one exists</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#get_secret" class="internal-link" title="pulsar.functions.context.Context.get_secret">get<wbr></wbr>_secret</a></code></td>
<td>Returns the secret value associated with the name. None if nothing was found</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#get_state" class="internal-link" title="pulsar.functions.context.Context.get_state">get<wbr></wbr>_state</a></code></td>
<td>get the value of a given key in the managed state</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#get_user_config_map" class="internal-link" title="pulsar.functions.context.Context.get_user_config_map">get<wbr></wbr>_user<wbr></wbr>_config<wbr></wbr>_map</a></code></td>
<td>Returns the entire user-defined config as a dict (the dict will be empty if no user-defined config is supplied)</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#get_user_config_value" class="internal-link" title="pulsar.functions.context.Context.get_user_config_value">get<wbr></wbr>_user<wbr></wbr>_config<wbr></wbr>_value</a></code></td>
<td>Returns the value of the user-defined config. If the key doesn't exist, None is returned</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#incr_counter" class="internal-link" title="pulsar.functions.context.Context.incr_counter">incr<wbr></wbr>_counter</a></code></td>
<td>incr the counter of a given key in the managed state</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#publish" class="internal-link" title="pulsar.functions.context.Context.publish">publish</a></code></td>
<td>Publishes message to topic_name by first serializing the message using serde_class_name serde The message will have properties specified if any</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#put_state" class="internal-link" title="pulsar.functions.context.Context.put_state">put<wbr></wbr>_state</a></code></td>
<td>update the value of a given key in the managed state</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#record_metric" class="internal-link" title="pulsar.functions.context.Context.record_metric">record<wbr></wbr>_metric</a></code></td>
<td>Records the metric_value. metric_value has to satisfy isinstance(metric_value, numbers.Number)</td>
</tr>
</table>
</div>
<div id="childList">
<div class="basemethod">
<a name="pulsar.functions.context.Context.ack">
</a>
<a name="ack">
</a>
<div class="functionHeader">
@<a href="https://docs.python.org/3/library/abc.html#abc.abstractmethod" class="intersphinx-link">abstractmethod</a><br />
<span class="py-keyword">def</span> <span class="py-defname">ack</span><span class="function-signature">(self, msgid, topic)</span>:
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.3.0/pulsar/functions/context.py#L166">
(source)
</a>
<a class="headerLink" href="#ack" title="pulsar.functions.context.Context.ack">
</a>
</div>
<div class="docstring functionBody">
<div><p>ack this message id</p></div>
</div>
</div><div class="basemethod">
<a name="pulsar.functions.context.Context.del_counter">
</a>
<a name="del_counter">
</a>
<div class="functionHeader">
@<a href="https://docs.python.org/3/library/abc.html#abc.abstractmethod" class="intersphinx-link">abstractmethod</a><br />
<span class="py-keyword">def</span> <span class="py-defname">del_counter</span><span class="function-signature">(self, key)</span>:
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.3.0/pulsar/functions/context.py#L181">
(source)
</a>
<a class="headerLink" href="#del_counter" title="pulsar.functions.context.Context.del_counter">
</a>
</div>
<div class="docstring functionBody">
<div><p>delete the counter of a given key in the managed state</p></div>
</div>
</div><div class="basemethod">
<a name="pulsar.functions.context.Context.get_counter">
</a>
<a name="get_counter">
</a>
<div class="functionHeader">
@<a href="https://docs.python.org/3/library/abc.html#abc.abstractmethod" class="intersphinx-link">abstractmethod</a><br />
<span class="py-keyword">def</span> <span class="py-defname">get_counter</span><span class="function-signature">(self, key)</span>:
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.3.0/pulsar/functions/context.py#L176">
(source)
</a>
<a class="headerLink" href="#get_counter" title="pulsar.functions.context.Context.get_counter">
</a>
</div>
<div class="docstring functionBody">
<div><p>get the counter of a given key in the managed state</p></div>
</div>
</div><div class="basemethod">
<a name="pulsar.functions.context.Context.get_current_message_topic_name">
</a>
<a name="get_current_message_topic_name">
</a>
<div class="functionHeader">
@<a href="https://docs.python.org/3/library/abc.html#abc.abstractmethod" class="intersphinx-link">abstractmethod</a><br />
<span class="py-keyword">def</span> <span class="py-defname">get_current_message_topic_name</span><span class="function-signature">(self)</span>:
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.3.0/pulsar/functions/context.py#L68">
(source)
</a>
<a class="headerLink" href="#get_current_message_topic_name" title="pulsar.functions.context.Context.get_current_message_topic_name">
</a>
</div>
<div class="docstring functionBody">
<div><p>Returns the topic name of the message that we are processing</p></div>
</div>
</div><div class="basemethod">
<a name="pulsar.functions.context.Context.get_function_id">
</a>
<a name="get_function_id">
</a>
<div class="functionHeader">
@<a href="https://docs.python.org/3/library/abc.html#abc.abstractmethod" class="intersphinx-link">abstractmethod</a><br />
<span class="py-keyword">def</span> <span class="py-defname">get_function_id</span><span class="function-signature">(self)</span>:
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.3.0/pulsar/functions/context.py#L87">
(source)
</a>
<a class="headerLink" href="#get_function_id" title="pulsar.functions.context.Context.get_function_id">
</a>
</div>
<div class="docstring functionBody">
<div><p>Returns the function id that we are a part of</p></div>
</div>
</div><div class="basemethod">
<a name="pulsar.functions.context.Context.get_function_name">
</a>
<a name="get_function_name">
</a>
<div class="functionHeader">
@<a href="https://docs.python.org/3/library/abc.html#abc.abstractmethod" class="intersphinx-link">abstractmethod</a><br />
<span class="py-keyword">def</span> <span class="py-defname">get_function_name</span><span class="function-signature">(self)</span>:
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.3.0/pulsar/functions/context.py#L82">
(source)
</a>
<a class="headerLink" href="#get_function_name" title="pulsar.functions.context.Context.get_function_name">
</a>
</div>
<div class="docstring functionBody">
<div><p>Returns the function name that we are a part of</p></div>
</div>
</div><div class="basemethod">
<a name="pulsar.functions.context.Context.get_function_namespace">
</a>
<a name="get_function_namespace">
</a>
<div class="functionHeader">
@<a href="https://docs.python.org/3/library/abc.html#abc.abstractmethod" class="intersphinx-link">abstractmethod</a><br />
<span class="py-keyword">def</span> <span class="py-defname">get_function_namespace</span><span class="function-signature">(self)</span>:
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.3.0/pulsar/functions/context.py#L78">
(source)
</a>
<a class="headerLink" href="#get_function_namespace" title="pulsar.functions.context.Context.get_function_namespace">
</a>
</div>
<div class="docstring functionBody">
<div><p>Returns the namespace of the message that's being processed</p></div>
</div>
</div><div class="basemethod">
<a name="pulsar.functions.context.Context.get_function_tenant">
</a>
<a name="get_function_tenant">
</a>
<div class="functionHeader">
@<a href="https://docs.python.org/3/library/abc.html#abc.abstractmethod" class="intersphinx-link">abstractmethod</a><br />
<span class="py-keyword">def</span> <span class="py-defname">get_function_tenant</span><span class="function-signature">(self)</span>:
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.3.0/pulsar/functions/context.py#L73">
(source)
</a>
<a class="headerLink" href="#get_function_tenant" title="pulsar.functions.context.Context.get_function_tenant">
</a>
</div>
<div class="docstring functionBody">
<div><p>Returns the tenant of the message that's being processed</p></div>
</div>
</div><div class="basemethod">
<a name="pulsar.functions.context.Context.get_function_version">
</a>
<a name="get_function_version">
</a>
<div class="functionHeader">
@<a href="https://docs.python.org/3/library/abc.html#abc.abstractmethod" class="intersphinx-link">abstractmethod</a><br />
<span class="py-keyword">def</span> <span class="py-defname">get_function_version</span><span class="function-signature">(self)</span>:
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.3.0/pulsar/functions/context.py#L97">
(source)
</a>
<a class="headerLink" href="#get_function_version" title="pulsar.functions.context.Context.get_function_version">
</a>
</div>
<div class="docstring functionBody">
<div><p>Returns the version of function that we are executing</p></div>
</div>
</div><div class="basemethod">
<a name="pulsar.functions.context.Context.get_input_topics">
</a>
<a name="get_input_topics">
</a>
<div class="functionHeader">
@<a href="https://docs.python.org/3/library/abc.html#abc.abstractmethod" class="intersphinx-link">abstractmethod</a><br />
<span class="py-keyword">def</span> <span class="py-defname">get_input_topics</span><span class="function-signature">(self)</span>:
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.3.0/pulsar/functions/context.py#L151">
(source)
</a>
<a class="headerLink" href="#get_input_topics" title="pulsar.functions.context.Context.get_input_topics">
</a>
</div>
<div class="docstring functionBody">
<div><p>Returns the input topics of function</p></div>
</div>
</div><div class="basemethod">
<a name="pulsar.functions.context.Context.get_instance_id">
</a>
<a name="get_instance_id">
</a>
<div class="functionHeader">
@<a href="https://docs.python.org/3/library/abc.html#abc.abstractmethod" class="intersphinx-link">abstractmethod</a><br />
<span class="py-keyword">def</span> <span class="py-defname">get_instance_id</span><span class="function-signature">(self)</span>:
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.3.0/pulsar/functions/context.py#L92">
(source)
</a>
<a class="headerLink" href="#get_instance_id" title="pulsar.functions.context.Context.get_instance_id">
</a>
</div>
<div class="docstring functionBody">
<div><p>Returns the instance id that is executing the function</p></div>
</div>
</div><div class="basemethod">
<a name="pulsar.functions.context.Context.get_logger">
</a>
<a name="get_logger">
</a>
<div class="functionHeader">
@<a href="https://docs.python.org/3/library/abc.html#abc.abstractmethod" class="intersphinx-link">abstractmethod</a><br />
<span class="py-keyword">def</span> <span class="py-defname">get_logger</span><span class="function-signature">(self)</span>:
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.3.0/pulsar/functions/context.py#L102">
(source)
</a>
<a class="headerLink" href="#get_logger" title="pulsar.functions.context.Context.get_logger">
</a>
</div>
<div class="docstring functionBody">
<div><p>Returns the logger object that can be used to do logging</p></div>
</div>
</div><div class="basemethod">
<a name="pulsar.functions.context.Context.get_message_eventtime">
</a>
<a name="get_message_eventtime">
</a>
<div class="functionHeader">
@<a href="https://docs.python.org/3/library/abc.html#abc.abstractmethod" class="intersphinx-link">abstractmethod</a><br />
<span class="py-keyword">def</span> <span class="py-defname">get_message_eventtime</span><span class="function-signature">(self)</span>:
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.3.0/pulsar/functions/context.py#L58">
(source)
</a>
<a class="headerLink" href="#get_message_eventtime" title="pulsar.functions.context.Context.get_message_eventtime">
</a>
</div>
<div class="docstring functionBody">
<div><p>Return the event time of the current message that we are processing</p></div>
</div>
</div><div class="basemethod">
<a name="pulsar.functions.context.Context.get_message_id">
</a>
<a name="get_message_id">
</a>
<div class="functionHeader">
@<a href="https://docs.python.org/3/library/abc.html#abc.abstractmethod" class="intersphinx-link">abstractmethod</a><br />
<span class="py-keyword">def</span> <span class="py-defname">get_message_id</span><span class="function-signature">(self)</span>:
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.3.0/pulsar/functions/context.py#L48">
(source)
</a>
<a class="headerLink" href="#get_message_id" title="pulsar.functions.context.Context.get_message_id">
</a>
</div>
<div class="docstring functionBody">
<div><p>Return the messageid of the current message that we are processing</p></div>
</div>
</div><div class="basemethod">
<a name="pulsar.functions.context.Context.get_message_key">
</a>
<a name="get_message_key">
</a>
<div class="functionHeader">
@<a href="https://docs.python.org/3/library/abc.html#abc.abstractmethod" class="intersphinx-link">abstractmethod</a><br />
<span class="py-keyword">def</span> <span class="py-defname">get_message_key</span><span class="function-signature">(self)</span>:
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.3.0/pulsar/functions/context.py#L53">
(source)
</a>
<a class="headerLink" href="#get_message_key" title="pulsar.functions.context.Context.get_message_key">
</a>
</div>
<div class="docstring functionBody">
<div><p>Return the key of the current message that we are processing</p></div>
</div>
</div><div class="basemethod">
<a name="pulsar.functions.context.Context.get_message_properties">
</a>
<a name="get_message_properties">
</a>
<div class="functionHeader">
@<a href="https://docs.python.org/3/library/abc.html#abc.abstractmethod" class="intersphinx-link">abstractmethod</a><br />
<span class="py-keyword">def</span> <span class="py-defname">get_message_properties</span><span class="function-signature">(self)</span>:
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.3.0/pulsar/functions/context.py#L63">
(source)
</a>
<a class="headerLink" href="#get_message_properties" title="pulsar.functions.context.Context.get_message_properties">
</a>
</div>
<div class="docstring functionBody">
<div><p>Return the message properties kv map of the current message that we are processing</p></div>
</div>
</div><div class="basemethod">
<a name="pulsar.functions.context.Context.get_output_serde_class_name">
</a>
<a name="get_output_serde_class_name">
</a>
<div class="functionHeader">
@<a href="https://docs.python.org/3/library/abc.html#abc.abstractmethod" class="intersphinx-link">abstractmethod</a><br />
<span class="py-keyword">def</span> <span class="py-defname">get_output_serde_class_name</span><span class="function-signature">(self)</span>:
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.3.0/pulsar/functions/context.py#L161">
(source)
</a>
<a class="headerLink" href="#get_output_serde_class_name" title="pulsar.functions.context.Context.get_output_serde_class_name">
</a>
</div>
<div class="docstring functionBody">
<div><p>return output Serde class</p></div>
</div>
</div><div class="basemethod">
<a name="pulsar.functions.context.Context.get_output_topic">
</a>
<a name="get_output_topic">
</a>
<div class="functionHeader">
@<a href="https://docs.python.org/3/library/abc.html#abc.abstractmethod" class="intersphinx-link">abstractmethod</a><br />
<span class="py-keyword">def</span> <span class="py-defname">get_output_topic</span><span class="function-signature">(self)</span>:
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.3.0/pulsar/functions/context.py#L156">
(source)
</a>
<a class="headerLink" href="#get_output_topic" title="pulsar.functions.context.Context.get_output_topic">
</a>
</div>
<div class="docstring functionBody">
<div><p>Returns the output topic of function</p></div>
</div>
</div><div class="basemethod">
<a name="pulsar.functions.context.Context.get_partition_key">
</a>
<a name="get_partition_key">
</a>
<div class="functionHeader">
@<a href="https://docs.python.org/3/library/abc.html#abc.abstractmethod" class="intersphinx-link">abstractmethod</a><br />
<span class="py-keyword">def</span> <span class="py-defname">get_partition_key</span><span class="function-signature">(self)</span>:
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.3.0/pulsar/functions/context.py#L123">
(source)
</a>
<a class="headerLink" href="#get_partition_key" title="pulsar.functions.context.Context.get_partition_key">
</a>
</div>
<div class="docstring functionBody">
<div><p>Returns partition key of the input message is one exists</p></div>
</div>
</div><div class="basemethod">
<a name="pulsar.functions.context.Context.get_secret">
</a>
<a name="get_secret">
</a>
<div class="functionHeader">
@<a href="https://docs.python.org/3/library/abc.html#abc.abstractmethod" class="intersphinx-link">abstractmethod</a><br />
<span class="py-keyword">def</span> <span class="py-defname">get_secret</span><span class="function-signature">(self, secret_name)</span>:
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.3.0/pulsar/functions/context.py#L118">
(source)
</a>
<a class="headerLink" href="#get_secret" title="pulsar.functions.context.Context.get_secret">
</a>
</div>
<div class="docstring functionBody">
<div><p>Returns the secret value associated with the name. None if nothing was found</p></div>
</div>
</div><div class="basemethod">
<a name="pulsar.functions.context.Context.get_state">
</a>
<a name="get_state">
</a>
<div class="functionHeader">
@<a href="https://docs.python.org/3/library/abc.html#abc.abstractmethod" class="intersphinx-link">abstractmethod</a><br />
<span class="py-keyword">def</span> <span class="py-defname">get_state</span><span class="function-signature">(self, key)</span>:
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.3.0/pulsar/functions/context.py#L191">
(source)
</a>
<a class="headerLink" href="#get_state" title="pulsar.functions.context.Context.get_state">
</a>
</div>
<div class="docstring functionBody">
<div><p>get the value of a given key in the managed state</p></div>
</div>
</div><div class="basemethod">
<a name="pulsar.functions.context.Context.get_user_config_map">
</a>
<a name="get_user_config_map">
</a>
<div class="functionHeader">
@<a href="https://docs.python.org/3/library/abc.html#abc.abstractmethod" class="intersphinx-link">abstractmethod</a><br />
<span class="py-keyword">def</span> <span class="py-defname">get_user_config_map</span><span class="function-signature">(self)</span>:
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.3.0/pulsar/functions/context.py#L112">
(source)
</a>
<a class="headerLink" href="#get_user_config_map" title="pulsar.functions.context.Context.get_user_config_map">
</a>
</div>
<div class="docstring functionBody">
<div><p>Returns the entire user-defined config as a dict
(the dict will be empty if no user-defined config is supplied)</p></div>
</div>
</div><div class="basemethod">
<a name="pulsar.functions.context.Context.get_user_config_value">
</a>
<a name="get_user_config_value">
</a>
<div class="functionHeader">
@<a href="https://docs.python.org/3/library/abc.html#abc.abstractmethod" class="intersphinx-link">abstractmethod</a><br />
<span class="py-keyword">def</span> <span class="py-defname">get_user_config_value</span><span class="function-signature">(self, key)</span>:
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.3.0/pulsar/functions/context.py#L107">
(source)
</a>
<a class="headerLink" href="#get_user_config_value" title="pulsar.functions.context.Context.get_user_config_value">
</a>
</div>
<div class="docstring functionBody">
<div><p>Returns the value of the user-defined config. If the key doesn't exist, None is returned</p></div>
</div>
</div><div class="basemethod">
<a name="pulsar.functions.context.Context.incr_counter">
</a>
<a name="incr_counter">
</a>
<div class="functionHeader">
@<a href="https://docs.python.org/3/library/abc.html#abc.abstractmethod" class="intersphinx-link">abstractmethod</a><br />
<span class="py-keyword">def</span> <span class="py-defname">incr_counter</span><span class="function-signature">(self, key, amount)</span>:
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.3.0/pulsar/functions/context.py#L171">
(source)
</a>
<a class="headerLink" href="#incr_counter" title="pulsar.functions.context.Context.incr_counter">
</a>
</div>
<div class="docstring functionBody">
<div><p>incr the counter of a given key in the managed state</p></div>
</div>
</div><div class="basemethod">
<a name="pulsar.functions.context.Context.publish">
</a>
<a name="publish">
</a>
<div class="functionHeader">
@<a href="https://docs.python.org/3/library/abc.html#abc.abstractmethod" class="intersphinx-link">abstractmethod</a><br />
<span class="py-keyword">def</span> <span class="py-defname">publish</span><span class="function-signature">(self, topic_name, message, serde_class_name=<span class="rst-variable-quote">'</span><span class="rst-variable-string">serde.IdentitySerDe</span><span class="rst-variable-quote">'</span>, properties=<a href="https://docs.python.org/3/library/constants.html#None" class="intersphinx-link">None</a>, compression_type=<a href="https://docs.python.org/3/library/constants.html#None" class="intersphinx-link">None</a>, callback=<a href="https://docs.python.org/3/library/constants.html#None" class="intersphinx-link">None</a>, message_conf=<a href="https://docs.python.org/3/library/constants.html#None" class="intersphinx-link">None</a>)</span>:
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.3.0/pulsar/functions/context.py#L133">
(source)
</a>
<a class="headerLink" href="#publish" title="pulsar.functions.context.Context.publish">
</a>
</div>
<div class="docstring functionBody">
<div><p>Publishes message to topic_name by first serializing the message using serde_class_name serde
The message will have properties specified if any</p>
<p>The available options for message_conf:</p>
<blockquote>
properties,
partition_key,
sequence_id,
replication_clusters,
disable_replication,
event_timestamp</blockquote>
</div>
</div>
</div><div class="basemethod">
<a name="pulsar.functions.context.Context.put_state">
</a>
<a name="put_state">
</a>
<div class="functionHeader">
@<a href="https://docs.python.org/3/library/abc.html#abc.abstractmethod" class="intersphinx-link">abstractmethod</a><br />
<span class="py-keyword">def</span> <span class="py-defname">put_state</span><span class="function-signature">(self, key, value)</span>:
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.3.0/pulsar/functions/context.py#L186">
(source)
</a>
<a class="headerLink" href="#put_state" title="pulsar.functions.context.Context.put_state">
</a>
</div>
<div class="docstring functionBody">
<div><p>update the value of a given key in the managed state</p></div>
</div>
</div><div class="basemethod">
<a name="pulsar.functions.context.Context.record_metric">
</a>
<a name="record_metric">
</a>
<div class="functionHeader">
@<a href="https://docs.python.org/3/library/abc.html#abc.abstractmethod" class="intersphinx-link">abstractmethod</a><br />
<span class="py-keyword">def</span> <span class="py-defname">record_metric</span><span class="function-signature">(self, metric_name, metric_value)</span>:
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.3.0/pulsar/functions/context.py#L128">
(source)
</a>
<a class="headerLink" href="#record_metric" title="pulsar.functions.context.Context.record_metric">
</a>
</div>
<div class="docstring functionBody">
<div><p>Records the metric_value. metric_value has to satisfy isinstance(metric_value, numbers.Number)</p></div>
</div>
</div>
</div>
</div>
</div>
<footer class="navbar navbar-default">
<hr />
<div class="container">
<a href="index.html">API Documentation</a> for _pulsar/pulsar,
generated by <a href="https://github.com/twisted/pydoctor/">pydoctor</a>
23.4.1 at 2023-08-30 15:10:14.
</div>
<script src="ajax.js" type="text/javascript"></script>
<script src="searchlib.js" type="text/javascript"></script>
<script src="search.js" type="text/javascript"></script>
</footer>
<script src="pydoctor.js" type="text/javascript"></script>
</body>
</html>