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/09/14 06:31:37 UTC

[GitHub] [spark] LuciferYang opened a new pull request #33991: [SPARK-36750][CORE] Replace the Guava API with `j.u.Objects` API with the same semantics

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


   ### What changes were proposed in this pull request?
   Java 8 provides the java.util.Objects, this pr it to replace some Guava API usages with the same semantics, the replacement rules are as follows:
   
   1. Preconditions.checkNotNull -> Objects.requireNonNull
   **Guava**
   ```
   public static <T> T checkNotNull(T reference,
         @Nullable String errorMessageTemplate,
         @Nullable Object... errorMessageArgs) {
       if (reference == null) {
         // If either of these parameters is null, the right thing happens anyway
         throw new NullPointerException(
             format(errorMessageTemplate, errorMessageArgs));
       }
       return reference;
     }
   ```
   
   **java.util.Objects**
   
   ```
       public static <T> T requireNonNull(T obj, Supplier<String> messageSupplier) {
           if (obj == null)
               throw new NullPointerException(messageSupplier.get());
           return obj;
       }
   ```
   
   
   2. Objects.hashCode -> j.u.Objects.hash
   
   **Guava**
   ```
     public static int hashCode(@Nullable Object... objects) {
       return java.util.Arrays.hashCode(objects);
     }
   ```
   
   **java.util.Objects**
   
   ```
       public static int hash(Object... values) {
           return java.util.Arrays.hashCode(values);
       }
   ```
   3. Objects.equal -> j.u.Objects.equals
   
   **Guava**
   ```
     public static boolean equal(@Nullable Object a, @Nullable Object b) {
       return a == b || (a != null && a.equals(b));
     }
   ```
   
   **java.util.Objects**
   
   ```
       public static boolean equals(Object a, Object b) {
           return (a == b) || (a != null && a.equals(b));
       }
   ```
   
   ### Why are the changes needed?
   Reduce dependence on Guava API because Spark still use Guava 14.0.1.
   
   
   
   ### 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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 #33991: [SPARK-36750][CORE][SQL][MLLIB] Replace the Guava API with `j.u.Objects` API with the same semantics

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


   **[Test build #143248 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143248/testReport)** for PR 33991 at commit [`7d0a912`](https://github.com/apache/spark/commit/7d0a912471047a58b8c40240e74805b69c78b758).


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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] github-actions[bot] closed pull request #33991: [SPARK-36750][CORE][SQL][MLLIB][YARN] Replace the Guava API with `java.util.Objects` API with the same semantics

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #33991:
URL: https://github.com/apache/spark/pull/33991


   


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 #33991: [SPARK-36750][CORE][SQL][MLLIB][YARN] Replace the Guava API with `java.util.Objects` API with the same semantics

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


   **[Test build #143245 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143245/testReport)** for PR 33991 at commit [`551c1ec`](https://github.com/apache/spark/commit/551c1ec9fa2e3e0a7f26df3d144e4bcd1379e115).


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 #33991: [SPARK-36750][CORE][SQL][MLLIB][YARN] Replace the Guava API with `java.util.Objects` API with the same semantics

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


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


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 #33991: [SPARK-36750][CORE][SQL][MLLIB][YARN] Replace the Guava API with `java.util.Objects` API with the same semantics

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


   **[Test build #143248 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143248/testReport)** for PR 33991 at commit [`7d0a912`](https://github.com/apache/spark/commit/7d0a912471047a58b8c40240e74805b69c78b758).


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 #33991: [SPARK-36750][CORE][SQL][MLLIB][YARN] Replace the Guava API with `java.util.Objects` API with the same semantics

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


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


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 #33991: [SPARK-36750][CORE][SQL][MLLIB][YARN] Replace the Guava API with `java.util.Objects` API with the same semantics

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






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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 #33991: [SPARK-36750][CORE][SQL][MLLIB][YARN] Replace the Guava API with `java.util.Objects` API with the same semantics

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


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


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 #33991: [SPARK-36750][CORE][SQL][MLLIB][YARN] Replace the Guava API with `java.util.Objects` API with the same semantics

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


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


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 #33991: [SPARK-36750][CORE][SQL][MLLIB][YARN] Replace the Guava API with `java.util.Objects` API with the same semantics

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


   **[Test build #143248 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143248/testReport)** for PR 33991 at commit [`7d0a912`](https://github.com/apache/spark/commit/7d0a912471047a58b8c40240e74805b69c78b758).
    * This patch **fails Spark unit 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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 #33991: [SPARK-36750][CORE][SQL][MLLIB][YARN] Replace the Guava API with `java.util.Objects` API with the same semantics

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


   **[Test build #143245 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143245/testReport)** for PR 33991 at commit [`551c1ec`](https://github.com/apache/spark/commit/551c1ec9fa2e3e0a7f26df3d144e4bcd1379e115).
    * 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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 #33991: [SPARK-36750][CORE][SQL][MLLIB] Replace the Guava API with `j.u.Objects` API with the same semantics

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


   **[Test build #143245 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143245/testReport)** for PR 33991 at commit [`551c1ec`](https://github.com/apache/spark/commit/551c1ec9fa2e3e0a7f26df3d144e4bcd1379e115).


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 #33991: [SPARK-36750][CORE][SQL][MLLIB][YARN] Replace the Guava API with `java.util.Objects` API with the same semantics

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


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


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 #33991: [SPARK-36750][CORE][SQL][MLLIB][YARN] Replace the Guava API with `java.util.Objects` API with the same semantics

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


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


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 #33991: [SPARK-36750][CORE][SQL][MLLIB][YARN] Replace the Guava API with `java.util.Objects` API with the same semantics

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






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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 #33991: [SPARK-36750][CORE][SQL][MLLIB][YARN] Replace the Guava API with `java.util.Objects` API with the same semantics

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


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


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 #33991: [SPARK-36750][CORE][SQL][MLLIB][YARN] Replace the Guava API with `java.util.Objects` API with the same semantics

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


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


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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] github-actions[bot] commented on pull request #33991: [SPARK-36750][CORE][SQL][MLLIB][YARN] Replace the Guava API with `java.util.Objects` API with the same semantics

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #33991:
URL: https://github.com/apache/spark/pull/33991#issuecomment-1000573460


   We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
   If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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