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

Extract storage driver into peer tasks #998

Merged
merged 3 commits into from
Jan 19, 2022

Conversation

jim3ma
Copy link
Member

@jim3ma jim3ma commented Jan 17, 2022

Description

Currently, when write every piece, storage need to search the task first, it's redundant.
When register a task, storage returns an instance of underlay driver, peer task conductor uses this instance to write all pieces.

Related Issue

Motivation and Context

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation Update (if none of the other choices apply)

Checklist:

  • Code compiles correctly.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@jim3ma jim3ma requested a review from a team as a code owner January 17, 2022 06:39
Signed-off-by: Jim Ma <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Jan 17, 2022

Codecov Report

Merging #998 (21ce1b6) into main (3afbbd0) will decrease coverage by 0.01%.
The diff coverage is 45.94%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #998      +/-   ##
==========================================
- Coverage   46.05%   46.03%   -0.02%     
==========================================
  Files         130      130              
  Lines        9074     9077       +3     
==========================================
  Hits         4179     4179              
  Misses       4433     4433              
- Partials      462      465       +3     
Flag Coverage Δ
Object-compatibility-e2etests ?
e2etests ?
unittests 46.03% <45.94%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
client/daemon/peer/peertask_manager.go 41.09% <ø> (ø)
client/daemon/peer/piece_downloader.go 56.00% <ø> (ø)
client/daemon/storage/storage_manager.go 19.20% <4.76%> (-0.05%) ⬇️
client/daemon/peer/peertask_conductor.go 57.05% <100.00%> (-0.17%) ⬇️
client/daemon/peer/peertask_stream.go 65.41% <100.00%> (ø)
client/daemon/peer/piece_manager.go 66.42% <100.00%> (-0.25%) ⬇️
pkg/sync/kmutex.go 83.33% <0.00%> (-16.67%) ⬇️
pkg/sync/krwmutex.go 81.81% <0.00%> (-4.55%) ⬇️
cdn/supervisor/progress/progress.go 97.01% <0.00%> (+5.97%) ⬆️

@jim3ma jim3ma changed the title Chore/daemon extract storage driver Extract storage driver into peer tasks Jan 18, 2022
Copy link
Member

@gaius-qi gaius-qi left a comment

Choose a reason for hiding this comment

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

LGTM

@244372610 244372610 merged commit 5083963 into main Jan 19, 2022
@244372610 244372610 deleted the chore/daemon-extract-storage-driver branch January 19, 2022 06:39
gaius-qi pushed a commit that referenced this pull request Jun 28, 2023
* chore: extract storage instead load every time

Signed-off-by: Jim Ma <[email protected]>

* fix: test

Signed-off-by: Jim Ma <[email protected]>

* fix: gofmt

Signed-off-by: Jim Ma <[email protected]>
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.

4 participants