[ 
https://issues.apache.org/jira/browse/FLINK-7554?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jiayi updated FLINK-7554:
-------------------------
    Comment: was deleted

(was: [~twalthr] 

I think I should let you know my idea about this issue before finishing the 
coding.

So.. Basically, there're two kinds of functions under 
"org.apache.flink.api.common.functions", one is the function that returns value 
like "MapFunction" and "FilterFunction", the other is the function without 
return like "FlatMapFunction". And for those without return, I'm going to 
implement a function to let developers to get its output.

And In order to make it work for both "streaming" and "batch" environments, I'm 
going to create two "TestContexts" which extend "RuntimeUDFContext" and 
"StreamingRuntimeContext", and develop several functions to let developers 
interact with "State", "Broadcast" and "Collectors".

And I'll make sure that every function is able to work with "TestContext" 
before I submit the pull request.
 # Do you have any suggestion about it ?
 # Should I write my tests for the "TestContext"? I'm not sure if I should do 
it because it'll be written in test package.)

> Add a testing RuntimeContext to test utilities
> ----------------------------------------------
>
>                 Key: FLINK-7554
>                 URL: https://issues.apache.org/jira/browse/FLINK-7554
>             Project: Flink
>          Issue Type: New Feature
>          Components: Tests
>            Reporter: Timo Walther
>            Assignee: Jiayi
>            Priority: Major
>              Labels: starter
>
> When unit testing user-defined functions it would be useful to have an 
> official testing {{RuntimeContext}} that uses Java collections for storing 
> state, metrics, etc.
> After executing the business logic, the user could then verify how the state 
> of the UDF changed or which metrics have been collected.
> This issue includes documentation for the "Testing" section.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to