This is an automated email from the ASF dual-hosted git repository.
jark pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fluss.git
The following commit(s) were added to refs/heads/main by this push:
new 6dd977662 [flink] Fix MultipleParameterTool ClassNotFoundException in
tiering service (#2063)
6dd977662 is described below
commit 6dd9776627ec63836b344cf0824c454a49966f89
Author: Pei Yu <[email protected]>
AuthorDate: Fri Dec 19 19:16:14 2025 +0800
[flink] Fix MultipleParameterTool ClassNotFoundException in tiering service
(#2063)
---
.../adapter/Flink118MultipleParameterToolTest.java | 21 ++++++++++
.../adapter/Flink119MultipleParameterToolTest.java | 21 ++++++++++
.../adapter/Flink120MultipleParameterToolTest.java | 21 ++++++++++
.../adapter/MultipleParameterToolAdapter.java | 46 ++++++++++++++++++++++
.../adapter/Flink21MultipleParameterToolTest.java | 21 ++++++++++
.../adapter/MultipleParameterToolAdapter.java | 46 ++++++++++++++++++++++
.../adapter/FlinkMultipleParameterToolTest.java | 40 +++++++++++++++++++
.../flink/tiering/FlussLakeTieringEntrypoint.java | 4 +-
8 files changed, 218 insertions(+), 2 deletions(-)
diff --git
a/fluss-flink/fluss-flink-1.18/src/test/java/org/apache/fluss/flink/adapter/Flink118MultipleParameterToolTest.java
b/fluss-flink/fluss-flink-1.18/src/test/java/org/apache/fluss/flink/adapter/Flink118MultipleParameterToolTest.java
new file mode 100644
index 000000000..84bde7e98
--- /dev/null
+++
b/fluss-flink/fluss-flink-1.18/src/test/java/org/apache/fluss/flink/adapter/Flink118MultipleParameterToolTest.java
@@ -0,0 +1,21 @@
+/*
+ * 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.fluss.flink.adapter;
+
+/** Test for {@link MultipleParameterToolAdapter} in flink 1.18. */
+public class Flink118MultipleParameterToolTest extends
FlinkMultipleParameterToolTest {}
diff --git
a/fluss-flink/fluss-flink-1.19/src/test/java/org/apache/fluss/flink/adapter/Flink119MultipleParameterToolTest.java
b/fluss-flink/fluss-flink-1.19/src/test/java/org/apache/fluss/flink/adapter/Flink119MultipleParameterToolTest.java
new file mode 100644
index 000000000..5c602fee1
--- /dev/null
+++
b/fluss-flink/fluss-flink-1.19/src/test/java/org/apache/fluss/flink/adapter/Flink119MultipleParameterToolTest.java
@@ -0,0 +1,21 @@
+/*
+ * 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.fluss.flink.adapter;
+
+/** Test for {@link MultipleParameterToolAdapter} in flink 1.19. */
+public class Flink119MultipleParameterToolTest extends
FlinkMultipleParameterToolTest {}
diff --git
a/fluss-flink/fluss-flink-1.20/src/test/java/org/apache/fluss/flink/adapter/Flink120MultipleParameterToolTest.java
b/fluss-flink/fluss-flink-1.20/src/test/java/org/apache/fluss/flink/adapter/Flink120MultipleParameterToolTest.java
new file mode 100644
index 000000000..56f0203bc
--- /dev/null
+++
b/fluss-flink/fluss-flink-1.20/src/test/java/org/apache/fluss/flink/adapter/Flink120MultipleParameterToolTest.java
@@ -0,0 +1,21 @@
+/*
+ * 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.fluss.flink.adapter;
+
+/** Test for {@link MultipleParameterToolAdapter} in flink 1.20. */
+public class Flink120MultipleParameterToolTest extends
FlinkMultipleParameterToolTest {}
diff --git
a/fluss-flink/fluss-flink-2.1/src/main/java/org/apache/fluss/flink/adapter/MultipleParameterToolAdapter.java
b/fluss-flink/fluss-flink-2.1/src/main/java/org/apache/fluss/flink/adapter/MultipleParameterToolAdapter.java
new file mode 100644
index 000000000..076dcb86c
--- /dev/null
+++
b/fluss-flink/fluss-flink-2.1/src/main/java/org/apache/fluss/flink/adapter/MultipleParameterToolAdapter.java
@@ -0,0 +1,46 @@
+/*
+ * 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.fluss.flink.adapter;
+
+import org.apache.flink.util.MultipleParameterTool;
+
+import java.util.Map;
+
+/**
+ * An adapter for Flink {@link MultipleParameterTool} class. The {@link
MultipleParameterTool} is
+ * moved to a new package since Flink 2.x, so this adapter helps to bridge
compatibility for
+ * different Flink versions.
+ *
+ * <p>TODO: remove this class when no longer support all the Flink 1.x series.
+ */
+public class MultipleParameterToolAdapter {
+
+ private MultipleParameterToolAdapter() {}
+
+ private MultipleParameterTool multipleParameterTool;
+
+ public static MultipleParameterToolAdapter fromArgs(String[] args) {
+ MultipleParameterToolAdapter adapter = new
MultipleParameterToolAdapter();
+ adapter.multipleParameterTool = MultipleParameterTool.fromArgs(args);
+ return adapter;
+ }
+
+ public Map<String, String> toMap() {
+ return this.multipleParameterTool.toMap();
+ }
+}
diff --git
a/fluss-flink/fluss-flink-2.1/src/test/java/org/apache/fluss/flink/adapter/Flink21MultipleParameterToolTest.java
b/fluss-flink/fluss-flink-2.1/src/test/java/org/apache/fluss/flink/adapter/Flink21MultipleParameterToolTest.java
new file mode 100644
index 000000000..f3922bcbd
--- /dev/null
+++
b/fluss-flink/fluss-flink-2.1/src/test/java/org/apache/fluss/flink/adapter/Flink21MultipleParameterToolTest.java
@@ -0,0 +1,21 @@
+/*
+ * 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.fluss.flink.adapter;
+
+/** Test for {@link MultipleParameterToolAdapter} in flink 2.1. */
+public class Flink21MultipleParameterToolTest extends
FlinkMultipleParameterToolTest {}
diff --git
a/fluss-flink/fluss-flink-common/src/main/java/org/apache/fluss/flink/adapter/MultipleParameterToolAdapter.java
b/fluss-flink/fluss-flink-common/src/main/java/org/apache/fluss/flink/adapter/MultipleParameterToolAdapter.java
new file mode 100644
index 000000000..9c1972ce6
--- /dev/null
+++
b/fluss-flink/fluss-flink-common/src/main/java/org/apache/fluss/flink/adapter/MultipleParameterToolAdapter.java
@@ -0,0 +1,46 @@
+/*
+ * 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.fluss.flink.adapter;
+
+import org.apache.flink.api.java.utils.MultipleParameterTool;
+
+import java.util.Map;
+
+/**
+ * An adapter for Flink {@link MultipleParameterTool} class. The {@link
MultipleParameterTool} is
+ * moved to a new package since Flink 2.x, so this adapter helps to bridge
compatibility for
+ * different Flink versions.
+ *
+ * <p>TODO: remove this class when no longer support all the Flink 1.x series.
+ */
+public class MultipleParameterToolAdapter {
+
+ private MultipleParameterToolAdapter() {}
+
+ private MultipleParameterTool multipleParameterTool;
+
+ public static MultipleParameterToolAdapter fromArgs(String[] args) {
+ MultipleParameterToolAdapter adapter = new
MultipleParameterToolAdapter();
+ adapter.multipleParameterTool = MultipleParameterTool.fromArgs(args);
+ return adapter;
+ }
+
+ public Map<String, String> toMap() {
+ return this.multipleParameterTool.toMap();
+ }
+}
diff --git
a/fluss-flink/fluss-flink-common/src/test/java/org/apache/fluss/flink/adapter/FlinkMultipleParameterToolTest.java
b/fluss-flink/fluss-flink-common/src/test/java/org/apache/fluss/flink/adapter/FlinkMultipleParameterToolTest.java
new file mode 100644
index 000000000..2cbf28235
--- /dev/null
+++
b/fluss-flink/fluss-flink-common/src/test/java/org/apache/fluss/flink/adapter/FlinkMultipleParameterToolTest.java
@@ -0,0 +1,40 @@
+/*
+ * 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.fluss.flink.adapter;
+
+import org.junit.jupiter.api.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/** Test for {@link MultipleParameterToolAdapter}. */
+abstract class FlinkMultipleParameterToolTest {
+
+ @Test
+ public void testToMap() {
+ String[] args =
+ new String[] {
+ "--multi1", "multiValue1", "--multi2", "multiValue2",
"--multi1", "multiValue3"
+ };
+
+ MultipleParameterToolAdapter adapter =
MultipleParameterToolAdapter.fromArgs(args);
+
+ // The last value is used.
+ assertThat(adapter.toMap()).containsEntry("multi1", "multiValue3");
+ assertThat(adapter.toMap()).containsEntry("multi2", "multiValue2");
+ }
+}
diff --git
a/fluss-flink/fluss-flink-tiering/src/main/java/org/apache/fluss/flink/tiering/FlussLakeTieringEntrypoint.java
b/fluss-flink/fluss-flink-tiering/src/main/java/org/apache/fluss/flink/tiering/FlussLakeTieringEntrypoint.java
index ce7e81279..74236c91a 100644
---
a/fluss-flink/fluss-flink-tiering/src/main/java/org/apache/fluss/flink/tiering/FlussLakeTieringEntrypoint.java
+++
b/fluss-flink/fluss-flink-tiering/src/main/java/org/apache/fluss/flink/tiering/FlussLakeTieringEntrypoint.java
@@ -19,8 +19,8 @@ package org.apache.fluss.flink.tiering;
import org.apache.fluss.config.ConfigOptions;
import org.apache.fluss.config.Configuration;
+import org.apache.fluss.flink.adapter.MultipleParameterToolAdapter;
-import org.apache.flink.api.java.utils.MultipleParameterTool;
import org.apache.flink.configuration.JobManagerOptions;
import org.apache.flink.core.execution.JobClient;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
@@ -39,7 +39,7 @@ public class FlussLakeTieringEntrypoint {
public static void main(String[] args) throws Exception {
// parse params
- final MultipleParameterTool params =
MultipleParameterTool.fromArgs(args);
+ final MultipleParameterToolAdapter params =
MultipleParameterToolAdapter.fromArgs(args);
Map<String, String> paramsMap = params.toMap();
// extract fluss config