-
Notifications
You must be signed in to change notification settings - Fork 98
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
SNOW-1658905 Limit SnowflakeSinkConnectorConfig responsibilities #925
Conversation
db47ffa
to
0eb0894
Compare
@Override | ||
public void ensureValid(String name, Object value) { | ||
assert value instanceof String; | ||
final String strValue = (String) value; |
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.
should we assert on instance of string?
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.
It's copied. Even if it's wrong I don't want to change anything within this PR.
public TopicToTableValidator() {} | ||
|
||
public void ensureValid(String name, Object value) { | ||
String s = (String) value; |
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.
same as above
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.
Same as above :)
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.
LGTM
// validate REST API is called | ||
@Override | ||
public void ensureValid(String name, Object value) { | ||
assert value instanceof String; |
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.
I think the use of assert
is a legacy part that we should get rid of. Since we cannot enforce that they are enabled at runtime, we assume they can be disabled.
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.
Yes, but not in the same PR as refactor.
Overview
SNOW-1658905 Initial config refactor
SnowflakeSinkConnectorConfig
class has a lot of responsibilities:This PR extracts some parts of this class to dedicated files. There are still many other things to be fixed around config but this is a 1 hour of work that gives some effect.
Pre-review checklist
snowflake.ingestion.method
.Yes
- Added end to end and Unit Tests.No
- Suggest why it is not param protected