-
方法概要
long
Retrieve the counter value for the key.
The id of the function that we are executing.
The name of the function that we are executing.
The version of the function that we are executing.
Get a list of all input topics.
int
The id of the instance that invokes this function.
org.slf4j.Logger
The logger object that can be used to log in a function.
The namespace this function belongs to.
int
Get the number of instances that invoke this function.
Get output schema builtin type or custom class name.
Get the output topic of the function.
Retrieve the state value for the key.
The tenant this function belongs to.
Get a map of all user-defined key/value configs for the function.
Get any user-defined key/value.
Get any user-defined key/value or a default value if none is present.
void
Increment the builtin distributed counter referred by key.
Publish an object to the topic using default schemas.
Publish an object using serDe for serializing to the topic.
void
Update the state value for the key.
void
Record a user defined metric.
-
方法详细资料
-
getTenant
The tenant this function belongs to.
- 返回:
- the tenant this function belongs to
-
getNamespace
The namespace this function belongs to.
- 返回:
- the namespace this function belongs to
-
getFunctionName
The name of the function that we are executing.
- 返回:
- The Function name
-
getFunctionId
The id of the function that we are executing.
- 返回:
- The function id
-
getInstanceId
int getInstanceId()
The id of the instance that invokes this function.
- 返回:
- the instance id
-
getNumInstances
int getNumInstances()
Get the number of instances that invoke this function.
- 返回:
- the number of instances that invoke this function.
-
getFunctionVersion
The version of the function that we are executing.
- 返回:
- The version id
-
-
getOutputTopic
Get the output topic of the function.
- 返回:
- output topic name
-
getOutputSchemaType
Get output schema builtin type or custom class name.
- 返回:
- output schema builtin type or custom class name
-
getLogger
org.slf4j.Logger getLogger()
The logger object that can be used to log in a function.
- 返回:
- the logger object
-
incrCounter
void incrCounter(String key,
long amount)
Increment the builtin distributed counter referred by key.
- 参数:
key - The name of the key
amount - The amount to be incremented
-
getCounter
Retrieve the counter value for the key.
- 参数:
key - name of the key
- 返回:
- the amount of the counter value for this key
-
putState
Update the state value for the key.
- 参数:
key - name of the key
value - state value of the key
-
getState
Retrieve the state value for the key.
- 参数:
key - name of the key
- 返回:
- the state value for the key.
-
getUserConfigMap
Get a map of all user-defined key/value configs for the function.
- 返回:
- The full map of user-defined config values
-
getUserConfigValue
Get any user-defined key/value.
- 参数:
key - The key
- 返回:
- The Optional value specified by the user for that key.
-
getUserConfigValueOrDefault
Get any user-defined key/value or a default value if none is present.
- 参数:
key - the config key to retrieve
defaultValue - value returned if the key is not found
- 返回:
- Either the user config value associated with a given key or a supplied default value
-
recordMetric
void recordMetric(String metricName,
double value)
Record a user defined metric.
- 参数:
metricName - The name of the metric
value - The value of the metric
-
publish
Publish an object using serDe for serializing to the topic.
- 参数:
topicName - The name of the topic for publishing
object - The object that needs to be published
schemaOrSerdeClassName - Either a builtin schema type (eg: "avro", "json", "protobuf")
or the class name of the custom schema class
- 返回:
- A future that completes when the framework is done publishing the message
-
publish
Publish an object to the topic using default schemas.
- 参数:
topicName - The name of the topic for publishing
object - The object that needs to be published
- 返回:
- A future that completes when the framework is done publishing the message