diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-09-12 22:47:52 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-09-12 22:47:52 -0700 |
| commit | e5fc35ed0c970fea060a5b3b7a3f5efb5af425d6 (patch) | |
| tree | 3ad0436940263a24ac46d38a60dd1e35b2c1cdfe /weed/filer/filer.go | |
| parent | 2c9d4c8f43c1e95c75fc332ca83d19e33e5da3ac (diff) | |
| download | seaweedfs-e5fc35ed0c970fea060a5b3b7a3f5efb5af425d6.tar.xz seaweedfs-e5fc35ed0c970fea060a5b3b7a3f5efb5af425d6.zip | |
change server address from string to a type
Diffstat (limited to 'weed/filer/filer.go')
| -rw-r--r-- | weed/filer/filer.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/weed/filer/filer.go b/weed/filer/filer.go index 1a20abefc..f13782031 100644 --- a/weed/filer/filer.go +++ b/weed/filer/filer.go @@ -3,6 +3,7 @@ package filer import ( "context" "fmt" + "github.com/chrislusf/seaweedfs/weed/pb" "os" "strings" "time" @@ -45,10 +46,10 @@ type Filer struct { RemoteStorage *FilerRemoteStorage } -func NewFiler(masters []string, grpcDialOption grpc.DialOption, - filerHost string, filerGrpcPort uint32, collection string, replication string, dataCenter string, notifyFn func()) *Filer { +func NewFiler(masters []pb.ServerAddress, grpcDialOption grpc.DialOption, + filerHost pb.ServerAddress, collection string, replication string, dataCenter string, notifyFn func()) *Filer { f := &Filer{ - MasterClient: wdclient.NewMasterClient(grpcDialOption, "filer", filerHost, filerGrpcPort, dataCenter, masters), + MasterClient: wdclient.NewMasterClient(grpcDialOption, "filer", filerHost, dataCenter, masters), fileIdDeletionQueue: util.NewUnboundedQueue(), GrpcDialOption: grpcDialOption, FilerConf: NewFilerConf(), @@ -63,7 +64,7 @@ func NewFiler(masters []string, grpcDialOption grpc.DialOption, return f } -func (f *Filer) AggregateFromPeers(self string, filers []string) { +func (f *Filer) AggregateFromPeers(self pb.ServerAddress, filers []pb.ServerAddress) { // set peers found := false @@ -110,7 +111,7 @@ func (f *Filer) GetStore() (store FilerStore) { return f.Store } -func (fs *Filer) GetMaster() string { +func (fs *Filer) GetMaster() pb.ServerAddress { return fs.MasterClient.GetMaster() } |
