public void cleanUp() {
        if (!(state.hasNotStarted() || state.hasCompletedShutdown())) {
            throw new IllegalStateException("Cannot clean up while running.");
        }
        stateDirectory.clean();
    }
Do a clean up of the local {@link StateStore} directory ({@link StreamsConfig#STATE_DIR_CONFIG}) by deleting all
data with regard to the {@link StreamsConfig#APPLICATION_ID_CONFIG application ID}.
<p>
May only be called either before this {@code KafkaStreams} instance is {@link #start() started} or after the
instance is {@link #close() closed}.
<p>
Calling this method triggers a restore of local {@link StateStore}s on the next {@link #start() application start}.

@throws IllegalStateException if this {@code KafkaStreams} instance has been started and hasn't fully shut down
@throws StreamsException if cleanup failed
streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java