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 9C04C10E03 for ; Mon, 29 Dec 2014 19:48:44 +0000 (UTC) Received: (qmail 28876 invoked by uid 500); 29 Dec 2014 19:48:45 -0000 Delivered-To: apmail-spark-reviews-archive@spark.apache.org Received: (qmail 28854 invoked by uid 500); 29 Dec 2014 19:48:45 -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 28843 invoked by uid 99); 29 Dec 2014 19:48:43 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Dec 2014 19:48:43 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id C80AD9D05AA; Mon, 29 Dec 2014 19:48:42 +0000 (UTC) From: JoshRosen To: reviews@spark.apache.org Reply-To: reviews@spark.apache.org References: In-Reply-To: Subject: [GitHub] spark pull request: [SPARK-4961] [CORE] Put HadoopRDD.getPartition... Content-Type: text/plain Message-Id: <20141229194842.C80AD9D05AA@tyr.zones.apache.org> Date: Mon, 29 Dec 2014 19:48:42 +0000 (UTC) Github user JoshRosen commented on a diff in the pull request: https://github.com/apache/spark/pull/3794#discussion_r22325585 --- Diff: core/src/main/scala/org/apache/spark/rdd/HadoopRDD.scala --- @@ -203,9 +204,27 @@ class HadoopRDD[K, V]( for (i <- 0 until inputSplits.size) { array(i) = new HadoopPartition(id, i, inputSplits(i)) } + logDebug("Get these partitions took %f s".format((System.nanoTime - start) / 1e9)) array } + @transient private var thesePartitions_ : Array[Partition] = { + try { + getThesePartitions() + } catch { + case e: Exception => + logDebug("Error initializing HadoopRDD's partitions", e) + null --- End diff -- (This comment is kind of moot since I proposed a more general fix in a top-level comment, but I'll still post it anyways:) I don't think that logging an exception at debug level then returning `null` is a good error-handling strategy; this is likely to cause a confusing NPE somewhere else with no obvious cause since most users won't have debug-level logging enabled. --- 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