protected void validateIsRunningOrRebalancing() {
        synchronized (stateLock) {
            if (state.hasNotStarted()) {
                throw new StreamsNotStartedException("KafkaStreams has not been started, you can retry after calling start()");
            }
            if (!state.isRunningOrRebalancing()) {
                throw new IllegalStateException("KafkaStreams is not running. State is " + state + ".");
            }
        }
    }
Return the current {@link State} of this {@code KafkaStreams} instance.

@return the current state of this Kafka Streams instance
streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java