crunch-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mkw...@apache.org
Subject crunch git commit: CRUNCH-507: Added additional constructor and made constructor avoid NPE
Date Thu, 07 May 2015 01:16:13 GMT
Repository: crunch
Updated Branches:
  refs/heads/master cc62ef73e -> 87318ca7e


CRUNCH-507: Added additional constructor and made constructor avoid NPE


Project: http://git-wip-us.apache.org/repos/asf/crunch/repo
Commit: http://git-wip-us.apache.org/repos/asf/crunch/commit/87318ca7
Tree: http://git-wip-us.apache.org/repos/asf/crunch/tree/87318ca7
Diff: http://git-wip-us.apache.org/repos/asf/crunch/diff/87318ca7

Branch: refs/heads/master
Commit: 87318ca7eec9f35ad9c2e386531344b5e1f8a45b
Parents: cc62ef7
Author: Micah Whitacre <micah.whitacre@cerner.com>
Authored: Mon Apr 6 21:36:22 2015 -0500
Committer: Micah Whitacre <micah.whitacre@cerner.com>
Committed: Wed May 6 19:28:04 2015 -0500

----------------------------------------------------------------------
 .../main/java/org/apache/crunch/impl/spark/SparkPipeline.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/crunch/blob/87318ca7/crunch-spark/src/main/java/org/apache/crunch/impl/spark/SparkPipeline.java
----------------------------------------------------------------------
diff --git a/crunch-spark/src/main/java/org/apache/crunch/impl/spark/SparkPipeline.java b/crunch-spark/src/main/java/org/apache/crunch/impl/spark/SparkPipeline.java
index 8108de8..da4f0b4 100644
--- a/crunch-spark/src/main/java/org/apache/crunch/impl/spark/SparkPipeline.java
+++ b/crunch-spark/src/main/java/org/apache/crunch/impl/spark/SparkPipeline.java
@@ -70,9 +70,14 @@ public class SparkPipeline extends DistributedPipeline {
   }
 
   public SparkPipeline(JavaSparkContext sparkContext, String appName) {
-    super(appName, sparkContext.hadoopConfiguration(), new SparkCollectFactory());
+    this(sparkContext, appName, null, sparkContext != null? sparkContext.hadoopConfiguration():
new Configuration());
+  }
+
+  public SparkPipeline(JavaSparkContext sparkContext, String appName, Class<?> jarClass,
Configuration conf) {
+    super(appName, conf, new SparkCollectFactory());
     this.sparkContext = Preconditions.checkNotNull(sparkContext);
     this.sparkConnect = sparkContext.getSparkHome().orNull();
+    this.jarClass = jarClass;
   }
 
   @Override


Mime
View raw message