Return-Path: X-Original-To: apmail-spark-reviews-archive@minotaur.apache.org Delivered-To: apmail-spark-reviews-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 60DC311A69 for ; Fri, 5 Sep 2014 18:12:03 +0000 (UTC) Received: (qmail 49272 invoked by uid 500); 5 Sep 2014 18:12:03 -0000 Delivered-To: apmail-spark-reviews-archive@spark.apache.org Received: (qmail 49251 invoked by uid 500); 5 Sep 2014 18:12:03 -0000 Mailing-List: contact reviews-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list reviews@spark.apache.org Received: (qmail 49240 invoked by uid 99); 5 Sep 2014 18:12:02 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Sep 2014 18:12:02 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 97C1EA0AB3D; Fri, 5 Sep 2014 18:12:02 +0000 (UTC) From: andrewor14 To: reviews@spark.apache.org Reply-To: reviews@spark.apache.org References: In-Reply-To: Subject: [GitHub] spark pull request: [SPARK-2713] Executors of same application in ... Content-Type: text/plain Message-Id: <20140905181202.97C1EA0AB3D@tyr.zones.apache.org> Date: Fri, 5 Sep 2014 18:12:02 +0000 (UTC) Github user andrewor14 commented on a diff in the pull request: https://github.com/apache/spark/pull/1616#discussion_r17188055 --- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala --- @@ -313,14 +313,74 @@ private[spark] object Utils extends Logging { } /** + * Download a file requested by the executor . Supports fetching the file in a variety of ways, + * including HTTP, HDFS and files on a standard filesystem, based on the URL parameter. + * + * If `useCache` is true, first attempts to fetch the file from a local cache that's shared across + * executors running the same application. + * + * Throws SparkException if the target file already exists and has different contents than + * the requested file. + */ + def fetchFile( + url: String, + targetDir: File, + conf: SparkConf, + securityMgr: SecurityManager, + hadoopConf: Configuration, + timestamp: Long, + useCache: Boolean) { + val fileName = url.split("/").last + val targetFile = new File(targetDir, fileName) + if (useCache) { + val cachedFileName = url.hashCode + timestamp + "_cach" --- End diff -- _cache --- 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. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org For additional commands, e-mail: reviews-help@spark.apache.org