Skip to content

Commit 60363bd

Browse files
authored
[flink] lake tiering support flink 1.18 (#1742)
1 parent 7bed725 commit 60363bd

File tree

2 files changed

+60
-1
lines changed
  • fluss-test-coverage

2 files changed

+60
-1
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package org.apache.flink.streaming.api.functions.sink.v2;
19+
20+
import org.apache.flink.annotation.PublicEvolving;
21+
import org.apache.flink.api.common.SupportsConcurrentExecutionAttempts;
22+
import org.apache.flink.api.connector.sink2.Sink;
23+
import org.apache.flink.api.connector.sink2.SinkWriter;
24+
25+
import java.io.IOException;
26+
27+
/**
28+
* A special sink that ignores all elements.
29+
*
30+
* @param <IN> The type of elements received by the sink.
31+
*/
32+
@PublicEvolving
33+
public class DiscardingSink<IN> implements Sink<IN>, SupportsConcurrentExecutionAttempts {
34+
private static final long serialVersionUID = 1L;
35+
36+
@Override
37+
public SinkWriter<IN> createWriter(InitContext context) throws IOException {
38+
return new DiscardingElementWriter();
39+
}
40+
41+
private class DiscardingElementWriter implements SinkWriter<IN> {
42+
43+
@Override
44+
public void write(IN element, Context context) throws IOException, InterruptedException {
45+
// discard it.
46+
}
47+
48+
@Override
49+
public void flush(boolean endOfInput) throws IOException, InterruptedException {
50+
// this writer has no pending data.
51+
}
52+
53+
@Override
54+
public void close() throws Exception {
55+
// do nothing.
56+
}
57+
}
58+
}

fluss-test-coverage/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,8 @@
354354
org.apache.fluss.flink.metrics.*
355355
</exclude>
356356
<!-- end exclude for flink-connector -->
357+
<!-- exclude flink 1.18 compatibility class for sink -->
358+
<exclude>org.apache.flink.streaming.api.functions.sink.v2.*</exclude>
357359
<exclude>org.apache.fluss.fs.hdfs.HadoopFsPlugin
358360
</exclude>
359361
<exclude>org.apache.fluss.fs.hdfs.HadoopSecurityTokenReceiver</exclude>
@@ -388,7 +390,6 @@
388390
<exclude>org.apache.fluss.lake.iceberg.*</exclude>
389391
<exclude>org.apache.fluss.row.encode.iceberg.*</exclude>
390392
<exclude>org.apache.fluss.bucketing.IcebergBucketingFunction</exclude>
391-
<exclude>org.apache.iceberg.transforms.TransformUtils</exclude>
392393
<!-- start exclude for flink tiering service -->
393394
<exclude>org.apache.fluss.flink.tiering.source.TieringSourceOptions</exclude>
394395
<exclude>org.apache.fluss.flink.tiering.source.TieringSource.Builder</exclude>

0 commit comments

Comments
 (0)