public void appendControlRecord(long timestamp, ControlRecordType type, ByteBuffer value) {
        Struct keyStruct = type.recordKey();
        ByteBuffer key = ByteBuffer.allocate(keyStruct.sizeOf());
        keyStruct.writeTo(key);
        key.flip();
        appendWithOffset(nextSequentialOffset(), true, timestamp, key, value, Record.EMPTY_HEADERS);
    }
Append a control record at the next sequential offset.

@param timestamp The record timestamp
@param type The control record type (cannot be UNKNOWN)
@param value The control record value
clients/src/main/java/org/apache/kafka/common/record/MemoryRecordsBuilder.java