@Evolving public interface TopicCatalog
TopicCatalog
interface defines the public API for managing topic objects in a schema.
If the catalog implementation supports topic objects, it should implement this interface.Modifier and Type | Method and Description |
---|---|
Topic |
alterTopic(NameIdentifier ident,
TopicChange... changes)
Apply the
changes to a topic in the catalog. |
Topic |
createTopic(NameIdentifier ident,
java.lang.String comment,
DataLayout dataLayout,
java.util.Map<java.lang.String,java.lang.String> properties)
Create a topic in the catalog.
|
boolean |
dropTopic(NameIdentifier ident)
Drop a topic from the catalog.
|
NameIdentifier[] |
listTopics(Namespace namespace)
List the topics in a schema namespace from the catalog.
|
Topic |
loadTopic(NameIdentifier ident)
Load topic metadata by
NameIdentifier from the catalog. |
default boolean |
topicExists(NameIdentifier ident)
Check if a topic exists using an
NameIdentifier from the catalog. |
NameIdentifier[] listTopics(Namespace namespace) throws NoSuchSchemaException
namespace
- A schema namespace.NoSuchSchemaException
- If the schema does not exist.Topic loadTopic(NameIdentifier ident) throws NoSuchTopicException
NameIdentifier
from the catalog.ident
- A topic identifier.NoSuchTopicException
- If the topic does not exist.default boolean topicExists(NameIdentifier ident)
NameIdentifier
from the catalog.ident
- A topic identifier.Topic createTopic(NameIdentifier ident, java.lang.String comment, DataLayout dataLayout, java.util.Map<java.lang.String,java.lang.String> properties) throws NoSuchSchemaException, TopicAlreadyExistsException
ident
- A topic identifier.comment
- The comment of the topic object. Null is set if no comment is specified.dataLayout
- The message schema of the topic object. Always null because it's not
supported yet.properties
- The properties of the topic object. Empty map is set if no properties are
specified.NoSuchSchemaException
- If the schema does not exist.TopicAlreadyExistsException
- If the topic already exists.Topic alterTopic(NameIdentifier ident, TopicChange... changes) throws NoSuchTopicException, java.lang.IllegalArgumentException
changes
to a topic in the catalog.ident
- A topic identifier.changes
- The changes to apply to the topic.NoSuchTopicException
- If the topic does not exist.java.lang.IllegalArgumentException
- If the changes is rejected by the implementation.boolean dropTopic(NameIdentifier ident)
ident
- A topic identifier.