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

@InternalUseOnly public final class DeephavenSchemaService extends Object implements SchemaService
Provides methods for interacting with the system Schema store using Schema instances. This implementation delegates to a Legacy SchemaService instance
  • Method Details

    • of

      public static DeephavenSchemaService of(@NotNull io.deephaven.shadow.enterprise.com.illumon.iris.db.schema.SchemaService legacyService)
      Construct a DeephavenSchemaService instance which delegates to a Legacy instance
      Parameters:
      legacyService - a Legacy SchemaService instance to which we will delegate most work
      Returns:
      a new DeephavenSchemaService instance
    • getLegacyService

      @InternalUseOnly public io.deephaven.shadow.enterprise.com.illumon.iris.db.schema.SchemaService getLegacyService()
      Returns this service as a Legacy SchemaService.
      Returns:
      a Legacy SchemaService
    • about

      public String about()
      Specified by:
      about in interface SchemaServiceBase
    • getImplementationName

      public String getImplementationName()
      Specified by:
      getImplementationName in interface io.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:
      authenticate in interface SchemaServiceBase
    • authenticate

      public boolean authenticate()
      Specified by:
      authenticate in interface SchemaServiceBase
    • getSchema

      @Nullable public @Nullable Schema getSchema(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName)
      Description copied from interface: SchemaService
      Get the latest version of the Schema defined by namespace and table name
      Specified by:
      getSchema in interface SchemaService
      Parameters:
      namespace - the namespace of the table
      tableName - the table name
      Returns:
      the latest version of namespace.tableName or null if none was found
    • getAllSchemas

      @NotNull public @NotNull Collection<Schema> getAllSchemas()
      Description copied from interface: SchemaService
      Get a collection of all known schemas in the system. The latest version of each will be returned.
      Specified by:
      getAllSchemas in interface SchemaService
      Returns:
      a collection of all known schemas
    • getSchemas

      @NotNull public @NotNull Collection<Schema> getSchemas(@NotNull @NotNull NamespaceSet namespaceSet)
      Description copied from interface: SchemaService
      Get a collection of all known schemas in the system, with the given namespace set. The latest version of each will be returned.
      Specified by:
      getSchemas in interface SchemaService
      Parameters:
      namespaceSet - the namespace set for the schemas
      Returns:
      a collection of all known schemas in the given namespace set
    • getSchemas

      @NotNull public @NotNull Collection<Schema> getSchemas(@NotNull @NotNull String namespace)
      Description copied from interface: SchemaService
      Get a collection of all known schemas in the given namespace. The latest version of each will be returned.
      Specified by:
      getSchemas in interface SchemaService
      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: SchemaService
      Add the specified schema to the service.
      Specified by:
      addSchema in interface SchemaService
      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: SchemaService
      Add the specified schema to the service.
      Specified by:
      addSchema in interface SchemaService
      Parameters:
      newSchema - the schema to add
      code - pass-thru to kv persistence, indicates the code source of this update
      comment - 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: SchemaService
      Update the schema with the same namespace and table name with the specified new schema.
      Specified by:
      updateSchema in interface SchemaService
      Parameters:
      newSchema - the schema to update with
      Returns:
      the schema actually stored in the SchemaService
      Throws:
      IllegalArgumentException - if the namespace or table does not exist
      SchemaException - 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: SchemaService
      Update the schema with the same namespace and table name with the specified new schema.
      Specified by:
      updateSchema in interface SchemaService
      Parameters:
      newSchema - the schema to update with
      code - pass-thru to kv persistence, indicates the code source of this update
      comment - 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 exist
      SchemaException - if the schema could not be updated
    • getNamespaceSet

      @NotNull public @NotNull NamespaceSet getNamespaceSet(@NotNull @NotNull String namespace) throws IllegalArgumentException
      Description copied from interface: SchemaService
      Get the NamespaceSet for a particular namespace.
      Specified by:
      getNamespaceSet in interface SchemaService
      Parameters:
      namespace - The namespace name
      Returns:
      the namespace set of the namespace
      Throws:
      IllegalArgumentException - if the namespace does not exist
    • containsNamespace

      public boolean containsNamespace(@NotNull @NotNull String namespace, boolean includeDeleted)
      Specified by:
      containsNamespace in interface SchemaServiceBase
    • containsNamespace

      public boolean containsNamespace(@NotNull @NotNull String namespace)
      Specified by:
      containsNamespace in interface SchemaServiceBase
    • createNamespace

      public boolean createNamespace(@NotNull @NotNull String namespaceSet, @NotNull @NotNull String namespaceName) throws SchemaException
      Description copied from interface: SchemaService
      Convenience method translates the namespace set from string to NamespaceSet and delegate to SchemaService.createNamespace(NamespaceSet, String)
      Specified by:
      createNamespace in interface SchemaService
      Parameters:
      namespaceSet - add namespaceName to this namespace set
      namespaceName - 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:
      containsSchema in interface SchemaServiceBase
    • listNamespaces

      @NotNull public @NotNull Collection<String> listNamespaces(boolean includeDeleted)
      Specified by:
      listNamespaces in interface SchemaServiceBase
    • listNamespaces

      @NotNull public @NotNull Collection<String> listNamespaces(@NotNull @NotNull NamespaceSet namespaceSet, boolean includeDeleted)
      Description copied from interface: SchemaService
      Get a collection of the namespaces available in the given namespace set.
      Specified by:
      listNamespaces in interface SchemaService
      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:
      listTableNames in interface SchemaServiceBase
    • listAllTables

      @NotNull public @NotNull Map<NamespaceSet,Map<String,Collection<String>>> listAllTables()
      Description copied from interface: SchemaService
      Get a map of all known tables in all known namespaces for all namespace sets.
      Specified by:
      listAllTables in interface SchemaService
      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: SchemaService
      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.
      Specified by:
      createNamespace in interface SchemaService
      Parameters:
      namespaceSet - add namespaceName to this namespace set
      namespaceName - 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: SchemaService
      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.
      Specified by:
      createNamespace in interface SchemaService
      Parameters:
      namespaceSet - add namespaceName to this namespace set
      namespaceName - name of the new namespace
      code - pass-thru to kv persistence, indicates the code source of this update
      comment - 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:
      removeNamespace in interface SchemaServiceBase
      Throws:
      SchemaException
    • removeNamespace

      public void removeNamespace(@NotNull @NotNull String namespaceName)
      Specified by:
      removeNamespace in interface SchemaServiceBase
    • deleteSchema

      public void deleteSchema(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName) throws IllegalArgumentException, SchemaException
      Specified by:
      deleteSchema in interface SchemaServiceBase
      Throws:
      IllegalArgumentException
      SchemaException
    • 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:
      deleteSchema in interface SchemaServiceBase
      Throws:
      IllegalArgumentException
      SchemaException
    • shutdown

      public void shutdown()
      Specified by:
      shutdown in interface SchemaServiceBase
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface SchemaServiceBase