diff options
| author | NyaMisty <gyc990326@gmail.com> | 2025-06-16 11:30:04 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-15 20:30:04 -0700 |
| commit | f894e7b7a500e6f4af26867233069e71139a7648 (patch) | |
| tree | a4516cded0cf9d1f3a6f43d14021be74dddcf670 /weed/shell/command_volume_tier_upload.go | |
| parent | 53e5c845233c0823346a237984f868a671e4ba37 (diff) | |
| download | seaweedfs-f894e7b7a500e6f4af26867233069e71139a7648.tar.xz seaweedfs-f894e7b7a500e6f4af26867233069e71139a7648.zip | |
Support filtering source disk type in volume.tier.upload (#6868)
Diffstat (limited to 'weed/shell/command_volume_tier_upload.go')
| -rw-r--r-- | weed/shell/command_volume_tier_upload.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/weed/shell/command_volume_tier_upload.go b/weed/shell/command_volume_tier_upload.go index 7eff20876..f53256c37 100644 --- a/weed/shell/command_volume_tier_upload.go +++ b/weed/shell/command_volume_tier_upload.go @@ -4,6 +4,7 @@ import ( "context" "flag" "fmt" + "github.com/seaweedfs/seaweedfs/weed/storage/types" "io" "time" @@ -69,6 +70,7 @@ func (c *commandVolumeTierUpload) Do(args []string, commandEnv *CommandEnv, writ quietPeriod := tierCommand.Duration("quietFor", 24*time.Hour, "select volumes without no writes for this period") dest := tierCommand.String("dest", "", "the target tier name") keepLocalDatFile := tierCommand.Bool("keepLocalDatFile", false, "whether keep local dat file") + disk := tierCommand.String("disk", "", "[hdd|ssd|<tag>] hard drive or solid state drive or any tag") if err = tierCommand.Parse(args); err != nil { return nil } @@ -84,9 +86,15 @@ func (c *commandVolumeTierUpload) Do(args []string, commandEnv *CommandEnv, writ return doVolumeTierUpload(commandEnv, writer, *collection, vid, *dest, *keepLocalDatFile) } + var diskType *types.DiskType + if disk != nil { + _diskType := types.ToDiskType(*disk) + diskType = &_diskType + } + // apply to all volumes in the collection // reusing collectVolumeIdsForEcEncode for now - volumeIds, err := collectVolumeIdsForEcEncode(commandEnv, *collection, *fullPercentage, *quietPeriod) + volumeIds, err := collectVolumeIdsForEcEncode(commandEnv, *collection, diskType, *fullPercentage, *quietPeriod) if err != nil { return err } |
