Package io.deephaven.enterprise.schema
Interface SchemaService
- All Superinterfaces:
AutoCloseable,io.deephaven.shadow.enterprise.com.illumon.util.type.NamedImplementation,SchemaServiceBase
- All Known Implementing Classes:
DeephavenSchemaService,SchemaService.Delegating
public interface SchemaService
extends SchemaServiceBase, io.deephaven.shadow.enterprise.com.illumon.util.type.NamedImplementation
Provides methods for interacting with the system Schema store.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classDelegate all method calls to an implementation object. -
Method Summary
Modifier and TypeMethodDescription@NotNull SchemaAdd the specified schema to the service.@NotNull SchemaAdd the specified schema to the service.booleancreateNamespace(@NotNull NamespaceSet namespaceSet, @NotNull String namespaceName) Add a namespace with the given name to the schema service, in the requested namespace set.booleancreateNamespace(@NotNull NamespaceSet namespaceSet, @NotNull String namespaceName, @NotNull String code, @NotNull String comment) Add a namespace with the given name to the schema service, in the requested namespace set.default booleancreateNamespace(@NotNull String namespaceSet, @NotNull String namespaceName) Convenience method translates the namespace set from string toNamespaceSetand delegate tocreateNamespace(NamespaceSet, String)default voiddeleteSchema(@NotNull Schema schema) Delete the specified schema.default voiddeleteSchema(@NotNull Schema schema, @NotNull String code, @NotNull String comment) Delete the specified schema.@NotNull Collection<Schema>Get a collection of all known schemas in the system.@NotNull NamespaceSetgetNamespaceSet(@NotNull String namespace) Get theNamespaceSetfor a particular namespace.@Nullable SchemaGet the latest version of theSchemadefined by namespace and table name@NotNull Collection<Schema>getSchemas(@NotNull NamespaceSet namespaceSet) Get a collection of all known schemas in the system, with the given namespace set.@NotNull Collection<Schema>getSchemas(@NotNull String namespace) Get a collection of all known schemas in the given namespace.default @NotNull Collection<Schema>getSchemasForNamespaceSet(@NotNull String namespaceSet) Convenience method translates the namespace set from string toNamespaceSetand delegate togetSchemas(NamespaceSet)@NotNull Map<NamespaceSet,Map<String, Collection<String>>> Get a map of all known tables in all known namespaces for all namespace sets.default @NotNull Collection<String>listNamespaces(@NotNull NamespaceSet namespaceSet) Get a collection of the namespaces available in the given namespace set.@NotNull Collection<String>listNamespaces(@NotNull NamespaceSet namespaceSet, boolean includeDeleted) Get a collection of the namespaces available in the given namespace set.default @NotNull Collection<String>listNamespaces(@NotNull String namespaceSet) Convenience method translates the namespace set from string toNamespaceSetand delegate tolistNamespaces(NamespaceSet)static SchemaServiceof(io.deephaven.shadow.enterprise.com.illumon.iris.db.schema.SchemaService legacyService) Construct aSchemaServiceinstance which delegates to a Legacy instance@NotNull SchemaupdateSchema(@NotNull Schema newSchema) Update the schema with the same namespace and table name with the specified new schema.@NotNull SchemaupdateSchema(@NotNull Schema newSchema, @NotNull String code, @NotNull String comment) Update the schema with the same namespace and table name with the specified new schema.Methods inherited from interface io.deephaven.shadow.enterprise.com.illumon.util.type.NamedImplementation
getImplementationNameMethods inherited from interface io.deephaven.enterprise.schema.internal.SchemaServiceBase
about, authenticate, authenticate, authenticate, close, containsNamespace, containsNamespace, containsSchema, deleteSchema, deleteSchema, initializationStage, listNamespaces, listNamespaces, listTableNames, listTableNames, removeNamespace, removeNamespace, shutdown
-
Method Details
-
of
static SchemaService of(@NotNull io.deephaven.shadow.enterprise.com.illumon.iris.db.schema.SchemaService legacyService) Construct aSchemaServiceinstance which delegates to a Legacy instance- Parameters:
legacyService- a Legacy SchemaService instance to which we will delegate most work- Returns:
- a new
SchemaServiceinstance
-
getNamespaceSet
@NotNull @NotNull NamespaceSet getNamespaceSet(@NotNull @NotNull String namespace) throws IllegalArgumentException Get theNamespaceSetfor a particular namespace.- Parameters:
namespace- The namespace name- Returns:
- the namespace set of the namespace
- Throws:
IllegalArgumentException- if the namespace does not exist
-
listNamespaces
@NotNull default @NotNull Collection<String> listNamespaces(@NotNull @NotNull NamespaceSet namespaceSet) Get a collection of the namespaces available in the given namespace set.- Parameters:
namespaceSet- list namespaces in this namespace set (User, System)- Returns:
- a collection of namespace names
-
listNamespaces
Convenience method translates the namespace set from string toNamespaceSetand delegate tolistNamespaces(NamespaceSet)- Parameters:
namespaceSet- list namespaces in this namespace set (User, System)- Returns:
- a collection of namespace names
-
listNamespaces
@NotNull @NotNull Collection<String> listNamespaces(@NotNull @NotNull NamespaceSet namespaceSet, boolean includeDeleted) Get a collection of the namespaces available in the given namespace set.- Parameters:
namespaceSet- list namespaces in this set (User, System)includeDeleted- true if deleted namespaces should be included- Returns:
- a collection of namespace names
-
listAllTables
Get a map of all known tables in all known namespaces for all namespace sets.- Returns:
- all the table names, mapped by namespace set and namespace
-
getSchema
@Nullable @Nullable Schema getSchema(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName) Get the latest version of theSchemadefined by namespace and table name- Parameters:
namespace- the namespace of the tabletableName- the table name- Returns:
- the latest version of namespace.tableName or null if none was found
-
getAllSchemas
Get a collection of all known schemas in the system. The latest version of each will be returned.- Returns:
- a collection of all known schemas
-
getSchemas
Get a collection of all known schemas in the system, with the given namespace set. The latest version of each will be returned.- Parameters:
namespaceSet- the namespace set for the schemas- Returns:
- a collection of all known schemas in the given namespace set
-
getSchemasForNamespaceSet
@NotNull default @NotNull Collection<Schema> getSchemasForNamespaceSet(@NotNull @NotNull String namespaceSet) Convenience method translates the namespace set from string toNamespaceSetand delegate togetSchemas(NamespaceSet)- Parameters:
namespaceSet- the namespace set for the schemas- Returns:
- a collection of all known schemas in the given namespace set
-
getSchemas
Get a collection of all known schemas in the given namespace. The latest version of each will be returned.- Parameters:
namespace- the namespace of the schemas- Returns:
- a collection of all known schemas in the given namespace
-
createNamespace
boolean createNamespace(@NotNull @NotNull NamespaceSet namespaceSet, @NotNull @NotNull String namespaceName) throws SchemaException Add a namespace with the given name to the schema service, in the requested namespace set. Returns true if the namespace was added, false if it already exists. Throws a SchemaException if the namespace could not be added.- Parameters:
namespaceSet- add namespaceName to this namespace setnamespaceName- name of the new namespace- Returns:
- true if the namespace was added, false if it already exists.
- Throws:
SchemaException- if the namespace could not be added to the given namespace set
-
createNamespace
default boolean createNamespace(@NotNull @NotNull String namespaceSet, @NotNull @NotNull String namespaceName) throws SchemaException Convenience method translates the namespace set from string toNamespaceSetand delegate tocreateNamespace(NamespaceSet, String)- Parameters:
namespaceSet- add namespaceName to this namespace setnamespaceName- name of the new namespace- Returns:
- true if the namespace was added, false if it already exists.
- Throws:
SchemaException- if the namespace could not be added to the given namespace set
-
createNamespace
boolean createNamespace(@NotNull @NotNull NamespaceSet namespaceSet, @NotNull @NotNull String namespaceName, @NotNull @NotNull String code, @NotNull @NotNull String comment) throws SchemaException Add a namespace with the given name to the schema service, in the requested namespace set. Returns true if the namespace was added, false if it already exists. Throws a SchemaException if the namespace could not be added.- Parameters:
namespaceSet- add namespaceName to this namespace setnamespaceName- name of the new namespacecode- pass-thru to kv persistence, indicates the code source of this updatecomment- pass-thru to kv persistence - a comment for this update- Returns:
- true if the namespace was added, false if it already exists.
- Throws:
SchemaException- if the namespace could not be added to the given namespace set
-
addSchema
Add the specified schema to the service.- Parameters:
newSchema- the schema to add- Returns:
- the schema actually stored in the SchemaService
- Throws:
SchemaException- if the schema could not be added
-
addSchema
@NotNull @NotNull Schema addSchema(@NotNull @NotNull Schema newSchema, @NotNull @NotNull String code, @NotNull @NotNull String comment) throws SchemaException Add the specified schema to the service.- Parameters:
newSchema- the schema to addcode- pass-thru to kv persistence, indicates the code source of this updatecomment- pass-thru to kv persistence - a comment for this update- Returns:
- the schema actually stored in the SchemaService
- Throws:
SchemaException- if the schema could not be added
-
updateSchema
@NotNull @NotNull Schema updateSchema(@NotNull @NotNull Schema newSchema) throws IllegalArgumentException, SchemaException Update the schema with the same namespace and table name with the specified new schema.- Parameters:
newSchema- the schema to update with- Returns:
- the schema actually stored in the SchemaService
- Throws:
IllegalArgumentException- if the namespace or table does not existSchemaException- if the schema could not be updated
-
updateSchema
@NotNull @NotNull Schema updateSchema(@NotNull @NotNull Schema newSchema, @NotNull @NotNull String code, @NotNull @NotNull String comment) throws IllegalArgumentException, SchemaException Update the schema with the same namespace and table name with the specified new schema.- Parameters:
newSchema- the schema to update withcode- pass-thru to kv persistence, indicates the code source of this updatecomment- pass-thru to kv persistence - a comment for this update- Returns:
- the schema actually stored in the SchemaService
- Throws:
IllegalArgumentException- if the namespace or table does not existSchemaException- if the schema could not be updated
-
deleteSchema
default void deleteSchema(@NotNull @NotNull Schema schema) throws IllegalArgumentException, SchemaException Delete the specified schema.- Parameters:
schema- the schema to delete- Throws:
IllegalArgumentException- if the namespace or table could not be foundSchemaException- if the schema could not be deleted
-
deleteSchema
default void deleteSchema(@NotNull @NotNull Schema schema, @NotNull @NotNull String code, @NotNull @NotNull String comment) throws IllegalArgumentException, SchemaException Delete the specified schema.- Parameters:
schema- the schema to deletecode- pass-thru to kv persistence, indicates the code source of this deletecomment- pass-thru to kv persistence - a comment for this delete- Throws:
IllegalArgumentException- if the namespace or table could not be foundSchemaException- if the schema could not be deleted
-