@InterfaceAudience.Public @InterfaceStability.Stable public interface WindowContext
| Modifier and Type | Method and Description |
|---|---|
long |
getCounter(String key)
Retrieve the counter value for the key.
|
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.
|
int |
getInstanceId()
The id of the instance that invokes this function.
|
org.slf4j.Logger |
getLogger()
The logger object that can be used to log in a function.
|
String |
getNamespace()
The namespace this function belongs to.
|
int |
getNumInstances()
Get the number of instances that invoke this function.
|
String |
getOutputSchemaType()
Get output schema builtin type or custom class name.
|
String |
getOutputTopic()
Get the output topic of the function.
|
ByteBuffer |
getState(String key)
Retrieve the state value for the key.
|
String |
getTenant()
The tenant this function belongs to.
|
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.
|
void |
incrCounter(String key,
long amount)
Increment the builtin distributed counter referred by key.
|
<O> CompletableFuture<Void> |
publish(String topicName,
O object)
Publish an object to the topic using default schemas.
|
<O> CompletableFuture<Void> |
publish(String topicName,
O object,
String schemaOrSerdeClassName)
Publish an object using serDe for serializing to the topic.
|
void |
putState(String key,
ByteBuffer value)
Update the state value for the key.
|
void |
recordMetric(String metricName,
double value)
Record a user defined metric.
|
String getTenant()
String getNamespace()
String getFunctionName()
String getFunctionId()
int getInstanceId()
int getNumInstances()
String getFunctionVersion()
Collection<String> getInputTopics()
String getOutputTopic()
String getOutputSchemaType()
org.slf4j.Logger getLogger()
void incrCounter(String key, long amount)
key - The name of the keyamount - The amount to be incrementedlong getCounter(String key)
key - name of the keyvoid putState(String key, ByteBuffer value)
key - name of the keyvalue - state value of the keyByteBuffer getState(String key)
key - name of the keyMap<String,Object> getUserConfigMap()
Optional<Object> getUserConfigValue(String key)
key - The keyObject getUserConfigValueOrDefault(String key, Object defaultValue)
key - defaultValue - void recordMetric(String metricName, double value)
metricName - The name of the metricvalue - The value of the metric<O> CompletableFuture<Void> publish(String topicName, O object, String schemaOrSerdeClassName)
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)
topicName - The name of the topic for publishingobject - The object that needs to be publishedCopyright © 2017–2021 Apache Software Foundation. All rights reserved.