aokolnychyi commented on code in PR #8336:
URL: https://github.com/apache/iceberg/pull/8336#discussion_r1296266751


##########
core/src/main/java/org/apache/iceberg/BaseFile.java:
##########
@@ -460,7 +463,15 @@ public ByteBuffer keyMetadata() {
 
   @Override
   public List<Long> splitOffsets() {
-    return ArrayUtil.toLongList(splitOffsets);
+    if (splitOffsetsAsList == null && splitOffsets != null) {
+      synchronized (this) {

Review Comment:
   I wonder whether we can drop `synchronized` here. It is unlikely we would 
access this from multiple threads and even if we do, there would be no 
correctness issues (at most, we would convert the array multiple times). Not 
sure whether the extra overhead of acquiring the lock all the time is worth it.



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