@Test public void testWrite() throws Exception { Identifier identifier = Identifier.newBuilder().setId("id-1").build(); String namedOutputMeta = "meta"; String namedOutputFault = "fault"; Configuration conf = new Configuration(); conf.set(MULTIPLE_OUTPUTS, namedOutputMeta + ' ' + namedOutputFault); conf.setClass(MO_PREFIX + namedOutputMeta + FORMAT, MockOutputFormat.class, OutputFormat.class); doReturn(MockOutputFormat.class).when(context).getOutputFormatClass(); doReturn(conf).when(context).getConfiguration(); doReturn(taskAttemptId).when(context).getTaskAttemptID(); doReturn(new JobID()).when(taskAttemptId).getJobID(); AvroMultipleOutputs multipleOutputs = new AvroMultipleOutputs(context); RecordWriter<?, ?> recordWriter = multipleOutputs.getRecordWriter(context, namedOutputMeta); multipleOutputs.write(namedOutputMeta, identifier); assertNotNull(recordWriter); assertTrue(recordWriter instanceof MockRecordWriter); assertEquals(1, ((MockRecordWriter)recordWriter).getWrittenRecords().size()); assertTrue(identifier == ((MockRecordWriter)recordWriter).getWrittenRecords().get(0)); }
public void write(String namedOutput, Object key) throws IOException, InterruptedException { write(namedOutput, key, NullWritable.get(), namedOutput); }
AvroMultipleOutputs { public void write(String namedOutput, Object key) throws IOException, InterruptedException { write(namedOutput, key, NullWritable.get(), namedOutput); } }
AvroMultipleOutputs { public void write(String namedOutput, Object key) throws IOException, InterruptedException { write(namedOutput, key, NullWritable.get(), namedOutput); } AvroMultipleOutputs(
      TaskInputOutputContext<?, ?, ?, ?> context); }
AvroMultipleOutputs { public void write(String namedOutput, Object key) throws IOException, InterruptedException { write(namedOutput, key, NullWritable.get(), namedOutput); } AvroMultipleOutputs(
      TaskInputOutputContext<?, ?, ?, ?> context); @SuppressWarnings("rawtypes") static void addNamedOutput(Job job, String namedOutput,
      Class<? extends OutputFormat> outputFormatClass,
      Schema keySchema); @SuppressWarnings("rawtypes") static void addNamedOutput(Job job, String namedOutput,
      Class<? extends OutputFormat> outputFormatClass,
      Schema keySchema, Schema valueSchema); static void setCountersEnabled(Job job, boolean enabled); static boolean getCountersEnabled(JobContext job); Set<String> getNamedOutputs(); void write(String namedOutput, Object key); void write(String namedOutput, Object key, Object value); @SuppressWarnings("unchecked") void write(String namedOutput, Object key, Object value,
      String baseOutputPath); void write(Object key, Object value, String baseOutputPath); @SuppressWarnings({ "unchecked", "deprecation" }) void write(Object key, Object value, Schema keySchema,
      Schema valSchema, String baseOutputPath); @SuppressWarnings("rawtypes") synchronized RecordWriter getRecordWriter(
      TaskAttemptContext taskContext, String baseFileName); @SuppressWarnings("deprecation") TaskAttemptContext getContext(String nameOutput); void close(); }
AvroMultipleOutputs { public void write(String namedOutput, Object key) throws IOException, InterruptedException { write(namedOutput, key, NullWritable.get(), namedOutput); } AvroMultipleOutputs(
      TaskInputOutputContext<?, ?, ?, ?> context); @SuppressWarnings("rawtypes") static void addNamedOutput(Job job, String namedOutput,
      Class<? extends OutputFormat> outputFormatClass,
      Schema keySchema); @SuppressWarnings("rawtypes") static void addNamedOutput(Job job, String namedOutput,
      Class<? extends OutputFormat> outputFormatClass,
      Schema keySchema, Schema valueSchema); static void setCountersEnabled(Job job, boolean enabled); static boolean getCountersEnabled(JobContext job); Set<String> getNamedOutputs(); void write(String namedOutput, Object key); void write(String namedOutput, Object key, Object value); @SuppressWarnings("unchecked") void write(String namedOutput, Object key, Object value,
      String baseOutputPath); void write(Object key, Object value, String baseOutputPath); @SuppressWarnings({ "unchecked", "deprecation" }) void write(Object key, Object value, Schema keySchema,
      Schema valSchema, String baseOutputPath); @SuppressWarnings("rawtypes") synchronized RecordWriter getRecordWriter(
      TaskAttemptContext taskContext, String baseFileName); @SuppressWarnings("deprecation") TaskAttemptContext getContext(String nameOutput); void close();  }