static ControllerResult<Void> generate(
        Consumer<String> activationMessageConsumer,
        boolean isEmpty,
        long transactionStartOffset,
        boolean zkMigrationEnabled,
        BootstrapMetadata bootstrapMetadata,
        FeatureControlManager featureControl
    ) {
        if (isEmpty) {
            return recordsForEmptyLog(activationMessageConsumer, transactionStartOffset, zkMigrationEnabled,
                bootstrapMetadata, bootstrapMetadata.metadataVersion());
        } else {
            return recordsForNonEmptyLog(activationMessageConsumer, transactionStartOffset, zkMigrationEnabled,
                featureControl, featureControl.metadataVersion());
        }
    }
Generate the set of activation records.
</p>
If the log is empty, write the bootstrap records. If the log is not empty, do some validation and
possibly write some records to put the log into a valid state. For bootstrap records, if KIP-868
metadata transactions are supported, ues them. Otherwise, write the bootstrap records as an
atomic batch. The single atomic batch can be problematic if the bootstrap records are too large
(e.g., lots of SCRAM credentials). If ZK migrations are enabled, the activation records will
include a ZkMigrationState record regardless of whether the log was empty or not.
metadata/src/main/java/org/apache/kafka/controller/ActivationRecordsGenerator.java