GitHub user zentol opened a pull request:

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

    [FLINK-9499][rest] Support JSON request in JarHandlers

    ## What is the purpose of the change
    
    With this PR it is now possible to configure the submission via the 
`JarRunHandler` with a JSON payload instead of query parameters.
    This has a number of advantages:
    * savepoint paths no longer have to be escaped to ridiculous degrees
    * program arguments are no longer limited in length (issue raised in 
FLINK9499)
    * arguments are transmitted as is and aren't subject to query parameter 
parsing rules (FLINK-9832)
    
    The handler now accepts the configuration both via JSON and query 
parameters, with JSON being prioritized. The WebUI makes use of this to be 
compatible with both new and legacy handlers, which is pretty rad.
    
    Note that the `JarPlanHandler` still suffers from the problems listed 
above. While this handler technically works similar to the `JarRunHandler` (in 
fact we _could_ adjust it to work the same way) it unfortunately is a `GET` 
request, for which we do not allow payloads.
    
    This PR shares some code with #6311.
    * simplification of dispatcher host retrieval
    * introduction of `BlobServerResource`
    
    ## Brief change log
    
    * added `JarRunRequestBody`, with optional fields for all parameters
    * modified `JarRunHandler` to accept parameters both via JSON and query 
parameters
    * modified WebUI to submit configuration both via JSON and query parameters
      * new handlers will ignore query parameters
      * legacy handlers will ignore JSON
    
    ## Verifying this change
    
    This change added tests and can be verified as follows:
    * build `flink-runtime-web` (this step is important since we build jar for 
the test)
    * run `JarRunHandlerParameterTest`
    
    The test verifies the successful submission with parameters
    * not being specified at all
    * being specified via query parameters
    * being specified via JSON request
    * being specified via both query parameters and JSON request.
    
    ## Does this pull request potentially affect one of the following parts:
    
      - Dependencies (does it add or upgrade a dependency): (no)
      - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: (yes)
      - The serializers: (no)
      - The runtime per-record code paths (performance sensitive): (no)
      - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Yarn/Mesos, ZooKeeper: (no)
      - The S3 file system connector: (no)
    
    ## Documentation
    
      - Does this pull request introduce a new feature? (yes)
      - If yes, how is the feature documented? (docs)


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

    $ git pull https://github.com/zentol/flink 9499

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

    https://github.com/apache/flink/pull/6330.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 #6330
    
----
commit 662eb3baa013a1a0eddf9ca0e4ae08caa9cccc48
Author: zentol <chesnay@...>
Date:   2018-07-13T12:00:10Z

    [FLINK-9499][rest] Support JSON request in JarHandlers

----


---

Reply via email to