Xianle Wang
11/25/2025, 11:07 PMDavid K
11/26/2025, 5:12 PMXianle Wang
11/26/2025, 5:17 PMDavid K
11/26/2025, 5:23 PMXianle Wang
11/26/2025, 5:24 PMXianle Wang
12/08/2025, 6:10 PMState storage is only available for Java functions for now.Does it mean I can't enable state storage for Python functions?
David K
12/08/2025, 7:01 PMDavid K
12/08/2025, 7:10 PMfrom pulsar import Function
class StatefulFunction(Function):
def process(self, input, context):
# Increment a counter
context.incr_counter("message_count", 1)
# Get the current counter value
count = context.get_counter("message_count")
context.get_logger().info(f"Processed {count} messages")
# Store arbitrary state (value must be bytes)
context.put_state("last_message", input.encode('utf-8'))
# Retrieve state
last_msg = context.get_state("last_message")
# Delete state if needed
# context.del_counter("some_key")
return inputXianle Wang
12/08/2025, 7:18 PMcontext.put_state(key, value) and context.get_state(key) in a serverless cluster, but context.get_state(key) always returns None.
And the UI shows "enableStateStore": false, in my functions "Custom Runtime options".
Could it be a special limitation on StreamNative's serverless cluster?David K
12/08/2025, 7:37 PMXianle Wang
12/09/2025, 12:49 AMput_state and get_state for a few KB of data?David K
12/09/2025, 2:15 AMDavid K
12/09/2025, 2:16 AM