diff options
Diffstat (limited to 'weed/shell')
| -rw-r--r-- | weed/shell/command_cluster_check.go | 3 | ||||
| -rw-r--r-- | weed/shell/command_volume_balance_test.go | 2 | ||||
| -rw-r--r-- | weed/shell/command_volume_list.go | 5 |
3 files changed, 6 insertions, 4 deletions
diff --git a/weed/shell/command_cluster_check.go b/weed/shell/command_cluster_check.go index 27a4f2bb3..57b30e008 100644 --- a/weed/shell/command_cluster_check.go +++ b/weed/shell/command_cluster_check.go @@ -4,6 +4,7 @@ import ( "context" "flag" "fmt" + "github.com/seaweedfs/seaweedfs/weed/storage/types" "io" "github.com/seaweedfs/seaweedfs/weed/cluster" @@ -79,7 +80,7 @@ func (c *commandClusterCheck) Do(args []string, commandEnv *CommandEnv, writer i if len(filers) > 0 { genericDiskInfo, genericDiskInfoOk := topologyInfo.DiskInfos[""] - hddDiskInfo, hddDiskInfoOk := topologyInfo.DiskInfos["hdd"] + hddDiskInfo, hddDiskInfoOk := topologyInfo.DiskInfos[types.HddType] if !genericDiskInfoOk && !hddDiskInfoOk { return fmt.Errorf("filer metadata logs need generic or hdd disk type to be defined") diff --git a/weed/shell/command_volume_balance_test.go b/weed/shell/command_volume_balance_test.go index f1a0c4450..6c4b2a818 100644 --- a/weed/shell/command_volume_balance_test.go +++ b/weed/shell/command_volume_balance_test.go @@ -265,7 +265,7 @@ func TestBalance(t *testing.T) { func TestVolumeSelection(t *testing.T) { topologyInfo := parseOutput(topoData) - vids, err := collectVolumeIdsForTierChange(topologyInfo, 1000, types.ToDiskType("hdd"), "", 20.0, 0) + vids, err := collectVolumeIdsForTierChange(topologyInfo, 1000, types.ToDiskType(types.HddType), "", 20.0, 0) if err != nil { t.Errorf("collectVolumeIdsForTierChange: %v", err) } diff --git a/weed/shell/command_volume_list.go b/weed/shell/command_volume_list.go index fe7d5f732..74655df12 100644 --- a/weed/shell/command_volume_list.go +++ b/weed/shell/command_volume_list.go @@ -6,6 +6,7 @@ import ( "fmt" "github.com/seaweedfs/seaweedfs/weed/pb/master_pb" "github.com/seaweedfs/seaweedfs/weed/storage/erasure_coding" + "github.com/seaweedfs/seaweedfs/weed/storage/types" "golang.org/x/exp/slices" "path/filepath" "strings" @@ -72,7 +73,7 @@ func diskInfosToString(diskInfos map[string]*master_pb.DiskInfo) string { var buf bytes.Buffer for diskType, diskInfo := range diskInfos { if diskType == "" { - diskType = "hdd" + diskType = types.HddType } fmt.Fprintf(&buf, " %s(volume:%d/%d active:%d free:%d remote:%d)", diskType, diskInfo.VolumeCount, diskInfo.MaxVolumeCount, diskInfo.ActiveVolumeCount, diskInfo.FreeVolumeCount, diskInfo.RemoteVolumeCount) } @@ -162,7 +163,7 @@ func (c *commandVolumeList) writeDiskInfo(writer io.Writer, t *master_pb.DiskInf var s statistics diskType := t.Type if diskType == "" { - diskType = "hdd" + diskType = types.HddType } output(verbosityLevel >= 4, writer, " Disk %s(%s)\n", diskType, diskInfoToString(t)) slices.SortFunc(t.VolumeInfos, func(a, b *master_pb.VolumeInformationMessage) int { |
