Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislusf committed Oct 10, 2015
1 parent c6daa97 commit 6030360
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions resource/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,25 +83,6 @@ func (l *Location) URL() string {
return l.Server + ":" + strconv.Itoa(l.Port)
}

func (cr *ComputeRequest) MatchScore(ro *ResourceOffer) (score float64, ok bool) {
c := cr.ComputeResource
r := ro.ComputeResource
if c.CPUCount > r.CPUCount ||
c.CPULevel > r.CPULevel ||
c.MemoryMB > r.MemoryMB {
return 0, false
}
totalCost := float64(1)
for _, input := range cr.Inputs {
if input.DataSizeMB > 0 {
cost := float64(10000) / float64(input.DataSizeMB)
cost /= input.Location.Distance(ro.ServerLocation)
totalCost += cost
}
}
return 100 / totalCost, true
}

// the distance is a relative value, similar to network lantency
func (a Location) Distance(b Location) float64 {
if a.DataCenter != b.DataCenter {
Expand Down

0 comments on commit 6030360

Please sign in to comment.