-
Notifications
You must be signed in to change notification settings - Fork 20
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: #4910 venus-market,venus : add sub command to mannage piece storage #153
Conversation
lint fail because it rely on another unmerged PR in venus repo |
RemovePieceStorage AddFsPieceStorage AddS3PieceStorage
0a1ce19
to
a353159
Compare
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.
有些类型应该移到venus-shared仓库了,需要更新
when add piece storage
unified the name of sub command check flag by cctx.IsSet add ArgsUsage comment
46d976f
to
2f48692
Compare
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
cli/piece-storage.go
Outdated
Aliases: []string{"e"}, | ||
Usage: "endpoint of the S3 bucket", | ||
}, | ||
// access key |
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.
下面三个量最好使用交互式的输入方式,避免在history里面留下记录
piecestorage/storagemgr.go
Outdated
@@ -14,8 +15,20 @@ type PieceStorageManager struct { | |||
|
|||
func NewPieceStorageManager(cfg *config.PieceStorage) (*PieceStorageManager, error) { | |||
var storages []IPieceStorage | |||
exist := make(map[string]bool) |
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.
建议使用map[string]struct{}
piecestorage/storagemgr.go
Outdated
return nil | ||
} | ||
|
||
func (p *PieceStorageManager) ListStorages() types.PieceStorageList { |
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.
建议名字是ListStorageInfos, 类型同理
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.
PieceStorageInfos
PieceStorageList -> PieceStorageInfos ListStorages -> ListStorageInfos
piecestorage/storagemgr.go
Outdated
@@ -83,3 +114,45 @@ func randStorageSelector(storages []IPieceStorage) (IPieceStorage, error) { | |||
return storages[rand.Intn(len(storages))], nil | |||
} | |||
} | |||
|
|||
func (p *PieceStorageManager) GetStorages() map[string]IPieceStorage { |
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.
删除
cli/piece-storage.go
Outdated
cs.Close() // nolint:errcheck | ||
}() | ||
|
||
rl := bufio.NewReader(cs) |
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.
做到类似密码的效果
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.
1
Codecov Report
@@ Coverage Diff @@
## main #153 +/- ##
==========================================
+ Coverage 18.81% 19.09% +0.28%
==========================================
Files 170 172 +2
Lines 17804 18213 +409
==========================================
+ Hits 3349 3478 +129
- Misses 14023 14292 +269
- Partials 432 443 +11
Flags with carried forward coverage won't be shown. Click here to find out more.
|
22a9ad9
to
e45787c
Compare
e45787c
to
29f241e
Compare
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
…/feat/dtynn/cgroup_cleanup chore: add a script for cleaning up orphan sub-groups in cgroup:cpuset
Related Issues
close filecoin-project/venus#4910
Proposed Changes
add subaommand to set piece storage when market is running
AddFsPieceStorage
ListPieceStorage
RemovePieceStorage
Additional Info
Checklist
Before you mark the PR ready for review, please make sure that:
<PR type>: <#issue number> <area>: <change being made>
fix: #1234 mempool: Introduce a cache for valid signatures
PR type
: fix, feat, INTERFACE BREAKING CHANGE, CONSENSUS BREAKING, build, chore, ci, docs, misc, perf, refactor, revert, style, testarea
: venus, venus-messager, venus-miner, venus-gateway, venus-auth, venus-market, venus-sealer, venus-wallet, venus-cluster, api, chain, state, vm, data transfer, mempool, message, block production, multisig, networking, paychan, proving, sealing, wallet