K1 - The common map output key typeV1 - The common map output value typeK2 - The reduce output key typeV2 - The reduce output value typepublic class MultipleInputsMapReduceDriver<K1,V1,K2,V2> extends org.apache.hadoop.mrunit.internal.driver.MultipleInputsMapReduceDriverBase<org.apache.hadoop.mapred.Mapper,K1,V1,K2,V2,MultipleInputsMapReduceDriver<K1,V1,K2,V2>>
| Modifier and Type | Field and Description |
|---|---|
static org.apache.commons.logging.Log |
LOG |
inputs, keyGroupComparator, keyValueOrderComparator, mapInputPathscounterWrapper, expectedEnumCounters, expectedMultipleOutputs, expectedOutputs, expectedPathOutputs, expectedStringCounters, mos| Constructor and Description |
|---|
MultipleInputsMapReduceDriver()
Construct a driver without specifying a Combiner nor a Reducer.
|
MultipleInputsMapReduceDriver(org.apache.hadoop.mapred.Reducer<K1,V1,K1,V1> combiner,
org.apache.hadoop.mapred.Reducer<K1,V1,K2,V2> reducer)
Construct a driver with the specified Combiner and Reducers
|
MultipleInputsMapReduceDriver(org.apache.hadoop.mapred.Reducer<K1,V1,K2,V2> reducer)
Construct a driver with the specified Reducer.
|
| Modifier and Type | Method and Description |
|---|---|
<K,V> void |
addAll(org.apache.hadoop.mapred.Mapper<K,V,K1,V1> mapper,
List<Pair<K,V>> inputs)
Add the specified input pairs to the specified mapper
|
<K,V> void |
addInput(org.apache.hadoop.mapred.Mapper<K,V,K1,V1> mapper,
K key,
V val)
Add the specified (key, val) pair to the specified mapper
|
<K,V> void |
addInput(org.apache.hadoop.mapred.Mapper<K,V,K1,V1> mapper,
Pair<K,V> input)
Add the specified input pair to the specified mapper
|
<K,V> void |
addMapper(org.apache.hadoop.mapred.Mapper<K,V,K1,V1> mapper)
Add a mapper to use with this test driver
|
org.apache.hadoop.mapred.Reducer<K1,V1,K1,V1> |
getCombiner() |
org.apache.hadoop.mapred.Counters |
getCounters() |
Collection<org.apache.hadoop.mapred.Mapper> |
getMappers() |
org.apache.hadoop.mapred.Reducer<K1,V1,K2,V2> |
getReducer() |
static <K1,V1,K2,V2> |
newMultipleInputMapReduceDriver()
Static factory-style method to construct a driver instance without
specifying a Combiner nor a Reducer.
|
static <K1,V1,K2,V2> |
newMultipleInputMapReduceDriver(org.apache.hadoop.mapred.Reducer<K1,V1,K1,V1> combiner,
org.apache.hadoop.mapred.Reducer<K1,V1,K2,V2> reducer)
Static factory-style method to construct a driver instance with the
specified Combiner and Reducer
|
static <K1,V1,K2,V2> |
newMultipleInputMapReduceDriver(org.apache.hadoop.mapred.Reducer<K1,V1,K2,V2> reducer)
Static factory-style method to construct a driver instance with the
specified Reducer
|
protected void |
preRunChecks(Set<org.apache.hadoop.mapred.Mapper> mappers,
Object reducer) |
List<Pair<K2,V2>> |
run()
Runs the test but returns the result set instead of validating it (ignores
any addOutput(), etc calls made before this)
|
void |
setCombiner(org.apache.hadoop.mapred.Reducer<K1,V1,K1,V1> combiner)
Set the combiner to use with this test driver
|
void |
setCounters(org.apache.hadoop.mapred.Counters counters)
Sets the counters object to use for this test
|
void |
setReducer(org.apache.hadoop.mapred.Reducer<K1,V1,K2,V2> reducer)
Set the reducer to use with this test driver
|
<K,V> MultipleInputsMapReduceDriver<K1,V1,K2,V2> |
withAll(org.apache.hadoop.mapred.Mapper<K,V,K1,V1> mapper,
List<Pair<K,V>> inputs)
Identical to addInput but supports fluent programming style
|
MultipleInputsMapReduceDriver<K1,V1,K2,V2> |
withCombiner(org.apache.hadoop.mapred.Reducer<K1,V1,K1,V1> combiner)
Identical to setCombiner but supports a fluent programming style
|
MultipleInputsMapReduceDriver<K1,V1,K2,V2> |
withCounter(org.apache.hadoop.mapred.Counters counters)
Identical to setCounters but supports a fluent programming style
|
<K,V> MultipleInputsMapReduceDriver<K1,V1,K2,V2> |
withInput(org.apache.hadoop.mapred.Mapper<K,V,K1,V1> mapper,
K key,
V val)
Identical to addInput but supports fluent programming style
|
<K,V> MultipleInputsMapReduceDriver<K1,V1,K2,V2> |
withInput(org.apache.hadoop.mapred.Mapper<K,V,K1,V1> mapper,
Pair<K,V> input)
Identical to addInput but supports fluent programming style
|
MultipleInputsMapReduceDriver<K1,V1,K2,V2> |
withInputFormat(Class<? extends org.apache.hadoop.mapred.InputFormat> inputFormatClass)
Set the InputFormat
|
<K,V> MultipleInputsMapReduceDriver<K1,V1,K2,V2> |
withMapper(org.apache.hadoop.mapred.Mapper<K,V,K1,V1> mapper)
Identical to addMapper but supports a fluent programming style
|
MultipleInputsMapReduceDriver<K1,V1,K2,V2> |
withOutputFormat(Class<? extends org.apache.hadoop.mapred.OutputFormat> outputFormatClass)
Configure
Reducer to output with a real OutputFormat. |
MultipleInputsMapReduceDriver<K1,V1,K2,V2> |
withReducer(org.apache.hadoop.mapred.Reducer<K1,V1,K2,V2> reducer)
Identical to setReducer but supports a fluent programming style
|
addAll, addInput, addInput, getMapInputPath, setKeyGroupingComparator, setKeyOrderComparator, setMapInputPath, withAll, withInput, withInput, withKeyGroupingComparator, withKeyOrderComparator, withMapInputPathaddAllOutput, addCacheArchive, addCacheArchive, addCacheFile, addCacheFile, addMultiOutput, addMultiOutput, addOutput, addOutput, addOutputFromString, cleanupDistributedCache, copy, copyPair, driverReused, formatPairList, formatValueList, getConfiguration, getExpectedEnumCounters, getExpectedOutputs, getExpectedStringCounters, getKeyComparator, getOutputSerializationConfiguration, getValueComparator, initDistributedCache, parseCommaDelimitedList, parseTabbedPair, printPreTestDebugLog, resetExpectedCounters, resetOutput, run, runTest, runTest, setCacheArchives, setCacheFiles, setConfiguration, setKeyComparator, setOutputSerializationConfiguration, setUsedOnceStatus, setValueComparator, thisAsTestDriver, validate, validate, validate, validateOutputList, withAllOutput, withCacheArchive, withCacheArchive, withCacheFile, withCacheFile, withConfiguration, withCounter, withCounter, withMultiOutput, withMultiOutput, withOutput, withOutput, withOutputFromString, withOutputSerializationConfiguration, withPathOutput, withPathOutput, withStrictCounterCheckingpublic MultipleInputsMapReduceDriver(org.apache.hadoop.mapred.Reducer<K1,V1,K2,V2> reducer)
reducer - The reducer to usepublic MultipleInputsMapReduceDriver(org.apache.hadoop.mapred.Reducer<K1,V1,K1,V1> combiner, org.apache.hadoop.mapred.Reducer<K1,V1,K2,V2> reducer)
combiner - The combiner to usereducer - The reducer to usepublic MultipleInputsMapReduceDriver()
public <K,V> void addMapper(org.apache.hadoop.mapred.Mapper<K,V,K1,V1> mapper)
K - The input key type to the mapperV - The input value type to the mappermapper - The mapper instance to addpublic <K,V> MultipleInputsMapReduceDriver<K1,V1,K2,V2> withMapper(org.apache.hadoop.mapred.Mapper<K,V,K1,V1> mapper)
K - The input key type to the mapperV - The input value type to the mappermapper - The mapper instance to addpublic Collection<org.apache.hadoop.mapred.Mapper> getMappers()
public void setCombiner(org.apache.hadoop.mapred.Reducer<K1,V1,K1,V1> combiner)
combiner - The combiner instance to usepublic MultipleInputsMapReduceDriver<K1,V1,K2,V2> withCombiner(org.apache.hadoop.mapred.Reducer<K1,V1,K1,V1> combiner)
combiner - The combiner instance to usepublic org.apache.hadoop.mapred.Reducer<K1,V1,K1,V1> getCombiner()
public void setReducer(org.apache.hadoop.mapred.Reducer<K1,V1,K2,V2> reducer)
reducer - The reducer instance to usepublic MultipleInputsMapReduceDriver<K1,V1,K2,V2> withReducer(org.apache.hadoop.mapred.Reducer<K1,V1,K2,V2> reducer)
reducer - The reducer instance to usepublic org.apache.hadoop.mapred.Reducer<K1,V1,K2,V2> getReducer()
public org.apache.hadoop.mapred.Counters getCounters()
public void setCounters(org.apache.hadoop.mapred.Counters counters)
counters - The counters object to usepublic MultipleInputsMapReduceDriver<K1,V1,K2,V2> withCounter(org.apache.hadoop.mapred.Counters counters)
counters - The counters object to usepublic MultipleInputsMapReduceDriver<K1,V1,K2,V2> withOutputFormat(Class<? extends org.apache.hadoop.mapred.OutputFormat> outputFormatClass)
Reducer to output with a real OutputFormat.outputFormatClass - The OutputFormat classpublic MultipleInputsMapReduceDriver<K1,V1,K2,V2> withInputFormat(Class<? extends org.apache.hadoop.mapred.InputFormat> inputFormatClass)
inputFormatClass - The InputFormat classpublic static <K1,V1,K2,V2> MultipleInputsMapReduceDriver<K1,V1,K2,V2> newMultipleInputMapReduceDriver(org.apache.hadoop.mapred.Reducer<K1,V1,K1,V1> combiner, org.apache.hadoop.mapred.Reducer<K1,V1,K2,V2> reducer)
K1 - The common output key type of the mappersV1 - The common output value type of the mappersK2 - The output key type of the reducerV2 - The output value type of the reducercombiner - The combiner to usereducer - The reducer to usepublic static <K1,V1,K2,V2> MultipleInputsMapReduceDriver<K1,V1,K2,V2> newMultipleInputMapReduceDriver(org.apache.hadoop.mapred.Reducer<K1,V1,K2,V2> reducer)
K1 - The common output key type of the mappersV1 - The common output value type of the mappersK2 - The output key type of the reducerV2 - The output value type of the reducerreducer - The reducer to usepublic static <K1,V1,K2,V2> MultipleInputsMapReduceDriver<K1,V1,K2,V2> newMultipleInputMapReduceDriver()
K1 - The common output key type of the mappersV1 - The common output value type of the mappersK2 - The output key type of the reducerV2 - The output value type of the reducerpublic <K,V> void addInput(org.apache.hadoop.mapred.Mapper<K,V,K1,V1> mapper, K key, V val)
K - The type of the keyV - The type of the valuemapper - The mapper to add the input pair tokey - The keyval - The valuepublic <K,V> void addInput(org.apache.hadoop.mapred.Mapper<K,V,K1,V1> mapper, Pair<K,V> input)
K - The type of the keyV - The type of the valuemapper - The mapper to add the input pair toinput - The (k,v) pair to addpublic <K,V> void addAll(org.apache.hadoop.mapred.Mapper<K,V,K1,V1> mapper, List<Pair<K,V>> inputs)
K - The type of the keyV - The type of the valuemapper - The mapper to add the input pairs toinputs - The (k, v) pairs to addpublic <K,V> MultipleInputsMapReduceDriver<K1,V1,K2,V2> withInput(org.apache.hadoop.mapred.Mapper<K,V,K1,V1> mapper, K key, V val)
K - The type of the keyV - The type of the valuemapper - The mapper to add the input pair tokey - The keyval - The valuepublic <K,V> MultipleInputsMapReduceDriver<K1,V1,K2,V2> withInput(org.apache.hadoop.mapred.Mapper<K,V,K1,V1> mapper, Pair<K,V> input)
K - The type of the keyV - The type of the valuemapper - The mapper to add the input pairs toinputs - The (k, v) pairs to addpublic <K,V> MultipleInputsMapReduceDriver<K1,V1,K2,V2> withAll(org.apache.hadoop.mapred.Mapper<K,V,K1,V1> mapper, List<Pair<K,V>> inputs)
K - The type of the keyV - The type of the valuemapper - The mapper to add the input pairs toinputs - The (k, v) pairs to addprotected void preRunChecks(Set<org.apache.hadoop.mapred.Mapper> mappers, Object reducer)
public List<Pair<K2,V2>> run() throws IOException
TestDriverrun in class TestDriver<K2,V2,MultipleInputsMapReduceDriver<K1,V1,K2,V2>>IOExceptionCopyright © 2014 The Apache Software Foundation. All Rights Reserved.