Re: [ANNOUNCE] New Apache Flink Committer - Yanfei Lei

2023-08-19 Thread ConradJam
Congratulations

Hang Ruan  于2023年8月15日周二 11:10写道:

> Congratulations!
>
> Best,
> Hang
>
> Roman Khachatryan  于2023年8月14日周一 22:38写道:
>
> > Congratulations, Yanfey!
> >
> > Regards,
> > Roman
> >
> >
> > On Wed, Aug 9, 2023 at 12:49 PM Benchao Li  wrote:
> >
> > > Congrats, YanFei!
> > >
> > > Jing Ge  于2023年8月8日周二 17:41写道:
> > >
> > > > Congrats, YanFei!
> > > >
> > > > Best regards,
> > > > Jing
> > > >
> > > > On Tue, Aug 8, 2023 at 3:04 PM Yangze Guo 
> wrote:
> > > >
> > > > > Congrats, Yanfei!
> > > > >
> > > > > Best,
> > > > > Yangze Guo
> > > > >
> > > > > On Tue, Aug 8, 2023 at 9:20 AM yuxia 
> > > > wrote:
> > > > > >
> > > > > > Congratulations, Yanfei!
> > > > > >
> > > > > > Best regards,
> > > > > > Yuxia
> > > > > >
> > > > > > - 原始邮件 -
> > > > > > 发件人: "ron9 liu" 
> > > > > > 收件人: "dev" 
> > > > > > 发送时间: 星期一, 2023年 8 月 07日 下午 11:44:23
> > > > > > 主题: Re: [ANNOUNCE] New Apache Flink Committer - Yanfei Lei
> > > > > >
> > > > > > Congratulations Yanfei!
> > > > > >
> > > > > > Best,
> > > > > > Ron
> > > > > >
> > > > > > Zakelly Lan  于2023年8月7日周一 23:15写道:
> > > > > >
> > > > > > > Congratulations, Yanfei!
> > > > > > >
> > > > > > > Best regards,
> > > > > > > Zakelly
> > > > > > >
> > > > > > > On Mon, Aug 7, 2023 at 9:04 PM Lincoln Lee <
> > lincoln.8...@gmail.com
> > > >
> > > > > wrote:
> > > > > > > >
> > > > > > > > Congratulations, Yanfei!
> > > > > > > >
> > > > > > > > Best,
> > > > > > > > Lincoln Lee
> > > > > > > >
> > > > > > > >
> > > > > > > > Weihua Hu  于2023年8月7日周一 20:43写道:
> > > > > > > >
> > > > > > > > > Congratulations Yanfei!
> > > > > > > > >
> > > > > > > > > Best,
> > > > > > > > > Weihua
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > On Mon, Aug 7, 2023 at 8:08 PM Feifan Wang <
> > zoltar9...@163.com
> > > >
> > > > > wrote:
> > > > > > > > >
> > > > > > > > > > Congratulations Yanfei! :)
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > ——
> > > > > > > > > > Name: Feifan Wang
> > > > > > > > > > Email: zoltar9...@163.com
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >  Replied Message 
> > > > > > > > > > | From | Matt Wang |
> > > > > > > > > > | Date | 08/7/2023 19:40 |
> > > > > > > > > > | To | dev@flink.apache.org |
> > > > > > > > > > | Subject | Re: [ANNOUNCE] New Apache Flink Committer -
> > > Yanfei
> > > > > Lei |
> > > > > > > > > > Congratulations Yanfei!
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > >
> > > > > > > > > > Best,
> > > > > > > > > > Matt Wang
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >  Replied Message 
> > > > > > > > > > | From | Mang Zhang |
> > > > > > > > > > | Date | 08/7/2023 18:56 |
> > > > > > > > > > | To |  |
> > > > > > > > > > | Subject | Re:Re: [ANNOUNCE] New Apache Flink Committer
> -
> > > > Yanfei
> > > > > > > Lei |
> > > > > > > > > > Congratulations--
> > > > > > > > > >
> > > > > > > > > > Best regards,
> > > > > > > > > > Mang Zhang
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > 在 2023-08-07 18:17:58,"Yuxin Tan" <
> tanyuxinw...@gmail.com>
> > > 写道:
> > > > > > > > > > Congrats, Yanfei!
> > > > > > > > > >
> > > > > > > > > > Best,
> > > > > > > > > > Yuxin
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > weijie guo  于2023年8月7日周一
> > 17:59写道:
> > > > > > > > > >
> > > > > > > > > > Congrats, Yanfei!
> > > > > > > > > >
> > > > > > > > > > Best regards,
> > > > > > > > > >
> > > > > > > > > > Weijie
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > Biao Geng  于2023年8月7日周一 17:03写道:
> > > > > > > > > >
> > > > > > > > > > Congrats, Yanfei!
> > > > > > > > > > Best,
> > > > > > > > > > Biao Geng
> > > > > > > > > >
> > > > > > > > > > 发送自 Outlook for iOS
> > > > > > > > > > 
> > > > > > > > > > 发件人: Qingsheng Ren 
> > > > > > > > > > 发送时间: Monday, August 7, 2023 4:23:52 PM
> > > > > > > > > > 收件人: dev@flink.apache.org 
> > > > > > > > > > 主题: Re: [ANNOUNCE] New Apache Flink Committer - Yanfei
> Lei
> > > > > > > > > >
> > > > > > > > > > Congratulations and welcome, Yanfei!
> > > > > > > > > >
> > > > > > > > > > Best,
> > > > > > > > > > Qingsheng
> > > > > > > > > >
> > > > > > > > > > On Mon, Aug 7, 2023 at 4:19 PM Matthias Pohl <
> > > > > matthias.p...@aiven.io
> > > > > > > > > > .invalid>
> > > > > > > > > > wrote:
> > > > > > > > > >
> > > > > > > > > > Congratulations, Yanfei! :)
> > > > > > > > > >
> > > > > > > > > > On Mon, Aug 7, 2023 at 10:00 AM Junrui Lee <
> > > > jrlee@gmail.com>
> > > > > > > > > > wrote:
> > > > > > > > > >
> > > > > > > > > > Congratulations Yanfei!
> > > > > > > > > >
> > > > > > > > > > Best,
> > > > > > > > > > Junrui
> > > > > > > > > >
> > > > > > > > > > Yun Tang  于2023年8月7日周一 15:19写道:
> > > > > > > > > >
> > > > > > > > > > Congratulations, Yanfei!
> > > > > > > > > >
> > > > > > > > > > Bes

