public <T> T getStore(final StoreQueryParameters<T> storeQueryParameters) {
        final String storeName = storeQueryParameters.storeName();
        final QueryableStoreType<T> queryableStoreType = storeQueryParameters.queryableStoreType();
        final List<T> globalStore = globalStoreProvider.stores(storeName, queryableStoreType);
        if (!globalStore.isEmpty()) {
            return queryableStoreType.create(globalStoreProvider, storeName);
        }
        return queryableStoreType.create(
            new WrappingStoreProvider(storeProviders.values(), storeQueryParameters),
            storeName
        );
    }
Get a composite object wrapping the instances of the {@link StateStore} with the provided
storeName and {@link QueryableStoreType}

@param storeQueryParameters       if stateStoresEnabled is used i.e. staleStoresEnabled is true, include standbys and recovering stores;
                                       if stateStoresDisabled i.e. staleStoresEnabled is false, only include running actives;
                                       if partition is null then it fetches all local partitions on the instance;
                                       if partition is set then it fetches a specific partition.
@param <T>                The expected type of the returned store
@return A composite object that wraps the store instances.
streams/src/main/java/org/apache/kafka/streams/state/internals/QueryableStoreProvider.java