forked from TrueCloudLab/frostfs-node
Add Inner Ring code
This commit is contained in:
parent
dadfd90dcd
commit
b7b5079934
400 changed files with 11420 additions and 8690 deletions
27
pkg/services/object_manager/replication/garbage.go
Normal file
27
pkg/services/object_manager/replication/garbage.go
Normal file
|
@ -0,0 +1,27 @@
|
|||
package replication
|
||||
|
||||
import (
|
||||
"sync"
|
||||
)
|
||||
|
||||
type (
|
||||
garbageStore struct {
|
||||
*sync.RWMutex
|
||||
items []Address
|
||||
}
|
||||
)
|
||||
|
||||
func (s *garbageStore) put(addr Address) {
|
||||
s.Lock()
|
||||
defer s.Unlock()
|
||||
|
||||
for i := range s.items {
|
||||
if s.items[i].Equal(&addr) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
s.items = append(s.items, addr)
|
||||
}
|
||||
|
||||
func newGarbageStore() *garbageStore { return &garbageStore{RWMutex: new(sync.RWMutex)} }
|
Loading…
Add table
Add a link
Reference in a new issue