hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From junping...@apache.org
Subject hadoop git commit: HADOOP-14683. FileStatus.compareTo binary compatible issue. Contributed by Akira Ajisaka.
Date Wed, 02 Aug 2017 00:22:01 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.8 f2f09e2bb -> 168d8e0c0


HADOOP-14683. FileStatus.compareTo binary compatible issue. Contributed by Akira Ajisaka.

(cherry picked from commit cf6794ebe93906c406a54acc5c8854dc600a9a7f)
(cherry picked from commit 60c10ea7b47f185997b215aea7a3f375ed713ac5)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/168d8e0c
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/168d8e0c
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/168d8e0c

Branch: refs/heads/branch-2.8
Commit: 168d8e0c04c0ba79aa31d04d498476334d6d61f6
Parents: f2f09e2
Author: Junping Du <junping_du@apache.org>
Authored: Tue Aug 1 17:13:02 2017 -0700
Committer: Junping Du <junping_du@apache.org>
Committed: Tue Aug 1 17:19:18 2017 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/fs/FileStatus.java   | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/168d8e0c/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileStatus.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileStatus.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileStatus.java
index 3481010..a60fd53 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileStatus.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileStatus.java
@@ -31,7 +31,7 @@ import org.apache.hadoop.io.Writable;
  */
 @InterfaceAudience.Public
 @InterfaceStability.Stable
-public class FileStatus implements Writable, Comparable<FileStatus> {
+public class FileStatus implements Writable, Comparable<Object> {
 
   private Path path;
   private long length;
@@ -328,11 +328,25 @@ public class FileStatus implements Writable, Comparable<FileStatus>
{
    * @return  a negative integer, zero, or a positive integer as this object
    *   is less than, equal to, or greater than the specified object.
    */
-  @Override
   public int compareTo(FileStatus o) {
     return this.getPath().compareTo(o.getPath());
   }
-  
+
+  /**
+   * Compare this FileStatus to another FileStatus.
+   * This method was added back by HADOOP-14683 to keep binary compatibility.
+   *
+   * @param   o the FileStatus to be compared.
+   * @return  a negative integer, zero, or a positive integer as this object
+   *   is less than, equal to, or greater than the specified object.
+   * @throws ClassCastException if the specified object is not FileStatus
+   */
+  @Override
+  public int compareTo(Object o) {
+    FileStatus other = (FileStatus) o;
+    return compareTo(other);
+  }
+
   /** Compare if this object is equal to another object
    * @param   o the object to be compared.
    * @return  true if two file status has the same path name; false if not.


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message