public void shutdown() {
        log.info("Informed to shut down");
        final State oldState = setState(State.PENDING_SHUTDOWN);
        if (oldState == State.CREATED) {
            // The thread may not have been started. Take responsibility for shutting down
            completeShutdown(true);
        }
    }
Shutdown this stream thread.
<p>
Note that there is nothing to prevent this function from being called multiple times
(e.g., in testing), hence the state is set only the first time
streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java