Search in sources :

Example 6 with EndTransactionMarker

use of org.apache.kafka.common.record.EndTransactionMarker in project kafka by apache.

the class FetcherTest method commitTransaction.

private void commitTransaction(ByteBuffer buffer, long producerId, long baseOffset) {
    short producerEpoch = 0;
    int partitionLeaderEpoch = 0;
    MemoryRecords.writeEndTransactionalMarker(buffer, baseOffset, time.milliseconds(), partitionLeaderEpoch, producerId, producerEpoch, new EndTransactionMarker(ControlRecordType.COMMIT, 0));
}
Also used : EndTransactionMarker(org.apache.kafka.common.record.EndTransactionMarker)

Aggregations

EndTransactionMarker (org.apache.kafka.common.record.EndTransactionMarker)6 ByteBuffer (java.nio.ByteBuffer)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 ConsumerRecord (org.apache.kafka.clients.consumer.ConsumerRecord)2 TopicPartition (org.apache.kafka.common.TopicPartition)2 MemoryRecordsBuilder (org.apache.kafka.common.record.MemoryRecordsBuilder)2 Arrays.asList (java.util.Arrays.asList)1 Collections.emptyList (java.util.Collections.emptyList)1 Collections.singletonList (java.util.Collections.singletonList)1 Test (org.junit.Test)1 Test (org.junit.jupiter.api.Test)1