This project has retired. For details please refer to its Attic page.
CrunchOutputs (Apache Crunch 0.7.0 API)

org.apache.crunch.io
Class CrunchOutputs<K,V>

java.lang.Object
  extended by org.apache.crunch.io.CrunchOutputs<K,V>

public class CrunchOutputs<K,V>
extends Object

An analogue of CrunchInputs for handling multiple OutputFormat instances writing to multiple files within a single MapReduce job.


Field Summary
static String CRUNCH_OUTPUTS
           
 
Constructor Summary
CrunchOutputs(org.apache.hadoop.mapreduce.TaskInputOutputContext<?,?,K,V> context)
          Creates and initializes multiple outputs support, it should be instantiated in the Mapper/Reducer setup method.
 
Method Summary
static void addNamedOutput(org.apache.hadoop.mapreduce.Job job, String name, Class<? extends org.apache.hadoop.mapreduce.OutputFormat> outputFormatClass, Class keyClass, Class valueClass)
           
static void addNamedOutput(org.apache.hadoop.mapreduce.Job job, String name, FormatBundle<? extends org.apache.hadoop.mapreduce.OutputFormat> outputBundle, Class keyClass, Class valueClass)
           
 void close()
           
 void write(String namedOutput, K key, V value)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CRUNCH_OUTPUTS

public static final String CRUNCH_OUTPUTS
See Also:
Constant Field Values
Constructor Detail

CrunchOutputs

public CrunchOutputs(org.apache.hadoop.mapreduce.TaskInputOutputContext<?,?,K,V> context)
Creates and initializes multiple outputs support, it should be instantiated in the Mapper/Reducer setup method.

Parameters:
context - the TaskInputOutputContext object
Method Detail

addNamedOutput

public static void addNamedOutput(org.apache.hadoop.mapreduce.Job job,
                                  String name,
                                  Class<? extends org.apache.hadoop.mapreduce.OutputFormat> outputFormatClass,
                                  Class keyClass,
                                  Class valueClass)

addNamedOutput

public static void addNamedOutput(org.apache.hadoop.mapreduce.Job job,
                                  String name,
                                  FormatBundle<? extends org.apache.hadoop.mapreduce.OutputFormat> outputBundle,
                                  Class keyClass,
                                  Class valueClass)

write

public void write(String namedOutput,
                  K key,
                  V value)
           throws IOException,
                  InterruptedException
Throws:
IOException
InterruptedException

close

public void close()
           throws IOException,
                  InterruptedException
Throws:
IOException
InterruptedException


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.