You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@orc.apache.org by GitBox <gi...@apache.org> on 2021/08/11 12:20:54 UTC

[GitHub] [orc] guiyanakuang commented on a change in pull request #739: ORC-838: Implement Improvements to ByteBufferAllocatorPool

guiyanakuang commented on a change in pull request #739:
URL: https://github.com/apache/orc/pull/739#discussion_r686775537



##########
File path: java/core/src/java/org/apache/orc/impl/RecordReaderUtils.java
##########
@@ -504,38 +504,33 @@ static void readDiskRanges(FSDataInputStream file,
     private static final class Key implements Comparable<Key> {
       private final int capacity;
       private final long insertionGeneration;
+      private final int hash;
 
       Key(int capacity, long insertionGeneration) {
         this.capacity = capacity;
         this.insertionGeneration = insertionGeneration;
+        this.hash = new HashCodeBuilder().append(capacity).append(insertionGeneration)

Review comment:
       I found that the equals and hashCode methods of the Key are not used at all, because the TreeMap implementation logic only use of compareTo. It is redundant to put the hashCode calculation statement in the constructor, and in fact there is no need to override them.




-- 
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: dev-unsubscribe@orc.apache.org

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