Stream and Topic Operations Summary

Provides a summary of stream topic operations and the interface, class, or method used for the operation.

The following stream and topic operations is not an inclusive list, but a sampling. For detailed information, see the following libraries:
Table 1. Summary of Stream and Topic operations
Operation Interface/Method Used
Creating streams

StreamDescriptor is used to set the attributes for streams that you plan to create.

Admin.createStream(String streamPathAndName, StreamDescriptor desc) - create the stream.

Editing stream attributes

StreamDescriptor is used to edit the stream's attribute values.

Admin.editStream(String streamPathAndName, StreamDescriptor desc) - set or modify the stream's attribute values.

Retrieving the default timestamp type on a stream
StreamDescriptor.getDefaultTimestampType() - retrieves the default timestamp type on the stream.
Note: This method is new as of 6.0.1
Sets the default timestamp type on a stream
StreamDescriptor.setDefaultTimestampType(TimestampType logAppendTime) - sets the default timestamp type on the stream.
Note: TimestampType Enum is new as of 6.0.1
Deleting streams Admin.deleteStream(String streamPathAndName)
Determining stream existence Admin.streamExists(String streamPathAndName) - determines whether a stream exists or not. Returns: true | false
Note: This method is new as of 6.0.1
Creating topics
Admin.createTopic(String streamPathAndName, String topicName, TopicDescriptor desc) is used when creating a topic with the defaults for partitions and timestamp type.
Note: TopicDescriptor is new as of 6.0.1

Admin.createTopic(String streamPathAndName, String topicName) is used when accepting the default number of partitions.

Admin.createTopic(String streamPathAndName, String topicName, int npartitions) - creates a topic with a specific number of partitions.

Note: If you do not specify the number of partitions for a stream topic, the default number of partitions is inherited from the stream.
Editing topics
Admin.editTopic(String streamPathAndName, String topicName, TopicDescriptor desc) - sets the partitions and timestamp type attributes of a topic.
Note: TopicDescriptor is new as of 6.0.1

Admin.editTopic(String streamPathAndName, String topicName, int npartitions)

Retrieving topic attributes Admin.getTopicDescriptor(String streamPathAndName, String topicName) - retrieves topic attributes.
Note: This method is new as of 6.0.1
Deleting topics Admin.deleteTopic(String streamPathAndName, String topicName) - deletes topics.
Listing topics Admin.listTopics(String streamPathAndName) - lists all topics in a stream.
Note: This method is new as of 6.0.1
Counting topics Admin.countTopics(String streamPathAndName) - counts the number of topics in a stream.
Gets/Sets topic timestamp type TopicDescriptor is used to retrieve the timestamp type attribute value of a topic.
Note: TopicDescriptor is new as of 6.0.1

TopicDescriptor.getTimestampType() - retrieves the default timestamp type of a topic.

TopicDescriptor.setTimestampType(TimestampType timestampType) - sets the default timestamp type of a topic.

Gets/Sets topic partitions TopicDescriptor is used to retrieve the partition attribute value of a topic.
Note: TopicDescriptor is new as of 6.0.1

TopicDescriptor.getPartitions() - retrieves the partitions of a topic.

TopicDescriptor.setParitions(int numPartitions) - sets the partitions of a topic.