GitHub user zentol opened a pull request:

    https://github.com/apache/flink/pull/3365

    [FLINK-5852] Move handler JSON generation code into static methods

    This PR is part of the History Server implementation. It is opened 
separately to make the review easier.
    
    The primary change is that the JSON generation of job-specific REST 
responses was moved from various ```handleRequest``` methods into static 
methods. This will allow easier re-use. In addition several refactorings have 
been made and tests were added.
    
    Other changes include:
    * added a utility method ```JsonUtils#addIOMetrics``` to aggregate 
```IOMetrics```
    * added a utility method ```JsonUtils#writeIOMetrics``` to write 
```IOMetrics```
    * added a utiltiy method ```JsonUtils#writeMinMaxAvg``` to write 
```MinMaxAvgStats``` (checkpointing related)
    * replaced **job-related** hard-coded JSON keys with static constants, 
defined in ```JsonUtils#Keys```
    * added an additional constructor to each ```Archived*``` class for easier 
generation in tests
    * added ```BuilderUtils``` class for easier generation of ```Archived*``` 
classes in tests
    * modified ```IOMetrics``` to allow sub-classing without requiring usage of 
Meters
    * added a test for every introduced static method

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/zentol/flink 5852_static_json

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/3365.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #3365
    
----
commit 5369cf678c252aa5988ca33c68ab79560ff6cd41
Author: zentol <[email protected]>
Date:   2017-02-13T14:41:29Z

    [FLINK-5852] Move handler JSON generation code into static methods

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to