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

[FLINK-8489][ES] Prevent side-effects when modifying user-config #5378

Closed
wants to merge 3 commits into from

Conversation

zentol
Copy link
Contributor

@zentol zentol commented Jan 29, 2018

What is the purpose of the change

The ElasticsearchSinkBase constructor was removing entries from a user-provided collection. We now copy the collection to prevent side-effects.

@StephanEwen
Copy link
Contributor

Looks good, but can this be guarded by a test?

Otherwise I can see a someone in the future going like "oh, I have an idea how to 'optimize' this" and remove that copying operation.

@zentol
Copy link
Contributor Author

zentol commented Jan 29, 2018

I'll add a test where we pass an unmodifiable map to the sink, that should cover it.

@zentol
Copy link
Contributor Author

zentol commented Jan 29, 2018

Added a test for the ElasticSearchSinkBase that passes an unmodifiable map containing all properties that we currently try to remove.

I also modified the ElasticSearchTestBase to pass an unmodifiable map to the constructors.

@tzulitai
Copy link
Contributor

LGTM, once Travis is green.

@zentol
Copy link
Contributor Author

zentol commented Jan 31, 2018

merging,

zentol added a commit to zentol/flink that referenced this pull request Jan 31, 2018
This closes apache#5378.
This closes apache#4847.
This closes apache#5305.
This closes apache#5208.
This closes apache#2192.
This closes apache#2422.
This closes apache#3478.
@asfgit asfgit closed this in 91cf60b Jan 31, 2018
@zentol zentol deleted the 8489 branch February 2, 2018 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants