You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/12/11 05:56:09 UTC

[GitHub] [iceberg] hililiwei commented on a change in pull request #3689: Checkstyle:Add checkstyle rule to prevent using raw HashMap, HashSet, ArrayList

hililiwei commented on a change in pull request #3689:
URL: https://github.com/apache/iceberg/pull/3689#discussion_r767094121



##########
File path: core/src/main/java/org/apache/iceberg/BaseFileScanTask.java
##########
@@ -117,7 +117,7 @@ public String toString() {
       this.offsets = ImmutableList.copyOf(offsetList);
       this.parentScanTask = parentScanTask;
       this.targetSplitSize = targetSplitSize;
-      this.splitSizes = new ArrayList<>(offsets.size());
+      this.splitSizes = Lists.newArrayListWithCapacity(offsets.size());

Review comment:
       Thank you for your comments. I think what you said is reasonable. When I am modifying the relevant code, I also hesitate to use which method to replace. Later, I saw a description on this method:
   
   > Note: This method will soon be deprecated. Even in the rare case that you do want some amount of padding, it's best if you choose your desired amount explicitly.
   
   This prompted me to use withcapacity,  If use withexpectedsize a lot, will it cause unnecessary waste of resources?
   thx.
   
   ![image](https://user-images.githubusercontent.com/59213263/145665870-57173659-2cc4-46d2-9566-2a51031f8587.png)
   




-- 
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: issues-unsubscribe@iceberg.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org