org.apache.kafka.common.record
Interface Records
- All Superinterfaces:
- java.lang.Iterable<LogEntry>
- All Known Implementing Classes:
- MemoryRecords
public interface Records
- extends java.lang.Iterable<LogEntry>
A binary format which consists of a 4 byte size, an 8 byte offset, and the record bytes. See MemoryRecords
for the in-memory representation.
Method Summary |
int |
sizeInBytes()
The size of these records in bytes |
int |
writeTo(java.nio.channels.GatheringByteChannel channel)
Write these records to the given channel |
Methods inherited from interface java.lang.Iterable |
iterator |
SIZE_LENGTH
static final int SIZE_LENGTH
- See Also:
- Constant Field Values
OFFSET_LENGTH
static final int OFFSET_LENGTH
- See Also:
- Constant Field Values
LOG_OVERHEAD
static final int LOG_OVERHEAD
- See Also:
- Constant Field Values
writeTo
int writeTo(java.nio.channels.GatheringByteChannel channel)
throws java.io.IOException
- Write these records to the given channel
- Parameters:
channel
- The channel to write to
- Returns:
- The number of bytes written
- Throws:
java.io.IOException
- If the write fails.
sizeInBytes
int sizeInBytes()
- The size of these records in bytes