class documentation

class Context(object): (source)

View In Hierarchy

Interface defining information available at process time

Method ack ack this message id
Method del_counter delete the counter of a given key in the managed state
Method get_counter get the counter of a given key in the managed state
Method get_current_message_topic_name Returns the topic name of the message that we are processing
Method get_function_id Returns the function id that we are a part of
Method get_function_name Returns the function name that we are a part of
Method get_function_namespace Returns the namespace of the message that's being processed
Method get_function_tenant Returns the tenant of the message that's being processed
Method get_function_version Returns the version of function that we are executing
Method get_input_topics Returns the input topics of function
Method get_instance_id Returns the instance id that is executing the function
Method get_logger Returns the logger object that can be used to do logging
Method get_message_eventtime Return the event time of the current message that we are processing
Method get_message_id Return the messageid of the current message that we are processing
Method get_message_key Return the key of the current message that we are processing
Method get_message_properties Return the message properties kv map of the current message that we are processing
Method get_output_serde_class_name return output Serde class
Method get_output_topic Returns the output topic of function
Method get_partition_key Returns partition key of the input message is one exists
Method get_secret Returns the secret value associated with the name. None if nothing was found
Method get_state get the value of a given key in the managed state
Method get_user_config_map Returns the entire user-defined config as a dict (the dict will be empty if no user-defined config is supplied)
Method get_user_config_value Returns the value of the user-defined config. If the key doesn't exist, None is returned
Method incr_counter incr the counter of a given key in the managed state
Method publish Publishes message to topic_name by first serializing the message using serde_class_name serde The message will have properties specified if any
Method put_state update the value of a given key in the managed state
Method record_metric Records the metric_value. metric_value has to satisfy isinstance(metric_value, numbers.Number)
@abstractmethod
def ack(self, msgid, topic): (source)

ack this message id

@abstractmethod
def del_counter(self, key): (source)

delete the counter of a given key in the managed state

@abstractmethod
def get_counter(self, key): (source)

get the counter of a given key in the managed state

@abstractmethod
def get_current_message_topic_name(self): (source)

Returns the topic name of the message that we are processing

@abstractmethod
def get_function_id(self): (source)

Returns the function id that we are a part of

@abstractmethod
def get_function_name(self): (source)

Returns the function name that we are a part of

@abstractmethod
def get_function_namespace(self): (source)

Returns the namespace of the message that's being processed

@abstractmethod
def get_function_tenant(self): (source)

Returns the tenant of the message that's being processed

@abstractmethod
def get_function_version(self): (source)

Returns the version of function that we are executing

@abstractmethod
def get_input_topics(self): (source)

Returns the input topics of function

@abstractmethod
def get_instance_id(self): (source)

Returns the instance id that is executing the function

@abstractmethod
def get_logger(self): (source)

Returns the logger object that can be used to do logging

@abstractmethod
def get_message_eventtime(self): (source)

Return the event time of the current message that we are processing

@abstractmethod
def get_message_id(self): (source)

Return the messageid of the current message that we are processing

@abstractmethod
def get_message_key(self): (source)

Return the key of the current message that we are processing

@abstractmethod
def get_message_properties(self): (source)

Return the message properties kv map of the current message that we are processing

@abstractmethod
def get_output_serde_class_name(self): (source)

return output Serde class

@abstractmethod
def get_output_topic(self): (source)

Returns the output topic of function

@abstractmethod
def get_partition_key(self): (source)

Returns partition key of the input message is one exists

@abstractmethod
def get_secret(self, secret_name): (source)

Returns the secret value associated with the name. None if nothing was found

@abstractmethod
def get_state(self, key): (source)

get the value of a given key in the managed state

@abstractmethod
def get_user_config_map(self): (source)

Returns the entire user-defined config as a dict (the dict will be empty if no user-defined config is supplied)

@abstractmethod
def get_user_config_value(self, key): (source)

Returns the value of the user-defined config. If the key doesn't exist, None is returned

@abstractmethod
def incr_counter(self, key, amount): (source)

incr the counter of a given key in the managed state

@abstractmethod
def publish(self, topic_name, message, serde_class_name='serde.IdentitySerDe', properties=None, compression_type=None, callback=None, message_conf=None): (source)

Publishes message to topic_name by first serializing the message using serde_class_name serde The message will have properties specified if any

The available options for message_conf:

properties, partition_key, sequence_id, replication_clusters, disable_replication, event_timestamp
@abstractmethod
def put_state(self, key, value): (source)

update the value of a given key in the managed state

@abstractmethod
def record_metric(self, metric_name, metric_value): (source)

Records the metric_value. metric_value has to satisfy isinstance(metric_value, numbers.Number)