spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From srowen <...@git.apache.org>
Subject [GitHub] spark pull request #14371: [SPARK-16736] WiP Core+ SQL superfluous fs calls
Date Tue, 26 Jul 2016 19:00:44 GMT
Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14371#discussion_r72315005
  
    --- Diff: core/src/main/scala/org/apache/spark/rdd/ReliableCheckpointRDD.scala ---
    @@ -166,17 +166,25 @@ private[spark] object ReliableCheckpointRDD extends Logging {
         val tempOutputPath =
           new Path(outputDir, s".$finalOutputName-attempt-${ctx.attemptNumber()}")
     
    -    if (fs.exists(tempOutputPath)) {
    -      throw new IOException(s"Checkpoint failed: temporary path $tempOutputPath already
exists")
    -    }
         val bufferSize = env.conf.getInt("spark.buffer.size", 65536)
     
    -    val fileOutputStream = if (blockSize < 0) {
    -      fs.create(tempOutputPath, false, bufferSize)
    -    } else {
    -      // This is mainly for testing purpose
    -      fs.create(tempOutputPath, false, bufferSize,
    -        fs.getDefaultReplication(fs.getWorkingDirectory), blockSize)
    +    val fileOutputStream = try {
    +      if (blockSize < 0) {
    +        fs.create(tempOutputPath, false, bufferSize)
    +      } else {
    +        // This is mainly for testing purpose
    +        fs.create(tempOutputPath, false, bufferSize,
    +          fs.getDefaultReplication(fs.getWorkingDirectory), blockSize)
    +      }
    +    } catch {
    +      case e: IOException =>
    +        // could be FileAlreadyExistsException, or a more fundamental create failure
    --- End diff --
    
    Do you want to catch for this separately then, rather than re-check whether it exists?


---
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


Mime
View raw message