i'm quite new hadoop , i've been struggling 2 days figure out why output.collect not collecting right value.
i explain myself: in fact, (for sake of simplification) have following map method :
public void map(longwritable key, text value, outputcollector<text, myobject> output, reporter reporter) throws ioexception { try { forxmlhandling message = (forxmlhandling) unmarshaller.unmarshal(new stringreader(value.tostring())); myobject row = xmlparser.parse(message); row.setorigin(true); output.collect(new text(row.getpnrrecordkey().tostring()), row); } catch(jaxbexception e) { log.debug(e); } }
where myobject object created:
public class myobject { private boolean original; private boolean split; .... } in fact, when launch mapper in debug mode, despite fact i'm setting origin attribute of row (myobject) true, output of mapper (output.collect) row origin attribute set false (default value of boolean). not understand wrong output.collect.
any more welcome. thanks!
thanks answer matt ! indeed, problem coming implementations of readfields , write not calling:
//write _original.write(out); _split.write(out); //readfields _original = new booleanwritable(); _split = new booleanwritable(); _original.readfields(in); _split.readfields(in);
Comments
Post a Comment