/** * Validates that the provided reader schema can read data written with the provided writer * schemas. * * @param reader schema to check. * @param writers that must be compatible with the provided reader schema. * @return a list of compatibility results. */ public static SchemaSetCompatibility checkReaderCompatibility( Schema reader, Iterator<Schema> writers) { final List<SchemaPairCompatibility> results = Lists.newArrayList(); while (writers.hasNext()) { // Check compatibility between each reader/writer pair. results.add(checkReaderWriterCompatibility(reader, writers.next())); } return new SchemaSetCompatibility(results); }
/** * Validates that the provided reader schemas can be used to decode data written with the provided * writer schema. * * @param readers that must be able to be used to decode data encoded with the provided writer * schema. * @param writer schema to check. * @return a list of compatibility results. */ public static SchemaSetCompatibility checkWriterCompatibility( Iterator<Schema> readers, Schema writer) { final List<SchemaPairCompatibility> results = Lists.newArrayList(); while (readers.hasNext()) { // Check compatibility between each reader/writer pair. results.add(checkReaderWriterCompatibility(readers.next(), writer)); } return new SchemaSetCompatibility(results); }