|Table of Contents|
This page is meant as a template for writing a KIP. To create a KIP choose Tools->Copy on this page and modify with your content and replace the heading with the next KIP number and a description of your issue. Replace anything in italics with your own description.
Current state: [One of "Under Discussion", "Accepted", "Rejected"]
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
Describe the problems you are trying to solve.
Briefly list any new interfaces that will be introduced as part of this proposal or any existing interfaces that will be removed or changed. The purpose of this section is to concisely call out the public contract that will come along with this feature.
A public interface is any change to the following:
Binary log format
The network protocol and api behavior
Any class in the public packages under clientsConfiguration, especially client configuration
org/apache/kafka/clients/consumer (eventually, once stable)
Command line tools and arguments
- Anything else that will likely break existing users in some way when they upgrade
Describe the new thing you want to do in appropriate detail. This may be fairly extensive and have large subsections of its own. Or it may be a few sentences. Use judgement based on the scope of the change.
Compatibility, Deprecation, and Migration Plan
- What impact (if any) will there be on existing users?
- If we are changing behavior how will we phase out the older behavior?
- If we need special migration tools, describe them here.
- When will we remove the existing behavior?
If there are alternative ways of accomplishing the same thing, what were they? The purpose of this section is to motivate why the design is the way it is and not some other way.
Currently, IQ throws InvalidStateStoreException for any types of error, that means a user cannot handle different types of error.
Because of that, we should throw different exceptions for each type.
To distinguish different types of error, we need to handle all InvalidStateStoreExceptions better during these public methods invoked. The main change is to introduce new exceptions that extend from InvalidStateStoreException. InvalidStateStoreException is not thrown at all anymore, but only new sub-classes.
# 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
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: will be thrown when state store already closed and stream state is REBALANCING.
- Fatal exceptions
- KafkaStreamsNotRunningException: 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: will be thrown when state store closed and stream thread is PENDING_SHUTDOWN / NOT_RUNNING / ERROR. The user cannot retry when this exception is thrown.
- UnknownStateStoreException: will be thrown when passing an unknown state store.
The following is the public methods that users will call to get state store instance:
- store(storeName, queryableStoreType)
|Throw exceptions: StreamThreadNotStartedException, StreamThreadRebalancingException, KafkaStreamsNotRunningException, UnknownStateStoreException|
The following is the public methods that users will call to get store values:
- interface ReadOnlyKeyValueStore(class CompositeReadOnlyKeyValueStore)
- range(from, to)
- interface ReadOnlySessionStore(class CompositeReadOnlySessionStore)
- fetch(from, to)
- interface ReadOnlyWindowStore(class CompositeReadOnlyWindowStore)
- fetch(key, time)
fetch(key, from, to)
- fetch(from, to, fromTime, toTime)
- fetchAll(from, to)
- @Deprecated fetch(key, timeFrom, timeTo)
- @Deprecated fetch(from, to, timeFrom, timeTo)
- @Deprecated fetchAll(timeFrom, timeTo)
- interface KeyValueIterator(class DelegatingPeekingKeyValueIterator)
All the above methods could be throw following exceptions:
StreamThreadRebalancingException, StateStoreMigratedException, KafkaStreamsNotRunningException, StateStoreNotAvailableException
Compatibility, Deprecation, and Migration Plan
- All new exceptions extend from InvalidStateStoreException, this change will be fully backward compatible.