diff options
author | Reynold Xin <rxin@databricks.com> | 2017-02-03 21:12:20 -0800 |
---|---|---|
committer | gatorsmile <gatorsmile@gmail.com> | 2017-02-03 21:12:20 -0800 |
commit | 22d4aae8be338051f6652cdf54dd593023751189 (patch) | |
tree | 6acb19436769d0a7e8ab378ac96bb853730b91fc /core/src/main/scala/org | |
parent | 050c20cc9084bd6ef738fd808dad43139250f316 (diff) | |
download | spark-22d4aae8be338051f6652cdf54dd593023751189.tar.gz spark-22d4aae8be338051f6652cdf54dd593023751189.tar.bz2 spark-22d4aae8be338051f6652cdf54dd593023751189.zip |
[SPARK-10063] Follow-up: remove dead code related to an old output committer.
## What changes were proposed in this pull request?
DirectParquetOutputCommitter was removed from Spark as it was deemed unsafe to use. We however still have some code to generate warning. This patch removes those code as well.
## How was this patch tested?
N/A
Author: Reynold Xin <rxin@databricks.com>
Closes #16796 from rxin/remove-direct.
Diffstat (limited to 'core/src/main/scala/org')
-rw-r--r-- | core/src/main/scala/org/apache/spark/internal/io/HadoopMapReduceCommitProtocol.scala | 3 | ||||
-rw-r--r-- | core/src/main/scala/org/apache/spark/internal/io/SparkHadoopMapReduceWriter.scala | 15 |
2 files changed, 0 insertions, 18 deletions
diff --git a/core/src/main/scala/org/apache/spark/internal/io/HadoopMapReduceCommitProtocol.scala b/core/src/main/scala/org/apache/spark/internal/io/HadoopMapReduceCommitProtocol.scala index 2f33f2e4ff..2c1b563688 100644 --- a/core/src/main/scala/org/apache/spark/internal/io/HadoopMapReduceCommitProtocol.scala +++ b/core/src/main/scala/org/apache/spark/internal/io/HadoopMapReduceCommitProtocol.scala @@ -163,7 +163,4 @@ class HadoopMapReduceCommitProtocol(jobId: String, path: String) tmp.getFileSystem(taskContext.getConfiguration).delete(tmp, false) } } - - /** Whether we are using a direct output committer */ - def isDirectOutput(): Boolean = committer.getClass.getSimpleName.contains("Direct") } diff --git a/core/src/main/scala/org/apache/spark/internal/io/SparkHadoopMapReduceWriter.scala b/core/src/main/scala/org/apache/spark/internal/io/SparkHadoopMapReduceWriter.scala index 6de1fc0685..63918ef12a 100644 --- a/core/src/main/scala/org/apache/spark/internal/io/SparkHadoopMapReduceWriter.scala +++ b/core/src/main/scala/org/apache/spark/internal/io/SparkHadoopMapReduceWriter.scala @@ -83,17 +83,6 @@ object SparkHadoopMapReduceWriter extends Logging { isAppend = false).asInstanceOf[HadoopMapReduceCommitProtocol] committer.setupJob(jobContext) - // When speculation is on and output committer class name contains "Direct", we should warn - // users that they may loss data if they are using a direct output committer. - if (SparkHadoopWriterUtils.isSpeculationEnabled(sparkConf) && committer.isDirectOutput) { - val warningMessage = - s"$committer may be an output committer that writes data directly to " + - "the final location. Because speculation is enabled, this output committer may " + - "cause data loss (see the case in SPARK-10063). If possible, please use an output " + - "committer that does not have this behavior (e.g. FileOutputCommitter)." - logWarning(warningMessage) - } - // Try to write all RDD partitions as a Hadoop OutputFormat. try { val ret = sparkContext.runJob(rdd, (context: TaskContext, iter: Iterator[(K, V)]) => { @@ -230,10 +219,6 @@ object SparkHadoopWriterUtils { enabledInConf && !validationDisabled } - def isSpeculationEnabled(conf: SparkConf): Boolean = { - conf.getBoolean("spark.speculation", false) - } - // TODO: these don't seem like the right abstractions. // We should abstract the duplicate code in a less awkward way. |