diff options
| author | Guo Lei <guol-fnst@fujitsu.com> | 2022-12-28 17:36:44 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-28 01:36:44 -0800 |
| commit | d8cfa1552b4958a6d803184eb423a29c1f18aeaf (patch) | |
| tree | 60a100d069d65fe19391376ab83416556f63fce1 /weed/shell/command_volume_vacuum_disable.go | |
| parent | 84492976c914cab5d084f4e242733906c20a3cc5 (diff) | |
| download | seaweedfs-d8cfa1552b4958a6d803184eb423a29c1f18aeaf.tar.xz seaweedfs-d8cfa1552b4958a6d803184eb423a29c1f18aeaf.zip | |
support enable/disable vacuum (#4087)
* stop vacuum
* suspend/resume vacuum
* remove unused code
* rename
* rename param
Diffstat (limited to 'weed/shell/command_volume_vacuum_disable.go')
| -rw-r--r-- | weed/shell/command_volume_vacuum_disable.go | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/weed/shell/command_volume_vacuum_disable.go b/weed/shell/command_volume_vacuum_disable.go new file mode 100644 index 000000000..e285117c9 --- /dev/null +++ b/weed/shell/command_volume_vacuum_disable.go @@ -0,0 +1,41 @@ +package shell + +import ( + "context" + "io" + + "github.com/seaweedfs/seaweedfs/weed/pb/master_pb" +) + +func init() { + Commands = append(Commands, &commandDisableVacuum{}) +} + +type commandDisableVacuum struct { +} + +func (c *commandDisableVacuum) Name() string { + return "volume.vacuum.disable" +} + +func (c *commandDisableVacuum) Help() string { + return `disable vacuuming + + volume.vacuum.disable + +` +} + +func (c *commandDisableVacuum) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) { + + if err = commandEnv.confirmIsLocked(args); err != nil { + return + } + + err = commandEnv.MasterClient.WithClient(false, func(client master_pb.SeaweedClient) error { + _, err = client.DisableVacuum(context.Background(), &master_pb.DisableVacuumRequest{}) + return err + }) + + return +} |
