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:
Operation | Interface/Method Used |
---|---|
Creating streams |
|
Editing stream attributes |
|
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 | falseNOTE 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
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
|
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
|
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
|
Enabling and tuning log compaction | TopicDescriptor is used to enable and tune log compaction at
the stream-level.
In addition, the Admin interface is used with the following
method to set compaction at the topic-level:
|
Enabling an Idempotent Producer | The Producer interface along with the
ProducerConfig class is used to enable idempotence (exact-once
message delivery semantics) publishing. |