-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: improve memory usage of record import #218
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This reverts commit 311bf75.
tasshi-me
force-pushed
the
feat/improve-memory-usage-of-import
branch
from
February 11, 2023 05:45
ab4e1b2
to
53935f7
Compare
tasshi-me
requested review from
a team,
hung-cybo and
ueokande
and removed request for
a team
February 14, 2023 07:42
tasshi-me
force-pushed
the
feat/improve-memory-usage-of-import
branch
from
February 14, 2023 12:33
34b13e4
to
8cede92
Compare
hung-cybo
reviewed
Feb 15, 2023
ueokande
suggested changes
Feb 15, 2023
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 comment at this moment.
src/record/import/repositories/localRecordRepositoryFromStream.ts
Outdated
Show resolved
Hide resolved
tasshi-me
force-pushed
the
feat/improve-memory-usage-of-import
branch
from
February 15, 2023 10:31
5b40070
to
0336314
Compare
hung-cybo
reviewed
Feb 15, 2023
tasshi-me
force-pushed
the
main
branch
2 times, most recently
from
February 17, 2023 04:37
68eb704
to
1d4d6c6
Compare
4 tasks
This was referenced Jan 17, 2024
This was referenced Jan 31, 2024
This was referenced Jun 12, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
#102
What
Design
I abstracted the data source, CSV file on the file system with
repository
.It provides the reader to read the
LocalRecord
iterative.usecase reads records by chunk size and processes them.
usecase doesn't have any knowledge of details (csv format, encoding, file system, and, command line)
The reader provides an async generator of records.
We read the records from the file system using Stream, but it makes code complicated to use Stream whole program.
So we encapsulated the Stream to an async generator.
How to test
Checklist
yarn lint
andyarn test
on the root directory.