Skip to content

Commit

Permalink
[flink] avoid using 'newHashMapWithExpectedSize' which is internal in…
Browse files Browse the repository at this point in the history
… flink (#4713)
  • Loading branch information
LsomeYeah authored Dec 16, 2024
1 parent 9179d65 commit 455246b
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
import org.apache.paimon.io.DataOutputViewStreamWrapper;

import org.apache.flink.core.io.SimpleVersionedSerializer;
import org.apache.flink.util.CollectionUtil;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -102,8 +102,7 @@ private void serializeMap(Map<Integer, List<DataFileMeta>> map, DataOutputView v
private Map<Integer, List<DataFileMeta>> deserializeMap(DataInputView view) throws IOException {
final int size = view.readInt();

final Map<Integer, List<DataFileMeta>> map =
CollectionUtil.newHashMapWithExpectedSize(size);
final Map<Integer, List<DataFileMeta>> map = new HashMap<>(size);
for (int i = 0; i < size; i++) {
map.put(view.readInt(), dataFileSerializer.deserializeList(view));
}
Expand Down

0 comments on commit 455246b

Please sign in to comment.