Package io.deephaven.kv.schema
Class SchemaStateAdapter.State
java.lang.Object
io.deephaven.kv.schema.SchemaStateAdapter.State
- Enclosing class:
- SchemaStateAdapter
The state of schemas in the kv store.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsNamespace(String namespace) booleancontainsSchema(String namespace, String tableName) getAllSchemaTables(Predicate<? super SchemaStateAdapter.Namespace> namespaceFilter) longGet the global schema modification revision.longgetModificationRevision(String namespace) Get the modification revision of the namespace from the full kv collection.longgetModificationRevision(String namespace, String tablename) Get the modification revision of the table from the full kv collection.intgetNamespaceType(String namespace) Get the NamespaceType of the given namespace.@Nullable SchemaTablegetSchemaTable(String namespace, String tableName) Get a SchemaTable.intGet a list of all namespaces.listNamespaces(NamespaceType namespaceType) Get a list of namespaces with the given type.listSchemas(String namespace) Get a list of schemaTables in the named namespace.voidonNext(@NotNull WatchResponseUnit unit) Update the collection and schema state with this unit.voidpublishInitial(@NotNull HeaderResponse initialHeader, @NotNull KeyValuesCollection initialState) Initialize the state.After an error in the watch, restart it at the last known revision.
-
Constructor Details
-
State
public State()
-
-
Method Details
-
publishInitial
public void publishInitial(@NotNull @NotNull HeaderResponse initialHeader, @NotNull @NotNull KeyValuesCollection initialState) Initialize the state.- Parameters:
initialHeader- the initial headerinitialState- the initial state - all keys and values starting at the GetPrefix root
-
onNext
Update the collection and schema state with this unit.- Parameters:
unit- changed KVs.
-
getModificationRevision
Get the modification revision of the namespace from the full kv collection.- Parameters:
namespace- the namespace to check- Returns:
- the modification revision of the namespace, 0 if the namespace does not exist
-
getModificationRevision
Get the modification revision of the table from the full kv collection.- Parameters:
namespace- the namespace containing the tabletablename- the table name to check- Returns:
- the modification revision of the table
-
getModificationRevision
public long getModificationRevision()Get the global schema modification revision.- Returns:
- the modification revision of the schemas context
-
getNamespaceCount
public int getNamespaceCount() -
getTableCount
public int getTableCount() -
containsNamespace
-
containsSchema
-
getSchemaTable
Get a SchemaTable.- Parameters:
namespace- the namespace containing the schematableName- the name of the schemaTable- Returns:
- the current SchemaTable, or null if it is not present.
-
getAllSchemaTables
public List<SchemaTable> getAllSchemaTables(Predicate<? super SchemaStateAdapter.Namespace> namespaceFilter) -
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
-
listSchemas
Get a list of schemaTables in the named namespace. If the namepsace 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
-
getNamespaceType
Get the NamespaceType of the given namespace.- Parameters:
namespace- the namespace to check- Returns:
- the namespaceType of the namespace, or null if the namespace does not exist.
-
restartWatch
After an error in the watch, restart it at the last known revision. This method provides access to the client, which has a State, but not a SchemaStateAdapter.- Returns:
- the new watch
-