public class MessagingCatalog extends CatalogDTO implements TopicCatalog
Catalog.Type| Modifier and Type | Field and Description |
|---|---|
protected RESTClient |
restClient
The REST client to send the requests.
|
PROPERTY_PACKAGE| Modifier and Type | Method and Description |
|---|---|
Schema |
alterSchema(NameIdentifier ident,
SchemaChange... changes)
Alter the schema with specified identifier by applying the changes.
|
Topic |
alterTopic(NameIdentifier ident,
TopicChange... changes)
Alter the topic with the given identifier.
|
SupportsSchemas |
asSchemas()
Return the
SupportsSchemas if the catalog supports schema operations. |
TopicCatalog |
asTopicCatalog() |
static com.datastrato.gravitino.client.MessagingCatalog.Builder |
builder() |
Schema |
createSchema(NameIdentifier ident,
java.lang.String comment,
java.util.Map<java.lang.String,java.lang.String> properties)
Create a new schema with specified identifier, comment and metadata.
|
Topic |
createTopic(NameIdentifier ident,
java.lang.String comment,
DataLayout dataLayout,
java.util.Map<java.lang.String,java.lang.String> properties)
Create a new topic with the given identifier, comment, data layout and properties.
|
boolean |
dropSchema(NameIdentifier ident,
boolean cascade)
Drop the schema with specified identifier.
|
boolean |
dropTopic(NameIdentifier ident)
Drop the topic with the given identifier.
|
NameIdentifier[] |
listSchemas(Namespace namespace)
List all the schemas under the given catalog namespace.
|
NameIdentifier[] |
listTopics(Namespace namespace)
List all the topics under the given namespace.
|
Schema |
loadSchema(NameIdentifier ident)
Load the schema with specified identifier.
|
Topic |
loadTopic(NameIdentifier ident)
Load the topic with the given identifier.
|
auditInfo, comment, name, properties, provider, typeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittopicExistsschemaExistsasFilesetCatalog, asTableCatalogprotected final RESTClient restClient
public static com.datastrato.gravitino.client.MessagingCatalog.Builder builder()
MessagingCatalog.public TopicCatalog asTopicCatalog() throws java.lang.UnsupportedOperationException
asTopicCatalog in interface CatalogTopicCatalog if the catalog supports topic operations.java.lang.UnsupportedOperationException - if the catalog does not support topic operations.public NameIdentifier[] listTopics(Namespace namespace) throws NoSuchSchemaException
listTopics in interface TopicCatalognamespace - The namespace to list the topics under it.NameIdentifier of the topics under the specified namespace.NoSuchSchemaException - if the schema with specified namespace does not exist.public Topic loadTopic(NameIdentifier ident) throws NoSuchTopicException
loadTopic in interface TopicCatalogident - The identifier of the topic to load.Topic with the specified identifier.NoSuchTopicException - if the topic with the specified identifier does not exist.public Topic createTopic(NameIdentifier ident, java.lang.String comment, DataLayout dataLayout, java.util.Map<java.lang.String,java.lang.String> properties) throws NoSuchSchemaException, TopicAlreadyExistsException
createTopic in interface TopicCatalogident - 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 with specified namespace does not exist.TopicAlreadyExistsException - if the topic with specified identifier already exists.public Topic alterTopic(NameIdentifier ident, TopicChange... changes) throws NoSuchTopicException, java.lang.IllegalArgumentException
alterTopic in interface TopicCatalogident - A topic identifier.changes - The changes to apply to the topic.NoSuchTopicException - if the topic with the specified identifier does not exist.java.lang.IllegalArgumentException - if the changes are invalid.public boolean dropTopic(NameIdentifier ident)
dropTopic in interface TopicCatalogident - A topic identifier.public SupportsSchemas asSchemas() throws java.lang.UnsupportedOperationException
CatalogSupportsSchemas if the catalog supports schema operations.asSchemas in interface CatalogSupportsSchemas if the catalog supports schema operations.java.lang.UnsupportedOperationException - if the catalog does not support schema operations.public NameIdentifier[] listSchemas(Namespace namespace) throws NoSuchCatalogException
listSchemas in interface SupportsSchemasnamespace - The namespace of the catalog.NameIdentifier of the schemas under the given catalog namespace.NoSuchCatalogException - if the catalog with specified namespace does not exist.public Schema createSchema(NameIdentifier ident, java.lang.String comment, java.util.Map<java.lang.String,java.lang.String> properties) throws NoSuchCatalogException, SchemaAlreadyExistsException
createSchema in interface SupportsSchemasident - The name identifier of the schema.comment - The comment of the schema.properties - The properties of the schema.Schema.NoSuchCatalogException - if the catalog with specified namespace does not exist.SchemaAlreadyExistsException - if the schema with specified identifier already exists.public Schema loadSchema(NameIdentifier ident) throws NoSuchSchemaException
loadSchema in interface SupportsSchemasident - The name identifier of the schema.Schema with specified identifier.NoSuchSchemaException - if the schema with specified identifier does not exist.public Schema alterSchema(NameIdentifier ident, SchemaChange... changes) throws NoSuchSchemaException
alterSchema in interface SupportsSchemasident - The name identifier of the schema.changes - The metadata changes to apply.Schema.NoSuchSchemaException - if the schema with specified identifier does not exist.public boolean dropSchema(NameIdentifier ident, boolean cascade) throws NonEmptySchemaException
dropSchema in interface SupportsSchemasident - The name identifier of the schema.cascade - Whether to drop all the tables under the schema.NonEmptySchemaException - if the schema is not empty and cascade is false.