hadoop - How to test reducer with avro params in MRUnit? -
i'm trying test reducer bellow
reducer<compositekeywritable, avrovalue<class1>, avrokey<class2>, nullwritable>
for these purpose use next code in test:
customreducer reducer = new customreducer(); reducedriver = new reducedriver<compositekeywritable, avrovalue<class1>, avrokey<class2>, nullwritable>(); job job = new job(); reducedriver = reducedriver.newreducedriver(reducer).withconfiguration(job.getconfiguration()); reducedriver.setreducer(reducer); job.setinputformatclass(avrokeyinputformat.class); job.setmapoutputkeyclass(compositekeywritable.class); avrojob.setmapoutputvalueschema(job, union); avrojob.setoutputkeyschema(job, class2.schema$); job.setoutputformatclass(avrokeyoutputformat.class); job.setoutputvalueclass(nullwritable.class);
as result got next error:
java.lang.runtimeexception: java.io.eofexception @ org.apache.hadoop.mrunit.internal.io.serialization.copy(serialization.java:86) @ org.apache.hadoop.mrunit.internal.io.serialization.copy(serialization.java:97) @ org.apache.hadoop.mrunit.internal.io.serialization.copywithconf(serialization.java:110) @ org.apache.hadoop.mrunit.testdriver.copy(testdriver.java:675) @ org.apache.hadoop.mrunit.reducedriverbase.addinput(reducedriverbase.java:167) @ org.apache.hadoop.mrunit.reducedriverbase.addinput(reducedriverbase.java:181) @ com.wellcare.caregap.hadoop.reducers.caregapreducertest.testreducer(caregapreducertest.java:70) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ org.junit.runners.model.frameworkmethod$1.runreflectivecall(frameworkmethod.java:50) @ org.junit.internal.runners.model.reflectivecallable.run(reflectivecallable.java:12) @ org.junit.runners.model.frameworkmethod.invokeexplosively(frameworkmethod.java:47) @ org.junit.internal.runners.statements.invokemethod.evaluate(invokemethod.java:17) @ org.junit.internal.runners.statements.runbefores.evaluate(runbefores.java:26) @ org.junit.runners.parentrunner.runleaf(parentrunner.java:325) @ org.junit.runners.blockjunit4classrunner.runchild(blockjunit4classrunner.java:78) @ org.junit.runners.blockjunit4classrunner.runchild(blockjunit4classrunner.java:57) @ org.junit.runners.parentrunner$3.run(parentrunner.java:290) @ org.junit.runners.parentrunner$1.schedule(parentrunner.java:71) @ org.junit.runners.parentrunner.runchildren(parentrunner.java:288) @ org.junit.runners.parentrunner.access$000(parentrunner.java:58) @ org.junit.runners.parentrunner$2.evaluate(parentrunner.java:268) @ org.junit.runners.parentrunner.run(parentrunner.java:363) @ org.eclipse.jdt.internal.junit4.runner.junit4testreference.run(junit4testreference.java:50) @ org.eclipse.jdt.internal.junit.runner.testexecution.run(testexecution.java:38) @ org.eclipse.jdt.internal.junit.runner.remotetestrunner.runtests(remotetestrunner.java:459) @ org.eclipse.jdt.internal.junit.runner.remotetestrunner.runtests(remotetestrunner.java:675) @ org.eclipse.jdt.internal.junit.runner.remotetestrunner.run(remotetestrunner.java:382) @ org.eclipse.jdt.internal.junit.runner.remotetestrunner.main(remotetestrunner.java:192)
what wrong in configuration of job? thankfull if body me these exception.
debug method readfields , write in class1. seems trying read or write fields after reaching end of datainput or dataoutput stream in 1 of them when adding input reducedriver.withinput(yourkey, yourvalue);
Comments
Post a Comment