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 TypeMethodDescriptionvoidaddSchema(@NotNull Schema newSchema, @NotNull UserContext userContext, @NotNull String code, @NotNull String comment) Add the given schemaTable.voidclose()Releases resources when this instance will no longer be used.booleancontainsNamespace(@NotNull String namespaceName) Determine whether the named namespace exists.booleancontainsSchemaTable(@NotNull String namespaceName, @NotNull String tableName) Determine whether the named schemaTable exists in the given namespace.voidcreateNamespace(@NotNull NamespaceType namespaceType, @NotNull String namespaceName, @NotNull UserContext userContext, @NotNull String code, @NotNull String comment) Create the given namespace.voiddeleteSchema(@NotNull String namespaceName, @NotNull String tableName, @NotNull UserContext userContext, @NotNull String code, @NotNull String comment) Delete the named schema.@NotNull Collection<SchemaTable>getAllSchemaTables(@NotNull Predicate<? super SchemaStateAdapter.Namespace> namespaceFilter) Get all the schemaTables in namespaces matching the filter (namespace name, namespace type, etc).@Nullable NamespaceTypegetNamespaceType(@NotNull String namespaceName) Get the NamespaceType of the given namespace.@Nullable SchemaTablegetSchemaTable(@NotNull String namespaceName, @NotNull String tableName) Get a schemaTable.booleanisClosed()Determine if close() has been called.@NotNull Map<NamespaceType,Map<String, Collection<String>>> Return a map of namespaceName to schemaTable name, by NamespaceType.Get a list of all namespaces.listNamespaces(@NotNull NamespaceType namespaceType) Get a list of namespaces with the given type.listSchemaTables(@NotNull String namespace) Get a list of schemaTables in the named namespace.voidremoveNamespace(@NotNull String namespaceName, @NotNull UserContext userContext, @NotNull String code, @NotNull String comment) Remove the given namespace.voidupdateSchema(@NotNull Schema newSchema, @NotNull UserContext userContext, @NotNull String code, @NotNull String comment) Update the given schema.
-
Method Details
-
getSchemaTable
@Nullable @Nullable SchemaTable getSchemaTable(@NotNull @NotNull String namespaceName, @NotNull @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 @NotNull Collection<SchemaTable> getAllSchemaTables(@NotNull @NotNull Predicate<? super 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
boolean containsSchemaTable(@NotNull @NotNull String namespaceName, @NotNull @NotNull String tableName) 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 @NotNull NamespaceType namespaceType, @NotNull @NotNull String namespaceName, @NotNull @NotNull UserContext userContext, @NotNull @NotNull String code, @NotNull @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 @NotNull String namespaceName, @NotNull @NotNull UserContext userContext, @NotNull @NotNull String code, @NotNull @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 @NotNull Schema newSchema, @NotNull @NotNull UserContext userContext, @NotNull @NotNull String code, @NotNull @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 @NotNull Schema newSchema, @NotNull @NotNull UserContext userContext, @NotNull @NotNull String code, @NotNull @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 @NotNull String namespaceName, @NotNull @NotNull String tableName, @NotNull @NotNull UserContext userContext, @NotNull @NotNull String code, @NotNull @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
-