private void applyDeltaAndUpdate(MetadataDelta delta, LogDeltaManifest manifest) {
        try {
            image = delta.apply(manifest.provenance());
        } catch (Throwable e) {
            faultHandler.handleFault("Error generating new metadata image from " +
                "metadata delta between offset " + image.offset() +
                " and " + manifest.provenance().lastContainedOffset(), e);
        }

        // Whether we can apply the delta or not, we need to make sure the batch loader gets reset
        // to the image known to MetadataLoader
        callback.update(delta, image, manifest);
        resetToImage(image);
    }
Flush the metadata accumulated in this batch loader if not in the middle of a transaction. The
flushed metadata will be passed to the {@link MetadataUpdater} configured for this class.
metadata/src/main/java/org/apache/kafka/image/loader/MetadataBatchLoader.java