Skip to content
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

MINOR: clean up and add getters to config #445

Merged
merged 2 commits into from
Sep 29, 2020
Merged

Conversation

levzem
Copy link
Contributor

@levzem levzem commented Sep 28, 2020

Signed-off-by: Lev Zemlyanov lev@confluent.io

Problem

connector does not use config getters which is not the best practice and ends up with some clunky code

Solution

add config getters and reorganize config class

Does this solution apply anywhere else?
  • yes
  • no
If yes, where?

Test Strategy

ensure all previous tests pass

Testing done:
  • Unit tests
  • Integration tests
  • System tests
  • Manual tests

Release Plan

backport to 5.0.x to reduce pint merge conflicts in future PRs

@levzem levzem requested a review from a team as a code owner September 28, 2020 19:02
Signed-off-by: Lev Zemlyanov <lev@confluent.io>
).define(
CONNECTION_PASSWORD_CONFIG,
Type.PASSWORD,
CONNECTION_PASSWORD_DEFAULT,
Copy link

@Prathibha-m Prathibha-m Sep 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this have a default? or should it be defined with Importance.HIGH as a required config?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not a required config

Copy link

@dosvath dosvath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the cleanup @levzem! Few questions.

One note for ES as a future improvement (not this PR) would be more integration test coverage around edge cases/negative paths, it seems to be behind compared to some of our other connectors.

return getString(TYPE_NAME_CONFIG);
}

public Set<String> urls() {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great if we could use a more descriptive name for this getter, ex. connectionUrls. Let's also make sure getList doesn't eliminate duplicates already.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't

return getBoolean(COMPACT_MAP_ENTRIES_CONFIG);
}

private Map<String, String> parseMapConfig(List<String> values) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this used for in this repo? First time I see this logic in connector configs.

Copy link
Contributor Author

@levzem levzem Sep 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TOPIC_INDEX_MAP_CONFIG / topicIndexMap()

Signed-off-by: Lev Zemlyanov <lev@confluent.io>
@levzem levzem requested a review from dosvath September 29, 2020 16:54
Copy link

@dosvath dosvath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@levzem levzem merged commit cb96f0c into confluentinc:5.0.x Sep 29, 2020
@levzem levzem deleted the config branch September 29, 2020 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants