You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/02/20 15:56:44 UTC

[jira] [Commented] (FLINK-5852) Move JSON generation code into static methods

    [ https://issues.apache.org/jira/browse/FLINK-5852?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15874731#comment-15874731 ] 

ASF GitHub Bot commented on FLINK-5852:
---------------------------------------

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 <ch...@apache.org>
Date:   2017-02-13T14:41:29Z

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

----


> Move JSON generation code into static methods
> ---------------------------------------------
>
>                 Key: FLINK-5852
>                 URL: https://issues.apache.org/jira/browse/FLINK-5852
>             Project: Flink
>          Issue Type: Improvement
>          Components: Webfrontend
>            Reporter: Chesnay Schepler
>            Assignee: Chesnay Schepler
>             Fix For: 1.3.0
>
>
> In order to implement the HistoryServer we need a way to generate the JSON responses independent of the REST API. As such i suggest to move the main parts of the generation code for job-specific handlers into static methods. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)