Re: [PR] Introduce operator for minibatch join [flink]

2024-01-24 Thread via GitHub


xishuaidelin commented on code in PR #24160:
URL: https://github.com/apache/flink/pull/24160#discussion_r1465868291


##
flink-table/flink-table-runtime/src/test/java/org/apache/flink/table/runtime/operators/join/stream/StreamingMiniBatchJoinOperatorTest.java:
##
@@ -0,0 +1,1667 @@
+/*
+ * 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.join.stream;
+
+import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
+import org.apache.flink.table.data.RowData;
+import org.apache.flink.table.runtime.keyselector.RowDataKeySelector;
+import 
org.apache.flink.table.runtime.operators.bundle.trigger.CountCoBundleTrigger;
+import org.apache.flink.table.runtime.operators.join.FlinkJoinType;
+import 
org.apache.flink.table.runtime.operators.join.stream.state.JoinInputSideSpec;
+import org.apache.flink.table.runtime.typeutils.InternalTypeInfo;
+import org.apache.flink.table.types.logical.CharType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.RowType;
+import org.apache.flink.table.utils.HandwrittenSelectorUtil;
+import org.apache.flink.types.RowKind;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInfo;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+import java.util.function.Function;
+import java.util.stream.Stream;
+
+import static 
org.apache.flink.table.runtime.util.StreamRecordUtils.deleteRecord;
+import static 
org.apache.flink.table.runtime.util.StreamRecordUtils.insertRecord;
+import static org.apache.flink.table.runtime.util.StreamRecordUtils.rowOfKind;
+import static 
org.apache.flink.table.runtime.util.StreamRecordUtils.updateAfterRecord;
+import static 
org.apache.flink.table.runtime.util.StreamRecordUtils.updateBeforeRecord;
+
+/** Test for StreamingMiniBatchJoinOperatorTest. */
+public final class StreamingMiniBatchJoinOperatorTest extends 
StreamingJoinOperatorTestBase {
+
+private RowDataKeySelector leftUniqueKeySelector;
+private RowDataKeySelector rightUniqueKeySelector;
+
+@BeforeEach
+public void beforeEach(TestInfo testInfo) throws Exception {
+rightTypeInfo =
+InternalTypeInfo.of(
+RowType.of(
+new LogicalType[]{
+new CharType(false, 20),
+new CharType(false, 20),
+new CharType(true, 10)
+},
+new String[]{
+"order_id#", "line_order_id0", 
"line_order_ship_mode"
+}));
+
+rightKeySelector =
+HandwrittenSelectorUtil.getRowDataSelector(
+new int[]{1},
+rightTypeInfo.toRowType().getChildren().toArray(new 
LogicalType[0]));
+super.beforeEach(testInfo);
+}
+
+@Tag("miniBatchSize=3")
+@Test
+public void testLeftJoinWithLeftArriveFirst() throws Exception {
+// joinKey is LineOrd
+// left fold  || right fold
+testHarness.processElement1(
+insertRecord(
+"Ord#1", "LineOrd#2", "3 Bellevue Drive, Pottstown, PA 
19464")); // left +I
+testHarness.processElement1(
+insertRecord(
+"Ord#i",
+"LineOrd#6",
+"i6 Bellevue Drive, Pottstown, Pi 19464")); // left  +I
+assertor.shouldEmitNothing(testHarness);
+testHarness.processElement2(insertRecord("Ord#X", "LineOrd#2", 
"AIR")); // right
+
+assertor.shouldEmit(
+testHarness,
+rowOfKind(
+RowKind.INSERT,
+"Ord#i",
+"LineOrd#6",
+"i6 Bellevue Drive, Pottstown, Pi 19464",
+null,
+null,
+ 

Re: [PR] Introduce operator for minibatch join [flink]

2024-01-24 Thread via GitHub


xishuaidelin commented on code in PR #24160:
URL: https://github.com/apache/flink/pull/24160#discussion_r1465811533


##
flink-table/flink-table-runtime/src/test/java/org/apache/flink/table/runtime/operators/join/stream/StreamingMiniBatchJoinOperatorTest.java:
##
@@ -0,0 +1,1807 @@
+/*
+ * 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.join.stream;
+
+import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
+import org.apache.flink.table.data.RowData;
+import org.apache.flink.table.runtime.keyselector.RowDataKeySelector;
+import 
org.apache.flink.table.runtime.operators.bundle.trigger.CountCoBundleTrigger;
+import org.apache.flink.table.runtime.operators.join.FlinkJoinType;
+import 
org.apache.flink.table.runtime.operators.join.stream.state.JoinInputSideSpec;
+import org.apache.flink.table.runtime.typeutils.InternalTypeInfo;
+import org.apache.flink.table.types.logical.CharType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.RowType;
+import org.apache.flink.table.utils.HandwrittenSelectorUtil;
+import org.apache.flink.types.RowKind;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInfo;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+import java.util.function.Function;
+import java.util.stream.Stream;
+
+import static 
org.apache.flink.table.runtime.util.StreamRecordUtils.deleteRecord;
+import static 
org.apache.flink.table.runtime.util.StreamRecordUtils.insertRecord;
+import static org.apache.flink.table.runtime.util.StreamRecordUtils.rowOfKind;
+import static 
org.apache.flink.table.runtime.util.StreamRecordUtils.updateAfterRecord;
+import static 
org.apache.flink.table.runtime.util.StreamRecordUtils.updateBeforeRecord;
+
+/** Test for StreamingMiniBatchJoinOperatorTest. */
+public final class StreamingMiniBatchJoinOperatorTest extends 
StreamingJoinOperatorTestBase {
+
+private RowDataKeySelector leftUniqueKeySelector;
+private RowDataKeySelector rightUniqueKeySelector;
+
+@BeforeEach
+public void beforeEach(TestInfo testInfo) throws Exception {
+rightTypeInfo =
+InternalTypeInfo.of(
+RowType.of(
+new LogicalType[] {
+new CharType(false, 20),
+new CharType(false, 20),
+new CharType(true, 10)
+},
+new String[] {
+"order_id#", "line_order_id0", 
"line_order_ship_mode"
+}));
+
+rightKeySelector =
+HandwrittenSelectorUtil.getRowDataSelector(
+new int[] {1},
+rightTypeInfo.toRowType().getChildren().toArray(new 
LogicalType[0]));
+super.beforeEach(testInfo);
+}
+
+@Tag("miniBatchSize=3")
+@Test
+public void testLeftJoinWithLeftArriveFirst() throws Exception {
+// joinKey is LineOrd
+// left fold  || right fold
+testHarness.processElement1(
+insertRecord(
+"Ord#1", "LineOrd#2", "3 Bellevue Drive, Pottstown, PA 
19464")); // left +I
+testHarness.processElement1(
+insertRecord(
+"Ord#i",
+"LineOrd#6",
+"i6 Bellevue Drive, Pottstown, Pi 19464")); // left  +I
+assertor.shouldEmitNothing(testHarness);
+testHarness.processElement2(insertRecord("Ord#X", "LineOrd#2", 
"AIR")); // right
+
+assertor.shouldEmit(
+testHarness,
+rowOfKind(
+RowKind.INSERT,
+"Ord#i",
+"LineOrd#6",
+"i6 Bellevue Drive, Pottstown, Pi 19464",
+null,
+null,
+null),
+rowOfKind(
+ 

Re: [PR] Introduce operator for minibatch join [flink]

2024-01-24 Thread via GitHub


xishuaidelin commented on code in PR #24160:
URL: https://github.com/apache/flink/pull/24160#discussion_r1465810094


##
flink-table/flink-table-runtime/src/test/java/org/apache/flink/table/runtime/operators/join/stream/StreamingMiniBatchJoinOperatorTest.java:
##
@@ -0,0 +1,1667 @@
+/*
+ * 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.join.stream;
+
+import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
+import org.apache.flink.table.data.RowData;
+import org.apache.flink.table.runtime.keyselector.RowDataKeySelector;
+import 
org.apache.flink.table.runtime.operators.bundle.trigger.CountCoBundleTrigger;
+import org.apache.flink.table.runtime.operators.join.FlinkJoinType;
+import 
org.apache.flink.table.runtime.operators.join.stream.state.JoinInputSideSpec;
+import org.apache.flink.table.runtime.typeutils.InternalTypeInfo;
+import org.apache.flink.table.types.logical.CharType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.RowType;
+import org.apache.flink.table.utils.HandwrittenSelectorUtil;
+import org.apache.flink.types.RowKind;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInfo;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+import java.util.function.Function;
+import java.util.stream.Stream;
+
+import static 
org.apache.flink.table.runtime.util.StreamRecordUtils.deleteRecord;
+import static 
org.apache.flink.table.runtime.util.StreamRecordUtils.insertRecord;
+import static org.apache.flink.table.runtime.util.StreamRecordUtils.rowOfKind;
+import static 
org.apache.flink.table.runtime.util.StreamRecordUtils.updateAfterRecord;
+import static 
org.apache.flink.table.runtime.util.StreamRecordUtils.updateBeforeRecord;
+
+/** Test for StreamingMiniBatchJoinOperatorTest. */
+public final class StreamingMiniBatchJoinOperatorTest extends 
StreamingJoinOperatorTestBase {
+
+private RowDataKeySelector leftUniqueKeySelector;
+private RowDataKeySelector rightUniqueKeySelector;
+
+@BeforeEach
+public void beforeEach(TestInfo testInfo) throws Exception {
+rightTypeInfo =
+InternalTypeInfo.of(
+RowType.of(
+new LogicalType[]{
+new CharType(false, 20),
+new CharType(false, 20),
+new CharType(true, 10)
+},
+new String[]{
+"order_id#", "line_order_id0", 
"line_order_ship_mode"
+}));
+
+rightKeySelector =
+HandwrittenSelectorUtil.getRowDataSelector(
+new int[]{1},
+rightTypeInfo.toRowType().getChildren().toArray(new 
LogicalType[0]));
+super.beforeEach(testInfo);
+}
+
+@Tag("miniBatchSize=3")
+@Test
+public void testLeftJoinWithLeftArriveFirst() throws Exception {
+// joinKey is LineOrd
+// left fold  || right fold
+testHarness.processElement1(
+insertRecord(
+"Ord#1", "LineOrd#2", "3 Bellevue Drive, Pottstown, PA 
19464")); // left +I
+testHarness.processElement1(
+insertRecord(
+"Ord#i",
+"LineOrd#6",
+"i6 Bellevue Drive, Pottstown, Pi 19464")); // left  +I
+assertor.shouldEmitNothing(testHarness);
+testHarness.processElement2(insertRecord("Ord#X", "LineOrd#2", 
"AIR")); // right
+
+assertor.shouldEmit(
+testHarness,
+rowOfKind(
+RowKind.INSERT,
+"Ord#i",
+"LineOrd#6",
+"i6 Bellevue Drive, Pottstown, Pi 19464",
+null,
+null,
+ 

Re: [PR] Introduce operator for minibatch join [flink]

2024-01-24 Thread via GitHub


xishuaidelin commented on code in PR #24160:
URL: https://github.com/apache/flink/pull/24160#discussion_r1465809902


##
flink-table/flink-table-runtime/src/test/java/org/apache/flink/table/runtime/operators/join/stream/StreamingJoinOperatorTestBase.java:
##
@@ -51,17 +51,17 @@ public abstract class StreamingJoinOperatorTestBase {
 },
 new String[] {"order_id", "line_order_id", 
"shipping_address"}));
 
-protected final InternalTypeInfo rightTypeInfo =
+protected InternalTypeInfo rightTypeInfo =
 InternalTypeInfo.of(
 RowType.of(
 new LogicalType[] {new CharType(false, 20), new 
CharType(true, 10)},
 new String[] {"line_order_id0", 
"line_order_ship_mode"}));
 
-protected final RowDataKeySelector leftKeySelector =
+protected RowDataKeySelector leftKeySelector =

Review Comment:
   Done



-- 
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-unsubscr...@flink.apache.org

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



Re: [PR] Introduce operator for minibatch join [flink]

2024-01-24 Thread via GitHub


xishuaidelin commented on code in PR #24160:
URL: https://github.com/apache/flink/pull/24160#discussion_r1465808645


##
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/join/stream/MiniBatchStreamingJoinOperator.java:
##
@@ -0,0 +1,416 @@
+/*
+ * 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.join.stream;
+
+import org.apache.flink.streaming.api.watermark.Watermark;
+import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
+import org.apache.flink.table.data.RowData;
+import org.apache.flink.table.data.util.RowDataUtil;
+import org.apache.flink.table.runtime.generated.GeneratedJoinCondition;
+import 
org.apache.flink.table.runtime.operators.bundle.trigger.BundleTriggerCallback;
+import org.apache.flink.table.runtime.operators.bundle.trigger.CoBundleTrigger;
+import org.apache.flink.table.runtime.operators.join.FlinkJoinType;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.BufferBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.InputSideHasNoUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.InputSideHasUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.JoinKeyContainsUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.state.JoinInputSideSpec;
+import 
org.apache.flink.table.runtime.operators.join.stream.state.JoinRecordStateView;
+import org.apache.flink.table.runtime.operators.metrics.SimpleGauge;
+import org.apache.flink.table.runtime.typeutils.InternalTypeInfo;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/** Streaming unbounded Join base operator which support mini-batch join. */
+public abstract class MiniBatchStreamingJoinOperator extends 
StreamingJoinOperator
+implements BundleTriggerCallback {
+
+private static final long serialVersionUID = -1106342589994963997L;
+
+private final CoBundleTrigger coBundleTrigger;
+
+private transient BufferBundle leftBuffer;
+private transient BufferBundle rightBuffer;
+private transient SimpleGauge leftBundleReducedSizeGauge;
+private transient SimpleGauge rightBundleReducedSizeGauge;
+
+public MiniBatchStreamingJoinOperator(MiniBatchStreamingJoinParameter 
parameter) {
+super(
+parameter.leftType,
+parameter.rightType,
+parameter.generatedJoinCondition,
+parameter.leftInputSideSpec,
+parameter.rightInputSideSpec,
+parameter.leftIsOuter,
+parameter.rightIsOuter,
+parameter.filterNullKeys,
+parameter.leftStateRetentionTime,
+parameter.rightStateRetentionTime);
+
+this.coBundleTrigger = parameter.coBundleTrigger;
+}
+
+@Override
+public void open() throws Exception {
+super.open();
+
+this.leftBuffer = initialBuffer(leftInputSideSpec);
+this.rightBuffer = initialBuffer(rightInputSideSpec);
+
+coBundleTrigger.registerCallback(this);
+coBundleTrigger.reset();
+LOG.info("Initialize MiniBatchStreamingJoinOperator successfully.");
+
+// register metrics
+leftBundleReducedSizeGauge = new SimpleGauge<>(0);
+rightBundleReducedSizeGauge = new SimpleGauge<>(0);
+
+getRuntimeContext()
+.getMetricGroup()
+.gauge("leftBundleReducedSize", leftBundleReducedSizeGauge);
+getRuntimeContext()
+.getMetricGroup()
+.gauge("rightBundleReducedSize", rightBundleReducedSizeGauge);
+}
+
+@Override
+public void processElement1(StreamRecord element) throws 
Exception {
+RowData joinKey = (RowData) getCurrentKey();
+RowData uniqueKey = null;
+if (leftInputSideSpec.getUniqueKeySelector() != null) {
+uniqueKey = 
leftInputSideSpec.getUniqueKeySelector().getKey(element.getValue());
+}
+leftBuffer.addRecord(joinKey, uniqueKey, element.getValue());
+

Re: [PR] Introduce operator for minibatch join [flink]

2024-01-24 Thread via GitHub


xishuaidelin commented on code in PR #24160:
URL: https://github.com/apache/flink/pull/24160#discussion_r1465808375


##
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/join/stream/MiniBatchStreamingJoinOperator.java:
##
@@ -0,0 +1,416 @@
+/*
+ * 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.join.stream;
+
+import org.apache.flink.streaming.api.watermark.Watermark;
+import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
+import org.apache.flink.table.data.RowData;
+import org.apache.flink.table.data.util.RowDataUtil;
+import org.apache.flink.table.runtime.generated.GeneratedJoinCondition;
+import 
org.apache.flink.table.runtime.operators.bundle.trigger.BundleTriggerCallback;
+import org.apache.flink.table.runtime.operators.bundle.trigger.CoBundleTrigger;
+import org.apache.flink.table.runtime.operators.join.FlinkJoinType;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.BufferBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.InputSideHasNoUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.InputSideHasUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.JoinKeyContainsUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.state.JoinInputSideSpec;
+import 
org.apache.flink.table.runtime.operators.join.stream.state.JoinRecordStateView;
+import org.apache.flink.table.runtime.operators.metrics.SimpleGauge;
+import org.apache.flink.table.runtime.typeutils.InternalTypeInfo;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/** Streaming unbounded Join base operator which support mini-batch join. */
+public abstract class MiniBatchStreamingJoinOperator extends 
StreamingJoinOperator
+implements BundleTriggerCallback {
+
+private static final long serialVersionUID = -1106342589994963997L;
+
+private final CoBundleTrigger coBundleTrigger;
+
+private transient BufferBundle leftBuffer;
+private transient BufferBundle rightBuffer;
+private transient SimpleGauge leftBundleReducedSizeGauge;
+private transient SimpleGauge rightBundleReducedSizeGauge;
+
+public MiniBatchStreamingJoinOperator(MiniBatchStreamingJoinParameter 
parameter) {
+super(
+parameter.leftType,
+parameter.rightType,
+parameter.generatedJoinCondition,
+parameter.leftInputSideSpec,
+parameter.rightInputSideSpec,
+parameter.leftIsOuter,
+parameter.rightIsOuter,
+parameter.filterNullKeys,
+parameter.leftStateRetentionTime,
+parameter.rightStateRetentionTime);
+
+this.coBundleTrigger = parameter.coBundleTrigger;
+}
+
+@Override
+public void open() throws Exception {
+super.open();
+
+this.leftBuffer = initialBuffer(leftInputSideSpec);
+this.rightBuffer = initialBuffer(rightInputSideSpec);
+
+coBundleTrigger.registerCallback(this);
+coBundleTrigger.reset();
+LOG.info("Initialize MiniBatchStreamingJoinOperator successfully.");
+
+// register metrics
+leftBundleReducedSizeGauge = new SimpleGauge<>(0);
+rightBundleReducedSizeGauge = new SimpleGauge<>(0);
+
+getRuntimeContext()
+.getMetricGroup()
+.gauge("leftBundleReducedSize", leftBundleReducedSizeGauge);
+getRuntimeContext()
+.getMetricGroup()
+.gauge("rightBundleReducedSize", rightBundleReducedSizeGauge);
+}
+
+@Override
+public void processElement1(StreamRecord element) throws 
Exception {
+RowData joinKey = (RowData) getCurrentKey();
+RowData uniqueKey = null;
+if (leftInputSideSpec.getUniqueKeySelector() != null) {
+uniqueKey = 
leftInputSideSpec.getUniqueKeySelector().getKey(element.getValue());
+}
+leftBuffer.addRecord(joinKey, uniqueKey, element.getValue());
+

Re: [PR] Introduce operator for minibatch join [flink]

2024-01-24 Thread via GitHub


xishuaidelin commented on code in PR #24160:
URL: https://github.com/apache/flink/pull/24160#discussion_r1465807749


##
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/join/stream/MiniBatchStreamingJoinOperator.java:
##
@@ -0,0 +1,416 @@
+/*
+ * 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.join.stream;
+
+import org.apache.flink.streaming.api.watermark.Watermark;
+import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
+import org.apache.flink.table.data.RowData;
+import org.apache.flink.table.data.util.RowDataUtil;
+import org.apache.flink.table.runtime.generated.GeneratedJoinCondition;
+import 
org.apache.flink.table.runtime.operators.bundle.trigger.BundleTriggerCallback;
+import org.apache.flink.table.runtime.operators.bundle.trigger.CoBundleTrigger;
+import org.apache.flink.table.runtime.operators.join.FlinkJoinType;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.BufferBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.InputSideHasNoUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.InputSideHasUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.JoinKeyContainsUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.state.JoinInputSideSpec;
+import 
org.apache.flink.table.runtime.operators.join.stream.state.JoinRecordStateView;
+import org.apache.flink.table.runtime.operators.metrics.SimpleGauge;
+import org.apache.flink.table.runtime.typeutils.InternalTypeInfo;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/** Streaming unbounded Join base operator which support mini-batch join. */
+public abstract class MiniBatchStreamingJoinOperator extends 
StreamingJoinOperator
+implements BundleTriggerCallback {
+
+private static final long serialVersionUID = -1106342589994963997L;
+
+private final CoBundleTrigger coBundleTrigger;
+
+private transient BufferBundle leftBuffer;
+private transient BufferBundle rightBuffer;
+private transient SimpleGauge leftBundleReducedSizeGauge;
+private transient SimpleGauge rightBundleReducedSizeGauge;
+
+public MiniBatchStreamingJoinOperator(MiniBatchStreamingJoinParameter 
parameter) {
+super(
+parameter.leftType,
+parameter.rightType,
+parameter.generatedJoinCondition,
+parameter.leftInputSideSpec,
+parameter.rightInputSideSpec,
+parameter.leftIsOuter,
+parameter.rightIsOuter,
+parameter.filterNullKeys,
+parameter.leftStateRetentionTime,
+parameter.rightStateRetentionTime);
+
+this.coBundleTrigger = parameter.coBundleTrigger;
+}
+
+@Override
+public void open() throws Exception {
+super.open();
+
+this.leftBuffer = initialBuffer(leftInputSideSpec);
+this.rightBuffer = initialBuffer(rightInputSideSpec);
+
+coBundleTrigger.registerCallback(this);
+coBundleTrigger.reset();
+LOG.info("Initialize MiniBatchStreamingJoinOperator successfully.");
+
+// register metrics
+leftBundleReducedSizeGauge = new SimpleGauge<>(0);
+rightBundleReducedSizeGauge = new SimpleGauge<>(0);
+
+getRuntimeContext()
+.getMetricGroup()
+.gauge("leftBundleReducedSize", leftBundleReducedSizeGauge);
+getRuntimeContext()
+.getMetricGroup()
+.gauge("rightBundleReducedSize", rightBundleReducedSizeGauge);
+}
+
+@Override
+public void processElement1(StreamRecord element) throws 
Exception {
+RowData joinKey = (RowData) getCurrentKey();
+RowData uniqueKey = null;
+if (leftInputSideSpec.getUniqueKeySelector() != null) {
+uniqueKey = 
leftInputSideSpec.getUniqueKeySelector().getKey(element.getValue());
+}
+leftBuffer.addRecord(joinKey, uniqueKey, element.getValue());
+

Re: [PR] Introduce operator for minibatch join [flink]

2024-01-24 Thread via GitHub


xishuaidelin commented on code in PR #24160:
URL: https://github.com/apache/flink/pull/24160#discussion_r1465807400


##
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/join/stream/MiniBatchStreamingJoinOperator.java:
##
@@ -0,0 +1,416 @@
+/*
+ * 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.join.stream;
+
+import org.apache.flink.streaming.api.watermark.Watermark;
+import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
+import org.apache.flink.table.data.RowData;
+import org.apache.flink.table.data.util.RowDataUtil;
+import org.apache.flink.table.runtime.generated.GeneratedJoinCondition;
+import 
org.apache.flink.table.runtime.operators.bundle.trigger.BundleTriggerCallback;
+import org.apache.flink.table.runtime.operators.bundle.trigger.CoBundleTrigger;
+import org.apache.flink.table.runtime.operators.join.FlinkJoinType;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.BufferBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.InputSideHasNoUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.InputSideHasUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.JoinKeyContainsUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.state.JoinInputSideSpec;
+import 
org.apache.flink.table.runtime.operators.join.stream.state.JoinRecordStateView;
+import org.apache.flink.table.runtime.operators.metrics.SimpleGauge;
+import org.apache.flink.table.runtime.typeutils.InternalTypeInfo;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/** Streaming unbounded Join base operator which support mini-batch join. */
+public abstract class MiniBatchStreamingJoinOperator extends 
StreamingJoinOperator
+implements BundleTriggerCallback {
+
+private static final long serialVersionUID = -1106342589994963997L;
+
+private final CoBundleTrigger coBundleTrigger;
+
+private transient BufferBundle leftBuffer;
+private transient BufferBundle rightBuffer;
+private transient SimpleGauge leftBundleReducedSizeGauge;
+private transient SimpleGauge rightBundleReducedSizeGauge;
+
+public MiniBatchStreamingJoinOperator(MiniBatchStreamingJoinParameter 
parameter) {
+super(
+parameter.leftType,
+parameter.rightType,
+parameter.generatedJoinCondition,
+parameter.leftInputSideSpec,
+parameter.rightInputSideSpec,
+parameter.leftIsOuter,
+parameter.rightIsOuter,
+parameter.filterNullKeys,
+parameter.leftStateRetentionTime,
+parameter.rightStateRetentionTime);
+
+this.coBundleTrigger = parameter.coBundleTrigger;
+}
+
+@Override
+public void open() throws Exception {
+super.open();
+
+this.leftBuffer = initialBuffer(leftInputSideSpec);
+this.rightBuffer = initialBuffer(rightInputSideSpec);
+
+coBundleTrigger.registerCallback(this);
+coBundleTrigger.reset();
+LOG.info("Initialize MiniBatchStreamingJoinOperator successfully.");
+
+// register metrics
+leftBundleReducedSizeGauge = new SimpleGauge<>(0);
+rightBundleReducedSizeGauge = new SimpleGauge<>(0);
+
+getRuntimeContext()
+.getMetricGroup()
+.gauge("leftBundleReducedSize", leftBundleReducedSizeGauge);
+getRuntimeContext()
+.getMetricGroup()
+.gauge("rightBundleReducedSize", rightBundleReducedSizeGauge);
+}
+
+@Override
+public void processElement1(StreamRecord element) throws 
Exception {
+RowData joinKey = (RowData) getCurrentKey();
+RowData uniqueKey = null;
+if (leftInputSideSpec.getUniqueKeySelector() != null) {
+uniqueKey = 
leftInputSideSpec.getUniqueKeySelector().getKey(element.getValue());
+}
+leftBuffer.addRecord(joinKey, uniqueKey, element.getValue());
+

Re: [PR] Introduce operator for minibatch join [flink]

2024-01-24 Thread via GitHub


xishuaidelin commented on code in PR #24160:
URL: https://github.com/apache/flink/pull/24160#discussion_r1465806063


##
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/join/stream/MiniBatchStreamingJoinOperator.java:
##
@@ -0,0 +1,416 @@
+/*
+ * 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.join.stream;
+
+import org.apache.flink.streaming.api.watermark.Watermark;
+import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
+import org.apache.flink.table.data.RowData;
+import org.apache.flink.table.data.util.RowDataUtil;
+import org.apache.flink.table.runtime.generated.GeneratedJoinCondition;
+import 
org.apache.flink.table.runtime.operators.bundle.trigger.BundleTriggerCallback;
+import org.apache.flink.table.runtime.operators.bundle.trigger.CoBundleTrigger;
+import org.apache.flink.table.runtime.operators.join.FlinkJoinType;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.BufferBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.InputSideHasNoUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.InputSideHasUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.JoinKeyContainsUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.state.JoinInputSideSpec;
+import 
org.apache.flink.table.runtime.operators.join.stream.state.JoinRecordStateView;
+import org.apache.flink.table.runtime.operators.metrics.SimpleGauge;
+import org.apache.flink.table.runtime.typeutils.InternalTypeInfo;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/** Streaming unbounded Join base operator which support mini-batch join. */
+public abstract class MiniBatchStreamingJoinOperator extends 
StreamingJoinOperator
+implements BundleTriggerCallback {
+
+private static final long serialVersionUID = -1106342589994963997L;
+
+private final CoBundleTrigger coBundleTrigger;
+
+private transient BufferBundle leftBuffer;
+private transient BufferBundle rightBuffer;
+private transient SimpleGauge leftBundleReducedSizeGauge;
+private transient SimpleGauge rightBundleReducedSizeGauge;
+
+public MiniBatchStreamingJoinOperator(MiniBatchStreamingJoinParameter 
parameter) {
+super(
+parameter.leftType,
+parameter.rightType,
+parameter.generatedJoinCondition,
+parameter.leftInputSideSpec,
+parameter.rightInputSideSpec,
+parameter.leftIsOuter,
+parameter.rightIsOuter,
+parameter.filterNullKeys,
+parameter.leftStateRetentionTime,
+parameter.rightStateRetentionTime);
+
+this.coBundleTrigger = parameter.coBundleTrigger;
+}
+
+@Override
+public void open() throws Exception {
+super.open();
+
+this.leftBuffer = initialBuffer(leftInputSideSpec);
+this.rightBuffer = initialBuffer(rightInputSideSpec);
+
+coBundleTrigger.registerCallback(this);
+coBundleTrigger.reset();
+LOG.info("Initialize MiniBatchStreamingJoinOperator successfully.");
+
+// register metrics
+leftBundleReducedSizeGauge = new SimpleGauge<>(0);
+rightBundleReducedSizeGauge = new SimpleGauge<>(0);
+
+getRuntimeContext()
+.getMetricGroup()
+.gauge("leftBundleReducedSize", leftBundleReducedSizeGauge);
+getRuntimeContext()
+.getMetricGroup()
+.gauge("rightBundleReducedSize", rightBundleReducedSizeGauge);
+}
+
+@Override
+public void processElement1(StreamRecord element) throws 
Exception {
+RowData joinKey = (RowData) getCurrentKey();
+RowData uniqueKey = null;
+if (leftInputSideSpec.getUniqueKeySelector() != null) {
+uniqueKey = 
leftInputSideSpec.getUniqueKeySelector().getKey(element.getValue());
+}
+leftBuffer.addRecord(joinKey, uniqueKey, element.getValue());
+

Re: [PR] Introduce operator for minibatch join [flink]

2024-01-24 Thread via GitHub


xishuaidelin commented on code in PR #24160:
URL: https://github.com/apache/flink/pull/24160#discussion_r1465798199


##
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/join/stream/MiniBatchStreamingJoinOperator.java:
##
@@ -0,0 +1,420 @@
+/*
+ * 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.join.stream;
+
+import org.apache.flink.streaming.api.watermark.Watermark;
+import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
+import org.apache.flink.table.data.RowData;
+import org.apache.flink.table.data.util.RowDataUtil;
+import org.apache.flink.table.runtime.generated.GeneratedJoinCondition;
+import 
org.apache.flink.table.runtime.operators.bundle.trigger.BundleTriggerCallback;
+import org.apache.flink.table.runtime.operators.bundle.trigger.CoBundleTrigger;
+import org.apache.flink.table.runtime.operators.join.FlinkJoinType;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.BufferBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.InputSideHasNoUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.InputSideHasUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.JoinKeyContainsUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.state.JoinInputSideSpec;
+import 
org.apache.flink.table.runtime.operators.join.stream.state.JoinRecordStateView;
+import org.apache.flink.table.runtime.operators.metrics.SimpleGauge;
+import org.apache.flink.table.runtime.typeutils.InternalTypeInfo;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/** Streaming unbounded Join base operator which support mini-batch join. */
+public abstract class MiniBatchStreamingJoinOperator extends 
StreamingJoinOperator
+implements BundleTriggerCallback {
+
+private static final long serialVersionUID = -1106342589994963997L;
+
+private final CoBundleTrigger coBundleTrigger;
+
+private transient BufferBundle leftBuffer;
+private transient BufferBundle rightBuffer;

Review Comment:
   done



##
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/join/stream/MiniBatchStreamingJoinOperator.java:
##
@@ -0,0 +1,420 @@
+/*
+ * 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.join.stream;
+
+import org.apache.flink.streaming.api.watermark.Watermark;
+import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
+import org.apache.flink.table.data.RowData;
+import org.apache.flink.table.data.util.RowDataUtil;
+import org.apache.flink.table.runtime.generated.GeneratedJoinCondition;
+import 
org.apache.flink.table.runtime.operators.bundle.trigger.BundleTriggerCallback;
+import org.apache.flink.table.runtime.operators.bundle.trigger.CoBundleTrigger;
+import org.apache.flink.table.runtime.operators.join.FlinkJoinType;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.BufferBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.InputSideHasNoUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.InputSideHasUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.JoinKeyContainsUniqueKeyBundle;
+import 

Re: [PR] Introduce operator for minibatch join [flink]

2024-01-24 Thread via GitHub


xishuaidelin commented on code in PR #24160:
URL: https://github.com/apache/flink/pull/24160#discussion_r1465790352


##
flink-table/flink-table-runtime/src/test/java/org/apache/flink/table/runtime/operators/join/stream/StreamingJoinOperatorTestBase.java:
##
@@ -41,7 +41,7 @@
 /** Base test class for {@link AbstractStreamingJoinOperator}. */
 public abstract class StreamingJoinOperatorTestBase {
 
-protected final InternalTypeInfo leftTypeInfo =
+protected InternalTypeInfo leftTypeInfo =

Review Comment:
   Yes, I changed this and only removed the final for rightType, 
rightKeySelector and assertor.



-- 
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-unsubscr...@flink.apache.org

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



Re: [PR] Introduce operator for minibatch join [flink]

2024-01-24 Thread via GitHub


xishuaidelin commented on code in PR #24160:
URL: https://github.com/apache/flink/pull/24160#discussion_r1465789710


##
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/join/stream/MiniBatchStreamingJoinOperator.java:
##
@@ -0,0 +1,420 @@
+/*
+ * 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.join.stream;
+
+import org.apache.flink.streaming.api.watermark.Watermark;
+import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
+import org.apache.flink.table.data.RowData;
+import org.apache.flink.table.data.util.RowDataUtil;
+import org.apache.flink.table.runtime.generated.GeneratedJoinCondition;
+import 
org.apache.flink.table.runtime.operators.bundle.trigger.BundleTriggerCallback;
+import org.apache.flink.table.runtime.operators.bundle.trigger.CoBundleTrigger;
+import org.apache.flink.table.runtime.operators.join.FlinkJoinType;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.BufferBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.InputSideHasNoUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.InputSideHasUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.JoinKeyContainsUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.state.JoinInputSideSpec;
+import 
org.apache.flink.table.runtime.operators.join.stream.state.JoinRecordStateView;
+import org.apache.flink.table.runtime.operators.metrics.SimpleGauge;
+import org.apache.flink.table.runtime.typeutils.InternalTypeInfo;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/** Streaming unbounded Join base operator which support mini-batch join. */
+public abstract class MiniBatchStreamingJoinOperator extends 
StreamingJoinOperator
+implements BundleTriggerCallback {
+
+private static final long serialVersionUID = -1106342589994963997L;
+
+private final CoBundleTrigger coBundleTrigger;
+
+private transient BufferBundle leftBuffer;
+private transient BufferBundle rightBuffer;
+private transient SimpleGauge leftBundleReducedSizeGauge;
+private transient SimpleGauge rightBundleReducedSizeGauge;
+
+public MiniBatchStreamingJoinOperator(MiniBatchStreamingJoinParameter 
parameter) {
+super(
+parameter.leftType,
+parameter.rightType,
+parameter.generatedJoinCondition,
+parameter.leftInputSideSpec,
+parameter.rightInputSideSpec,
+parameter.leftIsOuter,
+parameter.rightIsOuter,
+parameter.filterNullKeys,
+parameter.leftStateRetentionTime,
+parameter.rightStateRetentionTime);
+
+this.coBundleTrigger = parameter.coBundleTrigger;
+}
+
+@Override
+public void open() throws Exception {
+super.open();
+
+// must copy in mini-batch
+this.requiresCopy = true;
+
+this.leftBuffer = initialBuffer(leftInputSideSpec);
+this.rightBuffer = initialBuffer(rightInputSideSpec);
+
+coBundleTrigger.registerCallback(this);
+coBundleTrigger.reset();
+LOG.info("Initialize MiniBatchStreamingJoinOperator successfully.");
+
+// register metrics
+leftBundleReducedSizeGauge = new SimpleGauge<>(0);
+rightBundleReducedSizeGauge = new SimpleGauge<>(0);
+
+getRuntimeContext()
+.getMetricGroup()
+.gauge("leftBundleReducedSize", leftBundleReducedSizeGauge);
+getRuntimeContext()
+.getMetricGroup()
+.gauge("rightBundleReducedSize", rightBundleReducedSizeGauge);
+}
+
+@Override
+public void processElement1(StreamRecord element) throws 
Exception {
+RowData record = leftSerializer.toSerializedRow(element.getValue(), 
requiresCopy);

Review Comment:
   ditto



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

Re: [PR] Introduce operator for minibatch join [flink]

2024-01-24 Thread via GitHub


xishuaidelin commented on code in PR #24160:
URL: https://github.com/apache/flink/pull/24160#discussion_r1465789465


##
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/join/stream/MiniBatchStreamingJoinOperator.java:
##
@@ -0,0 +1,420 @@
+/*
+ * 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.join.stream;
+
+import org.apache.flink.streaming.api.watermark.Watermark;
+import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
+import org.apache.flink.table.data.RowData;
+import org.apache.flink.table.data.util.RowDataUtil;
+import org.apache.flink.table.runtime.generated.GeneratedJoinCondition;
+import 
org.apache.flink.table.runtime.operators.bundle.trigger.BundleTriggerCallback;
+import org.apache.flink.table.runtime.operators.bundle.trigger.CoBundleTrigger;
+import org.apache.flink.table.runtime.operators.join.FlinkJoinType;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.BufferBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.InputSideHasNoUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.InputSideHasUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.JoinKeyContainsUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.state.JoinInputSideSpec;
+import 
org.apache.flink.table.runtime.operators.join.stream.state.JoinRecordStateView;
+import org.apache.flink.table.runtime.operators.metrics.SimpleGauge;
+import org.apache.flink.table.runtime.typeutils.InternalTypeInfo;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/** Streaming unbounded Join base operator which support mini-batch join. */
+public abstract class MiniBatchStreamingJoinOperator extends 
StreamingJoinOperator
+implements BundleTriggerCallback {
+
+private static final long serialVersionUID = -1106342589994963997L;
+
+private final CoBundleTrigger coBundleTrigger;
+
+private transient BufferBundle leftBuffer;
+private transient BufferBundle rightBuffer;
+private transient SimpleGauge leftBundleReducedSizeGauge;
+private transient SimpleGauge rightBundleReducedSizeGauge;
+
+public MiniBatchStreamingJoinOperator(MiniBatchStreamingJoinParameter 
parameter) {
+super(
+parameter.leftType,
+parameter.rightType,
+parameter.generatedJoinCondition,
+parameter.leftInputSideSpec,
+parameter.rightInputSideSpec,
+parameter.leftIsOuter,
+parameter.rightIsOuter,
+parameter.filterNullKeys,
+parameter.leftStateRetentionTime,
+parameter.rightStateRetentionTime);
+
+this.coBundleTrigger = parameter.coBundleTrigger;
+}
+
+@Override
+public void open() throws Exception {
+super.open();
+
+// must copy in mini-batch
+this.requiresCopy = true;
+
+this.leftBuffer = initialBuffer(leftInputSideSpec);
+this.rightBuffer = initialBuffer(rightInputSideSpec);

Review Comment:
   Yes, I have changed this and simplified the code.



-- 
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-unsubscr...@flink.apache.org

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



Re: [PR] Introduce operator for minibatch join [flink]

2024-01-24 Thread via GitHub


xishuaidelin commented on code in PR #24160:
URL: https://github.com/apache/flink/pull/24160#discussion_r1465789018


##
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/join/stream/AbstractStreamingJoinOperator.java:
##
@@ -66,6 +67,10 @@ public abstract class AbstractStreamingJoinOperator extends 
AbstractStreamOperat
 protected transient JoinConditionWithNullFilters joinCondition;
 protected transient TimestampedCollector collector;
 
+protected transient boolean requiresCopy;

Review Comment:
   Yes, this could be removed.



-- 
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-unsubscr...@flink.apache.org

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



Re: [PR] Introduce operator for minibatch join [flink]

2024-01-24 Thread via GitHub


lsyldliu commented on code in PR #24160:
URL: https://github.com/apache/flink/pull/24160#discussion_r1465762258


##
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/join/stream/AbstractStreamingJoinOperator.java:
##
@@ -66,6 +67,10 @@ public abstract class AbstractStreamingJoinOperator extends 
AbstractStreamOperat
 protected transient JoinConditionWithNullFilters joinCondition;
 protected transient TimestampedCollector collector;
 
+protected transient boolean requiresCopy;

Review Comment:
   We don't need this member variable, this only used for minibatch join, it 
must need to copy.



##
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/join/stream/MiniBatchStreamingJoinOperator.java:
##
@@ -0,0 +1,420 @@
+/*
+ * 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.join.stream;
+
+import org.apache.flink.streaming.api.watermark.Watermark;
+import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
+import org.apache.flink.table.data.RowData;
+import org.apache.flink.table.data.util.RowDataUtil;
+import org.apache.flink.table.runtime.generated.GeneratedJoinCondition;
+import 
org.apache.flink.table.runtime.operators.bundle.trigger.BundleTriggerCallback;
+import org.apache.flink.table.runtime.operators.bundle.trigger.CoBundleTrigger;
+import org.apache.flink.table.runtime.operators.join.FlinkJoinType;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.BufferBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.InputSideHasNoUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.InputSideHasUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.JoinKeyContainsUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.state.JoinInputSideSpec;
+import 
org.apache.flink.table.runtime.operators.join.stream.state.JoinRecordStateView;
+import org.apache.flink.table.runtime.operators.metrics.SimpleGauge;
+import org.apache.flink.table.runtime.typeutils.InternalTypeInfo;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/** Streaming unbounded Join base operator which support mini-batch join. */
+public abstract class MiniBatchStreamingJoinOperator extends 
StreamingJoinOperator
+implements BundleTriggerCallback {
+
+private static final long serialVersionUID = -1106342589994963997L;
+
+private final CoBundleTrigger coBundleTrigger;
+
+private transient BufferBundle leftBuffer;
+private transient BufferBundle rightBuffer;
+private transient SimpleGauge leftBundleReducedSizeGauge;
+private transient SimpleGauge rightBundleReducedSizeGauge;
+
+public MiniBatchStreamingJoinOperator(MiniBatchStreamingJoinParameter 
parameter) {
+super(
+parameter.leftType,
+parameter.rightType,
+parameter.generatedJoinCondition,
+parameter.leftInputSideSpec,
+parameter.rightInputSideSpec,
+parameter.leftIsOuter,
+parameter.rightIsOuter,
+parameter.filterNullKeys,
+parameter.leftStateRetentionTime,
+parameter.rightStateRetentionTime);
+
+this.coBundleTrigger = parameter.coBundleTrigger;
+}
+
+@Override
+public void open() throws Exception {
+super.open();
+
+// must copy in mini-batch
+this.requiresCopy = true;
+
+this.leftBuffer = initialBuffer(leftInputSideSpec);
+this.rightBuffer = initialBuffer(rightInputSideSpec);

Review Comment:
   this.leftSerializer = leftType.createSerializer(new 
ExecutionConfig());
   this.rightSerializer = rightType.createSerializer(new 
ExecutionConfig());



##
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/join/stream/MiniBatchStreamingJoinOperator.java:
##
@@ -0,0 +1,420 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor 

Re: [PR] Introduce operator for minibatch join [flink]

2024-01-24 Thread via GitHub


xishuaidelin commented on code in PR #24160:
URL: https://github.com/apache/flink/pull/24160#discussion_r1465753408


##
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/join/stream/MiniBatchStreamingJoinOperator.java:
##
@@ -0,0 +1,416 @@
+/*
+ * 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.join.stream;
+
+import org.apache.flink.streaming.api.watermark.Watermark;
+import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
+import org.apache.flink.table.data.RowData;
+import org.apache.flink.table.data.util.RowDataUtil;
+import org.apache.flink.table.runtime.generated.GeneratedJoinCondition;
+import 
org.apache.flink.table.runtime.operators.bundle.trigger.BundleTriggerCallback;
+import org.apache.flink.table.runtime.operators.bundle.trigger.CoBundleTrigger;
+import org.apache.flink.table.runtime.operators.join.FlinkJoinType;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.BufferBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.InputSideHasNoUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.InputSideHasUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.bundle.JoinKeyContainsUniqueKeyBundle;
+import 
org.apache.flink.table.runtime.operators.join.stream.state.JoinInputSideSpec;
+import 
org.apache.flink.table.runtime.operators.join.stream.state.JoinRecordStateView;
+import org.apache.flink.table.runtime.operators.metrics.SimpleGauge;
+import org.apache.flink.table.runtime.typeutils.InternalTypeInfo;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/** Streaming unbounded Join base operator which support mini-batch join. */
+public abstract class MiniBatchStreamingJoinOperator extends 
StreamingJoinOperator
+implements BundleTriggerCallback {
+
+private static final long serialVersionUID = -1106342589994963997L;
+
+private final CoBundleTrigger coBundleTrigger;
+
+private transient BufferBundle leftBuffer;
+private transient BufferBundle rightBuffer;
+private transient SimpleGauge leftBundleReducedSizeGauge;
+private transient SimpleGauge rightBundleReducedSizeGauge;
+
+public MiniBatchStreamingJoinOperator(MiniBatchStreamingJoinParameter 
parameter) {
+super(
+parameter.leftType,
+parameter.rightType,
+parameter.generatedJoinCondition,
+parameter.leftInputSideSpec,
+parameter.rightInputSideSpec,
+parameter.leftIsOuter,
+parameter.rightIsOuter,
+parameter.filterNullKeys,
+parameter.leftStateRetentionTime,
+parameter.rightStateRetentionTime);
+
+this.coBundleTrigger = parameter.coBundleTrigger;
+}
+
+@Override
+public void open() throws Exception {
+super.open();
+
+this.leftBuffer = initialBuffer(leftInputSideSpec);
+this.rightBuffer = initialBuffer(rightInputSideSpec);
+
+coBundleTrigger.registerCallback(this);
+coBundleTrigger.reset();
+LOG.info("Initialize MiniBatchStreamingJoinOperator successfully.");
+
+// register metrics
+leftBundleReducedSizeGauge = new SimpleGauge<>(0);
+rightBundleReducedSizeGauge = new SimpleGauge<>(0);
+
+getRuntimeContext()
+.getMetricGroup()
+.gauge("leftBundleReducedSize", leftBundleReducedSizeGauge);
+getRuntimeContext()
+.getMetricGroup()
+.gauge("rightBundleReducedSize", rightBundleReducedSizeGauge);
+}
+
+@Override
+public void processElement1(StreamRecord element) throws 
Exception {
+RowData joinKey = (RowData) getCurrentKey();
+RowData uniqueKey = null;
+if (leftInputSideSpec.getUniqueKeySelector() != null) {
+uniqueKey = 
leftInputSideSpec.getUniqueKeySelector().getKey(element.getValue());
+}
+leftBuffer.addRecord(joinKey, uniqueKey, element.getValue());
+

Re: [PR] Introduce operator for minibatch join [flink]

2024-01-24 Thread via GitHub


xishuaidelin commented on code in PR #24160:
URL: https://github.com/apache/flink/pull/24160#discussion_r1464818953


##
flink-table/flink-table-runtime/src/test/java/org/apache/flink/table/runtime/operators/join/stream/StreamingMiniBatchJoinOperatorTest.java:
##
@@ -0,0 +1,1667 @@
+/*
+ * 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.join.stream;
+
+import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
+import org.apache.flink.table.data.RowData;
+import org.apache.flink.table.runtime.keyselector.RowDataKeySelector;
+import 
org.apache.flink.table.runtime.operators.bundle.trigger.CountCoBundleTrigger;
+import org.apache.flink.table.runtime.operators.join.FlinkJoinType;
+import 
org.apache.flink.table.runtime.operators.join.stream.state.JoinInputSideSpec;
+import org.apache.flink.table.runtime.typeutils.InternalTypeInfo;
+import org.apache.flink.table.types.logical.CharType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.RowType;
+import org.apache.flink.table.utils.HandwrittenSelectorUtil;
+import org.apache.flink.types.RowKind;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInfo;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+import java.util.function.Function;
+import java.util.stream.Stream;
+
+import static 
org.apache.flink.table.runtime.util.StreamRecordUtils.deleteRecord;
+import static 
org.apache.flink.table.runtime.util.StreamRecordUtils.insertRecord;
+import static org.apache.flink.table.runtime.util.StreamRecordUtils.rowOfKind;
+import static 
org.apache.flink.table.runtime.util.StreamRecordUtils.updateAfterRecord;
+import static 
org.apache.flink.table.runtime.util.StreamRecordUtils.updateBeforeRecord;
+
+/** Test for StreamingMiniBatchJoinOperatorTest. */
+public final class StreamingMiniBatchJoinOperatorTest extends 
StreamingJoinOperatorTestBase {
+
+private RowDataKeySelector leftUniqueKeySelector;
+private RowDataKeySelector rightUniqueKeySelector;
+
+@BeforeEach
+public void beforeEach(TestInfo testInfo) throws Exception {
+rightTypeInfo =
+InternalTypeInfo.of(
+RowType.of(
+new LogicalType[]{
+new CharType(false, 20),
+new CharType(false, 20),
+new CharType(true, 10)
+},
+new String[]{
+"order_id#", "line_order_id0", 
"line_order_ship_mode"
+}));
+
+rightKeySelector =
+HandwrittenSelectorUtil.getRowDataSelector(
+new int[]{1},
+rightTypeInfo.toRowType().getChildren().toArray(new 
LogicalType[0]));
+super.beforeEach(testInfo);
+}
+
+@Tag("miniBatchSize=3")
+@Test
+public void testLeftJoinWithLeftArriveFirst() throws Exception {
+// joinKey is LineOrd
+// left fold  || right fold
+testHarness.processElement1(
+insertRecord(
+"Ord#1", "LineOrd#2", "3 Bellevue Drive, Pottstown, PA 
19464")); // left +I
+testHarness.processElement1(
+insertRecord(
+"Ord#i",
+"LineOrd#6",
+"i6 Bellevue Drive, Pottstown, Pi 19464")); // left  +I
+assertor.shouldEmitNothing(testHarness);
+testHarness.processElement2(insertRecord("Ord#X", "LineOrd#2", 
"AIR")); // right
+
+assertor.shouldEmit(
+testHarness,
+rowOfKind(
+RowKind.INSERT,
+"Ord#i",
+"LineOrd#6",
+"i6 Bellevue Drive, Pottstown, Pi 19464",
+null,
+null,
+ 

Re: [PR] Introduce operator for minibatch join [flink]

2024-01-21 Thread via GitHub


flinkbot commented on PR #24160:
URL: https://github.com/apache/flink/pull/24160#issuecomment-1903006337

   
   ## CI report:
   
   * d487b086c0cccb48244e46b106bcd26143e6a272 UNKNOWN
   
   
   Bot commands
 The @flinkbot bot supports the following commands:
   
- `@flinkbot run azure` re-run the last Azure build
   


-- 
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-unsubscr...@flink.apache.org

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



[PR] Introduce operator for minibatch join [flink]

2024-01-21 Thread via GitHub


xishuaidelin opened a new pull request, #24160:
URL: https://github.com/apache/flink/pull/24160

   
   
   ## What is the purpose of the change
   
   *(For example: This pull request makes task deployment go through the blob 
server, rather than through RPC. That way we avoid re-transferring them on each 
deployment (during recovery).)*
   
   
   ## Brief change log
   
   *(for example:)*
 - *The TaskInfo is stored in the blob store on job creation time as a 
persistent artifact*
 - *Deployments RPC transmits only the blob storage reference*
 - *TaskManagers retrieve the TaskInfo from the blob cache*
   
   
   ## Verifying this change
   
   Please make sure both new and modified tests in this PR follows the 
conventions defined in our code quality guide: 
https://flink.apache.org/contributing/code-style-and-quality-common.html#testing
   
   *(Please pick either of the following options)*
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This change is already covered by existing tests, such as *(please describe 
tests)*.
   
   *(or)*
   
   This change added tests and can be verified as follows:
   
   *(example:)*
 - *Added integration tests for end-to-end deployment with large payloads 
(100MB)*
 - *Extended integration test for recovery after master (JobManager) 
failure*
 - *Added test that validates that TaskInfo is transferred only once across 
recoveries*
 - *Manually verified the change by running a 4 node cluster with 2 
JobManagers and 4 TaskManagers, a stateful streaming program, and killing one 
JobManager and two TaskManagers during the execution, verifying that recovery 
happens correctly.*
   
   ## Does this pull request potentially affect one of the following parts:
   
 - Dependencies (does it add or upgrade a dependency): (yes / no)
 - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: (yes / no)
 - The serializers: (yes / no / don't know)
 - The runtime per-record code paths (performance sensitive): (yes / no / 
don't know)
 - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / no / don't know)
 - The S3 file system connector: (yes / no / don't know)
   
   ## Documentation
   
 - Does this pull request introduce a new feature? (yes / no)
 - If yes, how is the feature documented? (not applicable / docs / JavaDocs 
/ not documented)
   


-- 
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-unsubscr...@flink.apache.org

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