Interface CachingSchemasKvAccessorInterface

All Known Implementing Classes:
CachingSchemasKvAccessorShim

public interface CachingSchemasKvAccessorInterface
Provide an interface so that multiple implementations can be used for read/write operations on the kv store. All operations are required to be atomic with respect to the state of the backing store.
Deephaven internal use only.
  • Method Details

    • getSchemaTable

      @Nullable io.deephaven.kv.schema.SchemaTable getSchemaTable(@NotNull String namespaceName, @NotNull String tableName)
      Get a schemaTable.
      Parameters:
      namespaceName - the namespace containing the table
      tableName - the name of the table
      Returns:
      the current SchemaTable, or null if either the namespace or table does not exist
    • getAllSchemaTables

      @NotNull Collection<io.deephaven.kv.schema.SchemaTable> getAllSchemaTables(@NotNull Predicate<? super io.deephaven.kv.schema.SchemaStateAdapter.Namespace> namespaceFilter)
      Get all the schemaTables in namespaces matching the filter (namespace name, namespace type, etc).
      Parameters:
      namespaceFilter - predicate for filtering namespaces
      Returns:
      a collection of schemaTables matching the filter
    • containsNamespace

      boolean containsNamespace(@NotNull String namespaceName)
      Determine whether the named namespace exists.
      Parameters:
      namespaceName - the namespace to check
      Returns:
      true if the namespace exists
    • containsSchemaTable

      boolean containsSchemaTable(@NotNull String namespaceName, @NotNull String tableName)
      Determine whether the named schemaTable exists in the given namespace.
      Parameters:
      namespaceName - the namespace to check
      tableName - the name of the schemaTable
      Returns:
      true if the schema exists
    • listNamespaces

      @NotNull List<String> listNamespaces()
      Get a list of all namespaces.
      Returns:
      a list of all namespaces
    • listNamespaces

      @NotNull List<String> listNamespaces(@NotNull io.deephaven.kv.schema.NamespaceType namespaceType)
      Get a list of namespaces with the given type.
      Parameters:
      namespaceType - the NamespaceType to filter on
      Returns:
      a list of all namespaces matching the NamespaceType
    • listSchemaTables

      @NotNull List<String> listSchemaTables(@NotNull String namespace)
      Get a list of schemaTables in the named namespace. If the namespace does not exist, the list will be empty.
      Parameters:
      namespace - the namespace to check
      Returns:
      a list of all schemaTables in the given namespace
    • listAllTables

      @NotNull Map<io.deephaven.kv.schema.NamespaceType,Map<String,Collection<String>>> listAllTables()
      Return a map of namespaceName to schemaTable name, by NamespaceType.
      Returns:
      a map of NamespaceType to map of namespace to schemaTable names
    • getNamespaceType

      @Nullable io.deephaven.kv.schema.NamespaceType getNamespaceType(@NotNull String namespaceName)
      Get the NamespaceType of the given namespace.
      Parameters:
      namespaceName - the namespace to check
      Returns:
      the namespaceType of the namespace, or null if the namespace does not exist.
    • createNamespace

      void createNamespace(@NotNull io.deephaven.kv.schema.NamespaceType namespaceType, @NotNull String namespaceName, @NotNull io.deephaven.enterprise.auth.UserContext userContext, @NotNull String code, @NotNull String comment)
      Create the given namespace.
      Parameters:
      namespaceType - create the namespace with this namespace type
      namespaceName - the name of the namespace to create
      userContext - the user making the change
      code - pass-thru to the kv layer
      comment - pass-thru to the kv layer
      Throws:
      SchemaException - if the namespace could not be added to the given namespace set
    • removeNamespace

      void removeNamespace(@NotNull String namespaceName, @NotNull io.deephaven.enterprise.auth.UserContext userContext, @NotNull String code, @NotNull String comment)
      Remove the given namespace. Throws SchemaException if the namespace does not exist.
      Parameters:
      namespaceName - the namespace to remove
      userContext - the user making the change
      code - pass-thru to the kv layer
      comment - pass-thru to the kv layer
      Throws:
      SchemaException - if the namespace cannot be removed
    • addSchema

      void addSchema(@NotNull Schema newSchema, @NotNull io.deephaven.enterprise.auth.UserContext userContext, @NotNull String code, @NotNull String comment)
      Add the given schemaTable. The namespace must exist and have the type indicated in the schema. The schema must not exist. This does not validate CopyTable delegates.
      Parameters:
      newSchema - the schemaTable to add
      userContext - the user making the change
      code - pass-thru to the kv layer
      comment - pass-thru to the kv layer
      Throws:
      SchemaException - if the add cannot be performed.
    • updateSchema

      void updateSchema(@NotNull Schema newSchema, @NotNull io.deephaven.enterprise.auth.UserContext userContext, @NotNull String code, @NotNull String comment)
      Update the given schema. The namespace must exist and have the type indicated in the schema. The schemaTable must exist. This does not validate CopyTable delegates.
      Parameters:
      newSchema - the schema to update
      userContext - the user making the change
      code - pass-thru to the kv layer
      comment - pass-thru to the kv layer
      Throws:
      SchemaException - if the update cannot be performed.
    • deleteSchema

      void deleteSchema(@NotNull String namespaceName, @NotNull String tableName, @NotNull io.deephaven.enterprise.auth.UserContext userContext, @NotNull String code, @NotNull String comment)
      Delete the named schema.
      Parameters:
      namespaceName - the namespace of the schema to delete
      tableName - the name of the schema to delete
      userContext - the user making the change
      code - pass-thru to the kv layer
      comment - pass-thru to the kv layer
      Throws:
      SchemaException - if the delete cannot be performed.
    • close

      void close()
      Releases resources when this instance will no longer be used.
    • isClosed

      boolean isClosed()
      Determine if close() has been called.
      Returns:
      true if close has been called.
    • initializationStage

      default Future<Void> initializationStage()