HI Chris,
As you know, I worked on a zookeeper counter within cascading to count
tuples in a stream.
While the counter works perfectly, i.e. I can increment it using the
TupleCount cascading operator, I encounter difficulties to use the
value of the counter inside a Cascading pipe.
1) I cannot use it inside an ExpressionFunction. The expression is
compiled when creating the cascading flow graph (ElementGraph), and at
this time, the counter is not yet created. I had to create a
DivisionFunction that fetch the counter value in the Function.operate
method (I am not sure if this is very efficient if I have to process
millions of tuples).
2) To be sure that the counter has been fully incremented, I had to
divide my pipe into two flows. The first flow processing my tuples and
counting the number of tuples, and the second flow that use the
zookeeper counter to compute the probability. In this way, I am sure
that when the second flow is executed, the zookeeper counter should be
fully incremented.
This is not very clean, and the cascading flow becomes difficult to
understand. Maybe, you have some ideas on how to improve such data
flow.
Regards
--
Renaud Delbru