diff options
| author | Chris Lu <chris.lu@gmail.com> | 2019-05-27 21:22:23 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2019-05-27 21:22:23 -0700 |
| commit | 03b9291e5da8a25a9c8a968de752e331da60ef7c (patch) | |
| tree | 05f0bb4ee056af577a8d6eada2cee4cf72b2a6cc /weed/storage/store.go | |
| parent | ac1ba3b667f7fff9a07fe18d7ef077f111ab4cdc (diff) | |
| download | seaweedfs-03b9291e5da8a25a9c8a968de752e331da60ef7c.tar.xz seaweedfs-03b9291e5da8a25a9c8a968de752e331da60ef7c.zip | |
volum server passes grpc option and master location to store
Diffstat (limited to 'weed/storage/store.go')
| -rw-r--r-- | weed/storage/store.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/weed/storage/store.go b/weed/storage/store.go index d5474d87f..d4fdb1a03 100644 --- a/weed/storage/store.go +++ b/weed/storage/store.go @@ -8,6 +8,7 @@ import ( "github.com/chrislusf/seaweedfs/weed/pb/master_pb" "github.com/chrislusf/seaweedfs/weed/storage/needle" . "github.com/chrislusf/seaweedfs/weed/storage/types" + "google.golang.org/grpc" ) const ( @@ -18,6 +19,8 @@ const ( * A VolumeServer contains one Store */ type Store struct { + MasterGrpcAddress string + grpcDialOption grpc.DialOption volumeSizeLimit uint64 //read from the master Ip string Port int @@ -38,8 +41,8 @@ func (s *Store) String() (str string) { return } -func NewStore(port int, ip, publicUrl string, dirnames []string, maxVolumeCounts []int, needleMapKind NeedleMapType) (s *Store) { - s = &Store{Port: port, Ip: ip, PublicUrl: publicUrl, NeedleMapType: needleMapKind} +func NewStore(grpcDialOption grpc.DialOption, port int, ip, publicUrl string, dirnames []string, maxVolumeCounts []int, needleMapKind NeedleMapType) (s *Store) { + s = &Store{grpcDialOption: grpcDialOption, Port: port, Ip: ip, PublicUrl: publicUrl, NeedleMapType: needleMapKind} s.Locations = make([]*DiskLocation, 0) for i := 0; i < len(dirnames); i++ { location := NewDiskLocation(dirnames[i], maxVolumeCounts[i]) |
