Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Gracefully closing a morphline

Gracefully closing a morphline

Explorer

What would be the best way to "exit" a morphline that has entered a while loop, without interfering with that loop?

 

For example, the readLine command of the KiteSDK reads an InputStream line-by-line via a buffered reader, from start to end. One can of course close the stream from anywhere in the pipeline, but then next time the readLine command executes, an IOException will result.

 

Any more graceful way of doing this?

1 REPLY 1

Re: Gracefully closing a morphline

Expert Contributor
returning "false" from a child morphline command will cause the readLine command to stop processing and return false to its parent. Almost all commands behave in such a way.