public class PipelineMapReduceDriver<K1,V1,K2,V2> extends TestDriver<K2,V2,PipelineMapReduceDriver<K1,V1,K2,V2>>
Modifier and Type | Field and Description |
---|---|
static org.apache.commons.logging.Log |
LOG |
protected org.apache.hadoop.fs.Path |
mapInputPath |
counterWrapper, expectedEnumCounters, expectedMultipleOutputs, expectedOutputs, expectedPathOutputs, expectedStringCounters, mos
Constructor and Description |
---|
PipelineMapReduceDriver() |
PipelineMapReduceDriver(List<Pair<org.apache.hadoop.mapred.Mapper,org.apache.hadoop.mapred.Reducer>> pipeline) |
Modifier and Type | Method and Description |
---|---|
void |
addAll(List<Pair<K1,V1>> inputs)
Adds list of inputs to send to the mapper
|
void |
addInput(K1 key,
V1 val)
Adds an input to send to the mapper
|
void |
addInput(Pair<K1,V1> input)
Adds an input to send to the Mapper
|
void |
addInputFromString(String input)
Deprecated.
No replacement due to lack of type safety and incompatibility
with non Text Writables
|
void |
addMapReduce(org.apache.hadoop.mapred.Mapper m,
org.apache.hadoop.mapred.Reducer r)
Add a Mapper and Reducer instance to the pipeline to use with this test
driver
|
void |
addMapReduce(Pair<org.apache.hadoop.mapred.Mapper,org.apache.hadoop.mapred.Reducer> p)
Add a Mapper and Reducer instance to the pipeline to use with this test
driver
|
org.apache.hadoop.mapred.Counters |
getCounters() |
org.apache.hadoop.fs.Path |
getMapInputPath() |
List<Pair<org.apache.hadoop.mapred.Mapper,org.apache.hadoop.mapred.Reducer>> |
getMapReducePipeline() |
static <K1,V1,K2,V2> |
newPipelineMapReduceDriver()
Returns a new PipelineMapReduceDriver without having to specify the generic
types on the right hand side of the object create statement.
|
static <K1,V1,K2,V2> |
newPipelineMapReduceDriver(List<Pair<org.apache.hadoop.mapred.Mapper,org.apache.hadoop.mapred.Reducer>> pipeline)
Returns a new PipelineMapReduceDriver without having to specify the generic
types on the right hand side of the object create statement.
|
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 |
setCounters(org.apache.hadoop.mapred.Counters ctrs)
Sets the counters object to use for this test.
|
void |
setMapInputPath(org.apache.hadoop.fs.Path mapInputPath) |
PipelineMapReduceDriver<K1,V1,K2,V2> |
withAll(List<Pair<K1,V1>> inputRecords)
Identical to addAll() but returns self for fluent programming style
|
PipelineMapReduceDriver<K1,V1,K2,V2> |
withCounters(org.apache.hadoop.mapred.Counters ctrs)
Sets the counters to use and returns self for fluent style
|
PipelineMapReduceDriver<K1,V1,K2,V2> |
withInput(K1 key,
V1 val)
Identical to addInput() but returns self for fluent programming style
|
PipelineMapReduceDriver<K1,V1,K2,V2> |
withInput(Pair<K1,V1> input)
Identical to addInput() but returns self for fluent programming style
|
PipelineMapReduceDriver<K1,V1,K2,V2> |
withInputFromString(String input)
Deprecated.
No replacement due to lack of type safety and incompatibility
with non Text Writables
|
PipelineMapReduceDriver<K1,V1,K2,V2> |
withMapInputPath(org.apache.hadoop.fs.Path mapInputPath) |
PipelineMapReduceDriver<K1,V1,K2,V2> |
withMapReduce(org.apache.hadoop.mapred.Mapper m,
org.apache.hadoop.mapred.Reducer r)
Add a Mapper and Reducer instance to the pipeline to use with this test
driver using fluent style
|
PipelineMapReduceDriver<K1,V1,K2,V2> |
withMapReduce(Pair<org.apache.hadoop.mapred.Mapper,org.apache.hadoop.mapred.Reducer> p)
Add a Mapper and Reducer instance to the pipeline to use with this test
driver using fluent style
|
addAllOutput, 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, withStrictCounterChecking
public static final org.apache.commons.logging.Log LOG
protected org.apache.hadoop.fs.Path mapInputPath
public PipelineMapReduceDriver(List<Pair<org.apache.hadoop.mapred.Mapper,org.apache.hadoop.mapred.Reducer>> pipeline)
public PipelineMapReduceDriver()
public org.apache.hadoop.mapred.Counters getCounters()
public void setCounters(org.apache.hadoop.mapred.Counters ctrs)
ctrs
- The counters object to use.public PipelineMapReduceDriver<K1,V1,K2,V2> withCounters(org.apache.hadoop.mapred.Counters ctrs)
public void addMapReduce(org.apache.hadoop.mapred.Mapper m, org.apache.hadoop.mapred.Reducer r)
m
- The Mapper instance to add to the pipeliner
- The Reducer instance to add to the pipelinepublic void addMapReduce(Pair<org.apache.hadoop.mapred.Mapper,org.apache.hadoop.mapred.Reducer> p)
p
- The Mapper and Reducer instances to add to the pipelinepublic PipelineMapReduceDriver<K1,V1,K2,V2> withMapReduce(org.apache.hadoop.mapred.Mapper m, org.apache.hadoop.mapred.Reducer r)
m
- The Mapper instance to user
- The Reducer instance to usepublic PipelineMapReduceDriver<K1,V1,K2,V2> withMapReduce(Pair<org.apache.hadoop.mapred.Mapper,org.apache.hadoop.mapred.Reducer> p)
p
- The Mapper and Reducer instances to add to the pipelinepublic List<Pair<org.apache.hadoop.mapred.Mapper,org.apache.hadoop.mapred.Reducer>> getMapReducePipeline()
public void addInput(K1 key, V1 val)
key
- val
- public void addAll(List<Pair<K1,V1>> inputs)
inputs
- list of (K, V) pairspublic PipelineMapReduceDriver<K1,V1,K2,V2> withInput(K1 key, V1 val)
key
- val
- public void addInput(Pair<K1,V1> input)
input
- The (k, v) pair to add to the input list.public PipelineMapReduceDriver<K1,V1,K2,V2> withInput(Pair<K1,V1> input)
input
- The (k, v) pair to add@Deprecated public void addInputFromString(String input)
input
- A string of the form "key \t val". Trims any whitespace.@Deprecated public PipelineMapReduceDriver<K1,V1,K2,V2> withInputFromString(String input)
input
- A string of the form "key \t val". Trims any whitespace.public PipelineMapReduceDriver<K1,V1,K2,V2> withAll(List<Pair<K1,V1>> inputRecords)
inputRecords
- input key/value pairspublic org.apache.hadoop.fs.Path getMapInputPath()
public void setMapInputPath(org.apache.hadoop.fs.Path mapInputPath)
mapInputPath
- Path which is to be passed to the mappers InputSplitpublic final PipelineMapReduceDriver<K1,V1,K2,V2> withMapInputPath(org.apache.hadoop.fs.Path mapInputPath)
mapInputPath
- The Path object which will be given to the mapperpublic List<Pair<K2,V2>> run() throws IOException
TestDriver
run
in class TestDriver<K2,V2,PipelineMapReduceDriver<K1,V1,K2,V2>>
IOException
public static <K1,V1,K2,V2> PipelineMapReduceDriver<K1,V1,K2,V2> newPipelineMapReduceDriver()
public static <K1,V1,K2,V2> PipelineMapReduceDriver<K1,V1,K2,V2> newPipelineMapReduceDriver(List<Pair<org.apache.hadoop.mapred.Mapper,org.apache.hadoop.mapred.Reducer>> pipeline)
pipeline
- passed to PipelineMapReduceDriver constructorCopyright © 2014 The Apache Software Foundation. All Rights Reserved.