mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-04-05 20:52:50 +08:00
rename varaible
This commit is contained in:
parent
e90ab4ac60
commit
f5156cf3a8
@ -29,8 +29,8 @@ type MasterClient struct {
|
|||||||
vidMap
|
vidMap
|
||||||
vidMapCacheSize int
|
vidMapCacheSize int
|
||||||
|
|
||||||
OnPeerUpdate func(update *master_pb.ClusterNodeUpdate, startFrom time.Time)
|
OnPeerUpdate func(update *master_pb.ClusterNodeUpdate, startFrom time.Time)
|
||||||
OnPeerUpdateAccessLock sync.RWMutex
|
OnPeerUpdateLock sync.RWMutex
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewMasterClient(grpcDialOption grpc.DialOption, filerGroup string, clientType string, clientHost pb.ServerAddress, clientDataCenter string, rack string, masters map[string]pb.ServerAddress) *MasterClient {
|
func NewMasterClient(grpcDialOption grpc.DialOption, filerGroup string, clientType string, clientHost pb.ServerAddress, clientDataCenter string, rack string, masters map[string]pb.ServerAddress) *MasterClient {
|
||||||
@ -47,9 +47,9 @@ func NewMasterClient(grpcDialOption grpc.DialOption, filerGroup string, clientTy
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (mc *MasterClient) SetOnPeerUpdateFn(onPeerUpdate func(update *master_pb.ClusterNodeUpdate, startFrom time.Time)) {
|
func (mc *MasterClient) SetOnPeerUpdateFn(onPeerUpdate func(update *master_pb.ClusterNodeUpdate, startFrom time.Time)) {
|
||||||
mc.OnPeerUpdateAccessLock.Lock()
|
mc.OnPeerUpdateLock.Lock()
|
||||||
mc.OnPeerUpdate = onPeerUpdate
|
mc.OnPeerUpdate = onPeerUpdate
|
||||||
mc.OnPeerUpdateAccessLock.Unlock()
|
mc.OnPeerUpdateLock.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (mc *MasterClient) GetLookupFileIdFunction() LookupFileIdFunctionType {
|
func (mc *MasterClient) GetLookupFileIdFunction() LookupFileIdFunctionType {
|
||||||
@ -227,7 +227,7 @@ func (mc *MasterClient) tryConnectToMaster(master pb.ServerAddress) (nextHintedL
|
|||||||
|
|
||||||
if resp.ClusterNodeUpdate != nil {
|
if resp.ClusterNodeUpdate != nil {
|
||||||
update := resp.ClusterNodeUpdate
|
update := resp.ClusterNodeUpdate
|
||||||
mc.OnPeerUpdateAccessLock.RLock()
|
mc.OnPeerUpdateLock.RLock()
|
||||||
if mc.OnPeerUpdate != nil {
|
if mc.OnPeerUpdate != nil {
|
||||||
if update.FilerGroup == mc.FilerGroup {
|
if update.FilerGroup == mc.FilerGroup {
|
||||||
if update.IsAdd {
|
if update.IsAdd {
|
||||||
@ -239,7 +239,7 @@ func (mc *MasterClient) tryConnectToMaster(master pb.ServerAddress) (nextHintedL
|
|||||||
mc.OnPeerUpdate(update, time.Now())
|
mc.OnPeerUpdate(update, time.Now())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mc.OnPeerUpdateAccessLock.RUnlock()
|
mc.OnPeerUpdateLock.RUnlock()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user