void waitUntilCaughtUp() throws InterruptedException {
        while (true) {
            if (loader.lastAppliedOffset() > 0) {
                return;
            }
            Thread.sleep(10);
        }
    }
Take the FileLock in the given directory.
shell/src/main/java/org/apache/kafka/shell/MetadataShell.java