@Override
    public void shutdown() throws InterruptedException {
        log.debug("Shutting down task scheduler.");
        // We use the local variable to avoid NullPointerException if another thread shuts down scheduler at same time.
        ScheduledThreadPoolExecutor maybeExecutor = null;
        synchronized (this) {
            if (isStarted()) {
                maybeExecutor = executor;
                maybeExecutor.shutdown();
                this.executor = null;
            }
        }
        if (maybeExecutor != null)
            maybeExecutor.awaitTermination(1, TimeUnit.DAYS);
    }
A scheduler based on java.util.concurrent.ScheduledThreadPoolExecutor
<br>
It has a pool of kafka-scheduler- threads that do the actual work.
server-common/src/main/java/org/apache/kafka/server/util/KafkaScheduler.java