Class DeephavenSchemaService
java.lang.Object
io.deephaven.enterprise.schema.impl.DeephavenSchemaService
- All Implemented Interfaces:
SchemaServiceBase,SchemaService,io.deephaven.shadow.enterprise.com.illumon.util.type.NamedImplementation,AutoCloseable
Provides methods for interacting with the system Schema store using
Schema instances. This implementation
delegates to a Legacy SchemaService instance-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.enterprise.schema.SchemaService
SchemaService.Delegating -
Method Summary
Modifier and TypeMethodDescriptionabout()@NotNull SchemaAdd the specified schema to the service.@NotNull SchemaAdd the specified schema to the service.booleanbooleanauthenticate(@NotNull String user, @NotNull String password, @NotNull String operateAs) voidclose()booleancontainsNamespace(@NotNull String namespace) booleancontainsNamespace(@NotNull String namespace, boolean includeDeleted) booleancontainsSchema(@NotNull String namespace, @NotNull String tableName) 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.booleancreateNamespace(@NotNull String namespaceSet, @NotNull String namespaceName) Convenience method translates the namespace set from string toNamespaceSetand delegate toSchemaService.createNamespace(NamespaceSet, String)voiddeleteSchema(@NotNull String namespace, @NotNull String tableName) voiddeleteSchema(@NotNull String namespace, @NotNull String tableName, @NotNull String code, @NotNull String comment) @NotNull Collection<Schema>Get a collection of all known schemas in the system.io.deephaven.shadow.enterprise.com.illumon.iris.db.schema.SchemaServiceReturns this service as aLegacy SchemaService.@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.@NotNull Map<NamespaceSet,Map<String, Collection<String>>> Get a map of all known tables in all known namespaces for all namespace sets.@NotNull Collection<String>listNamespaces(boolean includeDeleted) @NotNull Collection<String>listNamespaces(@NotNull NamespaceSet namespaceSet, boolean includeDeleted) Get a collection of the namespaces available in the given namespace set.@NotNull Collection<String>listTableNames(@NotNull String namespace, boolean includeDeleted) static DeephavenSchemaServiceof(io.deephaven.shadow.enterprise.com.illumon.iris.db.schema.SchemaService legacyService) Construct aDeephavenSchemaServiceinstance which delegates to a Legacy instancevoidremoveNamespace(@NotNull String namespaceName) voidremoveNamespace(@NotNull String namespaceName, @NotNull String code, @NotNull String comment) voidshutdown()@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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.deephaven.enterprise.schema.SchemaService
deleteSchema, deleteSchema, getSchemasForNamespaceSet, listNamespaces, listNamespacesMethods inherited from interface io.deephaven.enterprise.schema.internal.SchemaServiceBase
authenticate, initializationStage, listNamespaces, listTableNames
-
Method Details
-
of
public static DeephavenSchemaService of(@NotNull io.deephaven.shadow.enterprise.com.illumon.iris.db.schema.SchemaService legacyService) Construct aDeephavenSchemaServiceinstance which delegates to a Legacy instance- Parameters:
legacyService- a Legacy SchemaService instance to which we will delegate most work- Returns:
- a new
DeephavenSchemaServiceinstance
-
getLegacyService
@InternalUseOnly public io.deephaven.shadow.enterprise.com.illumon.iris.db.schema.SchemaService getLegacyService()Returns this service as aLegacy SchemaService.- Returns:
- a Legacy SchemaService
-
about
- Specified by:
aboutin interfaceSchemaServiceBase
-
getImplementationName
- Specified by:
getImplementationNamein interfaceio.deephaven.shadow.enterprise.com.illumon.util.type.NamedImplementation
-
authenticate
public boolean authenticate(@NotNull @NotNull String user, @NotNull @NotNull String password, @NotNull @NotNull String operateAs) - Specified by:
authenticatein interfaceSchemaServiceBase
-
authenticate
public boolean authenticate()- Specified by:
authenticatein interfaceSchemaServiceBase
-
getSchema
@Nullable public @Nullable Schema getSchema(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName) Description copied from interface:SchemaServiceGet the latest version of theSchemadefined by namespace and table name- Specified by:
getSchemain interfaceSchemaService- Parameters:
namespace- the namespace of the tabletableName- the table name- Returns:
- the latest version of namespace.tableName or null if none was found
-
getAllSchemas
Description copied from interface:SchemaServiceGet a collection of all known schemas in the system. The latest version of each will be returned.- Specified by:
getAllSchemasin interfaceSchemaService- Returns:
- a collection of all known schemas
-
getSchemas
Description copied from interface:SchemaServiceGet a collection of all known schemas in the system, with the given namespace set. The latest version of each will be returned.- Specified by:
getSchemasin interfaceSchemaService- Parameters:
namespaceSet- the namespace set for the schemas- Returns:
- a collection of all known schemas in the given namespace set
-
getSchemas
Description copied from interface:SchemaServiceGet a collection of all known schemas in the given namespace. The latest version of each will be returned.- Specified by:
getSchemasin interfaceSchemaService- Parameters:
namespace- the namespace of the schemas- Returns:
- a collection of all known schemas in the given namespace
-
addSchema
@NotNull public @NotNull Schema addSchema(@NotNull @NotNull Schema newSchema) throws SchemaException Description copied from interface:SchemaServiceAdd the specified schema to the service.- Specified by:
addSchemain interfaceSchemaService- 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 public @NotNull Schema addSchema(@NotNull @NotNull Schema newSchema, @NotNull @NotNull String code, @NotNull @NotNull String comment) throws SchemaException Description copied from interface:SchemaServiceAdd the specified schema to the service.- Specified by:
addSchemain interfaceSchemaService- 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 public @NotNull Schema updateSchema(@NotNull @NotNull Schema newSchema) throws IllegalArgumentException, SchemaException Description copied from interface:SchemaServiceUpdate the schema with the same namespace and table name with the specified new schema.- Specified by:
updateSchemain interfaceSchemaService- 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 public @NotNull Schema updateSchema(@NotNull @NotNull Schema newSchema, @NotNull @NotNull String code, @NotNull @NotNull String comment) throws IllegalArgumentException, SchemaException Description copied from interface:SchemaServiceUpdate the schema with the same namespace and table name with the specified new schema.- Specified by:
updateSchemain interfaceSchemaService- 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
-
getNamespaceSet
@NotNull public @NotNull NamespaceSet getNamespaceSet(@NotNull @NotNull String namespace) throws IllegalArgumentException Description copied from interface:SchemaServiceGet theNamespaceSetfor a particular namespace.- Specified by:
getNamespaceSetin interfaceSchemaService- Parameters:
namespace- The namespace name- Returns:
- the namespace set of the namespace
- Throws:
IllegalArgumentException- if the namespace does not exist
-
containsNamespace
- Specified by:
containsNamespacein interfaceSchemaServiceBase
-
containsNamespace
- Specified by:
containsNamespacein interfaceSchemaServiceBase
-
createNamespace
public boolean createNamespace(@NotNull @NotNull String namespaceSet, @NotNull @NotNull String namespaceName) throws SchemaException Description copied from interface:SchemaServiceConvenience method translates the namespace set from string toNamespaceSetand delegate toSchemaService.createNamespace(NamespaceSet, String)- Specified by:
createNamespacein interfaceSchemaService- 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
-
containsSchema
public boolean containsSchema(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName) - Specified by:
containsSchemain interfaceSchemaServiceBase
-
listNamespaces
- Specified by:
listNamespacesin interfaceSchemaServiceBase
-
listNamespaces
@NotNull public @NotNull Collection<String> listNamespaces(@NotNull @NotNull NamespaceSet namespaceSet, boolean includeDeleted) Description copied from interface:SchemaServiceGet a collection of the namespaces available in the given namespace set.- Specified by:
listNamespacesin interfaceSchemaService- Parameters:
namespaceSet- list namespaces in this set (User, System)includeDeleted- true if deleted namespaces should be included- Returns:
- a collection of namespace names
-
listTableNames
@NotNull public @NotNull Collection<String> listTableNames(@NotNull @NotNull String namespace, boolean includeDeleted) - Specified by:
listTableNamesin interfaceSchemaServiceBase
-
listAllTables
Description copied from interface:SchemaServiceGet a map of all known tables in all known namespaces for all namespace sets.- Specified by:
listAllTablesin interfaceSchemaService- Returns:
- all the table names, mapped by namespace set and namespace
-
createNamespace
public boolean createNamespace(@NotNull @NotNull NamespaceSet namespaceSet, @NotNull @NotNull String namespaceName) throws SchemaException Description copied from interface:SchemaServiceAdd 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.- Specified by:
createNamespacein interfaceSchemaService- 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
public boolean createNamespace(@NotNull @NotNull NamespaceSet namespaceSet, @NotNull @NotNull String namespaceName, @NotNull @NotNull String code, @NotNull @NotNull String comment) throws SchemaException Description copied from interface:SchemaServiceAdd 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.- Specified by:
createNamespacein interfaceSchemaService- 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
-
removeNamespace
public void removeNamespace(@NotNull @NotNull String namespaceName, @NotNull @NotNull String code, @NotNull @NotNull String comment) throws SchemaException - Specified by:
removeNamespacein interfaceSchemaServiceBase- Throws:
SchemaException
-
removeNamespace
- Specified by:
removeNamespacein interfaceSchemaServiceBase
-
deleteSchema
public void deleteSchema(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName) throws IllegalArgumentException, SchemaException - Specified by:
deleteSchemain interfaceSchemaServiceBase- Throws:
IllegalArgumentExceptionSchemaException
-
deleteSchema
public void deleteSchema(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName, @NotNull @NotNull String code, @NotNull @NotNull String comment) throws IllegalArgumentException, SchemaException - Specified by:
deleteSchemain interfaceSchemaServiceBase- Throws:
IllegalArgumentExceptionSchemaException
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceSchemaServiceBase
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSchemaServiceBase
-