tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ok...@apache.org
Subject [08/14] incubator-tinkerpop git commit: added a nice error message if Spark hasn't been created. Much better than NullPointerException.
Date Wed, 09 Dec 2015 13:51:29 GMT
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 <okrammarko@gmail.com>
Authored: Tue Dec 8 11:48:55 2015 -0700
Committer: Marko A. Rodriguez <okrammarko@gmail.com>
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<String> keepNames = new HashSet<>();
         for (final RDD<?> rdd : JavaConversions.asJavaIterable(CONTEXT.persistentRdds().values()))
{
             if (null != rdd.name()) {


Mime
View raw message