MultiTap question

267 views
Skip to first unread message

Dexin Wang

unread,
Oct 9, 2009, 7:42:29 PM10/9/09
to cascading-user
Hi,

Is there any example code for MultiTap? I don't see any in the
included tests.

I have a MultiTap that includes two taps from, and I'll have one pipe
from each tap. How do I do that?

I did this:
Tap tap1 = new Dfs(new TextLine(), args[0]);
Tap tap2 = new Dfs(new TextLine(), args[1]);

MultiTap combined = new MultiTap(new Tap[]{tap1,
tap2});

...

Pipe pipe1 = new Each("import", new Fields(fields1),
parser1);
Pipe pipe2 = new Each("import", new Fields(fields2),
parser2);

I got this planner exception: each input pipe branch must be uniquely
named

Then I use different names:

Pipe pipe1 = new Each("import", new Fields(fields1),
parser1);
Pipe pipe2 = new Each("import", new Fields(fields2),
parser2);

I got this: pipe name not found in either sink or source map: import2

I also tried to use different name in Tap with different TextLine
fields names, then I got "must use same scheme" error.

Thank you.
Dexin

Chris K Wensel

unread,
Oct 9, 2009, 9:40:00 PM10/9/09
to cascadi...@googlegroups.com
MultiTap binds multiple tap instances together as one single Tap
instance.

thus, you can only bind that MultiTap to a uniquely named branch.

If you want an assembly with multiple input branches, you don't need
multi-tap. Just bind each individual Tap to a unique branch name and
then use the appropriate FlowConnector#connect() method.

http://www.cascading.org/javadoc/cascading/flow/FlowConnector.html

ckw
--
Chris K Wensel
ch...@concurrentinc.com
http://www.concurrentinc.com

Dexin Wang

unread,
Oct 20, 2009, 1:55:39 PM10/20/09
to cascading-user
Yes, using a HashMap with FlowConnector works great. Should have read
your example here :)

http://www.cascading.org/userguide/htmlsingle/#N2057D

and use the same HashMap approach, I was able to have multiple Taps
for output. They just need some explicit unique names. Thanks for your
help.
Reply all
Reply to author
Forward
0 new messages