37
37
import org .apache .flink .cdc .common .types .TimestampType ;
38
38
import org .apache .flink .cdc .common .types .ZonedTimestampType ;
39
39
40
+ import javax .annotation .CheckReturnValue ;
40
41
import javax .annotation .Nullable ;
41
42
42
43
import java .util .ArrayList ;
@@ -56,6 +57,7 @@ public class SchemaUtils {
56
57
* create a list of {@link RecordData.FieldGetter} from given {@link Schema} to get Object from
57
58
* RecordData.
58
59
*/
60
+ @ CheckReturnValue
59
61
public static List <RecordData .FieldGetter > createFieldGetters (Schema schema ) {
60
62
return createFieldGetters (schema .getColumns ());
61
63
}
@@ -64,6 +66,7 @@ public static List<RecordData.FieldGetter> createFieldGetters(Schema schema) {
64
66
* create a list of {@link RecordData.FieldGetter} from given {@link Column} to get Object from
65
67
* RecordData.
66
68
*/
69
+ @ CheckReturnValue
67
70
public static List <RecordData .FieldGetter > createFieldGetters (List <Column > columns ) {
68
71
List <RecordData .FieldGetter > fieldGetters = new ArrayList <>(columns .size ());
69
72
for (int i = 0 ; i < columns .size (); i ++) {
@@ -73,6 +76,7 @@ public static List<RecordData.FieldGetter> createFieldGetters(List<Column> colum
73
76
}
74
77
75
78
/** Restore original data fields from RecordData structure. */
79
+ @ CheckReturnValue
76
80
public static List <Object > restoreOriginalData (
77
81
@ Nullable RecordData recordData , List <RecordData .FieldGetter > fieldGetters ) {
78
82
if (recordData == null ) {
@@ -86,6 +90,7 @@ public static List<Object> restoreOriginalData(
86
90
}
87
91
88
92
/** apply SchemaChangeEvent to the old schema and return the schema after changing. */
93
+ @ CheckReturnValue
89
94
public static Schema applySchemaChangeEvent (Schema schema , SchemaChangeEvent event ) {
90
95
return SchemaChangeEventVisitor .visit (
91
96
event ,
@@ -210,6 +215,7 @@ private static Schema applyAlterColumnTypeEvent(AlterColumnTypeEvent event, Sche
210
215
* position indicators. This is necessary since extra calculated columns might be added, and
211
216
* `FIRST` / `LAST` position might differ.
212
217
*/
218
+ @ CheckReturnValue
213
219
public static Optional <SchemaChangeEvent > transformSchemaChangeEvent (
214
220
boolean hasAsterisk , List <String > referencedColumns , SchemaChangeEvent event ) {
215
221
Optional <SchemaChangeEvent > evolvedSchemaChangeEvent = Optional .empty ();
0 commit comments