libenchao commented on a change in pull request #13519:
URL: https://github.com/apache/flink/pull/13519#discussion_r503005784



##########
File path: 
flink-table/flink-table-runtime-blink/src/test/java/org/apache/flink/table/runtime/operators/over/RowTimeOverWindowTestBase.java
##########
@@ -0,0 +1,59 @@
+/*
+ * 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.table.runtime.operators.over;
+
+import org.apache.flink.api.common.typeinfo.TypeInformation;
+import org.apache.flink.streaming.api.operators.KeyedProcessOperator;
+import org.apache.flink.streaming.util.KeyedOneInputStreamOperatorTestHarness;
+import org.apache.flink.streaming.util.OneInputStreamOperatorTestHarness;
+import org.apache.flink.table.data.RowData;
+import org.apache.flink.table.runtime.generated.AggsHandleFunction;
+import org.apache.flink.table.runtime.generated.GeneratedAggsHandleFunction;
+import org.apache.flink.table.runtime.util.BinaryRowDataKeySelector;
+import org.apache.flink.table.types.logical.BigIntType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.VarCharType;
+
+/**
+ * Base class for row-time over window test.
+ **/
+public class RowTimeOverWindowTestBase {
+       protected static GeneratedAggsHandleFunction aggsHandleFunction =
+               new GeneratedAggsHandleFunction("Function", "", new Object[0]) {
+                       @Override
+                       public AggsHandleFunction newInstance(ClassLoader 
classLoader) {
+                               return new SumAggsHandleFunction(1);
+                       }
+               };
+
+       protected LogicalType[] inputFieldTypes = new LogicalType[]{
+               new VarCharType(VarCharType.MAX_LENGTH),
+               new BigIntType(),
+               new BigIntType()
+       };
+       protected LogicalType[] accTypes = new LogicalType[]{new BigIntType()};
+
+       protected BinaryRowDataKeySelector keySelector = new 
BinaryRowDataKeySelector(new int[]{0}, inputFieldTypes);
+       protected TypeInformation<RowData> keyType = 
keySelector.getProducedType();
+
+       protected OneInputStreamOperatorTestHarness<RowData, RowData> 
createTestHarness(
+               KeyedProcessOperator<RowData, RowData, RowData> operator) 
throws Exception {

Review comment:
       ```suggestion
                        KeyedProcessOperator<RowData, RowData, RowData> 
operator) throws Exception {
   ```

##########
File path: 
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/operators/over/AbstractRowTimeUnboundedPrecedingOver.java
##########
@@ -68,6 +70,17 @@
 
        protected transient AggsHandleFunction function;
 
+       // 
------------------------------------------------------------------------
+       // Metrics
+       // 
------------------------------------------------------------------------
+       protected static final String LATE_ELEMENTS_DROPPED_METRIC_NAME = 
"numLateRecordsDropped";

Review comment:
       could be `private`?

##########
File path: 
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/operators/over/AbstractRowTimeUnboundedPrecedingOver.java
##########
@@ -68,6 +70,17 @@
 
        protected transient AggsHandleFunction function;
 
+       // 
------------------------------------------------------------------------
+       // Metrics
+       // 
------------------------------------------------------------------------
+       protected static final String LATE_ELEMENTS_DROPPED_METRIC_NAME = 
"numLateRecordsDropped";
+       private transient Counter numLateRecordsDropped;
+
+       @VisibleForTesting
+       public Counter getCounter() {

Review comment:
       could be `protected`?




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

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


Reply via email to