-
Notifications
You must be signed in to change notification settings - Fork 119
alter rmq replicator unnecessary validation #460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -208,22 +208,22 @@ public Class<? extends Task> taskClass() { | |
| return ReplicatorSourceTask.class; | ||
| } | ||
|
|
||
| private Set<String> neededParamKeys = new HashSet<String>() { | ||
| private Map<String, Boolean> neededParamKeys = new HashMap<String, Boolean>() { | ||
| { | ||
| add(ReplicatorConnectorConfig.SRC_CLOUD); | ||
| add(ReplicatorConnectorConfig.SRC_REGION); | ||
| add(ReplicatorConnectorConfig.SRC_CLUSTER); | ||
| add(ReplicatorConnectorConfig.SRC_ENDPOINT); | ||
| add(ReplicatorConnectorConfig.SRC_TOPICTAGS); | ||
| add(ReplicatorConnectorConfig.DEST_CLOUD); | ||
| add(ReplicatorConnectorConfig.DEST_REGION); | ||
| add(ReplicatorConnectorConfig.DEST_CLUSTER); | ||
| add(ReplicatorConnectorConfig.DEST_ENDPOINT); | ||
| add(ReplicatorConnectorConfig.DEST_TOPIC); | ||
| add(ReplicatorConnectorConfig.SRC_CLOUD); | ||
| add(ReplicatorConnectorConfig.SRC_ACL_ENABLE); | ||
| add(ReplicatorConnectorConfig.DEST_ACL_ENABLE); | ||
| add(ERRORS_TOLERANCE_CONFIG); | ||
| put(ReplicatorConnectorConfig.SRC_CLOUD, false); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it is not a necessary parameter, can you consider removing it from the verification?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is also possible to remove them directly, but it is easier for me to extend or customize them. It would be better to extract the required parameters into a unified public class rather than write them for each connector
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In my opinion, after the connector is implemented, the necessary configuration has been determined. In the subsequent evolution and development, of course, it is possible to challenge the verification rules of these parameters, but it is a very low-frequency operation. For example, we have some differences now. However, after our discussion this time, after confirming those that are indeed required and those that are not, there may be basically no major changes. |
||
| put(ReplicatorConnectorConfig.SRC_REGION, false); | ||
| put(ReplicatorConnectorConfig.SRC_CLUSTER, false); | ||
| put(ReplicatorConnectorConfig.SRC_ENDPOINT, true); | ||
| put(ReplicatorConnectorConfig.SRC_TOPICTAGS, true); | ||
| put(ReplicatorConnectorConfig.DEST_CLOUD, false); | ||
| put(ReplicatorConnectorConfig.DEST_REGION, false); | ||
| put(ReplicatorConnectorConfig.DEST_CLUSTER, false); | ||
| put(ReplicatorConnectorConfig.DEST_ENDPOINT, true); | ||
| put(ReplicatorConnectorConfig.DEST_TOPIC, true); | ||
| put(ReplicatorConnectorConfig.SRC_CLOUD, false); | ||
| put(ReplicatorConnectorConfig.SRC_ACL_ENABLE, false); | ||
| put(ReplicatorConnectorConfig.DEST_ACL_ENABLE, false); | ||
| put(ERRORS_TOLERANCE_CONFIG, false); | ||
| } | ||
| }; | ||
|
|
||
|
|
@@ -239,7 +239,7 @@ public void validate(KeyValue config) { | |
| ReplicatorUtils.checkNeedParams(ReplicatorSourceConnector.class.getName(), config, neededParamKeys); | ||
| String consumeFromWhere = config.getString(ReplicatorConnectorConfig.CONSUME_FROM_WHERE, ConsumeFromWhere.CONSUME_FROM_LAST_OFFSET.name()); | ||
| if (StringUtils.isNotBlank(consumeFromWhere) && consumeFromWhere.equals(ConsumeFromWhere.CONSUME_FROM_TIMESTAMP.name())) { | ||
| ReplicatorUtils.checkNeedParamNotEmpty(ReplicatorSourceConnector.class.getName(), config, ReplicatorConnectorConfig.CONSUME_FROM_TIMESTAMP); | ||
| ReplicatorUtils.checkNeedParamNotEmpty(ReplicatorSourceConnector.class.getName(), config, ReplicatorConnectorConfig.CONSUME_FROM_TIMESTAMP, true); | ||
| } | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No test changes detected alongside source modifications. Consider adding tests to cover the changes.