AvroOutputFormat extends FileOutputFormat<E> implements Serializable { public void setCodec(final Codec codec) { this.codec = checkNotNull(codec, "codec can not be null"); } AvroOutputFormat(Path filePath, Class<E> type);  AvroOutputFormat(Class<E> type); void setSchema(Schema schema); void setCodec(final Codec codec); @Override void writeRecord(E record); @Override void open(int taskNumber, int numTasks); @Override void close();  }
@Test public void testSetCodec() throws Exception { final AvroOutputFormat<User> outputFormat = new AvroOutputFormat<>(User.class); try { outputFormat.setCodec(AvroOutputFormat.Codec.SNAPPY); } catch (Exception ex) { fail("unexpected exception"); } }