You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/01/11 11:18:17 UTC

[GitHub] [spark] LuciferYang opened a new pull request #31130: [SPARK-34070][CORE][SQL ]Use exists method to simplify 'find + emptiness check' on Seq

LuciferYang opened a new pull request #31130:
URL: https://github.com/apache/spark/pull/31130


   ### What changes were proposed in this pull request?
   This pr use `exists` to simplify `find + emptiness check` on `Seq` , it's semantically consistent, but looks simpler.
   
   **Before**
   
   ```
   seq.find(p).isDefined
   
   or
   
   seq.find(p).isEmpty
   ```
   
   **After**
   
   ```
   seq.exists(p)
   
   or
   
   !seq.exists(p)
   ```
   ### Why are the changes needed?
   Code Simpilefications.
   
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   
   ### How was this patch tested?
   Pass the Jenkins or GitHub Action
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #31130: [SPARK-34070][CORE][SQL] Replaces find and emptiness check with exists

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31130:
URL: https://github.com/apache/spark/pull/31130#issuecomment-759236685


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/38586/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] LuciferYang commented on a change in pull request #31130: [SPARK-34070][CORE][SQL] Replaces find and emptiness check with exists

Posted by GitBox <gi...@apache.org>.
LuciferYang commented on a change in pull request #31130:
URL: https://github.com/apache/spark/pull/31130#discussion_r556226975



##########
File path: core/src/main/scala/org/apache/spark/storage/BlockManagerDecommissioner.scala
##########
@@ -272,7 +272,7 @@ private[storage] class BlockManagerDecommissioner(
         migrationPeers.get(peer).foreach(_.running = false)
     }
     // If we don't have anyone to migrate to give up
-    if (migrationPeers.values.find(_.running == true).isEmpty) {
+    if (!migrationPeers.values.exists(_.running == true)) {

Review comment:
       Let me check test dir today




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #31130: [SPARK-34070][CORE][SQL] Replaces find and emptiness check with exists

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31130:
URL: https://github.com/apache/spark/pull/31130#issuecomment-759249641


   Kubernetes integration test status success
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/38586/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #31130: [SPARK-34070][CORE][SQL] Replaces find and emptiness check with exists

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31130:
URL: https://github.com/apache/spark/pull/31130#issuecomment-759219926


   **[Test build #133998 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/133998/testReport)** for PR 31130 at commit [`16b2793`](https://github.com/apache/spark/commit/16b2793731bf7c998c26f7fdb9d16dd95918e0d5).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #31130: [SPARK-34070][CORE][SQL] Replaces find and emptiness check with exists

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31130:
URL: https://github.com/apache/spark/pull/31130#issuecomment-759488498


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/133998/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] srowen commented on a change in pull request #31130: [SPARK-34070][CORE][SQL] Replaces find and emptiness check with exists

Posted by GitBox <gi...@apache.org>.
srowen commented on a change in pull request #31130:
URL: https://github.com/apache/spark/pull/31130#discussion_r555830926



##########
File path: core/src/main/scala/org/apache/spark/storage/BlockManagerDecommissioner.scala
##########
@@ -272,7 +272,7 @@ private[storage] class BlockManagerDecommissioner(
         migrationPeers.get(peer).foreach(_.running = false)
     }
     // If we don't have anyone to migrate to give up
-    if (migrationPeers.values.find(_.running == true).isEmpty) {
+    if (!migrationPeers.values.exists(_.running == true)) {

Review comment:
       `== true` is redundant too




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins commented on pull request #31130: [SPARK-34070][CORE][SQL] Replaces find and emptiness check with exists

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31130:
URL: https://github.com/apache/spark/pull/31130#issuecomment-759263923


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/38586/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #31130: [SPARK-34070][CORE][SQL] Replaces find and emptiness check with exists

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31130:
URL: https://github.com/apache/spark/pull/31130#issuecomment-759263923


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/38586/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] LuciferYang commented on a change in pull request #31130: [SPARK-34070][CORE][SQL] Replaces find and emptiness check with exists

Posted by GitBox <gi...@apache.org>.
LuciferYang commented on a change in pull request #31130:
URL: https://github.com/apache/spark/pull/31130#discussion_r556226916



##########
File path: core/src/main/scala/org/apache/spark/storage/BlockManagerDecommissioner.scala
##########
@@ -272,7 +272,7 @@ private[storage] class BlockManagerDecommissioner(
         migrationPeers.get(peer).foreach(_.running = false)
     }
     // If we don't have anyone to migrate to give up
-    if (migrationPeers.values.find(_.running == true).isEmpty) {
+    if (!migrationPeers.values.exists(_.running == true)) {

Review comment:
       ok ~ 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins commented on pull request #31130: [SPARK-34070][CORE][SQL] Replaces find and emptiness check with exists

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31130:
URL: https://github.com/apache/spark/pull/31130#issuecomment-757985406


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/133925/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins commented on pull request #31130: [SPARK-34070][CORE][SQL] Replaces find and emptiness check with exists

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31130:
URL: https://github.com/apache/spark/pull/31130#issuecomment-759488498


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/133998/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #31130: [SPARK-34070][CORE][SQL] Replaces find and emptiness check with exists

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31130:
URL: https://github.com/apache/spark/pull/31130#issuecomment-757921563


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/38512/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA removed a comment on pull request #31130: [SPARK-34070][CORE][SQL] Replaces find and emptiness check with exists

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #31130:
URL: https://github.com/apache/spark/pull/31130#issuecomment-757891697


   **[Test build #133925 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/133925/testReport)** for PR 31130 at commit [`635f0da`](https://github.com/apache/spark/commit/635f0da5048d6bea931c1bd51146f749509480e7).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] LuciferYang commented on a change in pull request #31130: [SPARK-34070][CORE][SQL] Replaces find and emptiness check with exists

Posted by GitBox <gi...@apache.org>.
LuciferYang commented on a change in pull request #31130:
URL: https://github.com/apache/spark/pull/31130#discussion_r556270570



##########
File path: core/src/main/scala/org/apache/spark/storage/BlockManagerDecommissioner.scala
##########
@@ -272,7 +272,7 @@ private[storage] class BlockManagerDecommissioner(
         migrationPeers.get(peer).foreach(_.running = false)
     }
     // If we don't have anyone to migrate to give up
-    if (migrationPeers.values.find(_.running == true).isEmpty) {
+    if (!migrationPeers.values.exists(_.running == true)) {

Review comment:
       Address 16b2793 remove redundant  `== true` and  there are no other similar cases
   
   
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins commented on pull request #31130: [SPARK-34070][CORE][SQL] Replaces find and emptiness check with exists

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31130:
URL: https://github.com/apache/spark/pull/31130#issuecomment-757950191


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/38512/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #31130: [SPARK-34070][CORE][SQL] Replaces find and emptiness check with exists

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31130:
URL: https://github.com/apache/spark/pull/31130#issuecomment-759469286


   **[Test build #133998 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/133998/testReport)** for PR 31130 at commit [`16b2793`](https://github.com/apache/spark/commit/16b2793731bf7c998c26f7fdb9d16dd95918e0d5).
    * This patch **fails from timeout after a configured wait of `500m`**.
    * This patch merges cleanly.
    * This patch adds no public classes.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA removed a comment on pull request #31130: [SPARK-34070][CORE][SQL] Replaces find and emptiness check with exists

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #31130:
URL: https://github.com/apache/spark/pull/31130#issuecomment-759219926


   **[Test build #133998 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/133998/testReport)** for PR 31130 at commit [`16b2793`](https://github.com/apache/spark/commit/16b2793731bf7c998c26f7fdb9d16dd95918e0d5).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #31130: [SPARK-34070][CORE][SQL] Replaces find and emptiness check with exists

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31130:
URL: https://github.com/apache/spark/pull/31130#issuecomment-757975662


   **[Test build #133925 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/133925/testReport)** for PR 31130 at commit [`635f0da`](https://github.com/apache/spark/commit/635f0da5048d6bea931c1bd51146f749509480e7).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #31130: [SPARK-34070][CORE][SQL] Replaces find and emptiness check with exists

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31130:
URL: https://github.com/apache/spark/pull/31130#issuecomment-757938229


   Kubernetes integration test status failure
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/38512/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #31130: [SPARK-34070][CORE][SQL] Replaces find and emptiness check with exists

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31130:
URL: https://github.com/apache/spark/pull/31130#issuecomment-757950191


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/38512/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #31130: [SPARK-34070][CORE][SQL] Replaces find and emptiness check with exists

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31130:
URL: https://github.com/apache/spark/pull/31130#issuecomment-757891697


   **[Test build #133925 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/133925/testReport)** for PR 31130 at commit [`635f0da`](https://github.com/apache/spark/commit/635f0da5048d6bea931c1bd51146f749509480e7).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] srowen closed pull request #31130: [SPARK-34070][CORE][SQL] Replaces find and emptiness check with exists

Posted by GitBox <gi...@apache.org>.
srowen closed pull request #31130:
URL: https://github.com/apache/spark/pull/31130


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #31130: [SPARK-34070][CORE][SQL] Replaces find and emptiness check with exists

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31130:
URL: https://github.com/apache/spark/pull/31130#issuecomment-757985406


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/133925/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] srowen commented on pull request #31130: [SPARK-34070][CORE][SQL] Replaces find and emptiness check with exists

Posted by GitBox <gi...@apache.org>.
srowen commented on pull request #31130:
URL: https://github.com/apache/spark/pull/31130#issuecomment-759573447


   Merged to master


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] LuciferYang commented on pull request #31130: [SPARK-34070][CORE][SQL] Replaces find and emptiness check with exists

Posted by GitBox <gi...@apache.org>.
LuciferYang commented on pull request #31130:
URL: https://github.com/apache/spark/pull/31130#issuecomment-759879627


   thx~ @srowen 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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