SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
refactoring
Chris Lu8e23dc078b67
diff --git a/weed/pb/shared_values.go b/weed/pb/shared_values.gonew file mode 100644index 0000000000..cac253ebb9--- /dev/null+++ b/weed/pb/shared_values.go@@ -0,0 +1,5 @@+package pb++const (+ AdminShellClient = "shell"+)\ No newline at end of filediff --git a/weed/server/master_grpc_server.go b/weed/server/master_grpc_server.goindex 1785a8ccb3..a8da9ab2eb 100644--- a/weed/server/master_grpc_server.go+++ b/weed/server/master_grpc_server.go@@ -11,6 +11,7 @@ import ("google.golang.org/grpc/peer""github.com/chrislusf/seaweedfs/weed/glog"+ "github.com/chrislusf/seaweedfs/weed/pb""github.com/chrislusf/seaweedfs/weed/pb/master_pb""github.com/chrislusf/seaweedfs/weed/storage/backend""github.com/chrislusf/seaweedfs/weed/storage/needle"@@ -191,8 +192,8 @@ func (ms *MasterServer) KeepConnected(stream master_pb.Seaweed_KeepConnectedServpeerAddress := findClientAddress(stream.Context(), req.GrpcPort)// only one shell can be connected at any time- if req.Name == "shell" {- if ms.currentAdminShellClient == ""{+ if req.Name == pb.AdminShellClient {+ if ms.currentAdminShellClient == "" {ms.currentAdminShellClient = peerAddressdefer func() {ms.currentAdminShellClient = ""@@ -202,7 +203,6 @@ func (ms *MasterServer) KeepConnected(stream master_pb.Seaweed_KeepConnectedServ}}-stopChan := make(chan bool)clientName, messageChan := ms.addClient(req.Name, peerAddress)diff --git a/weed/shell/commands.go b/weed/shell/commands.goindex 41f197328e..cbae6c03e4 100644--- a/weed/shell/commands.go+++ b/weed/shell/commands.go@@ -43,7 +43,7 @@ var (func NewCommandEnv(options ShellOptions) *CommandEnv {return &CommandEnv{env: make(map[string]string),- MasterClient: wdclient.NewMasterClient(options.GrpcDialOption, "shell", 0, strings.Split(*options.Masters, ",")),+ MasterClient: wdclient.NewMasterClient(options.GrpcDialOption, pb.AdminShellClient, 0, strings.Split(*options.Masters, ",")),option: options,}}