@Override protected void cleanup(Context context) throws IOException, InterruptedException { amos.close(); } }
@Override protected void cleanup(Context context) throws IOException, InterruptedException { amos.close(); } }
@Override protected void cleanup(Context context) throws IOException,InterruptedException { amos.close(); } }
@Override protected void cleanup(Context context) throws IOException,InterruptedException { amos.close(); } }
@Override public void close() throws IOException, InterruptedException { super.close(); if (_multipleOutputs != null) { _multipleOutputs.close(); _multipleOutputs = null; } }
@Override protected void reduce(final Text key, final Iterable<AvroValue<GenericRecord>> values, final Context context) throws IOException, InterruptedException { final BaseReducer baseReducer = new BaseReducer(); final URI uri = baseReducer.getReducerKey(key, context); final AvroMultipleOutputs multipleOutputs = new AvroMultipleOutputs(context); try { for (AvroValue value : values) { GenericRecord rec = (GenericRecord) value.datum(); multipleOutputs.write(new AvroKey<GenericRecord>(rec), NullWritable.get(), uri.toString()); } } finally { multipleOutputs.close(); } } }