@InterfaceAudience.Public @InterfaceStability.Stable public interface Context extends BaseContext
| Modifier and Type | Method and Description |
|---|---|
Record<?> |
getCurrentRecord()
Access the record associated with the current input value.
|
String |
getFunctionId()
The id of the function that we are executing
|
String |
getFunctionName()
The name of the function that we are executing.
|
String |
getFunctionVersion()
The version of the function that we are executing.
|
Collection<String> |
getInputTopics()
Get a list of all input topics.
|
String |
getOutputSchemaType()
Get output schema builtin type or custom class name.
|
String |
getOutputTopic()
Get the output topic of the source.
|
PulsarAdmin |
getPulsarAdmin()
Get the pulsar admin client.
|
Map<String,Object> |
getUserConfigMap()
Get a map of all user-defined key/value configs for the function.
|
Optional<Object> |
getUserConfigValue(String key)
Get any user-defined key/value.
|
Object |
getUserConfigValueOrDefault(String key,
Object defaultValue)
Get any user-defined key/value or a default value if none is present.
|
<O> ConsumerBuilder<O> |
newConsumerBuilder(Schema<O> schema)
Create a ConsumerBuilder with the schema.
|
<O> TypedMessageBuilder<O> |
newOutputMessage(String topicName,
Schema<O> schema)
New output message using schema for serializing to the topic
|
<O> CompletableFuture<Void> |
publish(String topicName,
O object)
Deprecated.
in favor of using
newOutputMessage(String, Schema) |
<O> CompletableFuture<Void> |
publish(String topicName,
O object,
String schemaOrSerdeClassName)
Deprecated.
in favor of using
newOutputMessage(String, Schema) |
deleteState, deleteStateAsync, getCounter, getCounterAsync, getInstanceId, getLogger, getNamespace, getNumInstances, getPulsarClient, getSecret, getState, getStateAsync, getStateStore, getStateStore, getTenant, incrCounter, incrCounterAsync, putState, putStateAsync, recordMetricCollection<String> getInputTopics()
String getOutputTopic()
Record<?> getCurrentRecord()
String getOutputSchemaType()
String getFunctionName()
String getFunctionId()
String getFunctionVersion()
Map<String,Object> getUserConfigMap()
Optional<Object> getUserConfigValue(String key)
key - The keyObject getUserConfigValueOrDefault(String key, Object defaultValue)
key - defaultValue - PulsarAdmin getPulsarAdmin()
<O> CompletableFuture<Void> publish(String topicName, O object, String schemaOrSerdeClassName)
newOutputMessage(String, Schema)topicName - The name of the topic for publishingobject - The object that needs to be publishedschemaOrSerdeClassName - Either a builtin schema type (eg: "avro", "json", "protobuf") or the class name
of the custom schema class<O> CompletableFuture<Void> publish(String topicName, O object)
newOutputMessage(String, Schema)topicName - The name of the topic for publishingobject - The object that needs to be published<O> TypedMessageBuilder<O> newOutputMessage(String topicName, Schema<O> schema) throws PulsarClientException
O - topicName - The name of the topic for output messageschema - provide a way to convert between serialized data and domain objectsPulsarClientException<O> ConsumerBuilder<O> newConsumerBuilder(Schema<O> schema) throws PulsarClientException
O - schema - provide a way to convert between serialized data and domain objectsPulsarClientExceptionCopyright © 2017–2021 Apache Software Foundation. All rights reserved.