File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
pulsar-flink-connector/src/main/java/org/apache/flink/streaming/connectors/pulsar Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 35
35
import java .util .Set ;
36
36
import java .util .concurrent .CompletableFuture ;
37
37
38
+ import static org .apache .flink .util .InstantiationUtil .isSerializable ;
38
39
import static org .apache .flink .util .Preconditions .checkNotNull ;
40
+ import static org .apache .flink .util .Preconditions .checkState ;
39
41
40
42
/**
41
43
* Write data to Flink.
@@ -136,6 +138,8 @@ public FlinkPulsarSink<T> build(){
136
138
if ((cryptoKeyReader == null ) != (encryptionKeys .isEmpty ())){
137
139
throw new IllegalStateException ("Set crypto key reader and encryption keys in conjunction." );
138
140
}
141
+ checkState (isSerializable (cryptoKeyReader ));
142
+ checkState (isSerializable (encryptionKeys ));
139
143
return new FlinkPulsarSink <>(this );
140
144
}
141
145
Original file line number Diff line number Diff line change 88
88
import static org .apache .flink .streaming .connectors .pulsar .internal .metrics .PulsarSourceMetrics .COMMITS_FAILED_METRICS_COUNTER ;
89
89
import static org .apache .flink .streaming .connectors .pulsar .internal .metrics .PulsarSourceMetrics .COMMITS_SUCCEEDED_METRICS_COUNTER ;
90
90
import static org .apache .flink .streaming .connectors .pulsar .internal .metrics .PulsarSourceMetrics .PULSAR_SOURCE_METRICS_GROUP ;
91
+ import static org .apache .flink .util .InstantiationUtil .isSerializable ;
91
92
import static org .apache .flink .util .Preconditions .checkArgument ;
92
93
import static org .apache .flink .util .Preconditions .checkNotNull ;
94
+ import static org .apache .flink .util .Preconditions .checkState ;
95
+
93
96
94
97
/**
95
98
* Pulsar data source.
@@ -168,6 +171,7 @@ public FlinkPulsarSource<T> build(){
168
171
if (clientConf == null ){
169
172
throw new IllegalStateException ("Client conf mustn't be null. Either provide a client conf or a service URL plus properties." );
170
173
}
174
+ checkState (isSerializable (cryptoKeyReader ));
171
175
return new FlinkPulsarSource <>(this );
172
176
}
173
177
You can’t perform that action at this time.
0 commit comments