public void emit(Object v) {
try {
if(v instanceof Pair) {
Pair p = (Pair)v;
context.write(
new PlumeObject((WritableComparable)p.getKey(), channel),
new PlumeObject((WritableComparable)p.getValue(), channel)
);
} else {
context.write(
new PlumeObject((WritableComparable)v, channel),
new PlumeObject((WritableComparable)v, channel)
);
}
} catch (Exception e) {
e.printStackTrace(); // TODO How to report this
}
}
});
}
} else {
if(op instanceof Flatten) {
l = (LazyCollection)((Flatten)op).getDest();
}
int channel = mscr.getNumberedChannels().get(l);
if(toProcess instanceof Pair) {
context.write(new PlumeObject(key, channel), new PlumeObject(value, channel));
} else {
context.write(new PlumeObject(value, channel), new PlumeObject(value, channel));
}
}
}
};