iemejia commented on code in PR #3500:
URL: https://github.com/apache/parquet-java/pull/3500#discussion_r3107296087


##########
parquet-column/src/main/java/org/apache/parquet/io/api/Binary.java:
##########
@@ -101,6 +113,18 @@ public boolean equals(Object obj) {
     return false;
   }
 
+  /**
+   * Caches {@code hashCode} for non-reused instances and returns it. The 
cache uses
+   * a single int field with sentinel {@code 0} to remain race-safe without 
volatile.
+   * If the computed hash is {@code 0}, no caching occurs and the next call 
recomputes.
+   */
+  final int cacheHashCode(int hashCode) {

Review Comment:
   I had to revert this because the classes the inheriting classes were not 
able to use the method. I think this is the best compromise final and package 
private, so 



##########
parquet-column/src/main/java/org/apache/parquet/io/api/Binary.java:
##########
@@ -101,6 +113,18 @@ public boolean equals(Object obj) {
     return false;
   }
 
+  /**
+   * Caches {@code hashCode} for non-reused instances and returns it. The 
cache uses
+   * a single int field with sentinel {@code 0} to remain race-safe without 
volatile.
+   * If the computed hash is {@code 0}, no caching occurs and the next call 
recomputes.
+   */
+  final int cacheHashCode(int hashCode) {

Review Comment:
   I had to revert this because the classes the inheriting classes were not 
able to use the method. I think this is the best compromise final and package 
private



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