You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Josh Rosen (JIRA)" <ji...@apache.org> on 2014/12/15 23:50:13 UTC

[jira] [Updated] (SPARK-1037) the name of findTaskFromList & findTask in TaskSetManager.scala is confusing

     [ https://issues.apache.org/jira/browse/SPARK-1037?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Josh Rosen updated SPARK-1037:
------------------------------
    Description: 
the name of these two functions is confusing 

though in the comments the author said that the method does "dequeue" tasks from the list but from the name, it is not explicitly indicating that the method will mutate the parameter

in 

{code}
private def findTaskFromList(list: ArrayBuffer[Int]): Option[Int] = {
    while (!list.isEmpty) {
      val index = list.last
      list.trimEnd(1)
      if (copiesRunning(index) == 0 && !successful(index)) {
        return Some(index)
      }
    }
    None
  }
{code}

  was:
the name of these two functions is confusing 

though in the comments the author said that the method does "dequeue" tasks from the list but from the name, it is not explicitly indicating that the method will mutate the parameter

in 

private def findTaskFromList(list: ArrayBuffer[Int]): Option[Int] = {
    while (!list.isEmpty) {
      val index = list.last
      list.trimEnd(1)
      if (copiesRunning(index) == 0 && !successful(index)) {
        return Some(index)
      }
    }
    None
  }



> the name of findTaskFromList & findTask in TaskSetManager.scala is confusing
> ----------------------------------------------------------------------------
>
>                 Key: SPARK-1037
>                 URL: https://issues.apache.org/jira/browse/SPARK-1037
>             Project: Spark
>          Issue Type: Improvement
>          Components: Spark Core
>    Affects Versions: 0.9.1, 1.0.0
>            Reporter: Nan Zhu
>            Priority: Minor
>              Labels: starter
>
> the name of these two functions is confusing 
> though in the comments the author said that the method does "dequeue" tasks from the list but from the name, it is not explicitly indicating that the method will mutate the parameter
> in 
> {code}
> private def findTaskFromList(list: ArrayBuffer[Int]): Option[Int] = {
>     while (!list.isEmpty) {
>       val index = list.last
>       list.trimEnd(1)
>       if (copiesRunning(index) == 0 && !successful(index)) {
>         return Some(index)
>       }
>     }
>     None
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org