Class SchemaStateAdapter.State

java.lang.Object
io.deephaven.kv.schema.SchemaStateAdapter.State
Enclosing class:
SchemaStateAdapter

public class SchemaStateAdapter.State extends Object
The state of schemas in the kv store.
  • 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 header
      initialState - the initial state - all keys and values starting at the GetPrefix root
    • onNext

      public void onNext(@NotNull @NotNull WatchResponseUnit unit)
      Update the collection and schema state with this unit.
      Parameters:
      unit - changed KVs.
    • getModificationRevision

      public long getModificationRevision(String namespace)
      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

      public long getModificationRevision(String namespace, String tablename)
      Get the modification revision of the table from the full kv collection.
      Parameters:
      namespace - the namespace containing the table
      tablename - 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

      public boolean containsNamespace(String namespace)
    • containsSchema

      public boolean containsSchema(String namespace, String tableName)
    • getSchemaTable

      @Nullable public @Nullable SchemaTable getSchemaTable(String namespace, String tableName)
      Get a SchemaTable.
      Parameters:
      namespace - the namespace containing the schema
      tableName - 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

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

      public List<String> listNamespaces(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
    • listSchemas

      public List<String> listSchemas(String namespace)
      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

      public Map<NamespaceType,Map<String,Collection<String>>> listAllTables()
    • getNamespaceType

      public NamespaceType getNamespaceType(String namespace)
      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

      public WatchClient.Watch 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