You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/05/28 06:51:05 UTC

[GitHub] [flink-statefun] tzulitai opened a new pull request #119: [FLINK-17875] [core] Refactor JsonModule

tzulitai opened a new pull request #119:
URL: https://github.com/apache/flink-statefun/pull/119


   This PR is a pre-requisite preparation for adding state TTL for remote functions.
   It refactors the `JsonModule`, so that it'll be easier to manage the parsing logic of JSON application entities (functions, ingresses, egresses, routers, etc.) across multiple supported format versions.
   
   ## Main changes
   
   All concerns of parsing JSON into specs and binding them to the module is implemented as several `JsonEntity`s. For example, the `FunctionJsonEntity` handles the parsing and binding of functions, `IngressJsonEntity` handles ingresses, etc. The `JsonEntity` interface is:
   
   ```
   interface JsonEntity {
       void bind(Binder binder, JsonNode moduleSpecNode, FormatVersion version)
   }
   ```
   
   With this approach, each `JsonEntity` implementation is responsible of figuring out how to parse the provided JSON given the format version of the JSON.
   
   The `JsonModule` then just has a list of `JsonEntity`s that it needs to fully execute, which completes the parsing and binding of the given module.
   
   ## Change log
   
   - ffbb7c5 Adds the `JsonEntity` interface and implementations
   - 1c3dff1 Uses the entities in `JsonModule`
   - 6b9e29e A minor refactoring that moves the concern of default values to the right places
   - 7e0efb8 Breaks up the pointers in the `Pointers` class to their respective entities.
   
   ## Verifying
   
   This is just refactoring of code, no new functionality is added.
   So, existing tests already cover the changes.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org