Skip to content

Commit 87441c3

Browse files
committed
engine: drop List function
Drop the function that was not called anywhere because there is a similar function `ListWithCursor` that is being used. Signed-off-by: Andrey Butusov <[email protected]>
1 parent 48a607c commit 87441c3

File tree

1 file changed

+0
-43
lines changed

1 file changed

+0
-43
lines changed

pkg/local_object_storage/engine/select.go

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -49,46 +49,3 @@ func (e *StorageEngine) Select(cnr cid.ID, filters object.SearchFilters) ([]oid.
4949

5050
return addrList, nil
5151
}
52-
53-
// List returns `limit` available physically storage object addresses in engine.
54-
// If limit is zero, then returns all available object addresses.
55-
//
56-
// Returns an error if executions are blocked (see BlockExecution).
57-
func (e *StorageEngine) List(limit uint64) ([]oid.Address, error) {
58-
if e.metrics != nil {
59-
defer elapsed(e.metrics.AddListObjectsDuration)()
60-
}
61-
62-
e.blockMtx.RLock()
63-
defer e.blockMtx.RUnlock()
64-
65-
if e.blockErr != nil {
66-
return nil, e.blockErr
67-
}
68-
69-
addrList := make([]oid.Address, 0, limit)
70-
uniqueMap := make(map[string]struct{})
71-
ln := uint64(0)
72-
73-
// consider iterating over shuffled shards
74-
for _, sh := range e.unsortedShards() {
75-
res, err := sh.List() // consider limit result of shard iterator
76-
if err != nil {
77-
e.reportShardError(sh, "could not select objects from shard", err)
78-
continue
79-
}
80-
for _, addr := range res { // save only unique values
81-
if _, ok := uniqueMap[addr.EncodeToString()]; !ok {
82-
uniqueMap[addr.EncodeToString()] = struct{}{}
83-
addrList = append(addrList, addr)
84-
85-
ln++
86-
if limit > 0 && ln >= limit {
87-
return addrList, nil
88-
}
89-
}
90-
}
91-
}
92-
93-
return addrList, nil
94-
}

0 commit comments

Comments
 (0)