Package io.deephaven.kv.schema
Class SchemaStateAdapter
java.lang.Object
io.deephaven.kv.schema.SchemaStateAdapter
- All Implemented Interfaces:
WatchClient.UnitListener
Implement
WatchClient.UnitListener and present state updates to a WatchClient.StateListener.
This now handles all updates of unparsed kv values, managing the top level schema state.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRoughly representsSchemaNamespace, with only the required metadata.classThe state of schemas in the kv store. -
Constructor Summary
ConstructorsConstructorDescriptionSchemaStateAdapter(@NotNull SchemaContext schemaContext, WatchClient.StateListener<SchemaStateAdapter.State> listener, @NotNull KVClient kvClient, @NotNull WatchClient watchClient, @NotNull GetPrefix watchKeyPath) -
Method Summary
Modifier and TypeMethodDescriptionGet the watch future.voidInvoked on completion.voidInvoked on errors.voidonNext(@NotNull WatchResponseUnit unit) Invoked on new events.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
-
SchemaStateAdapter
public SchemaStateAdapter(@NotNull @NotNull SchemaContext schemaContext, @NotNull WatchClient.StateListener<SchemaStateAdapter.State> listener, @NotNull @NotNull KVClient kvClient, @NotNull @NotNull WatchClient watchClient, @NotNull @NotNull GetPrefix watchKeyPath)
-
-
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
Description copied from interface:WatchClient.UnitListenerInvoked on new events.Can be called many times but is never called after
WatchClient.UnitListener.onError(Throwable)orWatchClient.UnitListener.onCompleted()are called.- Specified by:
onNextin interfaceWatchClient.UnitListener- Parameters:
unit- the watch response unit
-
onError
Description copied from interface:WatchClient.UnitListenerInvoked on errors.May only be called once and if called it must be the last method called.
- Specified by:
onErrorin interfaceWatchClient.UnitListener- Parameters:
t- the error
-
onCompleted
public void onCompleted()Description copied from interface:WatchClient.UnitListenerInvoked on completion.May only be called once and if called it must be the last method called.
- Specified by:
onCompletedin interfaceWatchClient.UnitListener
-
getWatchFuture
Get the watch future.- Returns:
- the watch future
-
restartWatch
After an error in the watch, restart it at the last known revision.- Returns:
- the new watch
-