Return-Path: X-Original-To: apmail-tinkerpop-commits-archive@minotaur.apache.org Delivered-To: apmail-tinkerpop-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 77D18172D8 for ; Wed, 9 Dec 2015 13:52:46 +0000 (UTC) Received: (qmail 24119 invoked by uid 500); 9 Dec 2015 13:52:46 -0000 Delivered-To: apmail-tinkerpop-commits-archive@tinkerpop.apache.org Received: (qmail 24093 invoked by uid 500); 9 Dec 2015 13:52:46 -0000 Mailing-List: contact commits-help@tinkerpop.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tinkerpop.incubator.apache.org Delivered-To: mailing list commits@tinkerpop.incubator.apache.org Received: (qmail 24083 invoked by uid 99); 9 Dec 2015 13:52:45 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Dec 2015 13:52:45 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 739F81A2937 for ; Wed, 9 Dec 2015 13:52:45 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.226 X-Spam-Level: * X-Spam-Status: No, score=1.226 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.554] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id z8tFt3G0HNOR for ; Wed, 9 Dec 2015 13:52:44 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id 40D5724D8F for ; Wed, 9 Dec 2015 13:52:44 +0000 (UTC) Received: (qmail 22303 invoked by uid 99); 9 Dec 2015 13:51:28 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Dec 2015 13:51:28 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0F786E0B70; Wed, 9 Dec 2015 13:51:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: okram@apache.org To: commits@tinkerpop.incubator.apache.org Date: Wed, 09 Dec 2015 13:51:29 -0000 Message-Id: <0c40b6ea020940748455c640824fe4c8@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [08/14] incubator-tinkerpop git commit: added a nice error message if Spark hasn't been created. Much better than NullPointerException. added a nice error message if Spark hasn't been created. Much better than NullPointerException. Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/2653ca78 Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/2653ca78 Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/2653ca78 Branch: refs/heads/master Commit: 2653ca787417a789915f9a3bc13e641c21f10dfd Parents: 4fd1305 Author: Marko A. Rodriguez Authored: Tue Dec 8 11:48:55 2015 -0700 Committer: Marko A. Rodriguez Committed: Tue Dec 8 11:48:55 2015 -0700 ---------------------------------------------------------------------- .../java/org/apache/tinkerpop/gremlin/spark/structure/Spark.java | 2 ++ 1 file changed, 2 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2653ca78/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/Spark.java ---------------------------------------------------------------------- diff --git a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/Spark.java b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/Spark.java index cc1d2bf..2761efb 100644 --- a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/Spark.java +++ b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/Spark.java @@ -67,6 +67,8 @@ public class Spark { } public static void refresh() { + if (null == CONTEXT) + throw new IllegalStateException("The Spark context has not been created."); final Set keepNames = new HashSet<>(); for (final RDD rdd : JavaConversions.asJavaIterable(CONTEXT.persistentRdds().values())) { if (null != rdd.name()) {