Package com.illumon.iris.db.schema
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.
Deephaven internal use only.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addSchema
(Schema newSchema, io.deephaven.enterprise.auth.UserContext userContext, String code, String comment) Add the given schemaTable.void
close()
Releases resources when this instance will no longer be used.boolean
containsNamespace
(String namespaceName) Determine whether the named namespace exists.boolean
containsSchemaTable
(String namespaceName, String tableName) Determine whether the named schemaTable exists in the given namespace.void
createNamespace
(io.deephaven.kv.schema.NamespaceType namespaceType, String namespaceName, io.deephaven.enterprise.auth.UserContext userContext, String code, String comment) Create the given namespace.void
deleteSchema
(String namespaceName, String tableName, io.deephaven.enterprise.auth.UserContext userContext, String code, String comment) Delete the named schema.Collection<io.deephaven.kv.schema.SchemaTable>
getAllSchemaTables
(Predicate<? super io.deephaven.kv.schema.SchemaStateAdapter.Namespace> namespaceFilter) Get all the schemaTables in namespaces matching the filter (namespace name, namespace type, etc).io.deephaven.kv.schema.NamespaceType
getNamespaceType
(String namespaceName) Get the NamespaceType of the given namespace.io.deephaven.kv.schema.SchemaTable
getSchemaTable
(String namespaceName, String tableName) Get a schemaTable.boolean
isClosed()
Determine if close() has been called.Map<io.deephaven.kv.schema.NamespaceType,
Map<String, Collection<String>>> Return a map of namespaceName to schemaTable name, by NamespaceType.Get a list of all namespaces.listNamespaces
(io.deephaven.kv.schema.NamespaceType namespaceType) Get a list of namespaces with the given type.listSchemaTables
(String namespace) Get a list of schemaTables in the named namespace.void
removeNamespace
(String namespaceName, io.deephaven.enterprise.auth.UserContext userContext, String code, String comment) Remove the given namespace.void
updateSchema
(Schema newSchema, io.deephaven.enterprise.auth.UserContext userContext, String code, String comment) Update the given schema.
-
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 tabletableName
- 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
Determine whether the named namespace exists.- Parameters:
namespaceName
- the namespace to check- Returns:
- true if the namespace exists
-
containsSchemaTable
Determine whether the named schemaTable exists in the given namespace.- Parameters:
namespaceName
- the namespace to checktableName
- the name of the schemaTable- Returns:
- true if the schema exists
-
listNamespaces
Get a list of all namespaces.- Returns:
- a list of all namespaces
-
listNamespaces
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
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
Return a map of namespaceName to schemaTable name, by NamespaceType.- Returns:
- a map of NamespaceType to map of namespace to schemaTable names
-
getNamespaceType
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 typenamespaceName
- the name of the namespace to createuserContext
- the user making the changecode
- pass-thru to the kv layercomment
- 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 removeuserContext
- the user making the changecode
- pass-thru to the kv layercomment
- 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 adduserContext
- the user making the changecode
- pass-thru to the kv layercomment
- 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 updateuserContext
- the user making the changecode
- pass-thru to the kv layercomment
- 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 deletetableName
- the name of the schema to deleteuserContext
- the user making the changecode
- pass-thru to the kv layercomment
- 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
-