forked from TrueCloudLab/frostfs-node
[#661] blobovniczatree: Make Rebuild concurrent for objects
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
f1c7905263
commit
c6a739e746
3 changed files with 72 additions and 41 deletions
|
@ -25,6 +25,7 @@ type cfg struct {
|
|||
metrics Metrics
|
||||
waitBeforeDropDB time.Duration
|
||||
blzInitWorkerCount int
|
||||
blzMoveBatchSize int
|
||||
}
|
||||
|
||||
type Option func(*cfg)
|
||||
|
@ -36,6 +37,7 @@ const (
|
|||
defaultBlzShallowWidth = 16
|
||||
defaultWaitBeforeDropDB = 10 * time.Second
|
||||
defaultBlzInitWorkerCount = 5
|
||||
defaulBlzMoveBatchSize = 10000
|
||||
)
|
||||
|
||||
func initConfig(c *cfg) {
|
||||
|
@ -49,6 +51,7 @@ func initConfig(c *cfg) {
|
|||
metrics: &noopMetrics{},
|
||||
waitBeforeDropDB: defaultWaitBeforeDropDB,
|
||||
blzInitWorkerCount: defaultBlzInitWorkerCount,
|
||||
blzMoveBatchSize: defaulBlzMoveBatchSize,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -119,6 +122,12 @@ func WithWaitBeforeDropDB(t time.Duration) Option {
|
|||
}
|
||||
}
|
||||
|
||||
func WithMoveBatchSize(v int) Option {
|
||||
return func(c *cfg) {
|
||||
c.blzMoveBatchSize = v
|
||||
}
|
||||
}
|
||||
|
||||
// WithInitWorkerCount sets maximum workers count to init blobovnicza tree.
|
||||
//
|
||||
// Negative or zero value means no limit.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue