Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
pulsar
提交
a4c330e0
pulsar
项目概览
apache
/
pulsar
通知
129
Star
40
Fork
3
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Wiki
1
Wiki
分析
仓库
DevOps
项目成员
Pages
pulsar
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
Wiki
1
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a4c330e0
编写于
10月 31, 2019
作者:
B
Brian Candler
提交者:
Matteo Merli
10月 31, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Python API: add get_input_topics() (#5526)
Fixes #5525
上级
3d5bc0a0
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
11 addition
and
0 deletion
+11
-0
pulsar-client-cpp/python/pulsar/functions/context.py
pulsar-client-cpp/python/pulsar/functions/context.py
+5
-0
pulsar-functions/instance/src/main/python/contextimpl.py
pulsar-functions/instance/src/main/python/contextimpl.py
+3
-0
site2/docs/functions-api.md
site2/docs/functions-api.md
+1
-0
site2/docs/functions-develop.md
site2/docs/functions-develop.md
+2
-0
未找到文件。
pulsar-client-cpp/python/pulsar/functions/context.py
浏览文件 @
a4c330e0
...
...
@@ -146,6 +146,11 @@ class Context(object):
"""
pass
@
abstractmethod
def
get_input_topics
(
self
):
"""Returns the input topics of function"""
pass
@
abstractmethod
def
get_output_topic
(
self
):
"""Returns the output topic of function"""
...
...
pulsar-functions/instance/src/main/python/contextimpl.py
浏览文件 @
a4c330e0
...
...
@@ -135,6 +135,9 @@ class ContextImpl(pulsar.Context):
self
.
user_metrics_map
[
metric_name
].
observe
(
metric_value
)
def
get_input_topics
(
self
):
return
list
(
self
.
instance_config
.
function_details
.
source
.
inputSpecs
.
keys
())
def
get_output_topic
(
self
):
return
self
.
instance_config
.
function_details
.
output
...
...
site2/docs/functions-api.md
浏览文件 @
a4c330e0
...
...
@@ -588,6 +588,7 @@ Method | What it provides
`get_user_config_map`
| Returns the entire user-defined config as a dict
`record_metric`
| Records a per-key
[
metric
](
#python-metrics
)
`publish`
| Publishes a message to the specified Pulsar topic
`get_input_topics`
| The name(s) of the input(topics), as a list
`get_output_topic`
| The name of the output topic
`get_output_serde_class_name`
| The name of the output
[
SerDe
](
#python-serde
)
class
`ack`
|
[
Acks
](
reference-terminology.md#acknowledgment-ack
)
the message being processed to Pulsar
...
...
site2/docs/functions-develop.md
浏览文件 @
a4c330e0
...
...
@@ -356,6 +356,8 @@ class ContextImpl(pulsar.Context):
...
def record_metric(self, metric_name, metric_value):
...
def get_input_topics(self):
...
def get_output_topic(self):
...
def get_output_serde_class_name(self):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录