Browse Source
support enable/disable vacuum (#4087)
support enable/disable vacuum (#4087)
* stop vacuum * suspend/resume vacuum * remove unused code * rename * rename parampull/4092/head
Guo Lei
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 656 additions and 255 deletions
-
6weed/pb/filer_pb/filer.pb.go
-
4weed/pb/filer_pb/filer_grpc.pb.go
-
4weed/pb/iam_pb/iam_grpc.pb.go
-
14weed/pb/master.proto
-
664weed/pb/master_pb/master.pb.go
-
76weed/pb/master_pb/master_grpc.pb.go
-
4weed/pb/mount_pb/mount_grpc.pb.go
-
4weed/pb/mq_pb/mq.pb.go
-
4weed/pb/mq_pb/mq_grpc.pb.go
-
4weed/pb/remote_pb/remote.pb.go
-
4weed/pb/s3_pb/s3_grpc.pb.go
-
4weed/pb/volume_server_pb/volume_server.pb.go
-
17weed/server/master_grpc_server_volume.go
-
41weed/shell/command_volume_vacuum_disable.go
-
41weed/shell/command_volume_vacuum_enable.go
-
11weed/topology/topology.go
-
9weed/topology/topology_event_handling.go
664
weed/pb/master_pb/master.pb.go
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -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 |
|||
} |
@ -0,0 +1,41 @@ |
|||
package shell |
|||
|
|||
import ( |
|||
"context" |
|||
"io" |
|||
|
|||
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb" |
|||
) |
|||
|
|||
func init() { |
|||
Commands = append(Commands, &commandEnableVacuum{}) |
|||
} |
|||
|
|||
type commandEnableVacuum struct { |
|||
} |
|||
|
|||
func (c *commandEnableVacuum) Name() string { |
|||
return "volume.vacuum.enable" |
|||
} |
|||
|
|||
func (c *commandEnableVacuum) Help() string { |
|||
return `enable vacuuming |
|||
|
|||
volume.vacuum.enable |
|||
|
|||
` |
|||
} |
|||
|
|||
func (c *commandEnableVacuum) 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.EnableVacuum(context.Background(), &master_pb.EnableVacuumRequest{}) |
|||
return err |
|||
}) |
|||
|
|||
return |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue