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.
This commit is contained in:
Chris Lu committed 2013-01-04 01:02:52 -08:00
1 parent e9eb8949ba
commit 8fb8ebdf14
3 files changed
+25 -8

No files matched your search

+1 -1
View File
@@ -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 {
+2 -2
View File
@@ -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) {