File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed
km-common/src/main/java/com/xiaojukeji/know/streaming/km/common
bean/entity/connect/config Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 77import org .apache .kafka .connect .runtime .rest .entities .ConfigInfo ;
88import org .apache .kafka .connect .runtime .rest .entities .ConfigInfos ;
99
10- import java .util .ArrayList ;
11- import java .util .List ;
10+ import java .util .*;
11+
12+ import static com .xiaojukeji .know .streaming .km .common .constant .Constant .CONNECTOR_CONFIG_ACTION_RELOAD_NAME ;
13+ import static com .xiaojukeji .know .streaming .km .common .constant .Constant .CONNECTOR_CONFIG_ERRORS_TOLERANCE_NAME ;
1214
1315/**
1416 * @see ConfigInfos
1719@ NoArgsConstructor
1820@ AllArgsConstructor
1921public class ConnectConfigInfos {
22+
23+ private static final Map <String , List <String >> recommendValuesMap = new HashMap <>();
24+
25+ static {
26+ recommendValuesMap .put (CONNECTOR_CONFIG_ACTION_RELOAD_NAME , Arrays .asList ("none" , "restart" ));
27+ recommendValuesMap .put (CONNECTOR_CONFIG_ERRORS_TOLERANCE_NAME , Arrays .asList ("none" , "all" ));
28+ }
2029 private String name ;
2130
2231 private int errorCount ;
@@ -48,7 +57,7 @@ public ConnectConfigInfos(ConfigInfos configInfos) {
4857 ConnectConfigValueInfo value = new ConnectConfigValueInfo ();
4958 value .setName (configInfo .configValue ().name ());
5059 value .setValue (configInfo .configValue ().value ());
51- value .setRecommendedValues (configInfo .configValue ().recommendedValues ());
60+ value .setRecommendedValues (recommendValuesMap . getOrDefault ( configInfo .configValue ().name (), configInfo . configValue (). recommendedValues () ));
5261 value .setErrors (configInfo .configValue ().errors ());
5362 value .setVisible (configInfo .configValue ().visible ());
5463
Original file line number Diff line number Diff line change @@ -65,4 +65,9 @@ private Constant() {}
6565 public static final Integer DEFAULT_RETRY_TIME = 3 ;
6666
6767 public static final Integer ZK_ALIVE_BUT_4_LETTER_FORBIDDEN = 11 ;
68+
69+ public static final String CONNECTOR_CONFIG_ACTION_RELOAD_NAME = "config.action.reload" ;
70+
71+ public static final String CONNECTOR_CONFIG_ERRORS_TOLERANCE_NAME = "errors.tolerance" ;
72+
6873}
You can’t perform that action at this time.
0 commit comments