Re: [DISCUSS] Generating java code?

2020-04-28 Thread Niels Basjes
Hi, Thank you for clarifying the tradeoffs and choices. I've updated my pull request for your review, as far as I can tell it meets the choices. Now there are 3 scenarios: 1) There is no properties file --> everything returns a "default" value. These are the defaults I have chosen: Version

Re: [DISCUSS] Generating java code?

2020-04-21 Thread Chesnay Schepler
I've had an offline discussion with Till and we came to the following conclusion: All out-lined approaches work perfectly when Flink is built in it's entirety with maven. None of the out-lined approach work perfectly when Flink is _not_ built in it's entirety. The source-file generation

Re: [DISCUSS] Generating java code?

2020-04-16 Thread Niels Basjes
Hi, Apparently the IDEs (like IntelliJ) are imperfect at supporting the DEVs in these kinds of use cases. The solutions you see are like you have in IntelliJ: a "generate-sources" button. It is a way of working I see in almost all projects I'm involved with: Almost all either use a parser

Re: [DISCUSS] Generating java code?

2020-04-15 Thread Till Rohrmann
I'm not advocating for a specific approach. The point I wanted to make is that there are solutions which allow us to get rid of the problematic parsing and not disrupting the workflow. If the Jackson JSON file approach works for Niels, then I'm fine with that as well. Cheers, Till On Wed, Apr

Re: [DISCUSS] Generating java code?

2020-04-15 Thread Chesnay Schepler
It doesn't have to be a properties file, nor do we necessarily have to do any manual parsing. It could just be a JSON file that we point Jackson at. Naturally we could also generate it with Jackson. You'd have a POJO for all the fields with sane defaults (an analogue to the proposed generated

Re: [DISCUSS] Generating java code?

2020-04-15 Thread Jingsong Li
Hi Till, +1 to define an interface and load it at runtime if we can do. No disrupting the workflows of devs and throw an exception with good description look good to me. This also force us to do a good dependent class abstract. Best, Jingsong Lee On Wed, Apr 15, 2020 at 10:31 PM Till Rohrmann

Re: [DISCUSS] Generating java code?

2020-04-15 Thread Till Rohrmann
Hi everyone, thanks for starting this discussion Niels. I like the idea of getting rid of parsing a Properties instance. On the other hand, I also understand that people are concerned about disrupting the workflows of our devs. Maybe we can find a compromise between both approaches. For

Re: [DISCUSS] Generating java code?

2020-04-13 Thread Niels Basjes
Hi, On Mon, Apr 13, 2020 at 8:30 AM Yang Wang wrote: > Although the latter option is more stable, > i think it is not acceptable for all the developers to execute `mvn > generate-sources` first. Otherwise, the Flink project is just broken and could not run tests, Flink > jobs in IDE. > > It is

Re: [DISCUSS] Generating java code?

2020-04-13 Thread Yang Wang
Hi Niels, Thanks a lot for starting this discussion. Although the latter option is more stable, i think it is not acceptable for all the developers to execute `mvn generate-sources` first. Otherwise, the Flink project is just broken and could not run tests, Flink jobs in IDE. So i think the

[DISCUSS] Generating java code?

2020-04-09 Thread Niels Basjes
Hi, I'm working on https://issues.apache.org/jira/browse/FLINK-16871 to make more build time variables (like the scala version) into the code available at runtime. During the review process there was discussion around a basic question: *Is generating java code during the build ok?* See -