Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id BE35E200BEB for ; Wed, 28 Dec 2016 19:11:46 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id BCB1D160B2E; Wed, 28 Dec 2016 18:11:46 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 390CB160B2A for ; Wed, 28 Dec 2016 19:11:46 +0100 (CET) Received: (qmail 25656 invoked by uid 500); 28 Dec 2016 18:11:45 -0000 Mailing-List: contact dev-help@gearpump.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@gearpump.incubator.apache.org Delivered-To: mailing list dev@gearpump.incubator.apache.org Delivered-To: moderator for dev@gearpump.incubator.apache.org Received: (qmail 91506 invoked by uid 99); 28 Dec 2016 13:02:22 -0000 X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -7.019 X-Spam-Level: X-Spam-Status: No, score=-7.019 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999] autolearn=disabled From: th3iedkid To: dev@gearpump.incubator.apache.org Reply-To: dev@gearpump.incubator.apache.org References: In-Reply-To: Subject: [GitHub] incubator-gearpump pull request #126: Gearpump 257 remote application submit... Content-Type: text/plain Message-Id: <20161228130219.A9180DFC9D@git1-us-west.apache.org> Date: Wed, 28 Dec 2016 13:02:19 +0000 (UTC) archived-at: Wed, 28 Dec 2016 18:11:46 -0000 Github user th3iedkid commented on a diff in the pull request: https://github.com/apache/incubator-gearpump/pull/126#discussion_r94030146 --- Diff: core/src/main/scala/org/apache/gearpump/jarstore/FileServer.scala --- @@ -145,8 +145,7 @@ object FileServer { } private def entity(file: File)(implicit ec: ExecutionContext): Future[RequestEntity] = { - val entity = HttpEntity(MediaTypes.`application/octet-stream`, file.length(), - FileIO.fromFile(file, chunkSize = 100000)) + val entity = HttpEntity(MediaTypes.`application/octet-stream`, file, chunkSize = 100000) --- End diff -- yes its unconnected ,shall remove it if you feel so , However was wondering if it made the method more focused & better performant on setting up entity with file directly using Akka http API than us us doing a FileIO ? The akka http API does the same plus 1- we don't fetch the length of the file ourselves , 2- short-circuits if the file length were zero , prevent graph orchestration possibly for File IO reads of empty files. Believe these can be useful for a client context. Let me know otherwise , shall undo. --- 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 infrastructure@apache.org or file a JIRA ticket with INFRA. ---