Below snippet can be used to convert avro file read as InputStream to GenericRecord

/**
* Read Avro file from InputStream And add each record to an Arraylist. *
* @param is InputStream
* @retum List<GenericRecord>
*@throws IOException
*/
public static List < GenericRecord > convertIsToAvro(InputStream is) throws IOException {
DataFileStream < Object > reader = new DataFileStream < Object> (is, new GenericDatumReader < Object> ());
List < GenericRecord > recordList = new ArrayList < > ();
while (reader.hasNext()) {
recordList.add((GenericRecord) reader.next());
}
return recordList;
}

--

--

This is a short story to help to create Run configuration for Maven projects.Multiple configuration can be created

The Run Configuration window can be invoked by selecting the Run Configurations menu item from the Run menu.

click on New launch configuration

--

--

Salbin Antoney

Salbin Antoney

Cloud Native Developer | Micro Service Architecture