...
As the moment the IQ is only thrown InvalidStateStoreException for all errors. That means we the user cannot handle different types of errors. We should throw different exceptions for different types.
...
Add two new exception class for the IQ state store errors:
org.apache.kafka.streams.errors.StateStoreMigratedException
org.apache.kafka.streams.errors.StateStoreClosedException
StateStoreMigratedException used in the QueryableStoreProvider, StreamThreadStateStoreProvider and WrappingStoreProvider. The state store must be rediscovered when state store was migrated. The user can catch StateStoreMigratedException and wait until the store recreation finished.
StateStoreClosedException use for internal
public class StateStoreMigratedException extends InvalidStateStoreException
public class StateStoreClosedException extends InvalidStateStoreException
StateStoreMigratedException used for state store not available and may have been migrated to another. The user need re-discover its location.
StateStoreClosedException used for state store is closed.(RocksDBStore, WrappedStateStore)
Compatibility, Deprecation, and Migration Plan
- Because no classes will be removed, this change will be fully backward.
Rejected Alternatives
TBDNo