Would work thanks.Need to make some code changes so it becomes visible within
the inner class method processElement().Thanks very much Eugene.
From: Eugene Kirpichov <[email protected]>
To: amir bahmanyari <[email protected]>; "[email protected]"
<[email protected]>
Sent: Wednesday, September 21, 2016 5:25 PM
Subject: Re: Graceful termination of pipeline at runtime
Hmm, the straightforward way of invoking this API should work just fine:
PipelineResult result = p.run();...wait for your termination
condition...result.cancel();
Are you looking for something more specific?
On Wed, Sep 21, 2016 at 5:17 PM amir bahmanyari <[email protected]> wrote:
Thanks Eugene...I see it in the package org.apache.beam.sdk.Ay code example on
accurately using it pls?ThanksAmir- From: Eugene Kirpichov
<[email protected]>
To: amir bahmanyari <[email protected]>; "[email protected]"
<[email protected]>
Sent: Wednesday, September 21, 2016 5:07 PM
Subject: Re: Graceful termination of pipeline at runtime
You need to use a non-blocking runner where p.run() returns immediately.It
returns a PipelineResult
(https://github.com/apache/incubator-beam/blob/master/sdks/java/core/src/main/java/org/apache/beam/sdk/PipelineResult.java)
which provides cancel() and other operations.
On Wed, Sep 21, 2016 at 5:03 PM amir bahmanyari <[email protected]> wrote:
While still running [p.run()], is there a way to terminate a pipleline p.x
based on a condition for instance?I didnt see any related api like
p.terminate() or similar...ThanksAmir-