From 0b7f7b3632c4edeaed014aa97fe2058fcd834391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Boschi?= Date: Tue, 1 Mar 2022 14:25:19 +0100 Subject: [PATCH] fix cherry-pick issue --- .../apache/pulsar/functions/api/BaseContext.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pulsar-functions/api-java/src/main/java/org/apache/pulsar/functions/api/BaseContext.java b/pulsar-functions/api-java/src/main/java/org/apache/pulsar/functions/api/BaseContext.java index d2d0b3e719547..4bd65a1c701cd 100644 --- a/pulsar-functions/api-java/src/main/java/org/apache/pulsar/functions/api/BaseContext.java +++ b/pulsar-functions/api-java/src/main/java/org/apache/pulsar/functions/api/BaseContext.java @@ -19,6 +19,7 @@ package org.apache.pulsar.functions.api; import org.apache.pulsar.client.api.ClientBuilder; +import org.apache.pulsar.client.api.PulsarClient; import org.apache.pulsar.common.classification.InterfaceAudience; import org.apache.pulsar.common.classification.InterfaceStability; import org.slf4j.Logger; @@ -193,6 +194,18 @@ default S getStateStore(String tenant, String ns, String */ void recordMetric(String metricName, double value); + /** + * Get the pre-configured pulsar client. + * + * You can use this client to access Pulsar cluster. + * The Function will be responsible for disposing this client. + * + * @return the instance of pulsar client + */ + default PulsarClient getPulsarClient() { + throw new UnsupportedOperationException("not implemented"); + } + /** * Get the pre-configured pulsar client builder. *