public static final String STORAGE_MAX_SEGMENT_SIZE = "max-segment-size";
public static final int STORAGE_MAX_SEGMENT_SIZE_DEFAULT = STORAGE_MAX_ENTRY_SIZE_DEFAULT * 8;
public static final String STORAGE_MAX_UNFLUSHED_BYTES = "max-unflushed-bytes";
- public static final int STORAGE_MAX_UNFLUSHED_BYTES_DEFAULT = 0;
public static final String STORAGE_MEMORY_MAPPED = "memory-mapped";
private static final Logger LOG = LoggerFactory.getLogger(SegmentedFileJournal.class);
maxEntrySize = getBytes(config, STORAGE_MAX_ENTRY_SIZE, STORAGE_MAX_ENTRY_SIZE_DEFAULT);
maxSegmentSize = getBytes(config, STORAGE_MAX_SEGMENT_SIZE, STORAGE_MAX_SEGMENT_SIZE_DEFAULT);
- maxUnflushedBytes = getBytes(config, STORAGE_MAX_UNFLUSHED_BYTES, STORAGE_MAX_UNFLUSHED_BYTES_DEFAULT);
+ maxUnflushedBytes = getBytes(config, STORAGE_MAX_UNFLUSHED_BYTES, maxEntrySize);
if (config.hasPath(STORAGE_MEMORY_MAPPED)) {
storage = config.getBoolean(STORAGE_MEMORY_MAPPED) ? StorageLevel.MAPPED : StorageLevel.DISK;
max-entry-size = 16M
# Maximum size of a segment
max-segment-size = 128M
- # Maximum number of bytes that are written without synchronizing storage
- max-unflushed-bytes = 1M
+ # Maximum number of bytes that are written without synchronizing storage. Defaults to max-entry-size.
+ # Set to <= 0 to flush immediately.
+ #max-unflushed-bytes = 1M
# Map each segment into memory. Defaults to true, use false to keep a heap-based
# buffer instead.
memory-mapped = true
max-entry-size = 512K
# Maximum size of a segment
max-segment-size = 1M
- # Maximum number of bytes that are written without synchronizing storage
- max-unflushed-bytes = 128K
+ # Maximum number of bytes that are written without synchronizing storage. Defaults to max-entry-size.
+ # Set to <= 0 to flush immediately.
+ #max-unflushed-bytes = 128K
# Map each segment into memory. Note that while this can improve performance,
# it will also place additional burden on system resources.
memory-mapped = false