in dbeam-core/src/main/java/com/spotify/dbeam/avro/JdbcAvroIO.java [201:215]
public void write(final String query) throws Exception {
checkArgument(dataFileWriter != null, "Avro DataFileWriter was not properly created");
LOGGER.info("jdbcavroio : Starting write...");
try (ResultSet resultSet = executeQuery(query)) {
metering.startWriteMeter();
final JdbcAvroRecordConverter converter = JdbcAvroRecordConverter.create(resultSet);
while (resultSet.next()) {
dataFileWriter.appendEncoded(converter.convertResultSetIntoAvroBytes());
this.metering.incrementRecordCount();
}
this.dataFileWriter.flush();
this.metering.exposeWriteElapsed();
this.metering.exposeWrittenBytes(this.countingOutputStream.getCount());
}
}