public void write(ImageWriter writer, ImageWriterOptions options) {
        if (options.metadataVersion().isLessThan(MetadataVersion.MINIMUM_BOOTSTRAP_VERSION)) {
            handleFeatureLevelNotSupported(options);
        } else {
            writeFeatureLevels(writer, options);
        }

        if (options.metadataVersion().isMigrationSupported()) {
            writer.write(0, zkMigrationState.toRecord().message());
        } else {
            if (!zkMigrationState.equals(ZkMigrationState.NONE)) {
                options.handleLoss("the ZK Migration state which was " + zkMigrationState);
            }
        }
    }
Represents the feature levels in the metadata image.

This class is thread-safe.
metadata/src/main/java/org/apache/kafka/image/FeaturesImage.java