Hi,
Let's consider, I have two keyed streams one for rules and another for data and I have created a connected stream. I am maintaining a managed keyed state (ValueState), rules stream will keep updating the state and data stream will keep reading from it. Do I need to take a lock explicitly while updating the state or not? I need to understand. Please let me know. Thanks, -- Garvit Sharma github.com/garvitlnmiit/ No Body is a Scholar by birth, its only hard work and strong determination that makes him master. |
Hi Garvit,
I think you don't need to lock it, they are executed in the same thread sync. Best, Sihua 在2018年05月25日 10:26,[hidden email] 写道: Hi, Let's consider, I have two keyed streams one for rules and another for data and I have created a connected stream. I am maintaining a managed keyed state (ValueState), rules stream will keep updating the state and data stream will keep reading from it. Do I need to take a lock explicitly while updating the state or not? I need to understand. Please let me know. Thanks, -- Garvit Sharma github.com/garvitlnmiit/ No Body is a Scholar by birth, its only hard work and strong determination that makes him master. |
Hi Sihua, Thanks for the quick response. Could you please let me know, where can I find more details about it. Thanks, On Fri, May 25, 2018 at 11:04 AM, sihua zhou <[hidden email]> wrote:
Garvit Sharma github.com/garvitlnmiit/ No Body is a Scholar by birth, its only hard work and strong determination that makes him master. |
Hi Garvit, If you don't mind to take a look at the source code, I would suggest you to have a look at the "StreamTwoInputProcessor#processInput()" in StreamTwoInputProcessor.java. Your customer function will be called via here, the "CoFlatMapFunction#flatMap1()" will be called via streamOperator.processElement1(record);", "CoFlatMapFunction#flatMap2()" will be called via streamOperator.processElement2(record);". You could follow the calling chain to find more detail if you want. Best, Sihua
On 05/25/2018 14:05,[hidden email] wrote:
|
Free forum by Nabble | Edit this page |