diff options
| author | Chris Lu <chris.lu@gmail.com> | 2013-01-04 01:02:52 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2013-01-04 01:02:52 -0800 |
| commit | 8fb8ebdf148414eeece04739c5df3916b007fd43 (patch) | |
| tree | 48d3f0785485f591f85c3ad68e689716b4e51063 /weed-fs/src/pkg | |
| parent | e9eb8949bad2f208ac21272082bc1cba11c3379f (diff) | |
| download | seaweedfs-8fb8ebdf148414eeece04739c5df3916b007fd43.tar.xz seaweedfs-8fb8ebdf148414eeece04739c5df3916b007fd43.zip | |
master can redirect GET/DELETE/POST requests to volume servers. So
clients does not always need to remember the volume server locations.
This is good for low~medium sized web site traffic.
Diffstat (limited to 'weed-fs/src/pkg')
| -rw-r--r-- | weed-fs/src/pkg/topology/topology.go | 2 | ||||
| -rw-r--r-- | weed-fs/src/pkg/topology/volume_layout.go | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/weed-fs/src/pkg/topology/topology.go b/weed-fs/src/pkg/topology/topology.go index e0a2b0c34..4fd109a99 100644 --- a/weed-fs/src/pkg/topology/topology.go +++ b/weed-fs/src/pkg/topology/topology.go @@ -57,7 +57,7 @@ func (t *Topology) loadConfiguration(configurationFile string) error { return e } -func (t *Topology) Lookup(vid storage.VolumeId) *[]*DataNode { +func (t *Topology) Lookup(vid storage.VolumeId) []*DataNode { for _, vl := range t.replicaType2VolumeLayout { if vl != nil { if list := vl.Lookup(vid); list != nil { diff --git a/weed-fs/src/pkg/topology/volume_layout.go b/weed-fs/src/pkg/topology/volume_layout.go index 80eff5061..314aca69f 100644 --- a/weed-fs/src/pkg/topology/volume_layout.go +++ b/weed-fs/src/pkg/topology/volume_layout.go @@ -42,8 +42,8 @@ func (vl *VolumeLayout) isWritable(v *storage.VolumeInfo) bool{ return uint64(v.Size) < vl.volumeSizeLimit && v.Version == storage.CurrentVersion } -func (vl *VolumeLayout) Lookup(vid storage.VolumeId) *[]*DataNode { - return &vl.vid2location[vid].list +func (vl *VolumeLayout) Lookup(vid storage.VolumeId) []*DataNode { + return vl.vid2location[vid].list } func (vl *VolumeLayout) PickForWrite(count int) (*storage.VolumeId, int, *VolumeLocationList, error) { |
