pub fn create_batch_with_producer(producer: i64, records: u16) -> Batch {
    let mut batches = Batch::default();
    let header = batches.get_mut_header();
    header.magic = 2;
    header.producer_id = producer;
    header.producer_epoch = -1;

    for _ in 0..records {
        let mut record = Record::default();
        let bytes: Vec<u8> = TEST_RECORD.to_owned();
        record.value = bytes.into();
        batches.add_record(record);
    }

    batches
}
/// create batches with produce and records count
create batches with produce and records count
create batches with produce and records count
pub fn create_batch_with_producer(producer: i64, records: u16) -> Batch {
    let mut batches = Batch::default();
    let header = batches.get_mut_header();
    header.magic = 2;
    header.producer_id = producer;
    header.producer_epoch = -1;
    for _ in 0..records {
        let mut record = Record::default();
        let bytes: Vec<u8> = TEST_RECORD.to_owned();
        record.value = bytes.into();
        batches.add_record(record);
    }
    batches
}
pub fn create_batch_with_producer ( producer : i64 , records : u16 ) -> Batch { let mut batches = Batch :: default ( ) ; let header = batches . get_mut_header ( ) ; header . magic = 2 ; header . producer_id = producer ; header . producer_epoch = - 1 ; for _ in 0 .. records { let mut record = Record :: default ( ) ; let bytes : Vec < u8 > = TEST_RECORD . to_owned ( ) ; record . value = bytes . into ( ) ; batches . add_record ( record ) ; } batches }
create batches with produce and records count
create batches with produce and records count
producer
i64
records
u16
producer
i64
records
u16