com.adgear.anoa.write.AvroBatchWriteConsumer Maven / Gradle / Ivy
package com.adgear.anoa.write;
import org.apache.avro.file.DataFileWriter;
import org.apache.avro.generic.IndexedRecord;
import java.io.IOException;
class AvroBatchWriteConsumer implements WriteConsumer {
final DataFileWriter dataFileWriter;
AvroBatchWriteConsumer(DataFileWriter dataFileWriter) {
this.dataFileWriter = dataFileWriter;
}
@Override
public void acceptChecked(R record) throws IOException {
dataFileWriter.append(record);
}
@Override
public void flush() throws IOException {
dataFileWriter.flush();
}
@Override
public void close() throws IOException {
flush();
dataFileWriter.close();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy