Skip to content

Commit 5e0471e

Browse files
committed
[FLINK-38729] Bump Flink version to 2.2.0
1 parent d993c6a commit 5e0471e

38 files changed

Lines changed: 9645 additions & 4 deletions

flink-cdc-common-2.x/pom.xml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one or more
4+
contributor license agreements. See the NOTICE file distributed with
5+
this work for additional information regarding copyright ownership.
6+
The ASF licenses this file to You under the Apache License, Version 2.0
7+
(the "License"); you may not use this file except in compliance with
8+
the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
-->
18+
<project xmlns="http://maven.apache.org/POM/4.0.0"
19+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
21+
<parent>
22+
<artifactId>flink-cdc-parent</artifactId>
23+
<groupId>org.apache.flink</groupId>
24+
<version>${revision}</version>
25+
</parent>
26+
<modelVersion>4.0.0</modelVersion>
27+
28+
<artifactId>flink-cdc-common-2.x</artifactId>
29+
30+
<properties>
31+
<flink.version>${flink.2.x.version}</flink.version>
32+
<shaded.guava.version>${flink.2.x.shaded.guava.version}</shaded.guava.version>
33+
</properties>
34+
35+
<dependencies>
36+
<dependency>
37+
<groupId>org.apache.flink</groupId>
38+
<artifactId>flink-cdc-common</artifactId>
39+
<version>${project.version}</version>
40+
</dependency>
41+
</dependencies>
42+
43+
<build>
44+
<plugins>
45+
<plugin>
46+
<groupId>org.apache.maven.plugins</groupId>
47+
<artifactId>maven-jar-plugin</artifactId>
48+
<executions>
49+
<execution>
50+
<id>test-jar</id>
51+
<goals>
52+
<goal>test-jar</goal>
53+
</goals>
54+
</execution>
55+
</executions>
56+
</plugin>
57+
</plugins>
58+
</build>
59+
</project>
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
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.cdc.common.configuration.description;
19+
20+
import org.apache.flink.cdc.common.annotation.PublicEvolving;
21+
22+
import org.apache.flink.shaded.guava33.com.google.common.base.Strings;
23+
24+
import java.util.Arrays;
25+
import java.util.Collections;
26+
import java.util.EnumSet;
27+
import java.util.List;
28+
29+
/** Represents a text block in the {@link Description}. */
30+
@PublicEvolving
31+
public class TextElement implements BlockElement, InlineElement {
32+
private final String format;
33+
private final List<InlineElement> elements;
34+
private final EnumSet<TextStyle> textStyles = EnumSet.noneOf(TextStyle.class);
35+
36+
/**
37+
* Creates a block of text with placeholders ("%s") that will be replaced with proper string
38+
* representation of given {@link InlineElement}. For example:
39+
*
40+
* <p>{@code text("This is a text with a link %s", link("https://somepage", "to here"))}
41+
*
42+
* @param format text with placeholders for elements
43+
* @param elements elements to be put in the text
44+
* @return block of text
45+
*/
46+
public static TextElement text(String format, InlineElement... elements) {
47+
return new TextElement(format, Arrays.asList(elements));
48+
}
49+
50+
/**
51+
* Creates a simple block of text.
52+
*
53+
* @param text a simple block of text
54+
* @return block of text
55+
*/
56+
public static TextElement text(String text) {
57+
return new TextElement(text, Collections.emptyList());
58+
}
59+
60+
/** Wraps a list of {@link InlineElement}s into a single {@link TextElement}. */
61+
public static InlineElement wrap(InlineElement... elements) {
62+
return text(Strings.repeat("%s", elements.length), elements);
63+
}
64+
65+
/**
66+
* Creates a block of text formatted as code.
67+
*
68+
* @param text a block of text that will be formatted as code
69+
* @return block of text formatted as code
70+
*/
71+
public static TextElement code(String text) {
72+
TextElement element = text(text);
73+
element.textStyles.add(TextStyle.CODE);
74+
return element;
75+
}
76+
77+
public String getFormat() {
78+
return format;
79+
}
80+
81+
public List<InlineElement> getElements() {
82+
return elements;
83+
}
84+
85+
public EnumSet<TextStyle> getStyles() {
86+
return textStyles;
87+
}
88+
89+
private TextElement(String format, List<InlineElement> elements) {
90+
this.format = format;
91+
this.elements = elements;
92+
}
93+
94+
@Override
95+
public void format(Formatter formatter) {
96+
formatter.format(this);
97+
}
98+
99+
/** Styles that can be applied to {@link TextElement} e.g. code, bold etc. */
100+
@PublicEvolving
101+
public enum TextStyle {
102+
CODE
103+
}
104+
}

0 commit comments

Comments
 (0)