public final void resetToImage(MetadataImage image) {
        this.image = image;
        this.hasSeenRecord = true;
        this.delta = new MetadataDelta.Builder().setImage(image).build();
        this.transactionState = TransactionState.NO_TRANSACTION;
        this.lastOffset = image.provenance().lastContainedOffset();
        this.lastEpoch = image.provenance().lastContainedEpoch();
        this.lastContainedLogTimeMs = image.provenance().lastContainedLogTimeMs();
        this.numBytes = 0;
        this.numBatches = 0;
        this.totalBatchElapsedNs = 0;
    }
Reset the state of this batch loader to the given image. Any un-flushed state will be
discarded. This is called after applying a delta and passing it back to MetadataLoader, or
when MetadataLoader loads a snapshot.

@param image     Metadata image to reset this batch loader's state to.
metadata/src/main/java/org/apache/kafka/image/loader/MetadataBatchLoader.java