[TrueCloudLab/hrw#2] node: Optimize shard hash

Compute shard hash only once

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2023-02-27 16:16:37 +03:00 committed by fyrchik
parent a1ab25b33e
commit c3a7039801
3 changed files with 21 additions and 13 deletions

View file

@ -19,7 +19,7 @@ type StorageEngine struct {
mtx *sync.RWMutex
shards map[string]shardWrapper
shards map[string]hashedShard
shardPools map[string]util.WorkerPool
@ -223,7 +223,7 @@ func New(opts ...Option) *StorageEngine {
return &StorageEngine{
cfg: c,
mtx: new(sync.RWMutex),
shards: make(map[string]shardWrapper),
shards: make(map[string]hashedShard),
shardPools: make(map[string]util.WorkerPool),
closeCh: make(chan struct{}),
setModeCh: make(chan setModeRequest),