|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.mrunit.TestDriver<K1,V1,K2,V2>
public abstract class TestDriver<K1,V1,K2,V2>
| Field Summary | |
|---|---|
protected org.apache.hadoop.conf.Configuration |
configuration
|
protected List<Pair<K2,V2>> |
expectedOutputs
|
static org.apache.commons.logging.Log |
LOG
|
| Constructor Summary | |
|---|---|
TestDriver()
|
|
| Method Summary | |
|---|---|
protected static void |
formatValueList(List<?> values,
StringBuilder sb)
|
org.apache.hadoop.conf.Configuration |
getConfiguration()
|
List<Pair<K2,V2>> |
getExpectedOutputs()
|
protected static List<org.apache.hadoop.io.Text> |
parseCommaDelimitedList(String commaDelimList)
Split "val,val,val,val..." into a List of Text(val) objects. |
static Pair<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text> |
parseTabbedPair(String tabSeparatedPair)
Split "key \t val" into Pair(Text(key), Text(val)) |
void |
resetOutput()
Clears the list of outputs expected from this driver |
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) |
abstract void |
runTest()
Runs the test and validates the results |
void |
setConfiguration(org.apache.hadoop.conf.Configuration configuration)
|
protected void |
validate(List<Pair<K2,V2>> outputs)
check the outputs against the expected inputs in record |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final org.apache.commons.logging.Log LOG
protected List<Pair<K2,V2>> expectedOutputs
protected org.apache.hadoop.conf.Configuration configuration
| Constructor Detail |
|---|
public TestDriver()
| Method Detail |
|---|
public List<Pair<K2,V2>> getExpectedOutputs()
public void resetOutput()
public abstract List<Pair<K2,V2>> run()
throws IOException
IOException
public abstract void runTest()
throws RuntimeException
RuntimeException - if they don't
*public static Pair<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text> parseTabbedPair(String tabSeparatedPair)
tabSeparatedPair - protected static List<org.apache.hadoop.io.Text> parseCommaDelimitedList(String commaDelimList)
commaDelimList - A list of values separated by commas
protected void validate(List<Pair<K2,V2>> outputs)
throws RuntimeException
outputs - The actual output (k, v) pairs from the Mapper
RuntimeException - if they don't
protected static void formatValueList(List<?> values,
StringBuilder sb)
public org.apache.hadoop.conf.Configuration getConfiguration()
public void setConfiguration(org.apache.hadoop.conf.Configuration configuration)
configuration - The configuration object that will given to the
mapper and/or reducer associated with the driver (new API only)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||