Zakelly commented on code in PR #24810: URL: https://github.com/apache/flink/pull/24810#discussion_r1606741087
########## flink-runtime/src/test/java/org/apache/flink/runtime/state/v2/SumAggregator.java: ########## @@ -0,0 +1,47 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.runtime.state.v2; + +import org.apache.flink.api.common.functions.AggregateFunction; + +import java.io.Serializable; + +/** Test implementation of Aggregate function */ +public class SumAggregator implements AggregateFunction<Integer, Integer, Integer>, Serializable { Review Comment: Option 1: This could be a static package-private class within `AggregatingStateDescriptorTest` reused in both tests. This is common when some test reference the inner static class/variable from another test. Option 2: Two test inner classes. This makes sense if it is private. Also, anonymous class is better than inner class. The reason why I'd suggest make it inner/anonymous is that, typically functional interfaces like this vary in different scenarios, so there's nothing to share. I'd prefer option 2 with anonymous class, since making these tests self contained looks better to me. -- 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]
