building a lookup step in a UDJC

53 views
Skip to first unread message

Dan

unread,
Jan 16, 2015, 7:58:38 AM1/16/15
to kettle-d...@googlegroups.com
Hi,

I've built a lookupstep in a UDJC and it works fine in a simple test case.

However in the real world what seems to happen is that the transformation hangs.

I suspect this is because although my step has finished processing the input stream, it hasn't consumed all the lookup stream data.  Therefore the step feeding the lookup stream doesn't end.

So, short of simply calling getrows loads of times until they are all consumed, is there any other way to say "Oi, I'm done, just die"?

Thanks
Dan

Matt Casters

unread,
Jan 16, 2015, 9:00:53 AM1/16/15
to Kettle Developers mailing list
Fortunately there is no "ignore all these" rows method.
So the only option left to forcefully stop the transformation is to actually call stopAll();

I find the use-case a bit dubious though.  How would you know that you read all the lookup data and where to stop?  That's just one question I would have in this situation.

I think that instead you just need to make sure you depleted all the steps from a specific (what we call) info-step before starting to read from all other steps. From StreamLookup.java:

    RowSet rowSet = findInputRowSet( data.infoStream.getStepname() );
    Object[] rowData = getRowFrom( rowSet ); // rows are originating from "lookup_from"
    while ( rowData != null ) {
        ... do something....
        rowData = getRowFrom( rowSet );
    }

and only then call getRow() as before.

Good luck!
Matt


--
Matt Casters <mcas...@pentaho.org>
Chief Data Integration, Kettle founder, Author of Pentaho Kettle Solutions (Wiley)
Fonteinstraat 70 - 9400 OKEGEM - Belgium - Cell : +32 486 97 29 37
Pentaho  -  Powerful Analytics Made Easy


--
You received this message because you are subscribed to the Google Groups "kettle-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kettle-develop...@googlegroups.com.
To post to this group, send email to kettle-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/kettle-developers.
For more options, visit https://groups.google.com/d/optout.

Dan

unread,
Jan 16, 2015, 9:04:52 AM1/16/15
to kettle-d...@googlegroups.com
Perfect, thanks. I plan a blog to explain my specific use case in the next few weeks with source too :-)
Reply all
Reply to author
Forward
0 new messages