private static void ensureTransactionMarkerControlType(ControlRecordType type) {
        if (type != ControlRecordType.COMMIT && type != ControlRecordType.ABORT)
            throw new IllegalArgumentException("Invalid control record type for end transaction marker" + type);
    }
This class represents the control record which is written to the log to indicate the completion
of a transaction. The record key specifies the {@link ControlRecordType control type} and the
value embeds information useful for write validation (for now, just the coordinator epoch).
clients/src/main/java/org/apache/kafka/common/record/EndTransactionMarker.java