coufon commented on a change in pull request #2421:
URL: https://github.com/apache/hive/pull/2421#discussion_r702088341



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java
##########
@@ -5104,14 +5103,34 @@ public boolean drop_partition(final String db_name, 
final String tbl_name,
         null);
   }
 
-  private static class PathAndPartValSize {
-    PathAndPartValSize(Path path, int partValSize) {
-      this.path = path;
-      this.partValSize = partValSize;
+    /** Stores a path and its size. */
+    private static class PathAndPartValSize implements 
Comparable<PathAndPartValSize> {
+
+      public Path path;
+      int partValSize;
+
+      public PathAndPartValSize(Path path, int partValSize) {
+        this.path = path;
+        this.partValSize = partValSize;
+      }
+
+      @Override
+      public boolean equals(Object o) {
+        if (o == this) {
+          return true;
+        }
+        if (!(o instanceof PathAndPartValSize)) {
+          return false;
+        }
+        return path.equals(((PathAndPartValSize) o).path);
+      }
+
+      /** The highest {@code partValSize} is processed first in a {@link 
PriorityQueue}. */
+      @Override
+      public int compareTo(PathAndPartValSize o) {
+        return ((PathAndPartValSize) o).partValSize - partValSize;

Review comment:
       Done.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to