You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by techaddict <gi...@git.apache.org> on 2014/04/24 12:06:58 UTC

[GitHub] spark pull request: Fix Scala Style

GitHub user techaddict opened a pull request:

    https://github.com/apache/spark/pull/531

    Fix Scala Style

    Any comments are welcome

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/techaddict/spark stylefix-1

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/531.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #531
    
----
commit 08690e523cd79d11d5c0fb2490ee312e40d73f46
Author: Sandeep <sa...@techaddict.me>
Date:   2014-04-24T09:43:04Z

    fix if else styling

commit 05932d70d66b48babb7ebbfd0ba29e31f498f43e
Author: Sandeep <sa...@techaddict.me>
Date:   2014-04-24T09:56:03Z

    fix if else styling 2

commit b5e2e6f40585e3112bc7f0318fa565e1846d7d97
Author: Sandeep <sa...@techaddict.me>
Date:   2014-04-24T09:59:33Z

    Pass 3

----


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

[GitHub] spark pull request: Fix Scala Style

Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on the pull request:

    https://github.com/apache/spark/pull/531#issuecomment-41317233
  
    lgtm otherwise.


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

[GitHub] spark pull request: Fix Scala Style

Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/531#discussion_r11964875
  
    --- Diff: examples/src/main/scala/org/apache/spark/examples/LogQuery.scala ---
    @@ -49,8 +49,11 @@ object LogQuery {
           System.getenv("SPARK_HOME"), SparkContext.jarOfClass(this.getClass).toSeq)
     
         val dataSet =
    -      if (args.length == 2) sc.textFile(args(1))
    -      else sc.parallelize(exampleApacheLogs)
    +      if (args.length == 2) {
    --- End diff --
    
    this also. when if/else is used as ternary operator


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

[GitHub] spark pull request: Fix Scala Style

Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/531#discussion_r11965029
  
    --- Diff: yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/YarnAllocationHandler.scala ---
    @@ -328,8 +333,12 @@ private[yarn] class YarnAllocationHandler(
                 val rack = YarnAllocationHandler.lookupRack(conf, host)
                 if (rack != null) {
                   val rackCount = allocatedRackCount.getOrElse(rack, 0) - 1
    -              if (rackCount > 0) allocatedRackCount.put(rack, rackCount)
    -              else allocatedRackCount.remove(rack)
    +              if (rackCount > 0) {
    +                allocatedRackCount.put(rack, rackCount)
    +              }
    +              else {
    --- End diff --
    
    else on the previous line


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

[GitHub] spark pull request: Fix Scala Style

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/531


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

[GitHub] spark pull request: Fix Scala Style

Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/531#discussion_r11964960
  
    --- Diff: yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/YarnAllocationHandler.scala ---
    @@ -138,7 +138,9 @@ private[yarn] class YarnAllocationHandler(
               containers += container
             }
             // Add all ignored containers to released list
    -        else releasedContainerList.add(container.getId())
    +        else {
    --- End diff --
    
    put the else on the previous line


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

[GitHub] spark pull request: Fix Scala Style

Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/531#discussion_r11964657
  
    --- Diff: core/src/test/scala/org/apache/spark/rdd/RDDSuite.scala ---
    @@ -381,8 +381,12 @@ class RDDSuite extends FunSuite with SharedSparkContext {
           val prng42 = new Random(42)
           val prng43 = new Random(43)
           Array(1, 2, 3, 4, 5, 6).filter{i =>
    -        if (i < 4) 0 == prng42.nextInt(3)
    -        else 0 == prng43.nextInt(3)}
    +        if (i < 4){
    --- End diff --
    
    for this one u can put all of them on a single line, i.e.
    ```scala
    if (i < 4) 0 == prng42.nextInt(3) else 0 == prng43.nextInt(3)
    ```


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

[GitHub] spark pull request: Fix Scala Style

Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/531#discussion_r11964920
  
    --- Diff: repl/src/main/scala/org/apache/spark/repl/SparkExprTyper.scala ---
    @@ -47,9 +47,15 @@ trait SparkExprTyper extends Logging {
         var isIncomplete = false
         reporter.withIncompleteHandler((_, _) => isIncomplete = true) {
           val trees = codeParser.stmts(line)
    -      if (reporter.hasErrors) Some(Nil)
    -      else if (isIncomplete) None
    -      else Some(trees)
    +      if (reporter.hasErrors) {
    +        Some(Nil)
    +      }
    --- End diff --
    
    put "else if" on the same line as the preceding }. similarly for the last "else"


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

[GitHub] spark pull request: Fix Scala Style

Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on the pull request:

    https://github.com/apache/spark/pull/531#issuecomment-41338700
  
    Thanks. I merged this.


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

[GitHub] spark pull request: Fix Scala Style

Posted by techaddict <gi...@git.apache.org>.
Github user techaddict commented on the pull request:

    https://github.com/apache/spark/pull/531#issuecomment-41317754
  
    @rxin done :+1:  :wink: 


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

[GitHub] spark pull request: Fix Scala Style

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/531#issuecomment-41263471
  
    Can one of the admins verify this patch?


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