Re: Alert on state change.

2016-12-19 Thread Scott Kidder
Hi Rudra,

You could accomplish this with a rolling-fold on the stream of stock
prices. The accumulator argument to the fold can track the last price that
triggered an alert and the timestamp of the alert. When evaluating a new
stock price it can compare the the price against the last one that
triggered an alert. If it meets your alerting criteria, then send an alert
and update the accumulator state to reflect the most recent stock price &
timestamp.

Best,

--Scott Kidder



On Mon, Dec 19, 2016 at 7:15 AM, Rudra Tripathy  wrote:

> Hi All,
>
> I have a use case where I am monitoring price change.
>
> Lets s say the original price is $100
> in case of 20% rise , send the alert.
>
> In the stream I am getting updated prices.
>
> If in the next data $200 comes, send the alerts.
>
> Next I am getting 230 I would keep it but no alert
> . When I would get 240., I would send the alert.
>
> Is it possible to achieve using Flink.
>
> Thanks in advance,
> Rudra
>
>


Alert on state change.

2016-12-19 Thread Rudra Tripathy
Hi All,

I have a use case where I am monitoring price change.

Lets s say the original price is $100
in case of 20% rise , send the alert.

In the stream I am getting updated prices.

If in the next data $200 comes, send the alerts.

Next I am getting 230 I would keep it but no alert
. When I would get 240., I would send the alert.

Is it possible to achieve using Flink.

Thanks in advance,
Rudra