Complete the code to set the log segment size to 1 GB for better disk I/O performance.
props.put("log.segment.bytes", [1]);
The log segment size is set in bytes. 1 GB equals 1073741824 bytes, which helps optimize disk I/O by reducing segment rollover frequency.
Complete the code to enable log preallocation to improve disk write performance.
props.put("log.preallocate", [1]);
Setting log.preallocate to "true" enables preallocation of log files, which can reduce disk fragmentation and improve write performance.
Fix the error in the code to correctly configure the flush interval to 5000 milliseconds.
props.put("log.flush.interval.ms", [1]);
The value for log.flush.interval.ms must be a string representing the number of milliseconds. So it should be "5000" with quotes.
Fill both blanks to create a dictionary comprehension that sets log retention to 7 days and segment bytes to 1 GB.
config = {"log.retention.hours": [1], "log.segment.bytes": [2]Retention is set in hours as a string "168" (7 days * 24 hours). Segment bytes is set as integer 1073741824 (1 GB).
Fill all three blanks to create a dictionary comprehension that sets flush interval to 1000 ms, enables preallocation, and sets segment bytes to 512 MB.
config = {"log.flush.interval.ms": [1], "log.preallocate": [2], "log.segment.bytes": [3]The flush interval must be a string "1000" ms, preallocation enabled with string "true", and segment bytes set to 512 MB (536870912 bytes).