Search in sources :

Example 1 with TestBatch

use of org.apache.kafka.raft.internals.RecordsIteratorTest.TestBatch in project kafka by apache.

the class RecordsBatchReaderTest method testReadFromMemoryRecords.

@ParameterizedTest
@EnumSource(CompressionType.class)
public void testReadFromMemoryRecords(CompressionType compressionType) {
    long baseOffset = 57;
    List<TestBatch<String>> batches = RecordsIteratorTest.createBatches(baseOffset);
    MemoryRecords memRecords = RecordsIteratorTest.buildRecords(compressionType, batches);
    testBatchReader(baseOffset, memRecords, batches);
}
Also used : TestBatch(org.apache.kafka.raft.internals.RecordsIteratorTest.TestBatch) MemoryRecords(org.apache.kafka.common.record.MemoryRecords) EnumSource(org.junit.jupiter.params.provider.EnumSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 2 with TestBatch

use of org.apache.kafka.raft.internals.RecordsIteratorTest.TestBatch in project kafka by apache.

the class RecordsBatchReaderTest method testReadFromFileRecords.

@ParameterizedTest
@EnumSource(CompressionType.class)
public void testReadFromFileRecords(CompressionType compressionType) throws Exception {
    long baseOffset = 57;
    List<TestBatch<String>> batches = RecordsIteratorTest.createBatches(baseOffset);
    MemoryRecords memRecords = RecordsIteratorTest.buildRecords(compressionType, batches);
    FileRecords fileRecords = FileRecords.open(tempFile());
    fileRecords.append(memRecords);
    testBatchReader(baseOffset, fileRecords, batches);
}
Also used : TestBatch(org.apache.kafka.raft.internals.RecordsIteratorTest.TestBatch) FileRecords(org.apache.kafka.common.record.FileRecords) MemoryRecords(org.apache.kafka.common.record.MemoryRecords) EnumSource(org.junit.jupiter.params.provider.EnumSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

MemoryRecords (org.apache.kafka.common.record.MemoryRecords)2 TestBatch (org.apache.kafka.raft.internals.RecordsIteratorTest.TestBatch)2 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)2 EnumSource (org.junit.jupiter.params.provider.EnumSource)2 FileRecords (org.apache.kafka.common.record.FileRecords)1