Re: Unit Test for KeyedProcessFunction with out-of-core state

2020-09-17 Thread Alexey Trenikhun
Unfortunately it looks like impossible to change backend of AbstractStreamOperatorTestHarness without resorting to reflection, stateBackend initialized in constructor as `this.stateBackend = new MemoryStateBackend();`, since it is protected, I can change it in derived class, but

Re: Unit Test for KeyedProcessFunction with out-of-core state

2020-09-15 Thread Arvid Heise
The new backend would be for unit tests (instead of a RocksDB mock). It's kind of the mock for out-of-core behavior that you initially requested. To use rocksDB in an IT Case with multiple task managers, you would adjust the configuration in the usual minicluster setup, for example [1]. Note

Re: Unit Test for KeyedProcessFunction with out-of-core state

2020-09-14 Thread Alexey Trenikhun
Thank you for ideas. Do you suggest to use new backend with unit test or integration test? Thanks, Alexey From: Arvid Heise Sent: Monday, September 14, 2020 4:26:47 AM To: Dawid Wysakowicz Cc: Alexey Trenikhun ; Flink User Mail List Subject: Re: Unit Test for

Re: Unit Test for KeyedProcessFunction with out-of-core state

2020-09-14 Thread Arvid Heise
Hi Alexey, Definition of test levels are always a bit blurry when writing tests for a data processing framework, but I'm convinced that in your case, you should rather think in terms of integration tests than unit tests: * Unit test should really just be about business logic * If it's about

Re: Unit Test for KeyedProcessFunction with out-of-core state

2020-09-04 Thread Alexey Trenikhun
Hi Gordon, We already use [1]. Unfortunately it doesn’t allow to detect out-of-core specific bugs like this: POJO v = myMapState.get(myKey): v.setStatus(1); return; // missing myMapState.put(myKey, v); Thanks, Alexey From: Tzu-Li (Gordon) Tai Sent: Friday,

Re: Unit Test for KeyedProcessFunction with out-of-core state

2020-09-04 Thread Tzu-Li (Gordon) Tai
Hi Alexey, Is there a specific reason why you want to test against RocksDB? Otherwise, in Flink tests we use a `KeyedOneInputStreamOperatorTestHarness` [1] that allows you to wrap a user function and eliminate the need to worry about setting up heavy runtime context / dependencies such as the

Unit Test for KeyedProcessFunction with out-of-core state

2020-09-03 Thread Alexey Trenikhun
Hello, I want to unit test KeyedProcessFunction which uses with out-of-core state (like rocksdb). Does Flink has mock for rocksdb, which can be used in unit tests ? Thanks, Alexey