/** * Sets the maximum segment size in bytes, returning the builder for method chaining. * * <p>The maximum segment size dictates when logs should roll over to new segments. As entries * are written to a segment of the log, once the size of the segment surpasses the configured * maximum segment size, the log will create a new segment and append new entries to that * segment. * * <p>By default, the maximum segment size is {@code 1024 * 1024 * 32}. * * @param maxSegmentSize The maximum segment size in bytes. * @return The storage builder. * @throws IllegalArgumentException If the {@code maxSegmentSize} is not positive */ public Builder withMaxSegmentSize(int maxSegmentSize) { Assert.arg( maxSegmentSize > SegmentDescriptor.BYTES, "maxSegmentSize must be greater than " + SegmentDescriptor.BYTES); storage.maxSegmentSize = maxSegmentSize; return this; }