Re: [ANNOUNCE] New Apache Flink Committer - Hangxiang Yu

2023-08-19 Thread ConradJam
Congratulations!

Hang Ruan  于2023年8月15日周二 11:10写道:

> Congratulations!
>
> Best,
> Hang
>
> Roman Khachatryan  于2023年8月14日周一 22:36写道:
>
> > Congratulations, Hangxiang!
> >
> > Regards,
> > Roman
> >
> >
> > On Wed, Aug 9, 2023 at 12:49 PM Benchao Li  wrote:
> >
> > > Congrats, Hangxiang!
> > >
> > > Jing Ge  于2023年8月8日周二 17:44写道:
> > >
> > > > Congrats, Hangxiang!
> > > >
> > > > Best regards,
> > > > Jing
> > > >
> > > > On Tue, Aug 8, 2023 at 3:04 PM Yangze Guo 
> wrote:
> > > >
> > > > > Congrats, Hangxiang!
> > > > >
> > > > > Best,
> > > > > Yangze Guo
> > > > >
> > > > > On Tue, Aug 8, 2023 at 11:28 AM yh z 
> > wrote:
> > > > > >
> > > > > > Congratulations, Hangxiang !
> > > > > >
> > > > > >
> > > > > > Best,
> > > > > > Yunhong Zheng (Swuferhong)
> > > > > >
> > > > > > yuxia  于2023年8月8日周二 09:20写道:
> > > > > >
> > > > > > > Congratulations, Hangxiang !
> > > > > > >
> > > > > > > Best regards,
> > > > > > > Yuxia
> > > > > > >
> > > > > > > - 原始邮件 -
> > > > > > > 发件人: "Wencong Liu" 
> > > > > > > 收件人: "dev" 
> > > > > > > 发送时间: 星期一, 2023年 8 月 07日 下午 11:55:24
> > > > > > > 主题: Re:[ANNOUNCE] New Apache Flink Committer - Hangxiang Yu
> > > > > > >
> > > > > > > Congratulations, Hangxiang !
> > > > > > >
> > > > > > >
> > > > > > > Best,
> > > > > > > Wencong
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > At 2023-08-07 14:57:49, "Yuan Mei" 
> > wrote:
> > > > > > > >On behalf of the PMC, I'm happy to announce Hangxiang Yu as a
> > new
> > > > > Flink
> > > > > > > >Committer.
> > > > > > > >
> > > > > > > >Hangxiang has been active in the Flink community for more than
> > 1.5
> > > > > years
> > > > > > > >and has played an important role in developing and maintaining
> > > State
> > > > > and
> > > > > > > >Checkpoint related features/components, including Generic
> > > > Incremental
> > > > > > > >Checkpoints (take great efforts to make the feature
> prod-ready).
> > > > > Hangxiang
> > > > > > > >is also the main driver of the FLIP-263: Resolving schema
> > > > > compatibility.
> > > > > > > >
> > > > > > > >Hangxiang is passionate about the Flink community. Besides the
> > > > > technical
> > > > > > > >contribution above, he is also actively promoting Flink: talks
> > > about
> > > > > > > Generic
> > > > > > > >Incremental Checkpoints in Flink Forward and Meet-up.
> Hangxiang
> > > also
> > > > > spent
> > > > > > > >a good amount of time supporting users, participating in
> > > > Jira/mailing
> > > > > list
> > > > > > > >discussions, and reviewing code.
> > > > > > > >
> > > > > > > >Please join me in congratulating Hangxiang for becoming a
> Flink
> > > > > Committer!
> > > > > > > >
> > > > > > > >Thanks,
> > > > > > > >Yuan Mei (on behalf of the Flink PMC)
> > > > > > >
> > > > >
> > > >
> > >
> > >
> > > --
> > >
> > > Best,
> > > Benchao Li
> > >
> >
>


