Dynamical Windows

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Dynamical Windows

Antonio Saldivar Lezama
Hello

I am developing a Flink 1.4.2 application currently with sliding windows (Example below)
I want to ask if there is a way to create the window time dynamically also the key has to change in some Use Cases and we don't want to create an specific window for each UC

I want to send those values from the front end

SingleOutputStreamOperator<Object> windowed = ObjectDTO

.keyBy("Key")

.timeWindow(Time.minutes(10),Time.minutes(1))

.trigger(new AlertTrigger(env.getStreamTimeCharacteristic()))

.aggregate(new TxnAggregator(), new TxnWindowFn())

.name("TEN_MINUTES_WINDOW")



Thank you
Best Regards
Reply | Threaded
Open this post in threaded view
|

Re: Dynamical Windows

vino yang
Hi antonio,

The keyBy API can accept a KeySelector [1] which is a interface you can implement to specify the key for your business.

I think you can use it and implement its getKey method. In the method, you can access outer system (such as Zookeeper) to get a dynamic key.

It's just an idea, you can try it.

Thanks, vino.


2018-08-01 23:46 GMT+08:00 antonio saldivar <[hidden email]>:
Hello

I am developing a Flink 1.4.2 application currently with sliding windows (Example below)
I want to ask if there is a way to create the window time dynamically also the key has to change in some Use Cases and we don't want to create an specific window for each UC

I want to send those values from the front end

SingleOutputStreamOperator<Object> windowed = ObjectDTO

.keyBy("Key")

.timeWindow(Time.minutes(10),Time.minutes(1))

.trigger(new AlertTrigger(env.getStreamTimeCharacteristic()))

.aggregate(new TxnAggregator(), new TxnWindowFn())

.name("TEN_MINUTES_WINDOW")



Thank you
Best Regards

Reply | Threaded
Open this post in threaded view
|

Re: Dynamical Windows

vino yang

2018-08-01 23:57 GMT+08:00 vino yang <[hidden email]>:
Hi antonio,

The keyBy API can accept a KeySelector [1] which is a interface you can implement to specify the key for your business.

I think you can use it and implement its getKey method. In the method, you can access outer system (such as Zookeeper) to get a dynamic key.

It's just an idea, you can try it.

Thanks, vino.


2018-08-01 23:46 GMT+08:00 antonio saldivar <[hidden email]>:
Hello

I am developing a Flink 1.4.2 application currently with sliding windows (Example below)
I want to ask if there is a way to create the window time dynamically also the key has to change in some Use Cases and we don't want to create an specific window for each UC

I want to send those values from the front end

SingleOutputStreamOperator<Object> windowed = ObjectDTO

.keyBy("Key")

.timeWindow(Time.minutes(10),Time.minutes(1))

.trigger(new AlertTrigger(env.getStreamTimeCharacteristic()))

.aggregate(new TxnAggregator(), new TxnWindowFn())

.name("TEN_MINUTES_WINDOW")



Thank you
Best Regards


Reply | Threaded
Open this post in threaded view
|

Re: Dynamical Windows

Antonio Saldivar Lezama
Awesome, thank you very much I will try to do it with key selector to send the key from the front end

El mié., 1 ago. 2018 a las 11:57, vino yang (<[hidden email]>) escribió:

2018-08-01 23:57 GMT+08:00 vino yang <[hidden email]>:
Hi antonio,

The keyBy API can accept a KeySelector [1] which is a interface you can implement to specify the key for your business.

I think you can use it and implement its getKey method. In the method, you can access outer system (such as Zookeeper) to get a dynamic key.

It's just an idea, you can try it.

Thanks, vino.


2018-08-01 23:46 GMT+08:00 antonio saldivar <[hidden email]>:
Hello

I am developing a Flink 1.4.2 application currently with sliding windows (Example below)
I want to ask if there is a way to create the window time dynamically also the key has to change in some Use Cases and we don't want to create an specific window for each UC

I want to send those values from the front end

SingleOutputStreamOperator<Object> windowed = ObjectDTO

.keyBy("Key")

.timeWindow(Time.minutes(10),Time.minutes(1))

.trigger(new AlertTrigger(env.getStreamTimeCharacteristic()))

.aggregate(new TxnAggregator(), new TxnWindowFn())

.name("TEN_MINUTES_WINDOW")



Thank you
Best Regards