Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
# Two category exceptions
public class RetryableStateStoreException extends InvalidStateStoreException
public class FatalStateStoreException extends InvalidStateStoreException


# Retryable exceptions
public class StreamThreadNotStartedException extends RetryableStateStoreException
public class StreamThreadRebalancingException extends RetryableStateStoreException
public class StateStoreMigratedException extends RetryableStateStoreException


# Fatal exceptions
public class StreamThreadNotRunningException extends FatalStateStoreException
public class StateStoreNotAvailableException extends FatalStateStoreException


# Internal exceptions
public class EmptyStateStoreException extends InvalidStateStoreException
public class StateStoreClosedException extends InvalidStateStoreException

Various state store exceptions can classify into two category exceptions: RetryableStateStoreException and FatalStateStoreException. The user can use the two exceptions if they only need to distinguish whether it can retry.

  • Retryable exceptions
    • StreamThreadNotStartedException: will be thrown when streams thread state is CREATED, the user can retry until to RUNNING.
    • StreamThreadRebalancingException: will be thrown when stream thread is not running and stream state is REBALANCING, the user just retry and wait until rebalance finished (RUNNING).
    • StateStoreMigratedException: A wrapper for StateStoreClosedException / EmptyStateStoreException. Will will be thrown when stream thread is RUNNING / REBALANCING. The user needs to rediscover the state storestate store already closed or state store cannot be found.
  • Fatal exceptions
    • StreamThreadNotRunningException: will be thrown when stream thread is not running and stream state is PENDING_SHUTDOWN / NOT_RUNNING / ERROR. The user cannot retry when this exception is thrown.
    • StateStoreNotAvailableException: A wrapper for StateStoreClosedException / EmptyStateStoreException. Will be thrown when stream thread is PENDING_SHUTDOWN / NOT_RUNNING / ERROR. The user cannot retry when this exception is thrown.
  • Internal exceptions
    • StateStoreClosedException: will be thrown when state store is not open. This is an internal exception and will be wrapped in StateStoreMigratedException or StateStoreNotAvailableException later.
    • EmptyStateStoreException: will be thrown when state store cannot be found in all StateStoreProviders. This is an internal exception and will be wrapped in StateStoreMigratedException or StateStoreNotAvailableException later.


The following is the public methods that users will call to get state store instance or get store values:

  • KafkaStreams
    • store(storeName, queryableStoreType)
  • interface ReadOnlyKeyValueStore(class CompositeReadOnlyKeyValueStore)
    • get(key)
    • range(from, to)
    • all()
    • approximateNumEntries()
  • interface ReadOnlySessionStore(class CompositeReadOnlySessionStore)
    • fetch(key)
    • fetch(from, to)
  • interface ReadOnlyWindowStore(class CompositeReadOnlyWindowStore)
    • fetch(key, time)
    • fetch(key, from, to)

    • fetch(from, to, fromTime, toTime)
    • all()
    • fetchAll(from, to)
    • @Deprecated fetch(key, timeFrom, timeTo)
    • @Deprecated fetch(from, to, timeFrom, timeTo)
    • @Deprecated fetchAll(timeFrom, timeTo)
  • interface KeyValueIterator(class DelegatingPeekingKeyValueIterator)
    • next()
    • hasNext()
    • peekNextKey()

...

  • StreamThreadNotStartedException
  • StreamThreadRebalancingException
  • StateStoreMigratedException
  • StreamThreadNotRunningExceptionStateStoreNotAvailableException

Compatibility, Deprecation, and Migration Plan

...