Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Expose DataStreamWriter.Foreach API #387
Expose DataStreamWriter.Foreach API #387
Changes from 13 commits
994ea3e
b9ab9e0
13a3d02
6325e71
214f1ad
d7ec1dc
b60fbb4
102fc3a
6221e92
b0d0a27
ed782a1
5339306
c2aa3be
24fe2bf
9cb49ef
cfb9e37
3a9b287
75ed8ed
41ebfde
4e93d8e
8860a44
57a028b
33daff3
ec35490
985a3af
a62197f
02bf06b
66c9837
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Can we just remove this side effect? You can use locks such that there is always only one
StreamWriter
per file.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 also see this comment
A single instance of this class is responsible of all the data generated by a single task
. Do we need to handle thread issue here?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.
Originally I this a static field because the
StreamWriter
was not marked as[Serializable]
. But since we are creating theStreamWriter
object in theopen
call, marking the field as[NonSerialized]
addresses the issue.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.
If all the fields of the ForeachWriter are non static then I don't think there will be issues, but if there are static fields then I think it'll be up to the user to determine how to handle them.