@SuppressWarnings("deprecation") private <T>String generateTestFile(String filename,List<T> elems,AvroCoder<T> coder,String codec) throws IOException {
  File tmpFile=tmpFolder.newFile(filename);
  String path=tmpFile.toString();
  FileOutputStream os=new FileOutputStream(tmpFile);
  DatumWriter<T> datumWriter=coder.createDatumWriter();
  try (DataFileWriter<T> writer=new DataFileWriter<>(datumWriter)){
    writer.setCodec(CodecFactory.fromString(codec));
    writer.create(coder.getSchema(),os);
    for (    T elem : elems) {
      writer.append(elem);
    }
  }
   return path;
}

@ SuppressWarnings ( "deprecation" ) private < T > String generateTestFile ( String filename , List < T > elems , AvroCoder < T > coder , String codec ) throws IOException { File tmpFile = tmpFolder . newFile ( filename ) ; String path = tmpFile . toString ( ) ; FileOutputStream os = new FileOutputStream ( tmpFile ) ; DatumWriter < T > datumWriter = coder . createDatumWriter ( ) ; try ( DataFileWriter < T > writer = new DataFileWriter < > ( datumWriter ) ) { writer . setCodec ( CodecFactory . fromString ( codec ) ) ; writer . create ( coder . getSchema ( ) , os ) ; for ( T elem : elems ) { writer . append ( elem ) ; } } return path ; }
generates an input avro file containing the given records in the temporary directory and returns the full path of the file .
