SPL File Functions.spl

Content

Functions

Functions

rstring createMessageAddTopic(rstring topic)

Creates the JSON message to add a single topic to the operator's subscription to begin consuming from the default position.

Parameters

  • topic: The topic to subscribe

Returns

  • A JSON string to be submitted to the KafkaConsumer input port

rstring createMessageAddTopics(list<rstring> topics)

Creates the JSON message to add multiple topics to the operator's subscription to begin consuming from the default position.

Parameters

  • topics: The topics to subscribe

Returns

  • A JSON string to be submitted to the KafkaConsumer input port

rstring createMessageRemoveTopic(rstring topic)

Creates the JSON message to remove a single topic from the operator's subscription.

Parameters

  • topic: The topic to unsubscribe

Returns

  • A JSON string to be submitted to the KafkaConsumer input port

rstring createMessageRemoveTopics(list<rstring> topics)

Creates the JSON message to remove multiple topics from the operator's subscription.

Parameters

  • topics: The topics to unsubscribe

Returns

  • A JSON string to be submitted to the KafkaConsumer input port

rstring createMessageRemoveTopicPartition(list<Control.TopicPartition> topicPartitionsToRemove)

Creates the JSON message to remove multiple topic partitions from the operator's partition assignment.

Parameters

  • topicPartitionsToRemove: specifies a list of topic partitions to remove

Returns

  • A JSON string to be submitted to the KafkaConsumer input port

rstring createMessageAddTopicPartition(list<Control.TopicPartitionOffset> topicPartitionsToAdd)

Creates the JSON message to add multiple topic partitions to the operator's partition assignment. The operator will begin consuming from the topic partitions at their specified offset.

  • To begin consuming from the end of a topic partition, set the offset value to -1
  • To begin consuming from the beginning of a topic partition, set the offset value to -2
  • To begin consuming from the default position, set the offset value to -3, what is effectively equivalent to rstring createMessageAddTopicPartition (list<Control.TopicPartition> topicPartitionsToAdd)

Parameters

  • topicPartitionsToAdd: A list of topic partitions to assign to along with the corresponding offset number to begin consuming from.

Returns

  • A JSON string to be submitted to the KafkaConsumer input port

rstring createMessageAddTopicPartition(list<Control.TopicPartition> topicPartitionsToAdd)

Creates the JSON message to add multiple topic partitions to the operator's partition assignment. The operator will begin consuming all partitions from the default positions.

Parameters

  • topicPartitionsToAdd: A list of topic partitions to assign.

Returns

  • A JSON string to be submitted to the KafkaConsumer input port

rstring createMessageRemoveTopicPartition(rstring topic, int32 partition)

Creates the JSON message to remove a single topic partition from the operator's partition assignment.

Parameters

  • topic: The topic to which the partition belongs to
  • partition: The partition number of the topic to unassign

Returns

  • A JSON string to be submitted to the KafkaConsumer input port

rstring createMessageAddTopicPartition(rstring topic, int32 partition, int64 offset)

Creates the JSON message to add a single topic partition to the operator's partition assignment and to begin consuming at the specified offset.

  • To begin consuming from the end of a topic partition, set the offset value to -1
  • To begin consuming from the beginning of a topic partition, set the offset value to -2
  • To begin consuming from the default position, set the offset value to -3, what is effectively equivalent to rstring createMessageAddTopicPartition (rstring topic, int32 partition)

Parameters

  • topic: The topic to which the partition belongs to
  • partition: The partition number of the topic to assign to
  • offset: The offset of the topic partition to begin consuming from

Returns

  • A JSON string to be submitted to the KafkaConsumer input port

rstring createMessageAddTopicPartition(rstring topic, int32 partition)

Creates the JSON message to add a single topic partition to the operator's partition assignment and to begin consuming at the default position.

Parameters

  • topic: The topic to which the partition belongs to
  • partition: The partition number of the topic to assign to

Returns

  • A JSON string to be submitted to the KafkaConsumer input port