public <T> T store(final StoreQueryParameters<T> storeQueryParameters) {
        validateIsRunningOrRebalancing();
        final String storeName = storeQueryParameters.storeName();
        if (!topologyMetadata.hasStore(storeName)) {
            throw new UnknownStateStoreException(
                "Cannot get state store " + storeName + " because no such store is registered in the topology."
            );
        }
        return queryableStoreProvider.getStore(storeQueryParameters);
    }
Get a facade wrapping the local {@link StateStore} instances with the provided {@link StoreQueryParameters}.
The returned object can be used to query the {@link StateStore} instances.

@param storeQueryParameters   the parameters used to fetch a queryable store
@return A facade wrapping the local {@link StateStore} instances
@throws StreamsNotStartedException If Streams has not yet been started. Just call {@link KafkaStreams#start()}
                                   and then retry this call.
@throws UnknownStateStoreException If the specified store name does not exist in the topology.
@throws InvalidStateStorePartitionException If the specified partition does not exist.
@throws InvalidStateStoreException If the Streams instance isn't in a queryable state.
                                   If the store's type does not match the QueryableStoreType,
                                   the Streams instance is not in a queryable state with respect
                                   to the parameters, or if the store is not available locally, then
                                   an InvalidStateStoreException is thrown upon store access.
streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java