zeppelin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zjf...@apache.org
Subject [zeppelin] branch branch-0.8 updated: [ZEPPELIN-4041] SparkVersion.java refactoring
Date Mon, 11 Mar 2019 01:37:38 GMT
This is an automated email from the ASF dual-hosted git repository.

zjffdu pushed a commit to branch branch-0.8
in repository https://gitbox.apache.org/repos/asf/zeppelin.git


The following commit(s) were added to refs/heads/branch-0.8 by this push:
     new 74f748f  [ZEPPELIN-4041] SparkVersion.java refactoring
74f748f is described below

commit 74f748f9a208721c91fd500675d4d2eea802b312
Author: freenice12 <freenice12@gmail.com>
AuthorDate: Fri Mar 8 09:43:49 2019 +0900

    [ZEPPELIN-4041] SparkVersion.java refactoring
    
    ### What is this PR for?
    SparkVersion.java refactoring. Method: newerThanEqualsPatchVersion
    Method could use semantic majorVersion, minorVersion and patchVersion.
    I think It could be more readable.
    
    ### What type of PR is it?
    [Refactoring]
    
    ### What is the Jira issue?
    https://issues.apache.org/jira/browse/ZEPPELIN-4041
    
    ### How should this be tested?
    Unit test pass
    
    ### Questions:
    * Does the licenses files need update? no
    * Is there breaking changes for older versions? no
    * Does this needs documentation? no
    
    Author: freenice12 <freenice12@gmail.com>
    
    Closes #3323 from freenice12/ZEPPELIN-4041 and squashes the following commits:
    
    8dbf0ba4e [freenice12] Merge branch 'ZEPPELIN-4041' of https://github.com/freenice12/zeppelin
into ZEPPELIN-4041
    845cd23a6 [freenice12] SparkVersion.java refactoring.
    35a2eca08 [freenice12] SparkVersion.java refactoring
    
    (cherry picked from commit 9a5518e67038a8bc22145c9130f66474e614d1c8)
    Signed-off-by: Jeff Zhang <zjffdu@apache.org>
---
 .../src/main/java/org/apache/zeppelin/spark/SparkVersion.java        | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/spark/interpreter/src/main/java/org/apache/zeppelin/spark/SparkVersion.java b/spark/interpreter/src/main/java/org/apache/zeppelin/spark/SparkVersion.java
index f28ddf5..d0f3f79 100644
--- a/spark/interpreter/src/main/java/org/apache/zeppelin/spark/SparkVersion.java
+++ b/spark/interpreter/src/main/java/org/apache/zeppelin/spark/SparkVersion.java
@@ -134,8 +134,9 @@ public class SparkVersion {
   }
 
   public boolean newerThanEqualsPatchVersion(SparkVersion versionToCompare) {
-    return version / 100 == versionToCompare.version / 100 &&
-            version % 100 >= versionToCompare.version % 100;
+    return majorVersion == versionToCompare.majorVersion &&
+            minorVersion == versionToCompare.minorVersion &&
+            patchVersion >= versionToCompare.patchVersion;
   }
 
   public boolean olderThan(SparkVersion versionToCompare) {


Mime
View raw message