public abstract class ReduceDriverBase<K1,V1,K2,V2,T extends ReduceDriverBase<K1,V1,K2,V2,T>> extends TestDriver<K2,V2,T>
Modifier and Type | Class and Description |
---|---|
protected static class |
ReduceDriverBase.ValueClassInstanceReuseList<T> |
Modifier and Type | Field and Description |
---|---|
protected K1 |
inputKey
Deprecated.
|
protected List<Pair<K1,List<V1>>> |
inputs |
protected org.apache.hadoop.mrunit.internal.output.MockOutputCreator<K2,V2> |
mockOutputCreator |
counterWrapper, expectedEnumCounters, expectedMultipleOutputs, expectedOutputs, expectedPathOutputs, expectedStringCounters, LOG, mos
Constructor and Description |
---|
ReduceDriverBase() |
Modifier and Type | Method and Description |
---|---|
void |
addAll(List<Pair<K1,List<V1>>> inputs)
Adds input to send to the Reducer
|
void |
addInput(K1 key,
List<V1> values)
Add input (K, V*) to send to the Reducer
|
void |
addInput(Pair<K1,List<V1>> input)
Add input (K, V*) to send to the Reducer
|
void |
addInputValue(V1 val)
Deprecated.
MRUNIT-64. Moved to list implementation to support multiple
input (k, v*)*. Replaced by
setInput(K1, java.util.List<V1>) ,
addInput(K1, java.util.List<V1>) , and addAll(java.util.List<org.apache.hadoop.mrunit.types.Pair<K1, java.util.List<V1>>>) |
void |
addInputValues(List<V1> values)
Deprecated.
MRUNIT-64. Moved to list implementation to support multiple
input (k, v*)*. Replaced by
setInput(K1, java.util.List<V1>) ,
addInput(K1, java.util.List<V1>) , and addAll(java.util.List<org.apache.hadoop.mrunit.types.Pair<K1, java.util.List<V1>>>) |
void |
clearInput()
Clears the input to be sent to the Reducer
|
List<V1> |
getInputValues()
Deprecated.
MRUNIT-64. Moved to list implementation to support multiple
input (k, v*)*. Replaced by
getInputValues(Object) |
List<V1> |
getInputValues(K1 key)
Returns a list of values for the given key
|
protected void |
preRunChecks(Object reducer)
Handle inputKey and inputValues for backwards compatibility.
|
protected void |
printPreTestDebugLog()
Overridable hook for printing pre-test debug information
|
abstract 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 |
setInput(K1 key,
List<V1> values)
Sets the input to send to the reducer
|
void |
setInputFromString(String input)
Deprecated.
No replacement due to lack of type safety and incompatibility
with non Text Writables
|
void |
setInputKey(K1 key)
Deprecated.
MRUNIT-64. Moved to list implementation to support multiple
input (k, v*)*. Replaced by
setInput(K1, java.util.List<V1>) ,
addInput(K1, java.util.List<V1>) , and addAll(java.util.List<org.apache.hadoop.mrunit.types.Pair<K1, java.util.List<V1>>>) |
void |
setInputValues(List<V1> values)
Deprecated.
MRUNIT-64. Moved to list implementation to support multiple
input (k, v*)*. Replaced by
setInput(K1, java.util.List<V1>) ,
addInput(K1, java.util.List<V1>) , and addAll(java.util.List<org.apache.hadoop.mrunit.types.Pair<K1, java.util.List<V1>>>) |
T |
withAll(List<Pair<K1,List<V1>>> inputs)
Identical to addAll() but returns self for fluent programming style
|
T |
withInput(K1 key,
List<V1> values)
Identical to setInput() but returns self for fluent programming style
|
T |
withInput(Pair<K1,List<V1>> input)
Identical to addInput() but returns self for fluent programming style
|
T |
withInputFromString(String input)
Deprecated.
No replacement due to lack of type safety and incompatibility
with non Text Writables
|
T |
withInputKey(K1 key)
Deprecated.
MRUNIT-64. Moved to list implementation to support multiple
input (k, v*)*. Replaced by
withInput(Object, List) ,
withAll(List) , and withInput(Pair) |
T |
withInputValue(V1 val)
Deprecated.
MRUNIT-64. Moved to list implementation to support multiple
input (k, v*)*. Replaced by
withInput(Object, List) ,
withAll(List) , and withInput(Pair) |
T |
withInputValues(List<V1> values)
Deprecated.
MRUNIT-64. Moved to list implementation to support multiple
input (k, v*)*. Replaced by
withInput(Object, List) ,
withAll(List) , and withInput(Pair) |
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, 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
@Deprecated protected K1 inputKey
@Deprecated public List<V1> getInputValues()
getInputValues(Object)
public List<V1> getInputValues(K1 key)
key
- @Deprecated public void setInputKey(K1 key)
setInput(K1, java.util.List<V1>)
,
addInput(K1, java.util.List<V1>)
, and addAll(java.util.List<org.apache.hadoop.mrunit.types.Pair<K1, java.util.List<V1>>>)
@Deprecated public void addInputValue(V1 val)
setInput(K1, java.util.List<V1>)
,
addInput(K1, java.util.List<V1>)
, and addAll(java.util.List<org.apache.hadoop.mrunit.types.Pair<K1, java.util.List<V1>>>)
val
- @Deprecated public void setInputValues(List<V1> values)
setInput(K1, java.util.List<V1>)
,
addInput(K1, java.util.List<V1>)
, and addAll(java.util.List<org.apache.hadoop.mrunit.types.Pair<K1, java.util.List<V1>>>)
values
- @Deprecated public void addInputValues(List<V1> values)
setInput(K1, java.util.List<V1>)
,
addInput(K1, java.util.List<V1>)
, and addAll(java.util.List<org.apache.hadoop.mrunit.types.Pair<K1, java.util.List<V1>>>)
values
- public void setInput(K1 key, List<V1> values)
key
- values
- public void clearInput()
public void addInput(K1 key, List<V1> values)
key
- The key too addvalues
- The list of values to addpublic void addInput(Pair<K1,List<V1>> input)
input
- input pairpublic void addAll(List<Pair<K1,List<V1>>> inputs)
inputs
- list of (K, V*) pairs@Deprecated public void setInputFromString(String input)
input
- A string of the form "key \t val,val,val". Trims any whitespace.@Deprecated public T withInputKey(K1 key)
withInput(Object, List)
,
withAll(List)
, and withInput(Pair)
@Deprecated public T withInputValue(V1 val)
withInput(Object, List)
,
withAll(List)
, and withInput(Pair)
val
- @Deprecated public T withInputValues(List<V1> values)
withInput(Object, List)
,
withAll(List)
, and withInput(Pair)
values
- public T withInput(K1 key, List<V1> values)
@Deprecated public T withInputFromString(String input)
input
- A string of the form "key \t val". Trims any whitespace.public T withInput(Pair<K1,List<V1>> input)
input
- public T withAll(List<Pair<K1,List<V1>>> inputs)
inputs
- protected void preRunChecks(Object reducer)
public abstract List<Pair<K2,V2>> run() throws IOException
TestDriver
run
in class TestDriver<K2,V2,T extends ReduceDriverBase<K1,V1,K2,V2,T>>
IOException
protected void printPreTestDebugLog()
TestDriver
printPreTestDebugLog
in class TestDriver<K2,V2,T extends ReduceDriverBase<K1,V1,K2,V2,T>>
Copyright © 2014 The Apache Software Foundation. All Rights Reserved.