diff options
| author | Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> | 2022-08-05 05:35:00 +0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-04 17:35:00 -0700 |
| commit | 4d08393b7ca8b1a34ed65532955de76cf8843ec2 (patch) | |
| tree | b764fe5f4b927d9b9cf1b83a2f19c87a91d81c8e /weed/operation/lookup.go | |
| parent | 28a1f42962a3c22fa341d62e52ed014ae17c508f (diff) | |
| download | seaweedfs-4d08393b7ca8b1a34ed65532955de76cf8843ec2.tar.xz seaweedfs-4d08393b7ca8b1a34ed65532955de76cf8843ec2.zip | |
filer prefer volume server in same data center (#3405)
* initial prefer same data center
https://github.com/seaweedfs/seaweedfs/issues/3404
* GetDataCenter
* prefer same data center for ReplicationSource
* GetDataCenterId
* remove glog
Diffstat (limited to 'weed/operation/lookup.go')
| -rw-r--r-- | weed/operation/lookup.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/weed/operation/lookup.go b/weed/operation/lookup.go index 8e6926fc7..fc4609a2d 100644 --- a/weed/operation/lookup.go +++ b/weed/operation/lookup.go @@ -14,9 +14,10 @@ import ( ) type Location struct { - Url string `json:"url,omitempty"` - PublicUrl string `json:"publicUrl,omitempty"` - GrpcPort int `json:"grpcPort,omitempty"` + Url string `json:"url,omitempty"` + PublicUrl string `json:"publicUrl,omitempty"` + DataCenter string `json:"dataCenter,omitempty"` + GrpcPort int `json:"grpcPort,omitempty"` } func (l *Location) ServerAddress() pb.ServerAddress { @@ -94,9 +95,10 @@ func LookupVolumeIds(masterFn GetMasterFn, grpcDialOption grpc.DialOption, vids var locations []Location for _, loc := range vidLocations.Locations { locations = append(locations, Location{ - Url: loc.Url, - PublicUrl: loc.PublicUrl, - GrpcPort: int(loc.GrpcPort), + Url: loc.Url, + PublicUrl: loc.PublicUrl, + DataCenter: loc.DataCenter, + GrpcPort: int(loc.GrpcPort), }) } if vidLocations.Error != "" { |
