From issues-return-172414-archive-asf-public=cust-asf.ponee.io@flink.apache.org Wed Jun 20 10:54:05 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 63BC718067A for ; Wed, 20 Jun 2018 10:54:04 +0200 (CEST) Received: (qmail 88693 invoked by uid 500); 20 Jun 2018 08:54:03 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 88684 invoked by uid 99); 20 Jun 2018 08:54:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Jun 2018 08:54:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id DE87AC02AB for ; Wed, 20 Jun 2018 08:54:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.301 X-Spam-Level: X-Spam-Status: No, score=-110.301 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id hzJwofUGO0-v for ; Wed, 20 Jun 2018 08:54:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 224365F283 for ; Wed, 20 Jun 2018 08:54:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 5EE51E0CC5 for ; Wed, 20 Jun 2018 08:54:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 1987B2183F for ; Wed, 20 Jun 2018 08:54:00 +0000 (UTC) Date: Wed, 20 Jun 2018 08:54:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-9599) Implement generic mechanism to receive files via rest MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FLINK-9599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16517940#comment-16517940 ] ASF GitHub Bot commented on FLINK-9599: --------------------------------------- Github user zentol commented on a diff in the pull request: https://github.com/apache/flink/pull/6178#discussion_r196696248 --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/rest/FileUploadHandler.java --- @@ -116,5 +136,16 @@ private void reset() { currentHttpPostRequestDecoder.destroy(); currentHttpPostRequestDecoder = null; currentHttpRequest = null; + currentUploadDir = null; + currentJsonPayload = null; + } + + public static Optional getMultipartJsonPayload(ChannelHandlerContext ctx) { + return Optional.ofNullable(ctx.channel().attr(UPLOADED_JSON).get()); + } + + public static FileUploads getMultipartFileUploads(ChannelHandlerContext ctx) { + return Optional.ofNullable(ctx.channel().attr(UPLOADED_FILES).get()) + .orElse(FileUploads.EMPTY); --- End diff -- How does this differ to the current implementation? Are you suggesting to simplify `FileUploads` to only consider the case of 1 directory containing N files? > 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)