...
- If state is RUNNING or REBALANCING:
- StateStoreClosedException: should be wrapped to StateStoreRetriableException
- StateStoreMigratedException: should not be wrapped, directly thrown
- if state is PENDING_SHUTDOWSHUTDOWN or ERROR or NOT_RUNNING:
- wrap InvalidStateStoreException(include subclass) to StateStoreFailException
...
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
|
...
Expand | ||
---|---|---|
| ||
|
...
Code Block | ||||
---|---|---|---|---|
| ||||
public <T> T getStore(final String storeName, final QueryableStoreType<T> queryableStoreType) { final List<T> globalStore = globalStoreProvider.stores(storeName, queryableStoreType); if (!globalStore.isEmpty()) { return queryableStoreType.create(new WrappingStoreProvider(Collections.<StateStoreProvider>singletonList(globalStoreProvider)), storeName); } final List<T> allStores = new ArrayList<>(); for (StateStoreProvider storeProvider : storeProviders) { allStores.addAll(storeProvider.stores(storeName, queryableStoreType)); } if (allStores.isEmpty()) { // TODO: Replace with StateStoreMigratedException throw new InvalidStateStoreException("theThe state store, " + storeName + ", may have migrated to another instance."); } return queryableStoreType.create( new WrappingStoreProvider(storeProviders), storeName); } |
...
Code Block | ||||
---|---|---|---|---|
| ||||
public <T> List<T> stores(final String storeName, QueryableStoreType<T> type) { final List<T> allStores = new ArrayList<>(); for (StateStoreProvider provider : storeProviders) { final List<T> stores = provider.stores(storeName, type); allStores.addAll(stores); } if (allStores.isEmpty()) { // TODO: Replace with StateStoreMigratedException throw new InvalidStateStoreException("theThe state store, " + storeName + ", may have migrated to another instance."); } return allStores; } |
...