aboutsummaryrefslogtreecommitdiff
path: root/weed/wdclient/masterclient.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-08-30 00:07:15 -0700
committerchrislu <chris.lu@gmail.com>2022-08-30 00:07:15 -0700
commitae6292f9f0337dd364ffca20357155f66223bedb (patch)
treeae0c436caa4fc7e5a6eb3588ccb8e1d74eac0a13 /weed/wdclient/masterclient.go
parente16dda88e48d37ac46a4858450ca2c2563910bdc (diff)
downloadseaweedfs-ae6292f9f0337dd364ffca20357155f66223bedb.tar.xz
seaweedfs-ae6292f9f0337dd364ffca20357155f66223bedb.zip
rename variable
Diffstat (limited to 'weed/wdclient/masterclient.go')
-rw-r--r--weed/wdclient/masterclient.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/weed/wdclient/masterclient.go b/weed/wdclient/masterclient.go
index 08bee0f73..6316507d4 100644
--- a/weed/wdclient/masterclient.go
+++ b/weed/wdclient/masterclient.go
@@ -18,19 +18,19 @@ import (
)
type MasterClient struct {
- FilerGroup string
- clientType string
- clientHost pb.ServerAddress
- rack string
- currentMaster pb.ServerAddress
- masters map[string]pb.ServerAddress
- grpcDialOption grpc.DialOption
+ FilerGroup string
+ clientType string
+ clientHost pb.ServerAddress
+ rack string
+ currentMaster pb.ServerAddress
+ currentMasterLock sync.RWMutex
+ masters map[string]pb.ServerAddress
+ grpcDialOption grpc.DialOption
vidMap
vidMapCacheSize int
OnPeerUpdate func(update *master_pb.ClusterNodeUpdate, startFrom time.Time)
OnPeerUpdateLock sync.RWMutex
- accessLock sync.RWMutex
}
func NewMasterClient(grpcDialOption grpc.DialOption, filerGroup string, clientType string, clientHost pb.ServerAddress, clientDataCenter string, rack string, masters map[string]pb.ServerAddress) *MasterClient {
@@ -92,15 +92,15 @@ func (mc *MasterClient) LookupFileIdWithFallback(fileId string) (fullUrls []stri
}
func (mc *MasterClient) getCurrentMaster() pb.ServerAddress {
- mc.accessLock.RLock()
- defer mc.accessLock.RUnlock()
+ mc.currentMasterLock.RLock()
+ defer mc.currentMasterLock.RUnlock()
return mc.currentMaster
}
func (mc *MasterClient) setCurrentMaster(master pb.ServerAddress) {
- mc.accessLock.Lock()
+ mc.currentMasterLock.Lock()
mc.currentMaster = master
- mc.accessLock.Unlock()
+ mc.currentMasterLock.Unlock()
}
func (mc *MasterClient) GetMaster() pb.ServerAddress {