-- 
Best

ConradJam


[jira] [Created] (FLINK-32896) Incorrect `Map.computeIfAbsent(..., ...::new)` usage which misinterprets key as initial capacity

2023-08-19 Thread Marcono1234 (Jira)
Marcono1234 created FLINK-32896:
---

 Summary: Incorrect `Map.computeIfAbsent(..., ...::new)` usage 
which misinterprets key as initial capacity
 Key: FLINK-32896
 URL: https://issues.apache.org/jira/browse/FLINK-32896
 Project: Flink
  Issue Type: Bug
Affects Versions: 1.17.1
Reporter: Marcono1234


The are multiple cases in the code which look like this:
{code}
map.computeIfAbsent(..., ArrayList::new)
{code}

Not only does this create a new collection (here an {{ArrayList}}), but 
{{computeIfAbsent}} also passes the map key as argument to the mapping 
function, so instead of calling the no-args constructor such as {{new 
ArrayList<>()}}, this actually calls the constructor with {{int}} initial 
capacity parameter, such as {{new ArrayList<>(initialCapacity)}}.

For some cases where this occurs in the Flink code I am not sure if it is 
intended, but in same cases this does not seem to be intended. Here are the 
cases I found:

- 
[{{HsFileDataIndexImpl:163}}|https://github.com/apache/flink/blob/9546f8243a24e7b45582b6de6702f819f1d73f97/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/hybrid/HsFileDataIndexImpl.java#L163C70-L163C84]
- 
[{{HsSpillingStrategy:128}}|https://github.com/apache/flink/blob/9546f8243a24e7b45582b6de6702f819f1d73f97/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/hybrid/HsSpillingStrategy.java#L128C68-L128C82]
- 
[{{HsSpillingStrategy:134}}|https://github.com/apache/flink/blob/9546f8243a24e7b45582b6de6702f819f1d73f97/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/hybrid/HsSpillingStrategy.java#L134C63-L134C77]
- 
[{{HsSpillingStrategy:140}}|https://github.com/apache/flink/blob/9546f8243a24e7b45582b6de6702f819f1d73f97/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/hybrid/HsSpillingStrategy.java#L140C63-L140C77]
- 
[{{HsSpillingStrategy:145}}|https://github.com/apache/flink/blob/9546f8243a24e7b45582b6de6702f819f1d73f97/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/hybrid/HsSpillingStrategy.java#L145C70-L145C84]
- 
[{{HsSpillingStrategy:151}}|https://github.com/apache/flink/blob/9546f8243a24e7b45582b6de6702f819f1d73f97/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/hybrid/HsSpillingStrategy.java#L151C65-L151C79]
- 
[{{HsSpillingStrategy:157}}|https://github.com/apache/flink/blob/9546f8243a24e7b45582b6de6702f819f1d73f97/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/hybrid/HsSpillingStrategy.java#L157C65-L157C79]
- 
[{{HsSpillingStrategyUtils:76}}|https://github.com/apache/flink/blob/9546f8243a24e7b45582b6de6702f819f1d73f97/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/hybrid/HsSpillingStrategyUtils.java#L76C74-L76C88]
- 
[{{ProducerMergedPartitionFileIndex:171}}|https://github.com/apache/flink/blob/9546f8243a24e7b45582b6de6702f819f1d73f97/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/hybrid/tiered/file/ProducerMergedPartitionFileIndex.java#L171C75-L171C89]
- 
[{{TestingSpillingInfoProvider:201}}|https://github.com/apache/flink/blob/9546f8243a24e7b45582b6de6702f819f1d73f97/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/hybrid/TestingSpillingInfoProvider.java#L201C56-L201C70]
- 
[{{TestingSpillingInfoProvider:208}}|https://github.com/apache/flink/blob/9546f8243a24e7b45582b6de6702f819f1d73f97/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/hybrid/TestingSpillingInfoProvider.java#L208C54-L208C66]
- 
[{{TestingSpillingInfoProvider:216}}|https://github.com/apache/flink/blob/9546f8243a24e7b45582b6de6702f819f1d73f97/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/hybrid/TestingSpillingInfoProvider.java#L216C54-L216C66]
- 
[{{SourceCoordinatorConcurrentAttemptsTest:269}}|https://github.com/apache/flink/blob/9546f8243a24e7b45582b6de6702f819f1d73f97/flink-runtime/src/test/java/org/apache/flink/runtime/source/coordinator/SourceCoordinatorConcurrentAttemptsTest.java#L269C53-L269C65]

This can lead either to runtime exceptions in case the map key is negative, 
since the collection constructors reject negative initial capacity values, or 
it can lead to bad performance if the key (which is misinterpreted as initial 
capacity) is pretty low, such as 0, or is pretty large and therefore 
pre-allocates a lot of memory for the collection.


Regardless of whether or not these cases are intended it might be good to 
replace them with lambda expressions to make this more explicit:
{code}
map.computeIfAbsent(..., capacity -> new ArrayList<>(capacity))
{code}
or
{code}
map.computeIfAbsent(..., k -> new ArrayList<>())
{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)