diff options
| author | Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> | 2022-04-18 18:40:58 +0500 |
|---|---|---|
| committer | Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> | 2022-04-18 18:40:58 +0500 |
| commit | 1e35b4929f84830bf5fa132f1e715afa02cf62e0 (patch) | |
| tree | 8d4cdc55f1ed5af56b213c42bfdbc4e7aa68947f /weed/shell/command_volume_vacuum.go | |
| parent | cdb31c5b61ca3c8632c8722cbb8ca5adef535cdc (diff) | |
| download | seaweedfs-1e35b4929f84830bf5fa132f1e715afa02cf62e0.tar.xz seaweedfs-1e35b4929f84830bf5fa132f1e715afa02cf62e0.zip | |
shell vacuum volume by collection and volume id
Diffstat (limited to 'weed/shell/command_volume_vacuum.go')
| -rw-r--r-- | weed/shell/command_volume_vacuum.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/weed/shell/command_volume_vacuum.go b/weed/shell/command_volume_vacuum.go index 61b1f06fa..637411945 100644 --- a/weed/shell/command_volume_vacuum.go +++ b/weed/shell/command_volume_vacuum.go @@ -31,6 +31,8 @@ func (c *commandVacuum) Do(args []string, commandEnv *CommandEnv, writer io.Writ volumeVacuumCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError) garbageThreshold := volumeVacuumCommand.Float64("garbageThreshold", 0.3, "vacuum when garbage is more than this limit") + collection := volumeVacuumCommand.String("collection", "", "vacuum this collection") + volumeId := volumeVacuumCommand.Int("volumeId", 0, "the volume id") if err = volumeVacuumCommand.Parse(args); err != nil { return } @@ -42,6 +44,8 @@ func (c *commandVacuum) Do(args []string, commandEnv *CommandEnv, writer io.Writ err = commandEnv.MasterClient.WithClient(false, func(client master_pb.SeaweedClient) error { _, err = client.VacuumVolume(context.Background(), &master_pb.VacuumVolumeRequest{ GarbageThreshold: float32(*garbageThreshold), + VolumeId: uint32(*volumeId), + Collection: *collection, }) return err }) |
