mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-08-16 12:16:36 +00:00
chore(weed/topology): drop the unused DataNode volume id listing (#10618)
GetVolumeIds ranged over a slice and collected the loop indices, so it reported 0-99 rather than the node's volume ids. Nothing calls it: the disk-level GetVolumeIds, which ranges over a map and is correct, is what ToDiskInfo and ToMap use. Its private getVolumes helper went with it, having no other caller.
This commit is contained in:
@@ -2,7 +2,6 @@ package topology
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"slices"
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/glog"
|
||||
@@ -392,28 +391,3 @@ func (dn *DataNode) UpdateDiskTags(tags []*master_pb.DiskTag) {
|
||||
dn.diskMetas = metas
|
||||
dn.Unlock()
|
||||
}
|
||||
|
||||
// GetVolumeIds returns the human readable volume ids limited to count of max 100.
|
||||
func (dn *DataNode) GetVolumeIds() string {
|
||||
dn.RLock()
|
||||
defer dn.RUnlock()
|
||||
existingVolumes := dn.getVolumes()
|
||||
ids := make([]int, 0, len(existingVolumes))
|
||||
|
||||
for k := range existingVolumes {
|
||||
ids = append(ids, int(k))
|
||||
}
|
||||
|
||||
slices.Sort(ids)
|
||||
|
||||
return util.HumanReadableIntsMax(100, ids...)
|
||||
}
|
||||
|
||||
func (dn *DataNode) getVolumes() []storage.VolumeInfo {
|
||||
var existingVolumes []storage.VolumeInfo
|
||||
for _, c := range dn.children {
|
||||
disk := c.(*Disk)
|
||||
existingVolumes = append(existingVolumes, disk.GetVolumes()...)
|
||||
}
|
||||
return existingVolumes
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user