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.


Field Summary
static int LOG_OVERHEAD
           
static int OFFSET_LENGTH
           
static int SIZE_LENGTH
           
 
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
 

Field Detail

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
Method Detail

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