[
https://issues.apache.org/jira/browse/FLINK-9599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16518180#comment-16518180
]
ASF GitHub Bot commented on FLINK-9599:
---------------------------------------
GitHub user zentol opened a pull request:
https://github.com/apache/flink/pull/6189
[FLINK-9599][rest] RestClient supports FileUploads
This PR is based on a squashed #6178.
## What is the purpose of the change
This PR extends the `RestClient` to allow sending multipart messages
containing files and an optional json payload.
@tillrohrmann Regarding the previously discussed issue about
´EMPTY_LAST_HTTP_CONTENT`, you can reproduce the issue by reverting the change
to the `FileUploadHandler` and running the `RestClientMultipartTest`.
## Brief change log
* rework `FileUploadHandlerTest` into an abstract base class, to re-use
classes for the `RestClient`
## Verifying this change
* add `RequestProcess` interface for hiding differences between
non-/multipart messages
* refactor `RestClient#sendRequest` into `internalSendRequest` that allows
passing a `RequestProcessor`
* see `RestClientMultipartTest`
## 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)`: (no)
- 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? (no)
- If yes, how is the feature documented? (not applicable)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/zentol/flink 9280_gamma
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/6189.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 #6189
----
commit 97d7eaf2adbc8174025fafd32b3424f05bd27da1
Author: zentol <chesnay@...>
Date: 2018-06-18T08:54:42Z
[FLINK-9599][rest] Implement generic mechanism to access uploaded files
commit 0ea85f1658c3ceca09a481e27392ed39b955d8bb
Author: zentol <chesnay@...>
Date: 2018-06-19T07:45:09Z
[FLINK-9599][rest] RestClient supports FileUploads
----
> Implement generic mechanism to receive files via rest
> -----------------------------------------------------
>
> Key: FLINK-9599
> URL: https://issues.apache.org/jira/browse/FLINK-9599
> Project: Flink
> Issue Type: New Feature
> Components: REST
> Reporter: Chesnay Schepler
> Assignee: Chesnay Schepler
> Priority: Major
> Fix For: 1.6.0
>
>
> As a prerequisite for a cleaner implementation of FLINK-9280 we should
> * extend the RestClient to allow the upload of Files
> * extend FileUploadHandler to accept mixed multi-part requests (json + files)
> * generalize mechanism for accessing uploaded files in {{AbstractHandler}}
> Uploaded files can be forwarded to subsequent handlers as an attribute,
> similar to the existing special case for the {{JarUploadHandler}}. The JSON
> body can be forwarded by replacing the incoming http requests with a simple
> {{DefaultFullHttpRequest}}.
> Uploaded files will be retrievable through the {{HandlerRequest}}.
> I'm not certain if/how we can document that a handler accepts files.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)