Create a slice view of the file message set that begins and ends at the given byte offsets
Create a file message set with mutable option
Create a file message set with no slicing, and with initFileSize and preallocate.
Create a file message set with no slicing, and with initFileSize and preallocate. For windows NTFS and some old LINUX file system, set preallocate to true and initFileSize with one value (for example 512 * 1024 *1024 ) can improve the kafka produce performance. If it's new file and preallocate is true, end will be set to 0. Otherwise set to Int.MaxValue.
Create a file message set with no slicing
Create a file message set with no slicing.
Append these messages to the message set
Close this message set
Delete this message set from the filesystem
Delete this message set from the filesystem
True iff this message set was deleted.
The file name for the underlying log data
Commit all written data to the physical disk
Get an iterator over the messages in the set.
Get an iterator over the messages in the set. We only do shallow iteration here.
A limit on allowable message size to avoid allocating unbounded memory. If we encounter a message larger than this we throw an InvalidMessageException.
The iterator.
Get a shallow iterator over the messages in the set.
Get a shallow iterator over the messages in the set.
Return a message set which is a view into this set starting from the given position and with the given size limit.
Return a message set which is a view into this set starting from the given position and with the given size limit.
If the size is beyond the end of the file, the end will be based on the size of the file at the time of the read.
If this message set is already sliced, the position will be taken relative to that slicing.
The start position to begin the read from
The number of bytes after the start position to include
A sliced wrapper on this message set limited based on the given position and size
Read from the underlying file into the buffer starting at the given position
Rename the file that backs this message set
Rename the file that backs this message set
true iff the rename was successful
(Changed in version 2.9.0) The behavior of scanRight
has changed. The previous behavior can be reproduced with scanRight.reverse.
Search forward for the file position of the last offset that is greater than or equal to the target offset and return its physical position.
Search forward for the file position of the last offset that is greater than or equal to the target offset and return its physical position. If no such offsets are found, return null.
The offset to search for.
The starting position in the file to begin searching from.
The number of bytes taken up by this file set
The number of bytes taken up by this file set
Print this message set's contents.
Print this message set's contents. If the message set has more than 100 messages, just print the first 100.
(Changed in version 2.9.0) transpose
throws an IllegalArgumentException
if collections are not uniformly sized.
Trim file when close or roll to next file
Truncate this file message set to the given size in bytes.
Truncate this file message set to the given size in bytes. Note that this API does no checking that the given size falls on a valid message boundary.
The size to truncate to.
The number of bytes truncated off
Write some of this set to the given channel.
Write some of this set to the given channel.
The channel to write to.
The position in the message set to begin writing from.
The maximum number of bytes to write
The number of bytes actually written.
An on-disk message set. An optional start and end position can be applied to the message set which will allow slicing a subset of the file.