forked from TrueCloudLab/frostfs-node
[#288] pilorama: Use more descriptive names for memory tree
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
f856ad7480
commit
0045f1bcd4
2 changed files with 22 additions and 25 deletions
|
@ -12,7 +12,7 @@ import (
|
|||
// memoryForest represents multiple replicating trees sharing a single storage.
|
||||
type memoryForest struct {
|
||||
// treeMap maps tree identifier (container ID + name) to the replicated log.
|
||||
treeMap map[string]*state
|
||||
treeMap map[string]*memoryTree
|
||||
}
|
||||
|
||||
var _ Forest = (*memoryForest)(nil)
|
||||
|
@ -21,7 +21,7 @@ var _ Forest = (*memoryForest)(nil)
|
|||
// TODO: this function will eventually be removed and is here for debugging.
|
||||
func NewMemoryForest() ForestStorage {
|
||||
return &memoryForest{
|
||||
treeMap: make(map[string]*state),
|
||||
treeMap: make(map[string]*memoryTree),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ func (f *memoryForest) TreeMove(_ context.Context, d CIDDescriptor, treeID strin
|
|||
fullID := d.CID.String() + "/" + treeID
|
||||
s, ok := f.treeMap[fullID]
|
||||
if !ok {
|
||||
s = newState()
|
||||
s = newMemoryTree()
|
||||
f.treeMap[fullID] = s
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ func (f *memoryForest) TreeAddByPath(_ context.Context, d CIDDescriptor, treeID
|
|||
fullID := d.CID.String() + "/" + treeID
|
||||
s, ok := f.treeMap[fullID]
|
||||
if !ok {
|
||||
s = newState()
|
||||
s = newMemoryTree()
|
||||
f.treeMap[fullID] = s
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ func (f *memoryForest) TreeApply(_ context.Context, cnr cid.ID, treeID string, o
|
|||
fullID := cnr.String() + "/" + treeID
|
||||
s, ok := f.treeMap[fullID]
|
||||
if !ok {
|
||||
s = newState()
|
||||
s = newMemoryTree()
|
||||
f.treeMap[fullID] = s
|
||||
}
|
||||
|
||||
|
@ -131,7 +131,7 @@ func (f *memoryForest) TreeGetByPath(_ context.Context, cid cid.ID, treeID strin
|
|||
return nil, ErrTreeNotFound
|
||||
}
|
||||
|
||||
return s.get(attr, path, latest), nil
|
||||
return s.getByPath(attr, path, latest), nil
|
||||
}
|
||||
|
||||
// TreeGetMeta implements the Forest interface.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue